From 69f9390eeb65dcb2e80a6418e5ba83707b853b99 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, 11 Oct 2019 11:05:18 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E5=8F=91=E5=B8=83=20=E5=8C=85=E6=8B=AC=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E5=8F=91=E5=B8=83=E5=BC=B9=E7=AA=97=E5=B0=81?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coursesPublic/OneSelfOrderModal.js | 295 ++++++++++++++++++ .../graduation/tasks/GraduationTaskDetail.js | 15 +- .../modules/courses/graduation/tasks/index.js | 2 +- .../courses/shixunHomework/shixunHomework.js | 100 +++++- 4 files changed, 394 insertions(+), 18 deletions(-) create mode 100644 public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js diff --git a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js new file mode 100644 index 000000000..87e823af6 --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js @@ -0,0 +1,295 @@ +import React,{ Component } from "react"; +import { Modal,Checkbox,DatePicker} from "antd"; +import { handleDateString } from 'educoder'; +import locale from 'antd/lib/date-picker/locale/zh_CN'; +import moment from 'moment'; +const CheckboxGroup = Checkbox.Group; +const dateFormat = 'YYYY-MM-DD HH:mm'; + +function range(start, end) { + const result = []; + for (let i = start; i < end; i++) { + result.push(i); + } + return result; +} +function disabledDateTime() { + return { + // disabledHours: () => range(0, 24).splice(4, 20), + disabledMinutes: () => range(1, 30).concat(range(31, 60)), + // disabledSeconds: () => [55, 56], + }; +} + + +function disabledDate(current) { + return current && current < moment().endOf('day').subtract(1, 'days'); +} + + + +class OneSelfOrderModal extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + endtime:"" + } + } + componentDidMount() { + + + if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){ + + let arr=this.props.course_groups.map(item => item.id); + this.shixunhomeworkedit(arr); + } + + if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ + this.setState({ + endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") + }) + }else{ + this.setState({ + endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") + }) + } + } + componentDidUpdate=(prevProps)=>{ + // if(prevProps.visible!=this.props.visible){ + // + // if(this.props.course_groups!=undefined){ + // let arr=this.props.course_groups.map(item => item.id); + // this.shixunhomeworkedit(arr); + // } + // } + if(prevProps.course_groups!=this.props.course_groups){ + if(this.props.course_groups!=undefined){ + let arr=this.props.course_groups.map(item => item.id); + this.shixunhomeworkedit(arr); + } + } + if(prevProps.starttimes!=this.props.starttimes){ + + if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ + this.setState({ + endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") + }) + }else{ + this.setState({ + endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") + }) + } + } + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + this.setState({ + group_ids:list + }) + this.props.getcourse_groupslist && this.props.getcourse_groupslist(list) + } + + onChangeTimeend= (date, dateString) => { + // console.log('startValue',dateString); + + this.setState({ + endtime: date===null?"":handleDateString(dateString), + }) + + } + + propsSaves=(ds,endtime)=>{ + + if(ds.length ===0&&endtime === ""){ + this.props.Saves() + }else{ + if(this.props.typs!="end"){ + if(endtime === ""||endtime===undefined||endtime===null){ + + this.setState({ + endtimetype:true, + endtimetypevalue:"截止时间不能为空" + }) + return + } + + if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){ + this.setState({ + endtimetype:true, + endtimetypevalue:"必须晚于发布时间" + }) + return + } + } + this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm")) + } + + + } + + render(){ + let {group_ids,endtime}=this.state; + let {course_groups}=this.props; + + // console.log(this.props.starttimes) + // console.log(endtime) + // console.log(this.props.starttimes) + // console.log(this.state.endtime) + + // console.log(this.props.starttime,this.props.endtime) + // TODO course_groups为空时的处理 + + // let endtimelist=this.props.starttimes===undefined||this.props.starttimes===""?"":moment(handleDateString(endtime)).add(1,'months') + return( +
+ { + this.props.OneSelftype===true?:"" + } + { + this.props.OneSelftype===true? +
+ + + { this.props.usingCheckBeforePost ? + +

+ 发布设置均可修改, + + 点击修改 + +

+

+ 此设置将对所有分班生效 +

+
: + +

+ {this.props.Topval} + {this.props.Topvalright} +

+

+ {this.props.Botvalleft===undefined?"":"{this.props.Botvalleft}"} + {this.props.Botval} +

+
} + + + {this.props.starttime===undefined|| + this.props.starttime===""?"" + :

+ + 发布时间: + {this.props.starttime} + + {/*{this.props.endtime}*/} + 截止时间: + + {this.state.endtimetype===true?

{this.state.endtimetypevalue}
:""} + +

} + {/* usingCheckBeforePost 为true的时候 全选所有分班 */} + {this.props.modaltype===undefined||this.props.modaltype===2||this.props.modaltype===4 + || !course_groups || course_groups.length == 0 + || this.props.usingCheckBeforePost ?"":
    + + {/**/} + {/**/} + { + { + course_groups.map((item,key)=>{ + return( +
    +
  • + + {item.name} + + +
  • + +
    + ) + }) + } +
    } + +
+ } + +
+ {this.props.Cancelname} + this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname} +
+ +
+
:""} +
+ ) + } +} +export default OneSelfOrderModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index b9830d1fc..fbbfafabc 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -7,6 +7,7 @@ import Loading from '../../../../Loading'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import axios from 'axios'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; +import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal"; import AccessoryModal from "../../coursesPublic/AccessoryModal"; import Associationmodel from '../../coursesPublic/Associationmodel'; import CoursesListType from '../../coursesPublic/CoursesListType'; @@ -40,6 +41,7 @@ class GraduationTaskDetail extends Component{ this.state={ modalname:undefined, visible:false, + OneSelftype:false, Topval:undefined, starttime:undefined, starttimes:undefined, @@ -115,17 +117,20 @@ class GraduationTaskDetail extends Component{ } //立即发布 publish=()=>{ + let {questionslist}=this.state; let starttime= this.props.getNowFormatDates(1,1); let endtime=this.props.getNowFormatDates(2,1); // this.homeworkstart() this.setState({ modalname:"立即发布", visible:true, + OneSelftype:true, Topval:"学生将立即收到毕设任务", // Botvalleft:"点击修改", // Botval:`本操作只对"未发布"的分班有效`, starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , - starttimes:this.props.getNowFormatDates(1), + starttimes:questionslist.end_time, + staytime:this.props.getNowFormatDates(1), typs:"start", endtime:endtime, Cancelname:"暂不发布", @@ -176,7 +181,9 @@ class GraduationTaskDetail extends Component{ this.setState({ modalname:"立即截止", visible:true, + OneSelftype:true, Topval:"学生将不能再提交作品", + starttime:undefined, // Botvalleft:"暂不截止", // Botval:`本操作只对"提交中"的分班有效`, Cancelname:"暂不截止", @@ -212,6 +219,7 @@ class GraduationTaskDetail extends Component{ Modalstype:false, Loadtype:false, visible:false, + OneSelftype:false, Modulationtype:false, Allocationtype:false, Modalstopval:"", @@ -321,11 +329,12 @@ class GraduationTaskDetail extends Component{ { questionslist &&
- { + let selectnum= this.testonSelect(); + if(selectnum===true){ + this.noSelect(); + return + } + let coursesId=this.props.match.params.coursesId; + let url="/courses/"+coursesId+"/all_course_groups.json"; + + axios.get(url).then((response) => { + + if(response.status===200){ + let starttime= this.props.getNowFormatDates(1); + let endtime=this.props.getNowFormatDates(2); + this.setState({ + modalname:"立即发布", + modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1, + OneSelftype:true, + typs:"start", + Topval:"学生将立即收到作业", + // Botvalleft:"暂不发布", + Botval:`本操作只对"未发布"的分班有效`, + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + starttimes:starttime, + endtime:"截止时间:"+endtime, + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.homeworkhide, + Saves:this.homeworkstartend, + course_groups:response.data.course_groups, + }) + } + }).catch((error) => { + console.log(error) + }); + + } + + cancelmodels=()=>{ this.setState({ Modalstype:false, @@ -316,10 +360,12 @@ class ShixunHomework extends Component{ }) } - this.props.showNotification(result.data.message) + + this.homeworkupdatalist(Coursename,page,order); + this.cancelmodel() + this.props.showNotification(result.data.message) this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); - this.cancelmodel() + } }).catch((error)=>{ console.log(error); @@ -414,11 +460,11 @@ class ShixunHomework extends Component{ Loadtype:false, course_groups:[] }) - + this.homeworkupdatalist(Coursename,page,order); + this.cancelmodel() this.props.showNotification(response.data.message) this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); - this.cancelmodel() + } }) .catch(function (error) { @@ -722,8 +768,8 @@ class ShixunHomework extends Component{ checkedtype:false, antIcon:false }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification(response.data.message) - this.homeworkupdatalist(Coursename,page,order); this.props.updataleftNavfun() }else{ this.setState({ @@ -782,6 +828,7 @@ class ShixunHomework extends Component{ this.setState({ Modalstype:false, + OneSelftype:false, Loadtype:false, visible:false, Modalstopval:"", @@ -834,9 +881,10 @@ class ShixunHomework extends Component{ Loadtype:false, checkBoxValues:[] }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification(response.data.message) - this.homeworkupdatalist(Coursename,page,order); + } }) .catch(function (error) { @@ -886,9 +934,10 @@ class ShixunHomework extends Component{ checkBoxValues:[], checkAllValue:false }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification('已完成') this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); + } }) } @@ -1022,7 +1071,7 @@ class ShixunHomework extends Component{ loadtype={this.state.Loadtype} antIcon={this.state.antIcon} />:""} - {/*立即发布*/} + {/*批量立即发布*/} {visible===true?this.getcourse_groupslist(id)} />:""} - + {/*{单个立即发布}*/} + {/*this.getcourse_groupslist(id)}*/} + {/*/>*/} {shixunmodal===true||shixunpath===true? - {/**/} - {/**/} + + .F4FAFF{ + background: #F4FAFF; + } + ` + } + + {this.props.modaltype===undefined||this.props.modaltype===2 + || this.props.usingCheckBeforePost ?"":
+
  • + 分班名称 + + 截止时间 +
  • +
    } + {this.props.modaltype===undefined||this.props.modaltype===2 + || this.props.usingCheckBeforePost ?"":
      + { { course_groups.map((item,key)=>{ + return(
    • @@ -264,7 +281,7 @@ class OneSelfOrderModal extends Component{ placeholder="请选择截止时间" id={"endTime"} width={"210px"} - value={endtime===null||endtime===""?"":moment(endtime, dateFormat)} + value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)} onChange={this.onChangeTimeend} className={ this.state.endtimetype===true?"noticeTip fr":"fr"} /> From c1e2ca77a0b164b738d956abda4bd14dcb2ff9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 12 Oct 2019 12:44:41 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95?= =?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/AppConfig.js | 20 ++++---- .../src/modules/login/EducoderInteresse.js | 3 -- .../react/src/modules/login/EducoderLogin.js | 1 - .../react/src/modules/login/LoginDialog.css | 15 ++++-- public/react/src/modules/login/LoginDialog.js | 45 ++++++++++++++---- .../modules/user/LoginRegisterComponent.js | 27 +++++++++-- public/react/src/modules/user/common.css | 10 ++++ public/react/src/modules/user/commontwo.css | 4 +- public/react/src/modules/user/img/WeChat.png | Bin 0 -> 2844 bytes .../react/src/modules/user/img/WeChat@2x.png | Bin 0 -> 8077 bytes public/react/src/modules/user/img/qq.png | Bin 0 -> 2702 bytes public/react/src/modules/user/img/qq@2x.png | Bin 0 -> 7663 bytes 12 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 public/react/src/modules/user/img/WeChat.png create mode 100644 public/react/src/modules/user/img/WeChat@2x.png create mode 100644 public/react/src/modules/user/img/qq.png create mode 100644 public/react/src/modules/user/img/qq@2x.png diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index e1d5da561..98571d818 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/login/EducoderInteresse.js b/public/react/src/modules/login/EducoderInteresse.js index c69b2195d..073f188af 100644 --- a/public/react/src/modules/login/EducoderInteresse.js +++ b/public/react/src/modules/login/EducoderInteresse.js @@ -20,9 +20,6 @@ var newContainer={ top: "0px", bottom: "0px", minHeight: "100%", - overflow:"hidden", - - } class EducoderInteresse extends Component { constructor(props) { diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index eed3a9add..a6600b1e0 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -60,7 +60,6 @@ var newContainer={ top: "0px", bottom: "0px", minHeight: "100%", - overflow:"hidden", paddingTop: "40px", } diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index b2738e798..d66acc811 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -21,7 +21,7 @@ overflow-y:hidden !important; } #log_reg_content{ - top: 0px !important; + top: -64px !important; } #log_reg_content{ width:405px !important; @@ -106,7 +106,7 @@ #closeIcon{ position: absolute; - top: -30px; + top: -100px; right: -27px; z-index: 100000; } @@ -114,7 +114,7 @@ .bluebutton{ width: 100%; text-align: center; - color: #FFFFff!important; + color: #FFFFff !important; display: block; background: #cbcbcb; height: 45px; @@ -130,4 +130,13 @@ .startlogin{ color:#888; +} +.weixinheight390{ + height: 390px; +} +#log_reg_content { + padding: 38px 30px 20px !important; +} +.textcenter{ + text-align: center; } \ No newline at end of file diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 015510566..7a0637678 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -104,6 +104,7 @@ class LoginDialog extends Component { MyEduCoderModals:false, Phonenumberisnotco:undefined, Phonenumberisnotcobool:false, + weixinlogin:false }; } @@ -506,9 +507,19 @@ class LoginDialog extends Component { getloginurl=(url)=>{ window.location.href = url; }; + openweixinlogin=()=>{ + this.setState({ + weixinlogin:true + }) + } + hideweixinlogin=()=>{ + this.setState({ + weixinlogin:false + }) + } render() { let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, - dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; + dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender,weixinlogin}=this.state; if (isRender === undefined) { isRender = false @@ -532,14 +543,14 @@ class LoginDialog extends Component {
    • -
        + {weixinlogin===true?"":
        • {this.enter(0)}}>登录
        • {/*
        • {this.register(0)}}>快捷登录
        • */} -
        +
      }
      -
      + {weixinlogin===true?"":
      @@ -611,12 +622,26 @@ class LoginDialog extends Component {

      - {/*

      */} - - {/*———————— 快速登录 ————————*/} - - {/*

      */} - +

      + + ———————— 快速登录 ———————— +

      +

      + + } + {weixinlogin===true?:""} + {weixinlogin===true?

      + this.hideweixinlogin()}>返回账号登录 +

      :""}
      {/*快捷登录*/} diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 8b7df2e02..476e4cf25 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -890,7 +890,9 @@ class LoginRegisterComponent extends Component { console.log(classpass); return ( -
      +
      - + {weixinlogin===false? 登录 注册 - + :""} - { - parseInt(tab[0])==0 && + { + weixinlogin===false&&parseInt(tab[0])==0 &&
      + +
      +
      +
      +
      + +
      +
      + 为了更好的为您服务,请关联一个EduCoder账号 +
      +
      + +
      + +

      + + +

      + 新用户 +
      + + +
      欢迎来到EduCoder,新用户登录EduCoder可以到“账号管理-安全设置”中绑定手机/邮箱,以后可以用绑定的手机/邮箱,设置的密码登录EduCoder了。
      + 立即体验表示您已经同意我们的 服务协议条款 +
      + +
      +
      + +

      + +

      + + +

      + 老用户 +
      + + +
      已有EduCoder账号,可以输入您的账号和密码,将您的微信账号与EduCoder账号进行绑定。
      + + + + + + + {this.state.logintypes==="username"?请填写账号:this.state.logintypes==="password"?请填写密码:""} +
      + +
      +
      + +

      +
      + +
      +
      +
      © 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
      +
      +
      + +
      + ) + } + +} + +export default Otherlogin; diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 022564f5b..1e71ed681 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1163,7 +1163,7 @@ class LoginRegisterComponent extends Component { color: '#676767', }}>我已阅读并同意 - 《服务协议条款》 + 《服务协议条款》 @@ -1184,7 +1184,7 @@ class LoginRegisterComponent extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2f&response_type=code&scope=snsapi_login#wechat_redirect">:""} + src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherlogin&response_type=code&scope=snsapi_login#wechat_redirect">:""} {weixinlogin===true?

      this.hideweixinlogin()}>返回登录注册

      :""} From a03bb0dafb33612f29bac101e74b5cab9d2de127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 12 Oct 2019 16:35:31 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95=20?= =?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 | 9 ++++ public/react/src/modules/login/LoginDialog.js | 2 +- public/react/src/modules/login/Otherlogin.js | 44 ++++------------ .../src/modules/login/Otherloginstart.js | 52 +++++++++++++++++++ .../modules/user/LoginRegisterComponent.js | 2 +- 5 files changed, 74 insertions(+), 35 deletions(-) create mode 100644 public/react/src/modules/login/Otherloginstart.js diff --git a/public/react/src/App.js b/public/react/src/App.js index f9b6fd36b..34b5d1a4f 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -70,6 +70,12 @@ const Otherlogin=Loadable({ loader: () => import('./modules/login/Otherlogin'), loading: Loading, }) + +const Otherloginstart=Loadable({ + loader: () => import('./modules/login/Otherloginstart'), + loading: Loading, +}) + const TestIndex = Loadable({ loader: () => import('./modules/test'), loading: Loading, @@ -412,6 +418,9 @@ class App extends Component { + diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index b0c1602a9..ae7d781e9 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -638,7 +638,7 @@ class LoginDialog extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherlogin&response_type=code&scope=snsapi_login#wechat_redirect">:""} + src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect">:""} {weixinlogin===true?

      this.hideweixinlogin()}>返回账号登录

      :""} diff --git a/public/react/src/modules/login/Otherlogin.js b/public/react/src/modules/login/Otherlogin.js index 2dc82b578..3c27e0e96 100644 --- a/public/react/src/modules/login/Otherlogin.js +++ b/public/react/src/modules/login/Otherlogin.js @@ -79,48 +79,26 @@ class Otherlogin extends Component { } - getinfo=()=>{ - let url = `/users/get_user_info.json` - axios.get(url).then((result)=> { - console.log(result); - if(result){ - this.setState({ - data:result.data, - spinnings:false - }) - } - }).catch((error)=>{ - this.setState({ - spinnings:false - }) - }) - - } componentDidMount() { - let query=this.props.location.search; - const type = query.split('?code='); - const types = type[1].split('&state='); - let codeurl = `/auth/wechat/callback.json` - axios.get(codeurl,{params:{ - code:types[0] - }}).then((result)=> { + + let url = `/users/get_user_info.json` + axios.get(url).then((result)=> { + console.log(result); if(result){ - if(result.data.status===0){ - if(result.data.true===false){ - this.getinfo() - }else{ - // this.getinfo() - window.location.href="/" - } - } + this.setState({ + data:result.data, + spinnings:false + }) } }).catch((error)=>{ this.setState({ spinnings:false }) }) - } + + + } loginInputonChange=(e)=>{ diff --git a/public/react/src/modules/login/Otherloginstart.js b/public/react/src/modules/login/Otherloginstart.js new file mode 100644 index 000000000..4b134805d --- /dev/null +++ b/public/react/src/modules/login/Otherloginstart.js @@ -0,0 +1,52 @@ +import React, { Component } from 'react'; + +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; + +import { Spin } from 'antd'; +import axios from 'axios'; +class Otherloginstart extends Component { + + componentDidMount() { + let query=this.props.location.search; + const type = query.split('?code='); + const types = type[1].split('&state='); + let codeurl = `/auth/wechat/callback.json` + axios.get(codeurl,{params:{ + code:types[0] + }}).then((result)=> { + if(result){ + if(result.data.status===0){ + if(result.data.true===false){ + window.location.href="/otherlogin" + }else{ + // this.getinfo() + window.location.href="/" + } + } + } + }).catch((error)=>{ + + }) + + } + + render() { + // Loading + return ( +
      + + +
      + ); + } +} + +export default Otherloginstart; \ No newline at end of file diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index a599bcf24..fedc3cb22 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1192,7 +1192,7 @@ class LoginRegisterComponent extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherlogin&response_type=code&scope=snsapi_login#wechat_redirect">:""} + src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect">:""} {weixinlogin===true?

      this.hideweixinlogin()}>返回登录注册

      :""} From 8817c87677bc43155a0dce5f735daa0de2bd1f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 12 Oct 2019 16:45:05 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 24 +++++++++---------- .../src/modules/user/account/AccountSecure.js | 24 +++++++++++++------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 98571d818..c00c5fb62 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -// if (isDev) { -// const _search = window.location.search; -// let parsed = {}; -// if (_search) { -// parsed = queryString.parse(_search); -// } -// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : -// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -// } +if (isDev) { + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +} window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() @@ -84,9 +84,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${debugType}`; + config.url = `${config.url}?debug=${'student'}`; } else { - config.url = `${config.url}&debug=${debugType}`; + config.url = `${config.url}&debug=${'student'}`; } } else { // 加api前缀 diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js index 797b350d2..2e90824c9 100644 --- a/public/react/src/modules/user/account/AccountSecure.js +++ b/public/react/src/modules/user/account/AccountSecure.js @@ -153,20 +153,28 @@ class AccountSecure extends Component { }) } onPasswordSubmit = () => { + let {basicInfo}=this.props; this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - if(values.p_old == values.p_new){ - this.props.showNotification("新密码不能与旧密码相同!"); - return; - } + if(basicInfo&&basicInfo.has_password===true){ + if(values.p_old == values.p_new){ + this.props.showNotification("新密码不能与旧密码相同!"); + return; + } + } + if(values.p_again != values.p_new){ this.props.showNotification("两次输入的新密码必须一致!"); return; } let {login}=this.props.current_user; let url=`/users/accounts/${login}/password.json`; + let p_old=undefined; + if(basicInfo&&basicInfo.has_password===true){ + p_old=values.p_old + } axios.put((url),{ - old_password:values.p_old, + old_password:p_old, password:values.p_new }).then((result)=>{ if(result){ @@ -215,6 +223,8 @@ class AccountSecure extends Component { let {basicInfo}=this.props; const { getFieldDecorator } = this.props.form; const { updating,seconds,secondsFlag } = this.state + + console.log(basicInfo&&basicInfo.has_password) return (
      @@ -426,7 +436,7 @@ class AccountSecure extends Component { { updating == PASSWORD && - @@ -439,7 +449,7 @@ class AccountSecure extends Component { })( )} - + :""} Date: Sat, 12 Oct 2019 16:52:56 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationTaskDetail.js | 725 +++++++++--------- 1 file changed, 358 insertions(+), 367 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index fbbfafabc..66e4ccb8d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -7,7 +7,6 @@ import Loading from '../../../../Loading'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import axios from 'axios'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; -import OneSelfOrderModal from "../../coursesPublic/OneSelfOrderModal"; import AccessoryModal from "../../coursesPublic/AccessoryModal"; import Associationmodel from '../../coursesPublic/Associationmodel'; import CoursesListType from '../../coursesPublic/CoursesListType'; @@ -21,90 +20,89 @@ import Modals from '../../../modals/Modals'; //毕设描述 const GraduationTasksquestions= Loadable({ - loader: () => import('./GraduationTaskssettingquestions'), - loading: Loading, + loader: () => import('./GraduationTaskssettingquestions'), + loading: Loading, }) //毕设任务设置 const GraduationTaskssetting=Loadable({ - loader: () => import('./GraduationTaskssetting'), - loading: Loading, + loader: () => import('./GraduationTaskssetting'), + loading: Loading, }) //毕设任务列表 const GraduationTaskslist=Loadable({ - loader: () => import('./GraduationTaskssettinglist'), - loading: Loading, + loader: () => import('./GraduationTaskssettinglist'), + loading: Loading, }) class GraduationTaskDetail extends Component{ - constructor(props){ - super(props); - this.state={ - modalname:undefined, - visible:false, - OneSelftype:false, + constructor(props){ + super(props); + this.state={ + modalname:undefined, + visible:false, Topval:undefined, starttime:undefined, starttimes:undefined, typs:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - Topvalright:undefined, - Botvalleft:undefined, - course_groupslist:undefined, - course_groups:undefined, - questionslist:undefined, - tab:"list", - visibles:undefined, - Modalstype:undefined, - Modalstopval:undefined, - ModalCancel:undefined, - ModalSave:undefined, - acrossVisible:undefined - } - } - componentDidMount(){ - this.getdatas() - } - getdatas=()=>{ - const task_Id = this.props.match.params.task_Id; - let url="/graduation_tasks/"+task_Id+".json"; - - axios.get(url).then((result)=>{ - if(result.status===200){ - this.setState({ - questionslist:result.data - }) - - } - }).catch((error)=>{ - console.log(error) - }) - } - - - // 交叉评阅设置弹框 - openAcross=()=>{ - this.setState({ - acrossVisible:true - }) - } - closeAcross=()=>{ - this.setState({ - acrossVisible:false - }) + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + Topvalright:undefined, + Botvalleft:undefined, + course_groupslist:undefined, + course_groups:undefined, + questionslist:undefined, + tab:"list", + visibles:undefined, + Modalstype:undefined, + Modalstopval:undefined, + ModalCancel:undefined, + ModalSave:undefined, + acrossVisible:undefined + } + } + componentDidMount(){ + this.getdatas() + } + getdatas=()=>{ + const task_Id = this.props.match.params.task_Id; + let url="/graduation_tasks/"+task_Id+".json"; + + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + questionslist:result.data + }) + + } + }).catch((error)=>{ + console.log(error) + }) + } + + + // 交叉评阅设置弹框 + openAcross=()=>{ + this.setState({ + acrossVisible:true + }) + } + closeAcross=()=>{ + this.setState({ + acrossVisible:false + }) this.getdatas() - } + } - //返回 - 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; + //返回 + 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; // let courseId = this.props.match.params.coursesId; // if(courseId===undefined){ // this.props.history.push("/courses"); @@ -114,76 +112,71 @@ class GraduationTaskDetail extends Component{ // this.props.history.goBack() this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`); - } - //立即发布 - publish=()=>{ - let {questionslist}=this.state; - let starttime= this.props.getNowFormatDates(1,1); - let endtime=this.props.getNowFormatDates(2,1); - // this.homeworkstart() - this.setState({ - modalname:"立即发布", - visible:true, - OneSelftype:true, + } + //立即发布 + publish=()=>{ + let starttime= this.props.getNowFormatDates(1,1); + let endtime=this.props.getNowFormatDates(2,1); + // this.homeworkstart() + this.setState({ + modalname:"立即发布", + visible:true, Topval:"学生将立即收到毕设任务", - // Botvalleft:"点击修改", + // Botvalleft:"点击修改", // Botval:`本操作只对"未发布"的分班有效`, starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , - starttimes:questionslist.end_time, - staytime:this.props.getNowFormatDates(1), + starttimes:this.props.getNowFormatDates(1), typs:"start", - endtime:endtime, - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.cancelmodel, - Saves:this.homepublish, - }) - } - // 确定立即发布 - homepublish=(ids,endtime)=>{ - this.cancelmodel(); - let task_Id=this.props.match.params.task_Id; - const cid = this.props.match.params.coursesId; - // let url = `/courses/${cid}/graduation_tasks/publish_task.json`; - - let url="/courses/"+cid+"/graduation_tasks/publish_task.json" - axios.post(url,{ - task_ids:[task_Id], - group_ids: this.state.course_groupslist, + endtime:endtime, + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.cancelmodel, + Saves:this.homepublish, + }) + } + // 确定立即发布 + homepublish=(ids,endtime)=>{ + this.cancelmodel(); + let task_Id=this.props.match.params.task_Id; + const cid = this.props.match.params.coursesId; + // let url = `/courses/${cid}/graduation_tasks/publish_task.json`; + + let url="/courses/"+cid+"/graduation_tasks/publish_task.json" + axios.post(url,{ + task_ids:[task_Id], + group_ids: this.state.course_groupslist, end_time:endtime, - }).then((response)=>{ - if (response.data.status == 0) { + }).then((response)=>{ + if (response.data.status == 0) { this.getdatas() - this.props.showNotification(response.data.message); - - this.setState({ - // Modalstopval:response.data.message, - // ModalSave:this.cancelmodel, - // Loadtype:true, - course_groupslist:[], - checkAllValue:false - }) - } - }).catch((error)=>{ - - }) - } - - // 刷新 - resetList=()=>{ - this.getdatas(); - this.child && this.child.searchValue(); - } - - // 立即截止 - end=()=>{ + this.props.showNotification(response.data.message); + + this.setState({ + // Modalstopval:response.data.message, + // ModalSave:this.cancelmodel, + // Loadtype:true, + course_groupslist:[], + checkAllValue:false + }) + } + }).catch((error)=>{ + + }) + } + + // 刷新 + resetList=()=>{ + this.getdatas(); + this.child && this.child.searchValue(); + } + + // 立即截止 + end=()=>{ // this.homeworkstart() this.setState({ modalname:"立即截止", visible:true, - OneSelftype:true, Topval:"学生将不能再提交作品", - starttime:undefined, // Botvalleft:"暂不截止", // Botval:`本操作只对"提交中"的分班有效`, Cancelname:"暂不截止", @@ -192,75 +185,74 @@ class GraduationTaskDetail extends Component{ Saves:this.coursetaskend, typs:"end", }) - } - coursetaskend=()=>{ - const coursesId = this.props.match.params.coursesId; - const task_Id = this.props.match.params.task_Id; - - let url = `/courses/${coursesId}/graduation_tasks/end_task.json`; - axios.post(url,{ - task_ids:[task_Id], - group_ids: this.state.course_groupslist, - }).then((response)=>{ - if (response.data.status == 0) { - this.props.showNotification(response.data.message); - this.cancelmodel(); - this.getdatas(); - this.child && this.child.reInit(); - } - - }).catch((error)=>{ - - }) - } - // 取消 - cancelmodel=()=>{ - this.setState({ - Modalstype:false, - Loadtype:false, - visible:false, - OneSelftype:false, - Modulationtype:false, - Allocationtype:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - }) - } - - getcourse_groupslist=(id)=>{ - this.setState({ - course_groupslist:id - }) - } - - setTab = (tab) =>{ - this.setState({ - tab - }) - } - - // 关联项目 - AssociationItems=()=>{ + } + coursetaskend=()=>{ + const coursesId = this.props.match.params.coursesId; + const task_Id = this.props.match.params.task_Id; + + let url = `/courses/${coursesId}/graduation_tasks/end_task.json`; + axios.post(url,{ + task_ids:[task_Id], + group_ids: this.state.course_groupslist, + }).then((response)=>{ + if (response.data.status == 0) { + this.props.showNotification(response.data.message); + this.cancelmodel(); + this.getdatas(); + this.child && this.child.reInit(); + } + + }).catch((error)=>{ + + }) + } + // 取消 + cancelmodel=()=>{ + this.setState({ + Modalstype:false, + Loadtype:false, + visible:false, + Modulationtype:false, + Allocationtype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + }) + } + + getcourse_groupslist=(id)=>{ + this.setState({ + course_groupslist:id + }) + } + + setTab = (tab) =>{ + this.setState({ + tab + }) + } + + // 关联项目 + AssociationItems=()=>{ this.setState({ visibles:true }) - } - Cancel=()=>{ + } + Cancel=()=>{ this.setState({ visibles:false }) - } - // 取消关联 - cannelAssociation=()=>{ + } + // 取消关联 + cannelAssociation=()=>{ this.setState({ Modalstype:true, Modalstopval:"确定要取消该项目关联?", ModalCancel:this.cannerassocition, ModalSave:this.savetassociton }) - } - savetassociton=()=>{ + } + savetassociton=()=>{ this.cannerassocition(); let {questionslist}=this.state; let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json"; @@ -274,7 +266,7 @@ class GraduationTaskDetail extends Component{ }) } - cannerassocition=()=>{ + cannerassocition=()=>{ this.setState({ Modalstype:false, Modalstopval:"", @@ -283,10 +275,10 @@ class GraduationTaskDetail extends Component{ loadtype:false, visibles:false }) - } - // 补交附件 - handaccessory=()=>{ - // let {taskslistdata}=this.state; + } + // 补交附件 + handaccessory=()=>{ + // let {taskslistdata}=this.state; // let courseId=this.props.match.params.coursesId; // // let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise" @@ -300,130 +292,129 @@ class GraduationTaskDetail extends Component{ this.setState({ avisible:false }) - } - - - bindRef = ref => { this.child = ref } ; - render(){ - - let courseId=this.props.match.params.coursesId; - let category_id=this.props.match.params.category_id; - let task_Id=this.props.match.params.task_Id; - let { - questionslist , - tab , - visibles , - Modalstype, - Modalstopval, - ModalCancel, - ModalSave, - acrossVisible - } = this.state - - const commom = { - setTab:this.setTab, - getdatas:this.getdatas - } - return( -
      - { - questionslist && -
      - this.getcourse_groupslist(id)} - /> - {/*关联项目*/} - {visibles===true? - this.Cancel()} - taskid={ questionslist && questionslist.task_id } - funlist={this.resetList} - /> - :""} - - {this.state.avisible===true?:""} - {/*提示*/} - - - { - acrossVisible && - - } - -

      - {questionslist.course_name} - > - {questionslist.graduation_name} - > - 任务详情 -

      -
      -

      - {questionslist.task_name} -

      - - 返回 -
      -
      -
      - - 任务列表 - 毕设描述 - 设置 - - {/*导出成绩*/} - {/*{this.props.isAdmin()?导出成绩:""}*/} - {/*{this.props.isAdmin()?导出作品附件:""}*/} - - - {this.props.isAdmin()?
    • - 导出 - -
    • :""} - {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ - return( - + + {this.props.isAdmin()?
    • + 导出 + +
    • :""} + {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ + return( + {item==="提交作品"?提交作品:""} - {item==="补交作品"?补交作品:""} - {item==="修改作品"?修改作品:""} - {item==="查看作品"?查看作品 :""} - {item==="创建项目"?创建项目:""} - {item==="关联项目"?关联项目:""} - {item==="取消关联"?取消关联:""} - {item==="补交附件"?补交附件:""} + {item==="补交作品"?补交作品:""} + {item==="修改作品"?修改作品:""} + {item==="查看作品"?查看作品 :""} + {item==="创建项目"?创建项目:""} + {item==="关联项目"?关联项目:""} + {item==="取消关联"?取消关联:""} + {item==="补交附件"?补交附件:""} - ) - })} - - {/*项目在线质量检测*/} - { this.props.isAdmin() ? questionslist.status===1 ? { this.end()} }>立即截止 : "" : "" } - { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } - { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } - { this.props.isAdmin() ? 编辑任务 : "" } -
      -
      - - - () - } - > - - () - } - > - - () - }> - - -
      - } - -
      - ) - } + ) + })} + + {/*项目在线质量检测*/} + { this.props.isAdmin() ? questionslist.status===1 ? { this.end()} }>立即截止 : "" : "" } + { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } + { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } + { this.props.isAdmin() ? 编辑任务 : "" } +
      +
      + + + () + } + > + + () + } + > + + () + }> + + +
      + } + +
      + ) + } } // CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC)) export default (GraduationTaskDetail) ; \ No newline at end of file From 11a16c74034c7f9ec9b7bdadf54bbd9ddb840c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 12 Oct 2019 16:54:35 +0800 Subject: [PATCH 11/12] =?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/AppConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c00c5fb62..e1d5da561 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -84,9 +84,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${'student'}`; + config.url = `${config.url}?debug=${debugType}`; } else { - config.url = `${config.url}&debug=${'student'}`; + config.url = `${config.url}&debug=${debugType}`; } } else { // 加api前缀 From d56850e32ce5618320fec2f90d47ca13584f5dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 12 Oct 2019 16:59:21 +0800 Subject: [PATCH 12/12] =?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 | 1046 ++++++++--------- 1 file changed, 523 insertions(+), 523 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 857b5c244..46e90befb 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -31,7 +31,7 @@ import TraineetraininginformationModal from "./TraineetraininginformationModal"; import DownloadMessageysl from '../../modals/DownloadMessageysl'; import Startshixuntask from "../coursesPublic/Startshixuntask"; import ModulationModal from "../coursesPublic/ModulationModal"; -import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; +import HomeworkModal from "../coursesPublic/HomeworkModal"; import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; import NoneData from '../../../modules/courses/coursesPublic/NoneData'; @@ -210,13 +210,13 @@ class Listofworksstudentone extends Component { title={record.stduynumber} className="maxnamewidth145" style={{ - color:'#9A9A9A', + color:'#9A9A9A', textAlign: "center", width:'145px', - }}>{ + }}>{ record.stduynumber } - + } @@ -327,11 +327,11 @@ class Listofworksstudentone extends Component { // className:'font-14', // render: (text, record) => ( // - // {record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime} - // + // // ), // }, { @@ -451,8 +451,8 @@ class Listofworksstudentone extends Component { record.submitstate === "未提交" ?-- : this.Viewstudenttraininginformation(record)}>{record.operating} + className="color-blue" + onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating} } @@ -953,15 +953,15 @@ class Listofworksstudentone extends Component { } - // {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time } - // + // {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time } + // ) }, @@ -1268,14 +1268,14 @@ class Listofworksstudentone extends Component { 学员在EduCoder做实训花费的时间
      }> - {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} - + >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} + } @@ -1535,7 +1535,7 @@ class Listofworksstudentone extends Component { // console.log("获取作品列表"); // console.log("935"); // debugger - let searchtype=this.props.history.location.search; + let searchtype=this.props.history.location.search; let urll = `/homework_commons/${homeworkid}/works_list.json`; var datasysl = { search: this.state.searchtext, @@ -1589,12 +1589,12 @@ class Listofworksstudentone extends Component { if(result.data.update_score===true){ if(bool===true){ if(searchtype==="?tab=0"){ - try { - this.props.yslslowCheckresults(); - }catch (e) { + try { + this.props.yslslowCheckresults(); + }catch (e) { - } - this.setComputeTimet(); + } + this.setComputeTimet(); } } } @@ -2445,7 +2445,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分"){ continue }else { - columns2js.push(item); + columns2js.push(item); } } } @@ -2479,7 +2479,7 @@ class Listofworksstudentone extends Component { if(item.title==="分班"){ continue }else{ - columns2js.push(item); + columns2js.push(item); } } } @@ -2794,11 +2794,11 @@ class Listofworksstudentone extends Component { this.setState({ modalname: "立即发布", modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, - OneSelftype: true, + svisible: true, Topval:"学生将立即收到作业", // Botvalleft:"暂不发布", - Botval:``, - starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + Botval:`本操作只对"未发布"的分班有效`, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime: "截止时间:" + endtime, starttimes:starttime, typs:"start", @@ -2828,7 +2828,7 @@ class Listofworksstudentone extends Component { this.setState({ modalname: "立即截止", modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1, - OneSelftype: true, + svisible: true, Topval:"学生将不能再提交作业", // Botvalleft:"暂不截止", Botval:`本操作只对"提交中"的分班有效`, @@ -2931,7 +2931,7 @@ class Listofworksstudentone extends Component { this.setState({ modalname: undefined, modaltype: undefined, - OneSelftype: false, + svisible: false, Topval: undefined, Topvalright: undefined, Botvalleft: undefined, @@ -2985,31 +2985,31 @@ class Listofworksstudentone extends Component { let url = "/homework_commons/"+homeworkid+"/update_score.json"; axios.get(url).then((response) => { - if(response){ - if(response.data.status===0){ - // if(response.data.message!==undefined){ - // return; - // } + if(response){ + if(response.data.status===0){ + // if(response.data.message!==undefined){ + // return; + // } setTimeout(()=>{ this.setState({ loadingstate: true }) this.Getalistofworks(homeworkid,false); - try { - this.props.showNotification(`${response.data.message}`); - }catch (e) { + try { + this.props.showNotification(`${response.data.message}`); + }catch (e) { - } - try{ - this.props.yslslowCheckresultsNo(); - }catch (e) { + } + try{ + this.props.yslslowCheckresultsNo(); + }catch (e) { - } + } }, 2500); } - // this.props.history.replace( matchurl ); - } + // this.props.history.replace( matchurl ); + } }).catch((error) => { console.log(error) }); @@ -3038,8 +3038,8 @@ class Listofworksstudentone extends Component { // } daochushixunbaogao=()=>{ - let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo===undefined ||this.state.course_groupyslstwo===null? "": this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null? "":this.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext===null?"":this.state.searchtext}` - this.confirmysl(url); + let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo===undefined ||this.state.course_groupyslstwo===null? "": this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null? "":this.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext===null?"":this.state.searchtext}` + this.confirmysl(url); } daochuzuoye =() =>{ @@ -3092,105 +3092,105 @@ class Listofworksstudentone extends Component { let {columns,course_groupysls,datajs,isAdmin,homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu,columnsstu2, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; const antIcon = ; - let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; - // console.log("Listofworksstudentone.js"); - // console.log(orders); + let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; + // console.log("Listofworksstudentone.js"); + // console.log(orders); return ( this.props.isAdmin() === true ? -
      - {visible === true ? this.saveModulationModal(value, num)} - /> : ""} - - {this.state.showmodel === true ? this.hideshowmodel()} - updatas={() => this.isupdatas()} - /> : ""} - - - {visibles === true ? -
      - - this.cancelModulationModels()} - /> - -
      - : "" - } - - {/*立即发布*/} - this.getcourse_groupslist(id)} - starttimes={this.state.starttimes} - typs={this.state.typs} - /> - { - homework_status&&homework_status.length===0? -
      - -
      - : - homework_status&&homework_status.length>0 && homework_status[0]==="未发布"? -
      - -
      - : -
      - - -
      - - - + this.cancelModulationModels()} + /> + +
      + : "" + } + + {/*立即发布*/} + this.getcourse_groupslist(id)} + starttimes={this.state.starttimes} + typs={this.state.typs} + /> + { + homework_status&&homework_status.length===0? +
      + +
      + : + homework_status&&homework_status.length>0 && homework_status[0]==="未发布"? +
      + +
      + : +
      + + +
      + + + - {computeTimetype===false?
    • - - + + {computeTimetype===false?
    • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
    • :""} - - {/*作品状态GraduationTaskssettinglist*/} -
        -
      • - {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} - - - -
      • - -
      • -
        - {/*{course_is_end===true?"":*/} - {/*{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?*/} - {/* (this.props.isNotMember()===false?
        */} - {/* 查看最新成绩*/} - {/*
        :""):*/} - {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* (this.props.isNotMember()===false?
        */} - {/* 查看最新成绩*/} - {/*
        :"")*/} - {/*}*/} - {/*
        }*/} - +
      • :""} + + {/*作品状态GraduationTaskssettinglist*/} +
          +
        • + {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} + + + +
        • + +
        • +
          + {/*{course_is_end===true?"":*/} + {/*{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?*/} + {/* (this.props.isNotMember()===false?
          */} + {/* 查看最新成绩*/} + {/*
          :""):*/} + {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} + {/* (this.props.isNotMember()===false?
          */} + {/* 查看最新成绩*/} + {/*
          :"")*/} + {/*}*/} + {/*
          }*/} + -
          - 作品状态: - this.notlimiteds()}>不限 - this.funtaskstatust(e, task_status && task_status)} - style={{paddingTop: '4px'}}> - - {task_status === undefined ? "" : task_status.map((item, key) => { - return ( - +
      + 作品状态: + this.notlimiteds()}>不限 + this.funtaskstatust(e, task_status && task_status)} + style={{paddingTop: '4px'}}> + + {task_status === undefined ? "" : task_status.map((item, key) => { + return ( + {item.name} @@ -3297,97 +3297,97 @@ class Listofworksstudentone extends Component { - ) - })} - - {/*请输入姓名或学号搜索*/} - - - - - - {/*分班情况*/} - -
    • - {JSON.stringify(course_group_info) === "[]" ? "" : course_group_info === undefined ? "" : course_group_info.length < 2 ? "" : -
      - 分班情况: - this.notlimitedst()}>不限 - this.funtaskstatustwot(e, course_group_info && course_group_info)} - style={{paddingTop: '4px',width:'1017px'}}> - {course_group_info === undefined ? "" : - course_group_info.map((item, key) => { - return ( - + ) + })} + + {/*请输入姓名或学号搜索*/} + + +
    • + + + {/*分班情况*/} + +
    • + {JSON.stringify(course_group_info) === "[]" ? "" : course_group_info === undefined ? "" : course_group_info.length < 2 ? "" : +
      + 分班情况: + this.notlimitedst()}>不限 + this.funtaskstatustwot(e, course_group_info && course_group_info)} + style={{paddingTop: '4px',width:'1017px'}}> + {course_group_info === undefined ? "" : + course_group_info.map((item, key) => { + return ( + {item.group_group_name} ({item.count}) - ) - }) - } - -
      } -
    • + ) + }) + } + +
      } + -
    + -
    + + { + JSON.stringify(datajs) === "[]" ? + +
    +
    +
    + +

    暂时还没有相关数据哦!

    +
    +
    + +
    + : + +
    + -
    - {datajs === undefined ? "" : } - - - } - - - - { - teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? -
    - -
    - : "" - } - - } - - : +
    + {datajs === undefined ? "" :
    } + + + } -
    + +
    { - teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? - // 学生不能查看别人的 -
    - - {visibles === true ? -
    - - + {visibles === true ? +
    + + - this.cancelModulationModels()} - /> -
    - : "" - } + } + + this.cancelModulationModels()} + /> +
    + : "" + } - { - homework_status&&homework_status.length&&homework_status.length===0? -
    - -
    - : - homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"? -
    - -
    - : + { + homework_status&&homework_status.length&&homework_status.length===0? +
    + +
    + : + homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"? +
    + +
    + : -
    -
    +
    +
    - - {computeTimetype===false?
  • - - + + {computeTimetype===false?
  • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
  • :""} + :""} - {JSON.stringify(data) !== "[]" ? -
    -
    + {JSON.stringify(data) !== "[]" ? +
    +
    -
    +
    -
    - - {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} - {/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":*/} - {/* {computeTimetype===true?*/} - {/* (this.props.isNotMember()===false?*/} - {/* (*/} - {/* teacherdata&&teacherdata.update_score===true?*/} - {/*
    */} - {/* 查看最新成绩*/} - {/*
    */} - {/* :""*/} - {/* )*/} - {/* :"")*/} - {/* :*/} - {/* (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* this.props.isNotMember()===false?*/} - {/*
    */} - {/* 查看最新成绩*/} - {/*
    */} - {/* :"")*/} - {/* }*/} - {/*
    }*/} - -
    +
    + + {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} + {/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":*/} + {/* {computeTimetype===true?*/} + {/* (this.props.isNotMember()===false?*/} + {/* (*/} + {/* teacherdata&&teacherdata.update_score===true?*/} + {/*
    */} + {/* 查看最新成绩*/} + {/*
    */} + {/* :""*/} + {/* )*/} + {/* :"")*/} + {/* :*/} + {/* (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} + {/* this.props.isNotMember()===false?*/} + {/*
    */} + {/* 查看最新成绩*/} + {/*
    */} + {/* :"")*/} + {/* }*/} + {/*
    }*/}
    -
    - -
    - {data === undefined ? "" :
    } - +
    + {data === undefined ? "" :
    } + - : -
    -
    -
    - -

    暂时还没有相关数据哦!

    -
    + : +
    +
    +
    + +

    暂时还没有相关数据哦!

    -
    - } -
    +
    + }
    - } + - : - // 学生能查看别人的 -
    - {/*双层*/} - - - {visibles === true ? - this.cancelModulationModels()} - /> : "" - } + } +
    + : + // 学生能查看别人的 +
    + {/*双层*/} + + + {visibles === true ? + this.cancelModulationModels()} + /> : "" + } - { - homework_status&&homework_status.length===0? -
    - -
    - : - homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"? -
    - -
    - : -
    + { + homework_status&&homework_status.length===0? +
    + +
    + : + homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"? +
    + +
    + : +
    -
    - + - {computeTimetype===false?
  • - - + {computeTimetype===false?
  • + + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异 -
  • :""} + :""} - -
    - {data === undefined ? "" :
    } - - {JSON.stringify(datas) !== "[]" ? -
    -
    +
    + {data === undefined ? "" :
    } + + {JSON.stringify(datas) !== "[]" ? +
    +
    +
    -
    {teacherdata === undefined ? "0" : teacherdata.commit_count === undefined ? "0" : teacherdata.commit_count} @@ -3761,8 +3761,8 @@ class Listofworksstudentone extends Component { style={{color: '#FF6800'}}>{teacherdata.left_time.time}} - -
    - - {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} - {/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":*/} - {/* {computeTimetype===true?*/} - - {/* (this.props.isNotMember()===false?*/} - {/* (*/} - {/* teacherdata&&teacherdata.update_score===true?*/} - {/*
    */} - {/* 查看最新成绩*/} - {/*
    :""*/} - {/* )*/} - {/* :""):*/} - {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* (this.props.isNotMember()===false?
    */} - {/* 查看最新成绩*/} - {/*
    :"")*/} - {/* }*/} - {/*
    }*/} -
    + +
    + + {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} + {/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":*/} + {/* {computeTimetype===true?*/} + + {/* (this.props.isNotMember()===false?*/} + {/* (*/} + {/* teacherdata&&teacherdata.update_score===true?*/} + {/*
    */} + {/* 查看最新成绩*/} + {/*
    :""*/} + {/* )*/} + {/* :""):*/} + {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} + {/* (this.props.isNotMember()===false?
    */} + {/* 查看最新成绩*/} + {/*
    :"")*/} + {/* }*/} + {/*
    }*/}
    -
    - -
    - {datas === undefined ? "" :
    } - +
    + {datas === undefined ? "" :
    } - { - teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? -
    - -
    - : "" - } - : -
    -
    -
    - -

    暂时还没有相关数据哦!

    + { + teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? +
    +
    + : "" + } +
    + : +
    +
    +
    + +

    暂时还没有相关数据哦!

    - } -
    +
    + }
    - } + } + }