dev_aliyun_beta
杨树明 6 years ago
commit c1c57341e7

@ -47,6 +47,7 @@ module GitCommon
def add_file def add_file
@path, message, content = params[:path].strip, params[:message], params[:content] @path, message, content = params[:path].strip, params[:message], params[:content]
author_name, author_email = current_user.real_name, current_user.git_mail author_name, author_email = current_user.real_name, current_user.git_mail
Rails.logger.info(" good repo_name is #{@repo_path}")
@content = GitService.update_file(repo_path: @repo_path, @content = GitService.update_file(repo_path: @repo_path,
file_path: @path, file_path: @path,
message: message, message: message,

@ -1100,13 +1100,19 @@ class CoursesController < ApplicationController
def export_member_act_score def export_member_act_score
search = params[:search] ? "#{params[:search].strip}" : "" #用户名或学生学号id搜索 search = params[:search] ? "#{params[:search].strip}" : "" #用户名或学生学号id搜索
group_id = params[:group_id] #分班的班级id group_id = params[:group_id] #分班的班级id
@all_members = student_act_score group_id, search @all_members = @course.students
@all_members = @all_members.where(course_group_id: group_id) unless group_id.blank?
unless search.blank?
@all_members = @all_members.joins(user: [:user_extension]).where('concat(users.lastname, users.firstname) like ? or user_extensions.student_id like ?',"%#{search}%","%#{search}%")
end
if @all_members.size == 0 if @all_members.size == 0
normal_status(-1,"课堂暂时没有学生") normal_status(-1,"课堂暂时没有学生")
elsif params[:export].present? && params[:export] elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中") normal_status(0,"正在下载中")
else else
set_export_cookies set_export_cookies
@all_members = student_act_score group_id, search
act_score_to_xlsx(@all_members) act_score_to_xlsx(@all_members)
filename_ = "#{current_user.real_name}_#{@course.name}_活跃度_#{Time.now.strftime('%Y%m%d_%H%M%S')}" filename_ = "#{current_user.real_name}_#{@course.name}_活跃度_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_act_score.xlsx.axlsx", render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_act_score.xlsx.axlsx",

@ -11,7 +11,12 @@ class HomeworkBanksController < ApplicationController
def update def update
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer]) if @bank.homework_type == 1
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer])
elsif @bank.homework_type == 3
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer],
base_on_project: params[:base_on_project], min_num: params[:min_num], max_num: params[:max_num])
end
# 作业描述的附件 # 作业描述的附件
Attachment.associate_container(params[:attachment_ids], @bank.id, @bank.class) if params[:attachment_ids] Attachment.associate_container(params[:attachment_ids], @bank.id, @bank.class) if params[:attachment_ids]

@ -13,7 +13,7 @@ class ShixunsController < ApplicationController
before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :add_file, before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :add_file,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file] :get_mirror_script, :download_file]
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy] before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file]
before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish,
:shixun_members_added, :change_manager, :collaborators_delete, :shixun_members_added, :change_manager, :collaborators_delete,

@ -19,7 +19,7 @@ if @type == "image"
end end
elsif @type == "html" elsif @type == "html"
json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe if @user_picture[0].present?
elsif @type == "txt" elsif @type == "txt"
json.contents @contents.to_s json.contents @contents.to_s
elsif @type =="qrcode" elsif @type =="qrcode"

