From 077cb64ba180f6610fefea3038114474249cede4 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 09:26:13 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=BD=B1=E5=93=8Dnotification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index 314ece06a..b36533154 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -5,7 +5,8 @@ height: 420px; } #DialogID{ - z-index: 20000; + /* 影响notification */ + /* z-index: 20000; */ } #DialogID .dialogBox { width: 402px; From b543363bb53c616cac85a456aedbf5430ebd567c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 09:54:38 +0800 Subject: [PATCH 2/9] unDele --- .../page/layers/ImageLayerOfCommentHOC.js | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js index 4f111b14d..50eacb564 100644 --- a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js +++ b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js @@ -14,36 +14,38 @@ export function ImageLayerOfCommentHOC(options = {}) { imageSrc: '' } } + onDelegateClick = (event) => { + const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') + // 判断imageSrc是否是图片 + const fileName = event.target.innerHTML.trim() + if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) { + // 非回复里的头像图片; 非emoticons + if (imageSrc.indexOf('/images/avatars/User') === -1 && + imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { + this.setState({ + showImage: true, + imageSrc, + }) + } + event.stopPropagation() + event.preventDefault && event.preventDefault() + event.originalEvent.preventDefault() + // event.originalEvent.stopPropagation() + // event.originalEvent.cancelBubble = true + return false; + } + } componentDidMount() { // commentsDelegateParent #game_left_contents #tab_con_4 setTimeout(() => { $(options.parentSelector || ".commentsDelegateParent") - .delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => { - - const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') - // 判断imageSrc是否是图片 - const fileName = event.target.innerHTML.trim() - if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) { - // 非回复里的头像图片; 非emoticons - if (imageSrc.indexOf('/images/avatars/User') === -1 && - imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { - this.setState({ - showImage: true, - imageSrc, - }) - } - event.stopPropagation() - event.preventDefault && event.preventDefault() - event.originalEvent.preventDefault() - // event.originalEvent.stopPropagation() - // event.originalEvent.cancelBubble = true - return false; - } - - }); - }, 3000) - + .delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", this.onDelegateClick); + }, 1200) + } + componentWillUnmount() { + $(options.parentSelector || ".commentsDelegateParent", 'click', this.onDelegateClick) } + onImageLayerClose = () => { this.setState({ showImage: false, From 01ea852926c5f0bf7405e845f89849c6899e5407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 8 Jul 2019 11:09:48 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 2 +- public/react/src/AppConfig.js | 2 +- public/react/src/index.js | 92 ++++++++-------- .../react/src/modules/courses/css/Courses.css | 1 + .../courses/shixunHomework/Listofworks.js | 103 +++++++++--------- .../shixunHomework/Listofworksstudentone.js | 46 ++++---- .../shixunHomework/ShixunStudentWork.js | 6 +- .../shixunHomework/Trainingjobsetting.js | 4 +- .../shixunHomework/Workquestionandanswer.js | 4 +- public/react/src/modules/login/LoginDialog.js | 4 +- 10 files changed, 139 insertions(+), 125 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index f7530989e..dfb8c89d0 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -258,7 +258,7 @@ class App extends Component { - + {/*{*/} {/* isRender === true?*/} {/* : ""*/} diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 2100ebe8d..335ab80fa 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,7 +18,7 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/index.js b/public/react/src/index.js index 849f3faed..cb8cb4f94 100644 --- a/public/react/src/index.js +++ b/public/react/src/index.js @@ -1,46 +1,46 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; - -import './index.css'; -import './indexPlus.css'; -import App from './App'; - -// 加之前main.js 18.1MB -// import { message } from 'antd'; -import message from 'antd/lib/message'; -import 'antd/lib/message/style/css'; - -import { AppContainer } from 'react-hot-loader'; - -import registerServiceWorker from './registerServiceWorker'; - -import { configureUrlQuery } from 'react-url-query'; - -import history from './history'; - -// link the history used in our app to url-query so it can update the URL with it. -configureUrlQuery({ history }); -// ----------------------------------------------------------------------------------- 请求配置 - -window.__useKindEditor = false; - - -const render = (Component) => { - ReactDOM.render( - - - , - document.getElementById('root') - ); -} - - -// ReactDOM.render( -// , -// document.getElementById('root')); -// registerServiceWorker(); - -render(App); -if (module.hot) { - module.hot.accept('./App', () => { render(App) }); -} +import React from 'react'; +import ReactDOM from 'react-dom'; + +import './index.css'; +import './indexPlus.css'; +import App from './App'; + +// 加之前main.js 18.1MB +// import { message } from 'antd'; +import message from 'antd/lib/message'; +import 'antd/lib/message/style/css'; + +import { AppContainer } from 'react-hot-loader'; + +import registerServiceWorker from './registerServiceWorker'; + +import { configureUrlQuery } from 'react-url-query'; + +import history from './history'; + +// link the history used in our app to url-query so it can update the URL with it. +configureUrlQuery({ history }); +// ----------------------------------------------------------------------------------- 请求配置 + +window.__useKindEditor = false; + + +const render = (Component) => { + ReactDOM.render( + + + , + document.getElementById('root') + ); +} + + +// ReactDOM.render( +// , +// document.getElementById('root')); +// registerServiceWorker(); + +render(App); +if (module.hot) { + module.hot.accept('./App', () => { render(App) }); +} diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 65633839a..f058c415a 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -825,6 +825,7 @@ a.white-btn.use_scope-btn:hover{ .summaryname{ /*height: 23px;*/ font-size: 22px; + height: 25px; font-family: MicrosoftYaHei; font-weight: 400; color: rgba(51,51,51,1); diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 50faef559..f23465816 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -633,6 +633,7 @@ class Listofworks extends Component { // 获取作品列表 Getalistofworks = (homeworkid) => { // console.log("获取作品列表");7009 + let urll = `/homework_commons/${homeworkid}/works_list.json`; // console.log(homeworkid); @@ -651,6 +652,8 @@ class Listofworks extends Component { limit:20, } axios.post(urll, data).then((result) => { + + if(this.props.isNotMember()===false){ if (result !== undefined) { // console.log(url) // console.log("作品列表6789077") @@ -669,7 +672,7 @@ class Listofworks extends Component { challenges_count:result.data.challenges_count, }) this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); - } + } } }).catch((error) => { console.log(error) this.setState({ @@ -687,55 +690,57 @@ class Listofworks extends Component { //debug=t 是老师的意思 // console.log(ordervlue)7009 - var homeworkid = this.props.match.params.homeworkid; - let urll = `/homework_commons/${homeworkid}/works_list.json?`; - var order = "asc"; - if (ordervlue === "update_time") { - order = "desc"; - } - var checkedValuesines = checkedValuesine; - var checkedValuesineinfos = checkedValuesineinfo; - var searchtexts = searchtext - var data = { - search: searchtexts, - order: ordervlue, - b_order: order, - work_status: checkedValuesines, - course_group: checkedValuesineinfos, - page: page, - limit: limit, - } - // console.log("Startsorting"); - // console.log(data); - axios.post(urll, data).then((result) => { - // if (result.status === 200) {/] - // console.log(url) - // console.log("作品列表______________________") - // console.log(JSON.stringify(result)) - if (result !== undefined) { + var homeworkid = this.props.match.params.homeworkid; + let urll = `/homework_commons/${homeworkid}/works_list.json?`; + var order = "asc"; + if (ordervlue === "update_time") { + order = "desc"; + } + var checkedValuesines = checkedValuesine; + var checkedValuesineinfos = checkedValuesineinfo; + var searchtexts = searchtext + var data = { + search: searchtexts, + order: ordervlue, + b_order: order, + work_status: checkedValuesines, + course_group: checkedValuesineinfos, + page: page, + limit: limit, + } + // console.log("Startsorting"); + // console.log(data); + axios.post(urll, data).then((result) => { + // if (result.status === 200) {/] + // console.log(url) + // console.log("作品列表______________________") + // console.log(JSON.stringify(result)) + if(this.props.isNotMember()===false){ + if (result !== undefined) { + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + loadingstate: false, + jobsettingsdata: result, + allow_late:result.data.allow_late, + publish_immediately: result.data.publish_immediately, + work_efficiency: result.data.work_efficiency, + end_immediately: result.data.end_immediately, + code_review: result.data.code_review, + challenges_count:result.data.challenges_count, + }) + this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); + } + } + // } + }).catch((error) => { + console.log(error) this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - loadingstate: false, - jobsettingsdata: result, - allow_late:result.data.allow_late, - publish_immediately: result.data.publish_immediately, - work_efficiency: result.data.work_efficiency, - end_immediately: result.data.end_immediately, - code_review: result.data.code_review, - challenges_count:result.data.challenges_count, + loadingstate: false }) - this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); - } - - // } - }).catch((error) => { - console.log(error) - this.setState({ - loadingstate: false }) - }) + } @@ -1455,7 +1460,7 @@ class Listofworks extends Component { typs={this.state.typs} />
-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name} @@ -1467,7 +1472,7 @@ class Listofworks extends Component { 作业详情

-
+

{teacherdata === undefined ? "" : teacherdata.homework_name}

diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 4e9cb3e00..cb1e8b642 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -294,28 +294,32 @@ class Listofworksstudentone extends Component { course_group: "", } axios.post(urll, data).then((result) => { - if (result.status === 200) { - this.setState({ - teacherdata: result.data, - task_status: result.data.task_status, - course_group_info: result.data.course_group_info, - student_works: result.data.student_works, - jobsettingsdata: result, - publish_immediately: result.data.publish_immediately, - end_immediately: result.data.end_immediately, - id: result.data.id, - work_efficiency: result.data.work_efficiency, - code_review: result.data.code_review, - challenges_count:result.data.challenges_count, - view_report:result.data.view_report, - }) - if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { - this.seacthdata(result.data); - } else { - this.seacthdatas(result.data,result.data.student_works); - } + if (result.status === 200) { + if(this.props.isNotMember()===false) { + this.setState({ + teacherdata: result.data, + task_status: result.data.task_status, + course_group_info: result.data.course_group_info, + student_works: result.data.student_works, + jobsettingsdata: result, + publish_immediately: result.data.publish_immediately, + end_immediately: result.data.end_immediately, + id: result.data.id, + work_efficiency: result.data.work_efficiency, + code_review: result.data.code_review, + challenges_count: result.data.challenges_count, + view_report: result.data.view_report, + }) + if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { + this.seacthdata(result.data); + } else { + this.seacthdatas(result.data, result.data.student_works); + } + + } } + }).catch((error) => { console.log(error) }) @@ -703,6 +707,7 @@ class Listofworksstudentone extends Component { if (result !== undefined) { // console.log("学生公开的作品列表") // console.log(JSON.stringify(result)) + if(this.props.isNotMember()===false) { this.setState({ teacherdata: result.data, task_status: result.data.task_status, @@ -719,6 +724,7 @@ class Listofworksstudentone extends Component { }) this.seacthdata(result.data); } + } }).catch((error) => { console.log(error) this.setState({ diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 2d2babb09..93b9fa009 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -609,8 +609,8 @@ class ShixunStudentWork extends Component { typs={this.state.typs} />
-
-

+

+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name} {/*{data.course_name}*/} @@ -624,7 +624,7 @@ class ShixunStudentWork extends Component { 作业详情

-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}

diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 1ff1c1170..4532d92f9 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1711,7 +1711,7 @@ class Trainingjobsetting extends Component { modalSave={modalSave} >
-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name} @@ -1724,7 +1724,7 @@ class Trainingjobsetting extends Component {

-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name} diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index a02ec50e7..b0cbb82d7 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -400,7 +400,7 @@ class Workquestionandanswer extends Component { typs={this.state.typs} />

-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name} @@ -412,7 +412,7 @@ class Workquestionandanswer extends Component { 作业详情

-
+

{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}

diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 1275cf4a0..c6a5e3076 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -317,7 +317,9 @@ class LoginDialog extends Component { }); } handleDialogClose = () => { - if(this.props.match.path==="/"){ + if(this.props.match===undefined){ + window.location.href="/"; + }else if(this.props.match.path==="/"){ this.setState({ isRender: false }) From 03065faf2041b47aa09e0ece44eca01bae845530 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 11:32:12 +0800 Subject: [PATCH 4/9] labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} --- public/react/src/modules/courses/busyWork/CommonWorkPost.js | 3 ++- .../react/src/modules/courses/busyWork/CommonWorkSetting.js | 2 +- public/react/src/modules/courses/exercise/Ecercisemount.js | 2 +- .../courses/graduation/tasks/GraduationTasksSubmitedit.js | 2 +- .../courses/graduation/tasks/GraduationTasksSubmitnew.js | 2 +- .../modules/courses/graduation/tasks/GraduationTasksedit.js | 4 ++-- .../courses/graduation/tasks/GraduationTaskssetting.js | 2 +- .../react/src/modules/courses/studentWork/StudentHomework.js | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index 125975ae9..d96df9275 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -651,7 +651,8 @@ render(){ 返回
-
+ {/* */} +
- +
{/* TODO 取消统一发布设置 diff --git a/public/react/src/modules/courses/exercise/Ecercisemount.js b/public/react/src/modules/courses/exercise/Ecercisemount.js index 881d6c6a8..aa22b1f4a 100644 --- a/public/react/src/modules/courses/exercise/Ecercisemount.js +++ b/public/react/src/modules/courses/exercise/Ecercisemount.js @@ -68,7 +68,7 @@ class Ecercisemount extends Component{
- + {/*内容*/}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 7f5553e6c..1fce4d1bb 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -556,7 +556,7 @@ class GraduationTasksSubmitedit extends Component{ {description&&description?
- {/**/} + {/**/}
- {/*内容*/} -
- 补交附件 -
- -
- {revise_reason} -
- {revise_attachments.map((item,key)=>{ - return( -
- - - - - {item.title} - - {item.filesize} - {item.delete===true?:""} -
- ) - })} -
- 更新 - {atta_update_user} - - {moment(atta_update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(atta_update_time).format('YYYY-MM-DD HH:mm')} - -
-
} + {is_evaluation != true && project_info && project_info.name &&
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraiseReviseAttachments.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraiseReviseAttachments.js new file mode 100644 index 000000000..d12099d38 --- /dev/null +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraiseReviseAttachments.js @@ -0,0 +1,52 @@ +import React, { useState } from 'react' +import moment from 'moment' +// import Example from './TestHooks' +function CommonWorkAppraiseReviseAttachments(props) { + const { revise_attachments, revise_reason, atta_update_time, atta_update_user} = props + if (!revise_attachments) return '' + return ( + + {/* {Example()} */} + {revise_attachments.length===0?"":
+ +
+ 补交附件 +
+ + {/* {age} */} + +
+ {revise_reason} +
+ {revise_attachments.map((item,key)=>{ + return( +
+ + + + + {item.title} + + {item.filesize} + {item.delete===true?:""} +
+ ) + })} +
+ 更新 + {atta_update_user} + + {moment(atta_update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(atta_update_time).format('YYYY-MM-DD HH:mm')} + +
+
} +
+ ) + +} +export default CommonWorkAppraiseReviseAttachments; \ No newline at end of file diff --git a/public/react/src/modules/courses/busyWork/TestHooks.js b/public/react/src/modules/courses/busyWork/TestHooks.js new file mode 100644 index 000000000..53a03bd49 --- /dev/null +++ b/public/react/src/modules/courses/busyWork/TestHooks.js @@ -0,0 +1,26 @@ +// import React, { useState, useEffect } from 'react' + + +// function Example() { +// const [state, setState] = useState({counter: 0}) +// useEffect(() => { +// console.log(' cdm') + +// return () => { +// console.log(' cwum') +// }; +// }) +// const add1ToCounter = () => { +// const newCounterValue = state.counter + 1 +// setState({ counter: newCounterValue }) +// } +// return ( +//
+//

{state.counter}

+// +//
+// ) +// } +// export default Example \ No newline at end of file