From 78678a68ba486920604d1bb23df5b550adae97f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 25 Jul 2019 16:01:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 6 ++++ .../shixunHomework/ShixunHomeworkPage.js | 6 ++-- .../modules/tpm/TPMsettings/TPMsettings.js | 26 ++++++++++++++- .../src/modules/tpm/newshixuns/Newshixuns.js | 33 +++++++++++++++++-- 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index db58e95fd..81e388d6f 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1482,6 +1482,7 @@ class Listofworksstudentone extends Component { } //计算成绩 setComputeTime=()=>{ + let matchurl = this.props.match.url; let {teacherdata}=this.state; this.setState({ computeTimetype:false @@ -1494,6 +1495,7 @@ class Listofworksstudentone extends Component { this.props.showNotification(`${response.data.message}`); // var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); + this.props.history.replace( matchurl ); // this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) @@ -2147,6 +2149,9 @@ class Listofworksstudentone extends Component { } setComputeTimet=()=>{ + + let matchurl = this.props.match.url; + this.setState({ computeTimetype:false }) @@ -2163,6 +2168,7 @@ class Listofworksstudentone extends Component { }) this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.props.showNotification(`${response.data.message}`); + this.props.history.replace( matchurl ); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index e2285a7a6..fec98e69b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -123,9 +123,9 @@ class ShixunHomeworkPage extends Component { let {tab, teacherdatapage, jobsettingsdatapage} = this.state; const isAdmin = this.props.isAdmin(); - console.log(119) - console.log(jobsettingsdatapage); - console.log(teacherdatapage); + // console.log(119) + // console.log(jobsettingsdatapage); + // console.log(teacherdatapage); return (
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index ed1249f0d..f6af871dd 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -31,6 +31,30 @@ const Option = Select.Option; const RadioGroup = Radio.Group; +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + // 恢复数据 function md_rec_data(k,mdu,id, editor){ if(window.sessionStorage.getItem(k+mdu) !== null){ @@ -1120,7 +1144,7 @@ export default class TPMsettings extends Component { } onChangeTimePicker =(value, dateString)=> { this.setState({ - opening_time:dateString + opening_time:moment(handleDateStrings(dateString)) }) } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index cb0f08c0f..8cb79e9d0 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {TPMIndexHOC} from '../TPMIndexHOC'; -import {SnackbarHOC,handleDateString} from 'educoder'; +import {SnackbarHOC} from 'educoder'; import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd'; @@ -16,6 +16,7 @@ import './css/Newshixuns.css'; import {getUrl} from 'educoder' + let path = getUrl("/editormd/lib/") const $ = window.$; @@ -28,6 +29,34 @@ const Option = Select.Option; const RadioGroup = Radio.Group; const confirm = Modal.confirm; + + +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + + + // 恢复数据 function md_rec_data(k, mdu, id, editor) { if (window.sessionStorage.getItem(k + mdu) !== null) { @@ -713,7 +742,7 @@ class Newshixuns extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - TimePickervalue: handleDateString(dateString) + TimePickervalue: handleDateStrings(dateString) }) } // 附件相关 START From b350b0f1a61fdecb8eeb489c15f65b9aa5acd00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 25 Jul 2019 16:18:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paths/PathDetail/DetailCardsTemp.js | 25 +- .../src/modules/paths/PathDetail/DetailTop.js | 477 +++++++++--------- .../paths/PathDetail/PathDetailIndex.js | 10 +- .../tpm/shixunchild/Challenges/Challenges.js | 15 +- .../Propaedeutics/Propaedeu_tics.js | 8 +- 5 files changed, 280 insertions(+), 255 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js index 4acc28a48..5150d14da 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; +import { Tooltip } from 'antd'; import '../../paths/ShixunPaths.css'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import axios from 'axios'; @@ -85,16 +86,26 @@ class DetailCards extends Component{ + {item.stage_name} - - - - - - + + + + + + + + - + + + + + + + +

{item.stage_description}

diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 50c5c2680..09425df92 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -1,238 +1,241 @@ -import React,{ Component } from "react"; -import { Modal,Radio,Input,Tooltip } from "antd"; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import SendPanel from "./sendPanel.js"; -import { getImageUrl } from 'educoder'; -import axios from 'axios'; -import Modals from '../../modals/Modals'; -import './DetailTop.css'; - -const Search = Input.Search; -const RadioGroup = Radio.Group; -class DetailTop extends Component{ - constructor(props){ - super(props) - this.state={ - cardsModalcancel:this.cardsModalcancel, - cardsModalsave:this.cardsModalsave, - Modalstype:false, - Modalstopval:"", - Modalsbottomval:'', - loadtype:false, - deletepathtype:false, - cardsModalsavetype:false - } - } - - allow_deletepath=()=>{ - this.setState({ - Modalstype:true, - Modalstopval:"是否删除路径?", - deletepathtype:true - }) - } - - applyissuePath=()=>{ - this.setState({ - Modalstype:true, - Modalstopval:"发布申请已提交,请等待管理员的审核", - Modalsbottomval:"• 我们将在1-2个工作日内完成审核", - loadtype:true - }) - } - - cancelissuePath=()=>{ - let pathId=this.props.match.params.pathId; - let url ="/paths/"+pathId+"/cancel_publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - - }else if(result.data.status===1){ - window.location.href = "/paths/" + result.data.subject_id - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - reovkissuePath=()=>{ - - this.setState({ - Modalstype:true, - Modalstopval:"是否确认撤销发布", - Modalsbottomval:"确认后,回退到编辑状态", - cardsModalsavetype:true, - }) - - } - reovkissuePaths=()=>{ - let pathId=this.props.match.params.pathId; - let url ="/paths/"+pathId+"/cancel_has_publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - - }else if(result.data.status===1){ - this.setState({ - cardsModalsavetype:false, - loadtype:false, - deletepathtype:false - }) - window.location.href = "/paths/" + result.data.subject_id - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - Modalsbottomval:'', - loadtype:false, - deletepathtype:false - }) - } - - cardsModalsave=()=>{ - let {loadtype,deletepathtype}=this.state; - - //删除路径 - if(deletepathtype===true){ - let pathid=this.props.match.params.pathId; - const deleteUrl = `/paths/`+pathid+`.json`; - axios.delete(deleteUrl).then((response) => { - const status = response.data.status - if (status === 1) { - window.location.href = "/paths"; - } - }).catch((error) => { - console.log(error) - }) - } - - //申请发布 - if(loadtype===true){ - - let pathid=this.props.match.params.pathId; - let url ="/paths/"+pathid+"/publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - this.setState({ - Modalstype:true, - Modalstopval: result.data.message, - }) - }else if(result.data.status===1){ - window.location.reload(); - } - } - }).catch((error)=>{ - console.log(error); - }) - - } - this.setState({ - Modalstype:false, - Modalsbottomval:'' - }) - } - - render(){ - let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - - return( -
- - - { - detailInfoList && -
-
- - {detailInfoList.name} - - - {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? - - - :"" - } - - {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? - - 学习统计 - :"" - } - - { detailInfoList.allow_send === true && - - } - -
-
- { - detailInfoList && -
    - { detailInfoList.stages_count!=0 ?
  • 章节{detailInfoList.stages_count}
  • : ""} - { detailInfoList.stage_shixuns_count!=0 ?
  • 实训{ detailInfoList.stage_shixuns_count}
  • : ""} - { detailInfoList.challenge_choose_count!=0 ?
  • 选择题任务{detailInfoList.challenge_choose_count}
  • : ""} - { detailInfoList.challenges_count!=0 ?
  • 实践任务{detailInfoList.challenges_count}
  • : ""} - { detailInfoList.subject_score!=0 ?
  • 经验值{detailInfoList.subject_score}
  • : ""} - { detailInfoList.member_count!=0 ?
  • 学习人数{detailInfoList.member_count}
  • : ""} -
- } -
- {detailInfoList===undefined?"":detailInfoList.allow_delete===true?删除路径:""} - - { - detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true? - 申请发布:"" - } - - - { - detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true? - 撤销申请:"" - } - - { - detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? - 撤销发布:"" - } -
-
-
- } - -
- ) - } -} +import React,{ Component } from "react"; +import { Modal,Radio,Input,Tooltip } from "antd"; +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; +import SendPanel from "./sendPanel.js"; +import { getImageUrl } from 'educoder'; +import axios from 'axios'; +import Modals from '../../modals/Modals'; +import './DetailTop.css'; + +const Search = Input.Search; +const RadioGroup = Radio.Group; +class DetailTop extends Component{ + constructor(props){ + super(props) + this.state={ + cardsModalcancel:this.cardsModalcancel, + cardsModalsave:this.cardsModalsave, + Modalstype:false, + Modalstopval:"", + Modalsbottomval:'', + loadtype:false, + deletepathtype:false, + cardsModalsavetype:false + } + } + + allow_deletepath=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"是否删除路径?", + deletepathtype:true + }) + } + + applyissuePath=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"发布申请已提交,请等待管理员的审核", + Modalsbottomval:"• 我们将在1-2个工作日内完成审核", + loadtype:true + }) + } + + cancelissuePath=()=>{ + let pathId=this.props.match.params.pathId; + let url ="/paths/"+pathId+"/cancel_publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + + }else if(result.data.status===1){ + window.location.href = "/paths/" + result.data.subject_id + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + reovkissuePath=()=>{ + + this.setState({ + Modalstype:true, + Modalstopval:"是否确认撤销发布", + Modalsbottomval:"确认后,回退到编辑状态", + cardsModalsavetype:true, + }) + + } + reovkissuePaths=()=>{ + let pathId=this.props.match.params.pathId; + let url ="/paths/"+pathId+"/cancel_has_publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + + }else if(result.data.status===1){ + this.setState({ + cardsModalsavetype:false, + loadtype:false, + deletepathtype:false + }) + window.location.href = "/paths/" + result.data.subject_id + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + Modalsbottomval:'', + loadtype:false, + deletepathtype:false + }) + } + + cardsModalsave=()=>{ + let {loadtype,deletepathtype}=this.state; + + //删除路径 + if(deletepathtype===true){ + let pathid=this.props.match.params.pathId; + const deleteUrl = `/paths/`+pathid+`.json`; + axios.delete(deleteUrl).then((response) => { + const status = response.data.status + if (status === 1) { + window.location.href = "/paths"; + } + }).catch((error) => { + console.log(error) + }) + } + + //申请发布 + if(loadtype===true){ + + let pathid=this.props.match.params.pathId; + let url ="/paths/"+pathid+"/publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + this.setState({ + Modalstype:true, + Modalstopval: result.data.message, + }) + }else if(result.data.status===1){ + window.location.reload(); + } + } + }).catch((error)=>{ + console.log(error); + }) + + } + this.setState({ + Modalstype:false, + Modalsbottomval:'' + }) + } + + render(){ + let{detailInfoList}=this.props; + let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + + return( +
+ + + { + detailInfoList && +
+
+ + {detailInfoList.name} + + + {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + + + + + + :"" + } + + {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + + 学习统计 + :"" + } + + { detailInfoList.allow_send === true && + + } + +
+
+ { + detailInfoList && +
    + { detailInfoList.stages_count!=0 ?
  • 章节{detailInfoList.stages_count}
  • : ""} + { detailInfoList.stage_shixuns_count!=0 ?
  • 实训{ detailInfoList.stage_shixuns_count}
  • : ""} + { detailInfoList.challenge_choose_count!=0 ?
  • 选择题任务{detailInfoList.challenge_choose_count}
  • : ""} + { detailInfoList.challenges_count!=0 ?
  • 实践任务{detailInfoList.challenges_count}
  • : ""} + { detailInfoList.subject_score!=0 ?
  • 经验值{detailInfoList.subject_score}
  • : ""} + { detailInfoList.member_count!=0 ?
  • 学习人数{detailInfoList.member_count}
  • : ""} +
+ } +
+ {detailInfoList===undefined?"":detailInfoList.allow_delete===true?删除路径:""} + + { + detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true? + 申请发布:"" + } + + + { + detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true? + 撤销申请:"" + } + + { + detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? + 撤销发布:"" + } +
+
+
+ } + +
+ ) + } +} export default DetailTop; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 61933b765..a72771c39 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -369,9 +369,11 @@ class PathDetailIndex extends Component{

课程须知 {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + - + + :"" }

@@ -397,16 +399,18 @@ class PathDetailIndex extends Component{
+
15&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} - data-tip-down="显示全部" onClick={()=>this.clickNewsubscript(0)} >...
+
+
this.clickNewsubscript(1)}>
+
} diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index f5d57ae21..65e95319e 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -293,11 +293,12 @@ class Challenges extends Component {

简介 + + href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr"> +

{item.st === 0 ? - + + + : - + + + } 第{key+1}关 diff --git a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js index a2b20415d..f40e9fa63 100644 --- a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js +++ b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js @@ -10,6 +10,8 @@ import classNames from 'classnames'; import { getImageUrl, toPath } from 'educoder'; +import { Tooltip } from 'antd'; + import axios from 'axios'; import { CircularProgress } from 'material-ui/Progress'; @@ -76,8 +78,10 @@ class Propaedeutics extends Component { return (

- + + + +

{ loadingContent ? From 47ef7842e8c0eece2c210feee149a11a820525cc Mon Sep 17 00:00:00 2001 From: czd Date: Thu, 25 Jul 2019 16:26:25 +0800 Subject: [PATCH 3/3] 123 --- 2 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2 diff --git a/2 b/2 new file mode 100644 index 000000000..e69de29bb