@ -0,0 +1,5 @@
class AddTagToLibraries < ActiveRecord::Migration[5.2]
def change
execute "insert into library_tags(name) values('企业案例')"
end
end

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Link} from 'react-router-dom' import {Link} from 'react-router-dom'
const map={"blue":"blueFull","greyBack":"greyBack","grey":"greyWidthFixed","green":"greenBack",'greyLine':"greyLine", const map={"blue":"blueFull","greyBack":"greyBack","grey":"greyWidthFixed","green":"greenBack",'greyLine':"greyLine",'orangeLine':"orangeLine",
'colorBlue': 'colorBlue', // 蓝字白底 'colorBlue': 'colorBlue', // 蓝字白底
} }
class ActionBtn extends Component { class ActionBtn extends Component {

@ -21,7 +21,7 @@ class EvaluateSuccessEffectDisplay extends Component {
componentDidMount() { componentDidMount() {
if (this.props.type == 'html') { if (this.props.type == 'html') {
const iframe = document.getElementById('_displayIframe') const iframe = document.getElementById('_displayIframe')
if (iframe && iframe.contentWindow) { if (iframe && iframe.contentWindow && this.props.iframe_src) {
iframe.contentWindow.open() iframe.contentWindow.open()
iframe.contentWindow.document.write(this.props.iframe_src); iframe.contentWindow.document.write(this.props.iframe_src);
iframe.contentWindow.document.close(); iframe.contentWindow.document.close();

@ -278,7 +278,7 @@ class BoardsNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -597,7 +597,7 @@ render(){
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -3,11 +3,11 @@ import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Moda
import axios from 'axios' import axios from 'axios'
import '../css/busyWork.css' import '../css/busyWork.css'
import '../css/Courses.css' import '../css/Courses.css'
import { WordsBtn, getUrl, ConditionToolTip } from 'educoder' import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import NewWorkForm from './NewWorkForm'
const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
class NewWork extends Component{ class NewWork extends Component{
@ -17,6 +17,15 @@ class NewWork extends Component{
this.answerMdRef = React.createRef(); this.answerMdRef = React.createRef();
this.state={ this.state={
title_value:"",
title_num: 0,
contentFileList: [],
answerFileList: [],
workLoaded: false,
base_on_project: true,
category: {},
min_num: 2,
max_num: 10,
} }
} }
componentDidMount () { componentDidMount () {
@ -41,6 +50,7 @@ class NewWork extends Component{
course_id: data.course_id, course_id: data.course_id,
course_name: data.course_name, course_name: data.course_name,
category: data.category, category: data.category,
}) })
} }
}) })
@ -55,29 +65,129 @@ class NewWork extends Component{
.then((response) => { .then((response) => {
if (response.data.name) { if (response.data.name) {
const data = response.data; const data = response.data;
data.isEdit = true;
this.setState({ const contentFileList = data.attachments.map(item => {
category: data.category, return {
course_id: data.course_id, id: item.id,
course_name: data.course_name, uid: item.id,
name: appendFileSizeToUploadFile(item),
url: item.url,
filesize: item.filesize,
status: 'done'
}
})
const answerFileList = data.ref_attachments.map(item => {
return {
id: item.id,
uid: item.id,
name: appendFileSizeToUploadFile(item),
url: item.url,
filesize: item.filesize,
status: 'done'
}
})
this.setState({
...data,
// course_id: data.course_id,
// course_name: data.course_name,
// category: data.category,
title_num: parseInt(data.name.length),
workLoaded: true,
init_min_num: data.min_num,
init_max_num: data.max_num,
// description: data.description,
reference_answer: data.reference_answer,
contentFileList,
answerFileList,
}, () => {
setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '')
this.answerMdRef.current.setValue(data.reference_answer || '')
}, 2000)
this.props.form.setFieldsValue({
title: data.name,
description: data.description || '',
reference_answer: data.reference_answer || '',
});
}) })
this.newWorkFormRef.initValue(data);
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
} }
onCancel = () => {
this.props.toListPage(this.props.match.params, category.category_id) // 输入title
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: parseInt(e.target.value.length)
})
}
handleSubmit = () => {
const courseId = this.state.course_id || this.props.match.params.coursesId ;
this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values)
const mdContnet = this.contentMdRef.current.getValue().trim();
console.log(mdContnet)
values.description = mdContnet;
// return;
{/* max={has_commit ? init_min_num : null } */}
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
// 已有提交作品,人数范围只能扩大
const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
return;
}
}
// const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet
if (!err) {
if (this.isEdit) {
this.doEdit(courseId, values)
} else {
this.doNew(courseId, values)
}
} else {
$("html").animate({ scrollTop: $('html').scrollTop() - 100 })
}
})
} }
doEdit = (courseId, values) => {
doEdit = (params) => {
const workId = this.props.match.params.workId const workId = this.props.match.params.workId
const newUrl = `/homework_commons/${workId}.json` const newUrl = `/homework_commons/${workId}.json`
let attachment_ids = this.state.contentFileList.map(item => {
return item.response ? item.response.id : item.id
})
let reference_attachment_ids = this.state.answerFileList.map(item => {
return item.response ? item.response.id : item.id
})
const { min_num, max_num, base_on_project, category } = this.state
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
axios.put(newUrl, params) axios.put(newUrl, {
type: isGroup ? 3 : 1,
name: values.title,
description: values.description,
reference_answer: values.reference_answer,
attachment_ids,
reference_attachment_ids,
min_num,
max_num,
base_on_project
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('保存成功') this.props.showNotification('保存成功')
@ -88,11 +198,30 @@ class NewWork extends Component{
console.log(error); console.log(error);
}); });
} }
doNew = (params) => { doNew = (courseId, values) => {
const courseId = this.props.match.params.coursesId ;
const newUrl = `/courses/${courseId}/homework_commons.json` const newUrl = `/courses/${courseId}/homework_commons.json`
axios.post(newUrl, params) let attachment_ids = this.state.contentFileList.map(item => {
return item.response ? item.response.id : item.id
})
let reference_attachment_ids = this.state.answerFileList.map(item => {
return item.response ? item.response.id : item.id
})
const isGroup = this.props.isGroup()
const { min_num, max_num, base_on_project, category } = this.state
axios.post(newUrl, {
type: isGroup ? 3 : 1,
name: values.title,
description: values.description,
reference_answer: values.reference_answer,
attachment_ids,
reference_attachment_ids,
min_num,
max_num,
base_on_project
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('保存成功') this.props.showNotification('保存成功')
@ -103,26 +232,147 @@ class NewWork extends Component{
console.log(error); console.log(error);
}); });
} }
handleContentUploadChange = (info) => {
let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
}
handleAnswerUploadChange = (info) => {
let answerFileList = info.fileList;
this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) });
}
onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state[stateName].indexOf(file);
const newFileList = state[stateName].slice();
newFileList.splice(index, 1);
return {
[stateName]: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
max_num_change = (val) => {
if (val < 2) {
this.setState({
max_num: 2,
})
return;
}
const { min_num } = this.state;
this.setState({
max_num: val,
min_num: val <= min_num ? val - 1 : min_num
})
}
min_num_change = (val) => {
this.setState({ min_num: val })
}
base_on_project_change = () => {
this.setState({ base_on_project: !this.state.base_on_project })
}
render(){ render(){
let {typeId,coursesId,pageType}=this.props.match.params; let {typeId,coursesId,pageType}=this.props.match.params;
const { getFieldDecorator } = this.props.form;
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
const moduleName = !isGroup? "普通作业":"分组作业"; const moduleName = !isGroup? "普通作业":"分组作业";
const moduleEngName = this.props.getModuleName() const moduleEngName = this.props.getModuleName()
let{ let{
category title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project
}=this.state }=this.state
const { current_user } = this.props const { current_user } = this.props
const courseId = this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId ;
const isEdit = this.isEdit; const isEdit = this.isEdit;
if ((isEdit == undefined || isEdit) && !this.state.workLoaded) {
return ''
}
const uploadProps = {
width: 600,
fileList: contentFileList,
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},
};
const answerUploadProps = {
width: 600,
fileList: answerFileList,
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleAnswerUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},
};
return( return(
<div className="newMain"> <div className="newMain">
<div className="educontent mt20 mb50"> <div className="educontent mt20 mb50">
{/* <p className="clearfix">
<WordsBtn style="grey" className="fl">{course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl">{typeId==1 ?"普通作业":"分组作业"}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{pageType==="new"?"新建":"编辑"}</span>
</p> */}
<CBreadcrumb items={[ <CBreadcrumb items={[
{ to: current_user && current_user.first_category_url, name: this.state.course_name}, { to: current_user && current_user.first_category_url, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}` { to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`
@ -141,16 +391,161 @@ class NewWork extends Component{
</a> </a>
</p> </p>
<div> <div>
<NewWorkForm wrappedComponentRef={(ref) => {this.newWorkFormRef = ref}} {/* onSubmit={this.handleSubmit} */}
{...this.props} <style>
onCancel={this.onCancel} {
doNew={this.doNew} `
doEdit={this.doEdit} .yslnewworkinputaddonAfter .ant-input{
></NewWorkForm> border-right: none !important;
height: 40px !important;
}
`
}
</style>
<Form className="courseForm">
<Form.Item
label="标题"
className="AboutInputForm"
>
{getFieldDecorator('title', {
rules: [{
required: true, message: '请输入标题'
}],
})(
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView yslnewworkinputaddonAfter searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/>
)}
</Form.Item>
<style>{`
.uploadBtn.ant-btn {
border: none;
color: #4CACFF;
box-shadow: none;
background: transparent;
padding: 0 6px;
}
.ant-upload-list-item:hover .ant-upload-list-item-info{
background-color:#fff;
}
.upload_1 .ant-upload-list {
width: 350px;
}
.ant-input-number {
height: 40px;
line-height: 40px;
}
.workContent.AboutInputForm.ant-form-item {
border-bottom: none;
padding-bottom: 0px !important;
}
.newWorkUpload {
padding: 0px 30px 30px 30px!important;
background: #fff;
width: 100%;
display: inline-block;
border-bottom: 1px solid #EDEDED;
}
`}</style>
{ <Form.Item
label="内容"
className="AboutInputForm workContent mdInForm"
>
{getFieldDecorator('description', {
rules: [{
required: true, message: '请输入作业内容和要求'
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
{ isGroup &&
<Form.Item
label="分组设置"
className="AboutInputForm"
>
{getFieldDecorator('personNum', {
rules: [{
required: false
// required: true, message: '请输入最小人数和最大人数'
}],
})(
<div>
<p className="clearfix">
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
{/* max={has_commit ? init_min_num : null } */}
<InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40" value={min_num}
onChange={this.min_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<span className="ml15 mr15">~</span>
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<label className="color-grey-9 ml20 font-14">项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享</label>
</p>
<p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
<Checkbox checked={base_on_project} onChange={this.base_on_project_change}
disabled={has_project || has_commit}
>基于项目实施</Checkbox>
</ConditionToolTip>
<label className="color-grey-9 ml12 font-14">勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最新进展的实时统计</label>
</p>
</div>
)}
</Form.Item>
}
<Form.Item
label="参考答案"
className="AboutInputForm"
style={{"borderBottom":"none"}}
>
{getFieldDecorator('reference_answer', {
rules: [{
required: false
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
)}
<Upload {...answerUploadProps} className="upload_1">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
</Form.Item>
<Form.Item>
<div className="clearfix mt30 mb30">
{/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.toListPage(this.props.match.params, category.category_id)}>取消</ a>
</div>
</Form.Item>
</Form>
</div> </div>
</div> </div>
</div> </div>
) )
} }
} }
export default NewWork; const WrappedBoardsNew = Form.create({ name: 'NewWork' })(NewWork);
export default WrappedBoardsNew;

@ -257,7 +257,7 @@ class AccessoryModal extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -180,7 +180,7 @@ class AccessoryModal2 extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -396,7 +396,7 @@ class Selectsetting extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -344,7 +344,7 @@ class Sendresource extends Component{
// console.log('beforeUpload', file.name); // console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -708,7 +708,14 @@ a.white-btn.use_scope-btn:hover{
color: #999!important; color: #999!important;
padding:0px 10px; padding:0px 10px;
} }
.orangeLine{
background: #fff;
border:1px solid #FE944B;
color: #FE944B!important;
padding:0px 10px;
line-height: 28px;
border-radius: 4px;
}
.colorFF6800{ .colorFF6800{
color:#FF6800; color:#FF6800;

@ -332,17 +332,17 @@ class Testpapersettinghomepage extends Component{
<div className="fl task_menu_ul"> <div className="fl task_menu_ul">
{this.props.isAdmin()===true? {this.props.isAdmin()===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item> <Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1">统计结果</Menu.Item> <Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
<Menu.Item key="2">试卷预览</Menu.Item> <Menu.Item key="2" className={"exercisesafonts"}>试卷预览</Menu.Item>
<Menu.Item key="3">设置</Menu.Item> <Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu> </Menu>
: :
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item> <Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
{Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true? {Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true?
<Menu.Item key="1">统计结果</Menu.Item>:""} <Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>:""}
<Menu.Item key="3">设置</Menu.Item> <Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu> </Menu>
} }
</div> </div>
@ -370,7 +370,7 @@ class Testpapersettinghomepage extends Component{
padding-top: 10px; padding-top: 10px;
padding-bottom: 8px; padding-bottom: 8px;
} }
a:hover { .exercisesafonts:hover {
color:#1A0B00 !important; color:#1A0B00 !important;
} }
`} `}

@ -523,7 +523,7 @@ class GraduationTasksSubmitedit extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -540,7 +540,7 @@ render(){
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -172,7 +172,7 @@ class GraduationTasksappraiseMainEditor extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -297,7 +297,7 @@ class GraduationTasksedit extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -49,56 +49,55 @@ class GraduationTasksnew extends Component {
} }
Commoninterface =(fileList)=>{ Commoninterface =(fileList)=>{
let listid = [] let listid = []
for (var list of fileList) { for (var list of fileList) {
listid.push(list.response.id) listid.push(list.response.id)
} }
// if (GraduationTasksnewtype === true) { // if (GraduationTasksnewtype === true) {
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) {
if (values.tasktype === undefined) { if (values.tasktype === undefined) {
this.ifHasAnchorJustScorll("tasktypes"); this.ifHasAnchorJustScorll("tasktypes");
// this.scrollToAnchors("tasktypes");
return return
} }
if (values.name === undefined) { if (values.name === undefined) {
this.scrollToAnchors("nametypes"); this.ifHasAnchorJustScorll("nametypes");
return return
} }
if (values.description === undefined) { if (values.description === undefined) {
this.scrollToAnchors("descriptiontypes"); this.ifHasAnchorJustScorll("descriptiontypes");
return return
} else if (values.description.length > 5000) { }else if (values.description.length > 5000) {
this.scrollToAnchors("descriptiontypes"); this.ifHasAnchorJustScorll("descriptiontypes");
return return
} }
// console.log('Received values of form: ', values); if (!err) {
// console.log(fileList); // console.log('Received values of form: ', values);
const course_id = this.props.match.params.coursesId; // console.log(fileList);
const course_id = this.props.match.params.coursesId;
let url = "/courses/" + course_id + "/graduation_tasks.json"
axios.post(url, { let url = "/courses/" + course_id + "/graduation_tasks.json"
task_type: parseInt(values.tasktype), axios.post(url, {
name: values.name, task_type: parseInt(values.tasktype),
description: values.description, name: values.name,
attachment_ids: listid, description: values.description,
} attachment_ids: listid,
).then((response) => { }
// if (response.status === 200) { ).then((response) => {
// GraduationTasksnewtype = false; // if (response.status === 200) {
// this.goback(); // GraduationTasksnewtype = false;
if(response!==undefined){ // this.goback();
this.goback() if(response!==undefined){
} this.goback()
// } }
}).catch((error) => { // }
console.log(error) }).catch((error) => {
}) console.log(error)
} })
}
}); });
// } // }
} }
@ -128,14 +127,16 @@ class GraduationTasksnew extends Component {
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if(info.file.status == "done" || info.file.status == "uploading"){
let fileList = info.fileList;
// for(var list of fileList ){
// console.log(list) // for(var list of fileList ){
// } // console.log(list)
this.setState({ // }
fileList: appendFileSizeToUploadFileAll(fileList), this.setState({
}); fileList: appendFileSizeToUploadFileAll(fileList),
});
}
} }
// onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {
@ -202,10 +203,10 @@ class GraduationTasksnew extends Component {
} }
//滚动 //滚动
ifHasAnchorJustScorll(anchor) { ifHasAnchorJustScorll() {
// let anchor = this.getURLStuff("anchor"); // let anchor = this.getURLStuff("anchor");
// let anchor = this.state.anchor; let anchor = this.state.anchor;
// console.log("anchor ", anchor); // console.log("anchor ", anchor);
// 对应id的话, 滚动到相应位置 // 对应id的话, 滚动到相应位置
if (!!anchor) { if (!!anchor) {
@ -273,7 +274,7 @@ class GraduationTasksnew extends Component {
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },
@ -360,7 +361,7 @@ class GraduationTasksnew extends Component {
` `
} }
</style> </style>
<Form.Item label="类型" id="tasktype" className={"tasktype"}> <Form.Item label="类型" className={"tasktype"}>
{getFieldDecorator('tasktype', { {getFieldDecorator('tasktype', {
rules: [{required: true, message: "请选择任务类型"}], rules: [{required: true, message: "请选择任务类型"}],
})(<Select className={"greyInput mb20"} })(<Select className={"greyInput mb20"}

@ -314,7 +314,7 @@ class GraduateTopicNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -253,7 +253,7 @@ class GraduateTopicPostWorksNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -337,7 +337,6 @@ class PollNew extends Component {
}) })
} }
} }
// }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -1779,8 +1778,8 @@ class PollNew extends Component {
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess, max_choices: max_choicess===undefined?null:max_choicess===null?null:max_choicess===0?null:max_choicess,
min_choices: min_choicess, min_choices: min_choicess===undefined?null:min_choicess===null?null:min_choicess===0?null:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
insert_id: insert_id insert_id: insert_id
@ -2133,6 +2132,12 @@ class PollNew extends Component {
//最小值 //最小值
HandleGradationGroupChangee = (value, index, max, length) => { HandleGradationGroupChangee = (value, index, max, length) => {
console.log("最小值");
console.log(value);
console.log(index);
console.log(max);
console.log(length);
// debugger // debugger
var minbool = false; var minbool = false;
var maxbool = false; var maxbool = false;
@ -2147,7 +2152,7 @@ class PollNew extends Component {
if (minbool === true && maxbool === true) { if (minbool === true && maxbool === true) {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
arr[i].question.min_choices = parseInt(value); arr[i].question.min_choices = parseInt(value);
} }
} }
this.setState({ this.setState({
@ -2156,18 +2161,8 @@ class PollNew extends Component {
} else { } else {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
try {
if(parseInt(value)===0){
arr[i].question.min_choices = 2;
arr[i].question.max_choices = length;
}else{
arr[i].question.min_choices = parseInt(value); arr[i].question.min_choices = parseInt(value);
arr[i].question.max_choices = max; arr[i].question.max_choices = length;
}
}catch (e) {
arr[i].question.min_choices = 2;
arr[i].question.max_choices = length;
}
break; break;
} }
} }
@ -2179,19 +2174,32 @@ class PollNew extends Component {
} }
//最大值 //最大值
HandleGradationGroupChangeee = (value, index,minchoices) => { HandleGradationGroupChangeee = (value, index,minchoices,length) => {
// console.log("2112"); // console.log("2112");
// console.log(value); // console.log(value);
// console.log(minchoices); // console.log(minchoices);
console.log("最大值");
console.log(value);
console.log(index);
console.log(minchoices);
console.log(length);
let arr = this.state.adddom; let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (index === i) { if (index === i) {
if(parseInt(value)===0&&parseInt(minchoices)===0){ if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(0);
arr[i].question.max_choices = parseInt(0);
}else if(parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(2);
arr[i].question.max_choices = parseInt(value);
}
else if(parseInt(value)===0&&parseInt(minchoices)>0){
arr[i].question.min_choices= parseInt(minchoices); arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); arr[i].question.max_choices = parseInt(value);
}else { }
else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value); arr[i].question.max_choices = parseInt(value);
} }
} }
} }
@ -2464,9 +2472,8 @@ class PollNew extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;"; var displaymysave = (mysave === true) ? "" : "display:none;";
return ( return (
<div > <div className="newMain">
{/*提示*/} {/*提示*/}
{Modalstype && Modalstype === true ? <Modals {Modalstype && Modalstype === true ? <Modals
modalsType={this.state.Modalstype} modalsType={this.state.Modalstype}
@ -2476,14 +2483,8 @@ class PollNew extends Component {
modalsBottomval={this.state.ModalsBottomval} modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype} loadtype={this.state.Loadtype}
/> : ""} /> : ""}
<style>
{ <div className="educontent mb50">
`
.newMains{ margin: 0 auto; padding-bottom: 235px !important; min-width:1200px; min-height: 800px !important;}
`
}
</style>
<div className="educontent newMains">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a> <a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -2885,7 +2886,7 @@ class PollNew extends Component {
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
> >
<Option value={String("0")}>--</Option> <Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
return ( return (
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : "" indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
@ -2896,10 +2897,10 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
> >
<Option value={String("0")}>--</Option> <Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
return ( return (
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : "" indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
@ -3139,7 +3140,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
@ -3391,7 +3392,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>

@ -1100,7 +1100,7 @@ class ShixunHomework extends Component{
{course_modules&&course_modules.main_category.map((item,key)=>{ {course_modules&&course_modules.main_category.map((item,key)=>{
return( return(
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)} title={item.main_category_name}>{item.main_category_name}</li> datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)} title={item.main_category_name.length>18?item.main_category_name:""}>{item.main_category_name}</li>
) )
})} })}
@ -1109,10 +1109,10 @@ class ShixunHomework extends Component{
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1) return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => { }).map( (item,key) => {
if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){ if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li> return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name.length>18?item.category_name:""}>{item.category_name}</li>
} }
if(datas&&datas.category_id===null){ if(datas&&datas.category_id===null){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li> return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name.length>18?item.category_name:""}>{item.category_name}</li>
} }
})} })}

