commit
f99a375967
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,25 @@
|
|||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
if ($('.weapp-banner-setting-container').length > 0) {
|
||||||
|
var $form = $('#course_form');
|
||||||
|
|
||||||
|
$('.course.banner-item-bottom').on("change", 'input[type="file"]', function() {
|
||||||
|
var $fileInput = $(this);
|
||||||
|
var file = this.files[0];
|
||||||
|
var imageType = /image.*/;
|
||||||
|
if (file && file.type.match(imageType)) {
|
||||||
|
$form.ajaxSubmit()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var $shixunform = $('#shixun_form');
|
||||||
|
|
||||||
|
$('.shixun.banner-item-bottom').on("change", 'input[type="file"]', function() {
|
||||||
|
var $fileInput = $(this);
|
||||||
|
var file = this.files[0];
|
||||||
|
var imageType = /image.*/;
|
||||||
|
if (file && file.type.match(imageType)) {
|
||||||
|
$shixunform.ajaxSubmit()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
@ -1,171 +1,154 @@
|
|||||||
.admins-laboratories-index-page {
|
.admins-laboratories-index-page {
|
||||||
.laboratory-list-table {
|
.laboratory-list-table {
|
||||||
.member-container {
|
.member-container {
|
||||||
.laboratory-user {
|
.laboratory-user {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
.laboratory-user-item {
|
||||||
.laboratory-user-item {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
height: 22px;
|
||||||
height: 22px;
|
line-height: 22px;
|
||||||
line-height: 22px;
|
padding: 2px 5px;
|
||||||
padding: 2px 5px;
|
margin: 2px 2px;
|
||||||
margin: 2px 2px;
|
border: 1px solid #91D5FF;
|
||||||
border: 1px solid #91D5FF;
|
background-color: #E6F7FF;
|
||||||
background-color: #E6F7FF;
|
color: #91D5FF;
|
||||||
color: #91D5FF;
|
border-radius: 4px;
|
||||||
border-radius: 4px;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.admins-laboratory-settings-show-page, .admins-laboratory-settings-update-page {
|
|
||||||
.edit-laboratory-setting-container {
|
|
||||||
.logo-item {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
&-img {
|
|
||||||
display: block;
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-upload {
|
|
||||||
cursor: pointer;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border: 1px solid #E5E5E5;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 27px;
|
|
||||||
left: 39px;
|
|
||||||
width: 2px;
|
|
||||||
height: 26px;
|
|
||||||
background: #E5E5E5;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 39px;
|
|
||||||
left: 27px;
|
|
||||||
width: 26px;
|
|
||||||
height: 2px;
|
|
||||||
background: #E5E5E5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
position: relative;
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
|
|
||||||
&.has-img {
|
.admins-laboratory-settings-show-page,
|
||||||
.logo-item-upload {
|
.admins-laboratory-settings-update-page,
|
||||||
display: none;
|
.weapp-banner-setting-container {
|
||||||
}
|
.edit-laboratory-setting-container {
|
||||||
|
.logo-item {
|
||||||
&:hover {
|
display: flex;
|
||||||
.logo-item-upload {
|
&-img {
|
||||||
display: block;
|
display: block;
|
||||||
background: rgba(145, 145, 145, 0.8);
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
background: #f0f0f0;
|
||||||
|
}
|
||||||
|
&-upload {
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
background: #F5F5F5;
|
||||||
|
border: 1px solid #E5E5E5;
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 27px;
|
||||||
|
left: 39px;
|
||||||
|
width: 2px;
|
||||||
|
height: 26px;
|
||||||
|
background: #E5E5E5;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 39px;
|
||||||
|
left: 27px;
|
||||||
|
width: 26px;
|
||||||
|
height: 2px;
|
||||||
|
background: #E5E5E5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-left {
|
||||||
|
position: relative;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
&.has-img {
|
||||||
|
.logo-item-upload {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
.logo-item-upload {
|
||||||
|
display: block;
|
||||||
|
background: rgba(145, 145, 145, 0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: #777777;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
&-title {
|
||||||
|
color: #23272B;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-right {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: #777777;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
color: #23272B;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner-item {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
&-img {
|
|
||||||
display: block;
|
|
||||||
width: 300px;
|
|
||||||
height: 80px;
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-upload {
|
|
||||||
cursor: pointer;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: 300px;
|
|
||||||
height: 80px;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border: 1px solid #E5E5E5;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 27px;
|
|
||||||
left: 149px;
|
|
||||||
width: 2px;
|
|
||||||
height: 26px;
|
|
||||||
background: #E5E5E5;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 39px;
|
|
||||||
left: 137px;
|
|
||||||
width: 26px;
|
|
||||||
height: 2px;
|
|
||||||
background: #E5E5E5;
|
|
||||||
}
|
}
|
||||||
}
|
.banner-item {
|
||||||
|
margin-bottom: 15px;
|
||||||
&-top {
|
display: flex;
|
||||||
margin-bottom: 10px;
|
flex-direction: column;
|
||||||
}
|
&-img {
|
||||||
|
display: block;
|
||||||
&-bottom {
|
width: 300px;
|
||||||
position: relative;
|
height: 80px;
|
||||||
width: 300px;
|
background: #f0f0f0;
|
||||||
height: 80px;
|
}
|
||||||
|
&-upload {
|
||||||
&.has-img {
|
cursor: pointer;
|
||||||
.banner-item-upload {
|
position: absolute;
|
||||||
display: none;
|
top: 0;
|
||||||
}
|
width: 300px;
|
||||||
|
height: 80px;
|
||||||
&:hover {
|
background: #F5F5F5;
|
||||||
.banner-item-upload {
|
border: 1px solid #E5E5E5;
|
||||||
display: block;
|
&::before {
|
||||||
background: rgba(145, 145, 145, 0.8);
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 27px;
|
||||||
|
left: 149px;
|
||||||
|
width: 2px;
|
||||||
|
height: 26px;
|
||||||
|
background: #E5E5E5;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 39px;
|
||||||
|
left: 137px;
|
||||||
|
width: 26px;
|
||||||
|
height: 2px;
|
||||||
|
background: #E5E5E5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-top {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
&-bottom {
|
||||||
|
position: relative;
|
||||||
|
width: 300px;
|
||||||
|
height: 80px;
|
||||||
|
&.has-img {
|
||||||
|
.banner-item-upload {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
.banner-item-upload {
|
||||||
|
display: block;
|
||||||
|
background: rgba(145, 145, 145, 0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-title {
|
||||||
|
color: #23272B;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
color: #23272B;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
class Admins::WeappBannersController < Admins::BaseController
|
||||||
|
|
||||||
|
def index
|
||||||
|
@shixun = WeappSettings::ShixunBanner.first
|
||||||
|
@course = WeappSettings::CourseBanner.first
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
old_carouse = WeappSettings::CourseBanner.first
|
||||||
|
|
||||||
|
if old_carouse.present?
|
||||||
|
old_carouse.destroy!
|
||||||
|
file_path = Util::FileManage.source_disk_filename(old_carouse)
|
||||||
|
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
|
||||||
|
end
|
||||||
|
|
||||||
|
@course = WeappSettings::CourseBanner.create!
|
||||||
|
save_image_file(params[:course_banner], @course)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def shixun_banner
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
|
old_shixun = WeappSettings::ShixunBanner.first
|
||||||
|
|
||||||
|
if old_shixun.present?
|
||||||
|
old_shixun.destroy!
|
||||||
|
file_path = Util::FileManage.source_disk_filename(old_shixun)
|
||||||
|
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
|
||||||
|
end
|
||||||
|
|
||||||
|
@shixun = WeappSettings::ShixunBanner.create!
|
||||||
|
save_image_file(params[:shixun_banner], @shixun)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def save_image_file(file, model)
|
||||||
|
return unless file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
|
||||||
|
|
||||||
|
file_path = Util::FileManage.source_disk_filename(model)
|
||||||
|
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
|
||||||
|
Util.write_file(file, file_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,12 @@
|
|||||||
|
class Weapps::BannersController < Weapps::BaseController
|
||||||
|
|
||||||
|
def index
|
||||||
|
shixun = WeappSettings::ShixunBanner.first
|
||||||
|
course = WeappSettings::CourseBanner.first
|
||||||
|
|
||||||
|
render json: {
|
||||||
|
shixun_img: shixun ? Util::FileManage.source_disk_file_url(shixun) : '',
|
||||||
|
course_img: course ? Util::FileManage.source_disk_file_url(course) : ''
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,11 @@
|
|||||||
|
#encoding=utf-8
|
||||||
|
class Ecloud < ActiveRecord::Base
|
||||||
|
# attr_accessible :applyno, :begintime, :bossorderid, :custcode, :custid, :custname, :custtype, :ecordercode, :endtime,
|
||||||
|
# :mobile, :opttype, :productcode, :registersource, :string, :trial, :useralias, :userid, :username, :email,
|
||||||
|
# :effecttime, :operatime
|
||||||
|
|
||||||
|
has_many :ecloud_services, :dependent => :destroy # 业务列表
|
||||||
|
has_many :ecloud_productparas, :dependent => :destroy # 开通参数列表
|
||||||
|
|
||||||
|
has_one :ecloud_user
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class EcloudLog < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
class EcloudProductpara < ActiveRecord::Base
|
||||||
|
# attr_accessible :key, :value, :ecloud_id
|
||||||
|
belongs_to :ecloud
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class EcloudUser < ActiveRecord::Base
|
||||||
|
has_many :ecloud_user_paras
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class EcloudUserPara < ActiveRecord::Base
|
||||||
|
belongs_to :ecloud_user
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class WeappSettings::CourseBanner < WeappSetting
|
||||||
|
default_scope { order(position: :asc) }
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class WeappSettings::ShixunBanner < WeappSetting
|
||||||
|
default_scope { order(position: :asc) }
|
||||||
|
end
|
@ -0,0 +1 @@
|
|||||||
|
$("#course_img")[0].innerHTML = "<%= escape_javascript(image_tag Util::FileManage.source_disk_file_url(@course), class: 'banner-item-img course-banner-img') %>"
|
@ -0,0 +1,41 @@
|
|||||||
|
<% define_admin_breadcrumbs do %>
|
||||||
|
<% add_admin_breadcrumb('banner设置') %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="box weapp-banner-setting-container">
|
||||||
|
<div class="form-group px-2 setting-item edit-laboratory-setting-container">
|
||||||
|
|
||||||
|
<div class="pl-0 py-3 row setting-item-body">
|
||||||
|
<%= form_with(url: '/admins/weapp_banners', html: { id: 'course_form', enctype: 'multipart/form-data' }) do |f| %>
|
||||||
|
<div class="col-12 col-md-4 banner-item">
|
||||||
|
<div class="banner-item-top">实践课程</div>
|
||||||
|
<div class="course banner-item-bottom <%= @course ? 'has-img' : '' %>">
|
||||||
|
<div id="course_img">
|
||||||
|
<% if @course %>
|
||||||
|
<img class="banner-item-img course-banner-img" src="<%= Util::FileManage.exists?(@course) ? Util::FileManage.source_disk_file_url(@course) : '' %>"/>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: '') %>
|
||||||
|
<label for="course_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<%= form_with(url: '/admins/weapp_banners/shixun_banner', html: { id: 'shixun_form', enctype: 'multipart/form-data' }) do |f| %>
|
||||||
|
<div class="col-12 col-md-4 banner-item">
|
||||||
|
<div class="banner-item-top">实训项目</div>
|
||||||
|
<div class="shixun banner-item-bottom <%= @shixun ? 'has-img' : '' %>">
|
||||||
|
<div id="shixun_img">
|
||||||
|
<% if @shixun %>
|
||||||
|
<img class="banner-item-img shixun-banner-img" src="<%= Util::FileManage.exists?(@shixun) ? Util::FileManage.source_disk_file_url(@shixun) : '' %>"/>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<%= file_field_tag(:shixun_banner, accept: 'image/*', style: 'display: none', value: '') %>
|
||||||
|
<label for="shixun_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1 @@
|
|||||||
|
$("#shixun_img")[0].innerHTML = "<%= escape_javascript(image_tag Util::FileManage.source_disk_file_url(@shixun), class: 'banner-item-img course-banner-img') %>"
|
@ -1,10 +1,5 @@
|
|||||||
json.tags @tech_system do |tag|
|
|
||||||
json.tag_id tag.id
|
|
||||||
json.tag_name tag.name
|
|
||||||
end
|
|
||||||
|
|
||||||
json.subjects do
|
json.subjects do
|
||||||
json.partial! 'subject', locals: {subjects: @subjects}
|
json.partial! 'subject', locals: {subjects: @subjects}
|
||||||
end
|
end
|
||||||
|
|
||||||
json.total_count @total_count
|
json.total_count @subject_count
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,42 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import {getImageUrl} from 'educoder';
|
||||||
|
import { Modal} from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
import './../questioncss/questioncom.css'
|
||||||
|
//立即申请试用
|
||||||
|
class QuestionModalys extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state={
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
keyboard={false}
|
||||||
|
closable={false}
|
||||||
|
footer={null}
|
||||||
|
destroyOnClose={true}
|
||||||
|
title="提示"
|
||||||
|
centered={true}
|
||||||
|
visible={this.props.modalsType===undefined?false:this.props.modalsType}
|
||||||
|
width="442px"
|
||||||
|
>
|
||||||
|
<div className="educouddiv">
|
||||||
|
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
|
||||||
|
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
|
||||||
|
<div className="clearfix mt30 edu-txt-center">
|
||||||
|
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>知道啦</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default QuestionModalys;
|
@ -0,0 +1,42 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import {getImageUrl} from 'educoder';
|
||||||
|
import { Modal} from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
import './../../question/questioncss/questioncom.css'
|
||||||
|
//立即申请试用
|
||||||
|
class QuestionModalys extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state={
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
keyboard={false}
|
||||||
|
closable={false}
|
||||||
|
footer={null}
|
||||||
|
destroyOnClose={true}
|
||||||
|
title="提示"
|
||||||
|
centered={true}
|
||||||
|
visible={this.props.modalsType===undefined?false:this.props.modalsType}
|
||||||
|
width="442px"
|
||||||
|
>
|
||||||
|
<div className="educouddiv">
|
||||||
|
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
|
||||||
|
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
|
||||||
|
<div className="clearfix mt30 edu-txt-center">
|
||||||
|
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>知道啦</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default QuestionModalys;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue