From 370b1ee2343cbd8f5679cd7bffb3aa18b7717891 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 10:35:34 +0800 Subject: [PATCH 01/16] css --- .../src/modules/courses/boards/TopicDetail.js | 37 +++++++++++++------ .../modules/courses/common/courseMessage.css | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index 1ef880c9f..5d4a434a5 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -227,15 +227,30 @@ class TopicDetail extends Component { // filesize = bytesToSize(item.filesize) } attachments.push( -

- - - {fileName && 30 }> - {fileName} - } - {filesize? ` ${filesize.replace(' ', '')}` : ''} + //

+ // + // + // {fileName && 30 }> + // {fileName} + // } + // {filesize? ` ${filesize.replace(' ', '')}` : ''} + // + //

+ +
+ + -

+ {fileName && 30 }> + + {fileName} + + } + + {item.filesize} + +
) }) return attachments; @@ -542,7 +557,7 @@ class TopicDetail extends Component { } {/* || current_user.user_id === author_info.user_id */} { current_user && (isAdmin || isCurrentUserTheAuthor) && -
+
-
+
-
+
{/* ${memo.user_praise ? '' : ''} */} diff --git a/public/react/src/modules/courses/common/courseMessage.css b/public/react/src/modules/courses/common/courseMessage.css index db2381d37..e521b24f5 100644 --- a/public/react/src/modules/courses/common/courseMessage.css +++ b/public/react/src/modules/courses/common/courseMessage.css @@ -25,7 +25,7 @@ } */ #forum_list .return_btn.no_mr { - margin-right: 15px + /* margin-right: 15px */ } /* md编辑器拖拽调整 */ From e1339db81243bf967529695d61991a8c450ce68b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 11:01:00 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/exercise/ExerciseNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseNew.js b/public/react/src/modules/courses/exercise/ExerciseNew.js index 88e1859f9..b17e8288c 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNew.js +++ b/public/react/src/modules/courses/exercise/ExerciseNew.js @@ -408,7 +408,7 @@ class ExerciceNew extends Component{

{this.isEdit ? "编辑" : "新建"}试卷 this.props.history.goBack()}> + onClick={() => this.props.history.length == 1 ? this.props.history.push(`/courses/${courseId}/exercises/${left_banner_id}`): this.props.history.goBack()}> 返回

From 716c2b68cae222dab9745210f414939cb8ef643a Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 11:03:50 +0800 Subject: [PATCH 03/16] clearfix mt30 mb30 --- public/react/src/modules/courses/boards/BoardsNew.js | 2 +- public/react/src/modules/courses/busyWork/NewWork.js | 2 +- public/react/src/modules/courses/exercise/ExerciseNew.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js index bd134c922..cf530aba5 100644 --- a/public/react/src/modules/courses/boards/BoardsNew.js +++ b/public/react/src/modules/courses/boards/BoardsNew.js @@ -280,7 +280,7 @@ class BoardsNew extends Component{ { name: this.isEdit ? '帖子编辑' : '帖子新建'} ]}> -

+

{this.isEdit ? "编辑" : "新建"}帖子 this.props.history.goBack()}> diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js index 607a2dc82..eefbc1f0b 100644 --- a/public/react/src/modules/courses/busyWork/NewWork.js +++ b/public/react/src/modules/courses/busyWork/NewWork.js @@ -373,7 +373,7 @@ class NewWork extends Component{ { name: `${ this.isEdit ? '编辑' : '新建'}` } ]}> -

+

{this.isEdit ?"编辑":"新建"}{ moduleName } {/* history.goBack() this.props.toListPage(this.props.match.params, category.category_id)} diff --git a/public/react/src/modules/courses/exercise/ExerciseNew.js b/public/react/src/modules/courses/exercise/ExerciseNew.js index b17e8288c..8bc7ed6ae 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNew.js +++ b/public/react/src/modules/courses/exercise/ExerciseNew.js @@ -405,7 +405,7 @@ class ExerciceNew extends Component{ { name: this.isEdit ? '编辑试卷' : '新建试卷'} ]}> -

+

{this.isEdit ? "编辑" : "新建"}试卷 this.props.history.length == 1 ? this.props.history.push(`/courses/${courseId}/exercises/${left_banner_id}`): this.props.history.goBack()}> From 005dfc59ca1d5a61e04594491dfbb93c67ae3f22 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 14:41:42 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationTasksnew.js | 685 +++++++++--------- public/react/src/modules/tpm/NewHeader.js | 2 +- 2 files changed, 359 insertions(+), 328 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index f98373fe6..79a0e77ea 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -1,297 +1,327 @@ -import React,{Component} from "React"; -import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd"; +import React, {Component} from "React"; +import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd"; import {Link} from 'react-router-dom'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -import { WordsBtn,getUrl} from 'educoder'; +import {WordsBtn, getUrl} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import '../../css/Courses.css'; -const { Option} = Select; + +const {Option} = Select; const CheckboxGroup = Checkbox.Group; const confirm = Modal.confirm; -let GraduationTasksnewtype=true; -class GraduationTasksnew extends Component{ - - constructor(props){ - super(props) - this.state={ - coursename:"", - coursesearch:"", - title_num:60, - title_value:"", - fileList: [], - contents: [{val:"",id:1}], - type:true - } - } - - componentDidMount(){ - // const query =this.props.location.search; - // - // const type = query.split('&'); - // let name = type[1].split("name=") - // name = String(name).split(",") - // name = decodeURI(name[1]) - // - // this.setState({ - // coursename:name, - // coursesearch:this.props.location.search - // }) - } - - scrollToAnchors=(anchorName)=>{ - this.setState({ - anchor:anchorName - }) - } - - - handleSubmit=(e) => { - let {fileList}=this.state; - let listid=[] - - for(var list of fileList){ - listid.push(list.response.id) - } - e.preventDefault(); - if( GraduationTasksnewtype===true){ - this.props.form.validateFields((err, values) => { - if (!err) { - if(values.tasktype===undefined){ - this.scrollToAnchors("tasktypes"); - return +let GraduationTasksnewtype = true; + +class GraduationTasksnew extends Component { + + constructor(props) { + super(props) + this.state = { + coursename: "", + coursesearch: "", + title_num: 60, + title_value: "", + fileList: [], + contents: [{val: "", id: 1}], + type: true + } + } + + componentDidMount() { + // const query =this.props.location.search; + // + // const type = query.split('&'); + // let name = type[1].split("name=") + // name = String(name).split(",") + // name = decodeURI(name[1]) + // + // this.setState({ + // coursename:name, + // coursesearch:this.props.location.search + // }) + } + + scrollToAnchors = (anchorName) => { + this.setState({ + anchor: anchorName + }) + } + + + handleSubmit = (e) => { + let {fileList} = this.state; + let listid = [] + + for (var list of fileList) { + listid.push(list.response.id) + } + e.preventDefault(); + if (GraduationTasksnewtype === true) { + this.props.form.validateFields((err, values) => { + if (!err) { + if (values.tasktype === undefined) { + this.scrollToAnchors("tasktypes"); + return + } + + if (values.name === undefined) { + this.scrollToAnchors("nametypes"); + return + } + + if (values.description === undefined) { + this.scrollToAnchors("descriptiontypes"); + return + } else if (values.description.length > 5000) { + this.scrollToAnchors("descriptiontypes"); + return + } + console.log('Received values of form: ', values); + console.log(fileList); + const course_id = this.props.match.params.coursesId; + + let url = "/courses/" + course_id + "/graduation_tasks.json" + axios.post(url, { + task_type: parseInt(values.tasktype), + name: values.name, + description: values.description, + attachment_ids: listid, + } + ).then((response) => { + if (response.status === 200) { + GraduationTasksnewtype = false; + // this.goback(); + this.props.history.push("/courses/" + this.props.match.params.coursesId + "/graduation_tasks/" + this.props.match.params.category_id + "/" + response.data.task_id + "/setting"); + } + }).catch((error) => { + console.log(error) + }) + } + + }); + } + + + } + + + goback = () => { + let courseId = this.props.match.params.coursesId; + let category_id = this.props.match.params.category_id; + + window.location.href = "/courses/" + courseId + "/graduation_tasks/" + category_id; + } + + + // 输入title + changeTitle = (e) => { + + this.setState({ + title_num: 60 - parseInt(e.target.value.length), + title_value: e.target.value + }) + + } + // 附件相关 START + handleChange = (info) => { + let fileList = info.fileList; + + // for(var list of fileList ){ + // console.log(list) + // } + this.setState({fileList}); + } + + onAttachmentRemove = (file) => { + // confirm({ + // title: '确定要删除这个附件吗?', + // okText: '确定', + // cancelText: '取消', + // // content: 'Some descriptions', + // onOk: () => { + // this.deleteAttachment(file) + // }, + // onCancel() { + // console.log('Cancel'); + // }, + // }); + // return false; + + this.setState({ + Modalstype: true, + Modalstopval: '确定要删除这个附件吗?', + ModalSave: () => this.deleteAttachment(file), + ModalCancel: this.cancelAttachment + }) + return false; + } + + cancelAttachment = () => { + this.setState({ + Modalstype: false, + Modalstopval: '确定要删除这个附件吗?', + ModalSave: "", + ModalCancel: "" + }) + } + + deleteAttachment = (file) => { + 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.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + + //滚动 + ifHasAnchorJustScorll() { + // let anchor = this.getURLStuff("anchor"); + + let anchor = this.state.anchor; + // console.log("anchor ", anchor); + // 对应id的话, 滚动到相应位置 + if (!!anchor) { + let anchorElement = document.getElementById(anchor); + if (anchorElement) { + window.scrollTo(0, anchorElement.offsetTop - window.innerHeight / 2); + } + } + // 没有的话,滚动到头部 + else { + document.body.scrollTop = document.documentElement.scrollTop = 0; + } + } + + render() { + const {getFieldDecorator} = this.props.form; + let { + coursename, coursesearch, title_num, title_value, pageType, fileList, contents, type, + Modalstype, Modalstopval, ModalCancel, ModalSave + } = this.state; + + let {coursedata} = this.props; + + let courseId = this.props.match.params.coursesId; + let position = this.props.match.params.position; + let category_id = this.props.match.params.category_id; + const uploadProps = { + width: 600, + fileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUrl()}/api/attachments.json`, + onChange: this.handleChange, + onRemove: this.onAttachmentRemove, + beforeUpload: (file) => { + console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 150; + if (!isLt150M) { + message.error('文件大小必须小于150MB!'); + } + return isLt150M; + }, + }; + this.ifHasAnchorJustScorll(); + // console.log(this.props.current_user.course_name) + return ( + + +

+ {/*提示*/} + +
+
+ +

+ {this.props.current_user && this.props.current_user.course_name} + > + 毕设任务 + > + {"新建"} +

+ +
+ + +
+ + {/*内容*/} +
+ + + {getFieldDecorator('tasktype', { + rules: [{required: true, message: "请选择任务类型"}], + })()} + + (选择确认后,无法修改) + + + + {getFieldDecorator('name', { + rules: [{required: true, message: "不能为空"}], + })()} + + +
+ + +
+ - - {getFieldDecorator('description', { - rules: [{ - required: true, message: '请输入帖子内容', - }, { - max: 5000, message: '最大限制为5000个字符', - }], - })( - - )} - - - - - (单个文件150M以内) - -
- - - -
- - 取消 -
-
-
- -
-
-
- - - - ) - } + + {getFieldDecorator('description', { + rules: [{ + required: true, message: '请输入帖子内容', + }, { + max: 5000, message: '最大限制为5000个字符', + }], + })( + + )} + + + + + (单个文件150M以内) + +
+ + + +
+ + 取消 +
+
+ + +
+
+
+ + + + ) + } } -const GraduationTasksnewApp = Form.create({ name: 'coursesNew' })(GraduationTasksnew); + +const GraduationTasksnewApp = Form.create({name: 'coursesNew'})(GraduationTasksnew); export default GraduationTasksnewApp; \ No newline at end of file diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 25d290fac..e97a728d4 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -570,7 +570,7 @@ submittojoinclass=(value)=>{ // join_course_url: "https://www.educoder.net/courses/join_course_multi_role" // join_project_url: "https://www.educoder.net/applied_project/applied_project_info" // rolearr:["",""], - console.log() + // console.log() return (
From d486fa127244c92c57cfed3f7c6e608e0aa7093f Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 15:02:39 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/graduation/tasks/GraduationTasksnew.js | 4 ++-- public/react/src/modules/login/Trialapplication.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index 79a0e77ea..ccbaa8646 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -240,7 +240,7 @@ class GraduationTasksnew extends Component { return isLt150M; }, }; - this.ifHasAnchorJustScorll(); + // this.ifHasAnchorJustScorll(); // console.log(this.props.current_user.course_name) return ( @@ -313,7 +313,7 @@ class GraduationTasksnew extends Component { {getFieldDecorator('name', { rules: [{required: true, message: "不能为空"}], })()} diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index e0a631541..bf81c8655 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -212,8 +212,8 @@ class Trialapplication extends Component { this.setState({ isRenders: false }) - this.Cancel(); window.location.href = "/"; + this.Cancel(); } else { this.setState({ isRenders: false From 6995de1523182422013b2c58bca9cb223619458e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 15:08:09 +0800 Subject: [PATCH 06/16] cs --- .../modules/courses/boards/BoardsListItem.js | 42 ++++++++++--------- .../courses/busyWork/CommonWorkItem.js | 10 ++++- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/courses/boards/BoardsListItem.js b/public/react/src/modules/courses/boards/BoardsListItem.js index c25c541e8..2a6aaae2f 100644 --- a/public/react/src/modules/courses/boards/BoardsListItem.js +++ b/public/react/src/modules/courses/boards/BoardsListItem.js @@ -1,7 +1,7 @@ import React,{ Component } from "react"; import {Tooltip} from 'antd' import moment from 'moment' -import { getUrl } from 'educoder' +import { getUrl, WordsBtn } from 'educoder' class BoardsListItem extends Component{ constructor(props){ super(props); @@ -61,34 +61,37 @@ class BoardsListItem extends Component{
-

+

- {discussMessage.author.name} + {discussMessage.author.name} - { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } - { discussMessage.total_praises_count != 0 && {discussMessage.total_praises_count} 点赞 } - { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } + { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } + { discussMessage.total_praises_count != 0 && {discussMessage.total_praises_count} 点赞 } + { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } - {moment(discussMessage.created_on).fromNow()} + {moment(discussMessage.created_on).fromNow()} - {/* 最后回复社区导师10个月前 */}

+
+ {(isAdmin || discussMessage.author.login == current_user.login) && + { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑 } + + { isAdmin && { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> + { discussMessage.sticky ? '取消置顶' : '置顶' } } +
+ + - {/* 473 */} - {/*

- 82 - 1 - 4 -

*/} - { (isAdmin || discussMessage.author.login == current_user.login) && + {/* { (isAdmin || discussMessage.author.login == current_user.login) &&
- } + } */} + +
) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index 258a06332..295f55fe1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -156,7 +156,7 @@ class CommonWorkItem extends Component{ - { + {/* { mainList && isAdmin &&
  • @@ -170,7 +170,7 @@ class CommonWorkItem extends Component{
  • - } + } */}

    {item.commit_count===undefined?"":{item.commit_count} 已交} @@ -184,6 +184,12 @@ class CommonWorkItem extends Component{ {item.status_time} } + + {this.props.isAdmin &&

    + { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑 + { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置 +
    } + { // isStudent && From b7424701b22fab5af6f4d98fe117562ac5b8f718 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 15:11:07 +0800 Subject: [PATCH 07/16] =?UTF-8?q?route=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/busyWork/IndexGroup.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/react/src/modules/courses/busyWork/IndexGroup.js b/public/react/src/modules/courses/busyWork/IndexGroup.js index 5271d7deb..0a4415f2f 100644 --- a/public/react/src/modules/courses/busyWork/IndexGroup.js +++ b/public/react/src/modules/courses/busyWork/IndexGroup.js @@ -36,6 +36,10 @@ const CommonWorkAnswer = Loadable({ loader: () => import('./CommonWorkAnswer'), loading:Loading, }) +const CommonWorkAppraise = Loadable({ + loader: () => import('./CommonWorkAppraise'), + loading:Loading, +}) const CommonWork = Loadable({ @@ -87,6 +91,12 @@ class CoursesWorkIndex extends Component{ (props) => () } > + {/* 评阅 */} + () + } + > Date: Fri, 21 Jun 2019 15:18:11 +0800 Subject: [PATCH 08/16] title --- public/react/src/modules/courses/busyWork/CommonWorkList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 58a448a35..11d26ebf1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -70,10 +70,10 @@ function buildColumns(that, student_works) { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' - }}> - + }} title={text}> + {/* + */} {text} - ), }, { From 9769bec51717f4afc616c8d2e66022e4caed64b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 21 Jun 2019 15:31:48 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTasksedit.js | 9 +++++++-- public/react/src/modules/courses/new/CoursesNew.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 9874b26fa..cd84cd221 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -79,7 +79,12 @@ class GraduationTasksedit extends Component{ let listid=[] let graduation_id=this.state.data.graduation_id; for(var list of fileList){ - listid.push(list.response.id) + if(list.response!=undefined){ + listid.push(list.response.id) + }else{ + listid.push(list.id) + } + } // console.log(listid) @@ -125,7 +130,7 @@ class GraduationTasksedit extends Component{ GraduationTasksedittype=false; // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; // this.goback() - window.location.href="/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"; + this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index d8fb83974..6c0158f21 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -314,7 +314,7 @@ class CoursesNew extends Component { } }).then((result)=>{ this.setState({ - searchlistscholl:result.data.shools_name, + searchlistscholl:result.data.school_names, scholl:value }) this.props.form.setFieldsValue({ From 5811df7dcecba4a2baa7a23d25e4798bff220691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 21 Jun 2019 15:34:44 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/graduation/tasks/GraduationTasksedit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index cd84cd221..39116c5de 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -82,7 +82,7 @@ class GraduationTasksedit extends Component{ if(list.response!=undefined){ listid.push(list.response.id) }else{ - listid.push(list.id) + listid.push(list.uid) } } From 0d3608e6e095ffab9ec9263cdf5b507f760476c2 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 15:34:56 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/HomeworkModal.js | 2 ++ public/react/src/modules/login/Trialapplication.js | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js index f448483d2..66bca0023 100644 --- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js +++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js @@ -27,6 +27,8 @@ class HomeworkModal extends Component{ group_ids:[], endtime:"" } + console.log("30"); + console.log(props); } componentDidMount() { diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index bf81c8655..9626a1475 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -213,7 +213,6 @@ class Trialapplication extends Component { isRenders: false }) window.location.href = "/"; - this.Cancel(); } else { this.setState({ isRenders: false @@ -274,8 +273,6 @@ class Trialapplication extends Component { thiss.setState({ isRenders: false }) - thiss.Cancel(); - } else { thiss.setState({ isRenders: false From 66e65946fbf32ad17d7ce4bba58d9d262dc6cd82 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 16:25:51 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/HomeworkModal.js | 2 -- .../src/modules/login/Trialapplication.js | 27 +++++++++++-------- public/react/src/modules/tpm/NewHeader.js | 2 ++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js index 66bca0023..f448483d2 100644 --- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js +++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js @@ -27,8 +27,6 @@ class HomeworkModal extends Component{ group_ids:[], endtime:"" } - console.log("30"); - console.log(props); } componentDidMount() { diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index 9626a1475..b86b68930 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -69,6 +69,22 @@ class Trialapplication extends Component { }) } + // 是否不显示手机栏 + let url = `/users/get_user_info.json` + axios.get(url,{params:{ + school:1 + } + }, + ).then((response) => { + if(response !==undefined){ + this.setState({ + user_phone_binded:response.data.user_phone_binded + }) + } + }).catch((error) => { + console.log(error) + }) + axios.interceptors.response.use((response) => { if (response != undefined) if (response && response.data.status === 407) { @@ -81,18 +97,7 @@ class Trialapplication extends Component { // // // TODO 这里如果样式变了会出现css不加载的情况 }); // console.log("89"); - try { - // console.log(this.state.props.user && this.state.props.user.user_phone_binded); - if (this.state.props.user !== undefined) { - this.setState({ - user_phone_binded: this.state.props.user.user_phone_binded, - }) - } - } catch (e) { - console.log(e); - - } } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index e97a728d4..956e9afc4 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -173,6 +173,8 @@ class NewHeader extends Component { showTrial:false, user:undefined, } + console.log("176") + console.log(props); } componentDidMount() { From 8791b8edf10412ab398fb267895ba8e6749288a9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 16:39:24 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E5=88=86=E7=8F=AD=E8=AE=BE=E7=BD=AE=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkSetting.js | 64 +++++++++++-------- .../modules/courses/members/teacherList.js | 2 +- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 5ce5a5df3..ab00f3c00 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -271,8 +271,8 @@ class CommonWorkSetting extends Component{ absence_penalty = 2 } } else { - evaluation_start = '' - evaluation_end = '' + evaluation_start = null + evaluation_end = null evaluation_num = 0 absence_penalty = 0 } @@ -484,6 +484,7 @@ class CommonWorkSetting extends Component{ publish_time_type, end_time_type } = this.state; let group_settings_param = [] + let max_un_unified_setting_end_time = null if (!unified_setting) { const result = this.refs.pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules); this.setState({ @@ -494,6 +495,9 @@ class CommonWorkSetting extends Component{ return false; } group_settings_param = result.rules.map(item => { + if (!max_un_unified_setting_end_time || moment(item.end_time) > moment(max_un_unified_setting_end_time)) { + max_un_unified_setting_end_time = item.end_time; + } return { group_id: item.course_group_id, publish_time: item.publish_time, @@ -517,16 +521,22 @@ class CommonWorkSetting extends Component{ return false } - - let temp_publish_time = publish_time - let temp_end_time = end_time - if (!temp_publish_time) { - const publish_time_moment = getNextHalfHourOfMoment(moment()); - temp_publish_time = publish_time_moment.format(dateFormat); - } - if (!temp_end_time) { - temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat) + let temp_publish_time + let temp_end_time + if (unified_setting) { + let temp_publish_time = publish_time + let temp_end_time = end_time + if (!temp_publish_time) { + const publish_time_moment = getNextHalfHourOfMoment(moment()); + temp_publish_time = publish_time_moment.format(dateFormat); + } + if (!temp_end_time) { + temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat) + } + } else { + temp_end_time = max_un_unified_setting_end_time } + // 已发布的不检查 const isUnPublish= homework_status.indexOf(STATUS_UN_PUBLISH) != -1 const isAdmin = this.props.isAdmin() @@ -534,20 +544,22 @@ class CommonWorkSetting extends Component{ const publish_time_editable = isUnPublish; const end_time_editable = isAdmin || !end_time || moment(end_time) > current; - if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) { - this.setState({ - publicTimeTip: '发布时间不能小于当前时间' - }) - scrollTo('.publicTimeTip') - return false - } - // 已截止的不检查 - if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) { - this.setState({ - publicTimeTip: '截止时间必须晚于发布时间' - }) - scrollTo('.publicTimeTip') - return false + if (unified_setting) { + if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) { + this.setState({ + publicTimeTip: '发布时间不能小于当前时间' + }) + scrollTo('.publicTimeTip') + return false + } + // 已截止的不检查 + if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) { + this.setState({ + publicTimeTip: '截止时间必须晚于发布时间' + }) + scrollTo('.publicTimeTip') + return false + } } this.setState({ publicTimeTip: '' @@ -1201,7 +1213,7 @@ class CommonWorkSetting extends Component{ - {anonymous_comment_time_tip &&
    {anonymous_comment_time_tip}
    } + {
    {anonymous_comment_time_tip}
    } {/* 匿评数量 */}
    diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 9b1a2ad6e..509bf56c1 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -49,7 +49,7 @@ function buildColumns(that) { width: 160, key: 'name', render: (name, record) => { - return {name} + return {name} } }, { title: '角色', From ad989177c7795488d10cc518d111a7a416312cc7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 16:41:28 +0800 Subject: [PATCH 14/16] isAdmin --- public/react/src/modules/courses/busyWork/CommonWorkItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index 295f55fe1..ad755338c 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -185,7 +185,7 @@ class CommonWorkItem extends Component{ } - {this.props.isAdmin &&
    + {isAdmin &&
    { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑 { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置
    } From 51467cf3ef8ddb5bfc0ec3bb333affd8123bb8ef Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 16:41:42 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/login/Trialapplication.js | 45 +++++++++---------- public/react/src/modules/tpm/NewHeader.js | 2 +- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index b86b68930..d98228856 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -44,18 +44,14 @@ class Trialapplication extends Component { componentWillReceiveProps(nextProps) { - // this.setState({ - // isRenders:nextProps.isRenders - // }) - // console.log("componentWillReceiveProps"); - // console.log(nextProps); + } //初始化数据 componentDidMount() { - // console.log("53"); + console.log("53"); - // console.log(this.props.isRenders); + console.log(this.props.isRenders); if (this.props.isRenders != undefined) { this.setState({ @@ -69,22 +65,6 @@ class Trialapplication extends Component { }) } - // 是否不显示手机栏 - let url = `/users/get_user_info.json` - axios.get(url,{params:{ - school:1 - } - }, - ).then((response) => { - if(response !==undefined){ - this.setState({ - user_phone_binded:response.data.user_phone_binded - }) - } - }).catch((error) => { - console.log(error) - }) - axios.interceptors.response.use((response) => { if (response != undefined) if (response && response.data.status === 407) { @@ -94,10 +74,22 @@ class Trialapplication extends Component { } return response; }, (error) => { - // // // TODO 这里如果样式变了会出现css不加载的情况 + //TODO 这里如果样式变了会出现css不加载的情况 + }); - // console.log("89"); + console.log("89"); + try { + if (this.state.props.user !== undefined) { + console.log(this.state.props.user && this.state.props.user.user_phone_binded); + this.setState({ + user_phone_binded: this.state.props.user.user_phone_binded, + }) + } + + } catch (e) { + console.log(e); + } } @@ -217,6 +209,7 @@ class Trialapplication extends Component { this.setState({ isRenders: false }) + this.Cancel(); window.location.href = "/"; } else { this.setState({ @@ -278,6 +271,8 @@ class Trialapplication extends Component { thiss.setState({ isRenders: false }) + thiss.Cancel(); + } else { thiss.setState({ isRenders: false diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 956e9afc4..3d3e83d36 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -583,7 +583,7 @@ submittojoinclass=(value)=>{ /> {/* :""*/} {/*}*/} - + {/*{*/} {/* isRenders&&isRenders===true?*/} From fbd6f3fe5df798dab16566487f1cc46eca0e2794 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 16:58:08 +0800 Subject: [PATCH 16/16] invalid --- .../modules/courses/busyWork/CommonWorkSetting.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index ab00f3c00..1574d692d 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -1018,7 +1018,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择发布时间" id={"startime"} width={"210px"} - value={publish_time===null||publish_time===""?"":moment(publish_time, dateFormat)} + value={!publish_time?"":moment(publish_time, dateFormat)} onChange={this.onChangeTimepublish} // disabled={this.props.isSuperAdmin()?false:publish_time_type===true?true:false} disabled={moment(this.state.init_publish_time) < moment() || noAuth} @@ -1048,7 +1048,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择截止时间" id={"endTime"} width={"210px"} - value={end_time===null||end_time===""?"":moment(end_time, dateFormat)} + value={!end_time?"":moment(end_time, dateFormat)} onChange={this.onChangeTimeend} disabled={this.props.isSuperAdmin()?false:end_time_type===true?true:false} disabled={moment(this.state.init_end_time) < moment() || noAuth} @@ -1117,7 +1117,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择结束时间" id={"enTime"} width={"210px"} - value={late_time===null||late_time===""? undefined :moment(late_time, dateFormat)} + value={!late_time ? undefined :moment(late_time, dateFormat)} onChange={this.onChangeTimelatetime} disabledTime={disabledDateTime} disabled={!allow_late || noAuth || moment(init_late_time) < moment()} @@ -1165,7 +1165,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择匿名开启时间" id={"startime"} width={"210px"} - value={evaluation_start===null||evaluation_start===""?"":moment(evaluation_start, dateFormat)} + value={!evaluation_start ?"":moment(evaluation_start, dateFormat)} onChange={this.onChangeEvaluationStart} disabled={ (anonymous_comment && !noAuth ? false : true) || moment(init_evaluation_start) < moment() } // disabledDate={ (evaluation_start) => @@ -1194,7 +1194,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择匿名结束时间" id={"endtime"} width={"210px"} - value={evaluation_end===null||evaluation_end===""?"":moment(evaluation_end, dateFormat)} + value={!evaluation_end ?"":moment(evaluation_end, dateFormat)} onChange={this.onChangeEvaluationEnd} disabledTime={disabledDateTime} disabled={(anonymous_comment && !noAuth ? false : true) || moment(init_evaluation_end) < moment()} @@ -1289,7 +1289,7 @@ class CommonWorkSetting extends Component{ placeholder="请选择申诉结束时间" id={"endtime"} width={"210px"} - value={appeal_time===null||appeal_time===""?"":moment(appeal_time, dateFormat)} + value={!appeal_time?"":moment(appeal_time, dateFormat)} onChange={this.appeal_time_change} disabled={ (anonymous_appeal && !noAuth ? false : true) || moment(init_appeal_time) < moment()} />