@ -82,10 +82,10 @@ class CaseDetail extends Component{
<a href="/moop_cases" className="color-grey-9">教学案例</a> &gt; <span className="color-grey-3">{ CaseDetail.title}</span> <a href="/moop_cases" className="color-grey-9">教学案例</a> &gt; <span className="color-grey-3">{ CaseDetail.title}</span>
</p> </p>
<p className="lineh-25 mb20 clearfix"> <p className="lineh-25 mb20 clearfix">
<span className="font-22 fl mr10 task-hide" style={{maxWidth:"800px"}}> <span className="font-22 fl mr10 task-hide lineh-30" style={{maxWidth:"800px"}}>
{ CaseDetail.title} { CaseDetail.title}
</span> </span>
<span className="mt5 fl"> <span className="mt10 fl">
<Tags tags={tags}></Tags> <Tags tags={tags}></Tags>
{ {
CaseDetail.status == "pending" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">草稿</span> CaseDetail.status == "pending" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">草稿</span>

@ -47,19 +47,18 @@ class CaseNew extends Component{
// 上传附件-删除确认框 // 上传附件-删除确认框
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){ if(file.response!=undefined){
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
onOk: () => { onOk: () => {
this.deleteAttachment(file, stateName) this.deleteAttachment(file, stateName)
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel');
}, },
}); });
return false; return false;
} }
} }
// 上传附件-确认删除 // 上传附件-确认删除
@ -279,7 +278,7 @@ class CaseNew extends Component{
beforeUpload: (file) => { beforeUpload: (file) => {
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
//message.error('文件大小必须小于150MB!'); //this.props.showNotification('文件大小必须小于150MB!');
this.props.define({ this.props.define({
title:'提示', title:'提示',
content:"该文件无法上传。超过文件大小限制(150MB),建议上传到百度云等其它共享工具里然后再txt文档里给出链接以及共享密码并上传" content:"该文件无法上传。超过文件大小限制(150MB),建议上传到百度云等其它共享工具里然后再txt文档里给出链接以及共享密码并上传"
@ -383,7 +382,7 @@ class CaseNew extends Component{
<ul className="fl libraries_tab"> <ul className="fl libraries_tab">
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li> <li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li>
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li> <li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li>
{/*<li className={casesTags.indexOf(3) > -1 ? "active" : ""} onclick={() => this.changeType(3)}>企业案例</li>*/} <li className={ casesTags.indexOf(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li>
</ul> </ul>
{ {
checkTag && <div class="ant-form-explain">请选择标签</div> checkTag && <div class="ant-form-explain">请选择标签</div>

@ -14,7 +14,17 @@ class CaseTags extends Component{
{ {
tags && tags.map((item,key)=>{ tags && tags.map((item,key)=>{
return( return(
<span key={key} className={item.name == "获奖案例" ? "edu-filter-btn fl cdefault edu-activity-red ml10" : "edu-filter-btn fl cdefault edu-activity-blue ml10"}>{item.name}</span> <React.Fragment>
{
item.name == "获奖案例" ?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-red ml10">{item.name}</span>
:
item.name == "入库案例" ?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-blue ml10">{item.name}</span>
:
<span key={key} className="edu-filter-btn fl cdefault edu-activity-orange-sub ml10">{item.name}</span>
}
</React.Fragment>
) )
}) })
} }

@ -62,6 +62,13 @@
border: 1px solid #4CACFF; border: 1px solid #4CACFF;
line-height: 17px; line-height: 17px;
} }
.edu-activity-orange-sub {
background-color: #FF781B;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.pointsBtn { .pointsBtn {
width: 70px; width: 70px;

@ -481,12 +481,13 @@ export function TPMIndexHOC(WrappedComponent) {
} }
` `
}</style> }</style>
<NewHeader {...this.state} {...this.props}></NewHeader>
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin" <Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" size="large"
tip= {this._gLoadingTip || "加载中..."} tip= {this._gLoadingTip || "加载中..."}
> >
<NewHeader {...this.state} {...this.props}></NewHeader>
<div className="newContainer newContainers"> <div className="newContainer newContainers">
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)} <WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
{...this.props} {...this.state} {...this.props} {...this.state}
@ -497,11 +498,12 @@ export function TPMIndexHOC(WrappedComponent) {
</div> </div>
</Spin>
<NewFooter <NewFooter
Footerdown={Footerdown} Footerdown={Footerdown}
/> />
</Spin>
</div> </div>
); );
} }

@ -916,7 +916,7 @@ class Newshixuns extends Component {
// // console.log('beforeUpload', file.name); // // console.log('beforeUpload', file.name);
// const isLt50M = file.size / 1024 / 1024 < 50; // const isLt50M = file.size / 1024 / 1024 < 50;
// if (!isLt50M) { // if (!isLt50M) {
// message.error('文件大小必须小于150MB!'); // this.props.showNotification('文件大小必须小于150MB!');
// } // }
// return isLt50M; // return isLt50M;
// }, // },

@ -13,6 +13,7 @@ import axios from 'axios';
import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; import { trace, trace_collapse ,getImageUrl, toPath} from "educoder";
import RepositoryDirectories from './RepositoryDirectories' import RepositoryDirectories from './RepositoryDirectories'
import RepositoryAddFile from './RepositoryAddFile'
const $ = window.$; const $ = window.$;
// 点击按钮复制功能 // 点击按钮复制功能
@ -82,10 +83,10 @@ class Repository extends Component {
<a href="/forums/2784" target="_blank" <a href="/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a> className=" guideBtn" >Git使用指南</a>
{/* <RepositoryAddFile {...this.props} {...this.state}></RepositoryAddFile> */}
<div className="fr font-12 color-grey-9 pr"> <div className="fr font-12 color-grey-9 pr">
<label className="fl">网址克隆</label> <label className="fl mt2">网址克隆</label>
<input type="text" id="copy_rep_content" className="fl url-input" <input type="text" id="copy_rep_content" className="fl url-input mt2"
defaultValue={ git_url } style={{width: 313}}/> defaultValue={ git_url } style={{width: 313}}/>
<a onClick={() => { <a onClick={() => {
jsCopy() jsCopy()

@ -0,0 +1,52 @@
import React, { Component } from 'react';
import { ActionBtn } from 'educoder'
import { Form , Modal } from 'antd'
class RepositoryAddFile extends Component {
constructor(props) {
super(props);
this.state={
visible:false
}
}
addFile = () =>{
this.setState({
visible:true
})
}
cancelAdd = () =>{
this.setState({
visible:false
})
}
render(){
let { visible } = this.state
return(
<React.Fragment>
<ActionBtn style="orangeLine" className="ml20" onClick={this.addFile}>+添加文件</ActionBtn>
<Modal
className={"RepositioryModal"}
title={'添加文件'}
visible={visible}
closable={false}
footer={null}
destroyOnClose={true}
width="550px"
>
<div className="task-popup-content">
</div>
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr30" onClick={this.cancelAdd}>取消</a>
<a className="task-btn task-btn-orange">提交</a>
</div>
</Modal>
</React.Fragment>
)
}
}
const WrappedRepositoryAddFile = Form.create({name: 'taskRepositoryAddFile'})(RepositoryAddFile);
// RouteHOC()
export default (WrappedRepositoryAddFile);
Loading…
Cancel
Save