From df6f12a8ab04a0877b2f5503e97d97252b313357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 29 Jun 2019 11:14:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 109 ++++----- .../exercise/Testpapersettinghomepage.js | 6 +- .../shixunHomework/Listofworksstudentone.js | 213 +++++++++--------- 3 files changed, 150 insertions(+), 178 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 33362df65..a84347e25 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -67,14 +67,13 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'number', key: 'number', align: 'center', - width: "84px", - className: "edu-txt-center", + className: "edu-txt-center font-14", render: (text, record) => ( {record.number === "--" ? - {record.number} + {record.number} : - {record.number} + {record.number} } @@ -85,14 +84,13 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'name', key: 'name', align: 'center', - className: "edu-txt-center", - width: "110px", + className: "edu-txt-center font-14", render: (text, record) => ( {record.name === "--" ? - {record.name} + {record.name} : - {record.name} + {record.name} } @@ -103,28 +101,24 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center", - width: "175px", + className: "edu-txt-center font-14", render: (text, record) => ( {record.stduynumber === null ? -- : + }}>-- : record.stduynumber === "" ? -- : + }}>-- : {record.stduynumber} + }}>{record.stduynumber} } @@ -136,27 +130,23 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'classroom', align: 'center', className: "edu-txt-center", - width: "120px", - render: (text, record) => ( + render: (text, record) => ( {record.classroom === null ? -- : + }}>-- : record.classroom === "" ? -- : + }}>-- : {record.classroom} + }}>{record.classroom} } @@ -167,19 +157,16 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'submitstate', key: 'submitstate', align: 'center', - width: "124px", - className: "edu-txt-center", + className: "edu-txt-center", render: (text, record) => ( {record.submitstate} + }}>{record.submitstate} ) @@ -190,13 +177,12 @@ class Studentshavecompletedthelist extends Component { key: 'updatetime', align: 'center', className: "edu-txt-center", - width: "236.4px", - render: (text, record) => ( + render: (text, record) => ( {record.updatetime === "--" ? - {record.updatetime} + {record.updatetime} : - {record.updatetime} + {record.updatetime} } ), @@ -207,36 +193,30 @@ class Studentshavecompletedthelist extends Component { key: 'completion', align: 'center', className: "edu-txt-center", - width: "124px", - render: (text, record) => ( + render: (text, record) => ( { record.completion === "--" ? + }}> {record.completion} : 90 ? { "color": '#DD1717', "text-align": "center" - , "width": "124px" - } : parseInt(record.completion) <= 90 ? { + } : parseInt(record.completion) <= 90 ? { "color": '#FF6800', "text-align": "center" - , "width": "124px" - } : parseInt(record.completion) <= 60 ? { + } : parseInt(record.completion) <= 60 ? { "color": '#747A7F', "text-align": "center" - , "width": "124px" - } : + } : { "color": '#747A7F', "text-align": "center" - , "width": "124px" - }}>{record.completion} + }}>{record.completion} } @@ -247,32 +227,27 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'levelscore', key: 'levelscore', align: 'center', - width: "124px", - className: "edu-txt-center", + className: "edu-txt-center", render: (text, record) => ( {record.levelscore === "--" ? + }}> {record.levelscore} : 90 ? { "color": '#DD1717', "text-align": "center" - , "width": "124px" - } : parseInt(record.levelscore) <= 90 ? { + } : parseInt(record.levelscore) <= 90 ? { "color": '#FF6800', "text-align": "center" - , "width": "124px" - } : parseInt(record.levelscore) <= 60 ? { + } : parseInt(record.levelscore) <= 60 ? { "color": '#747A7F', "text-align": "center" - , "width": "124px" - } : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore} + } : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore} } ) @@ -282,35 +257,30 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'efficiencyscore', key: 'efficiencyscore', align: 'center', - width: "124px", - className: "edu-txt-center", + className: "edu-txt-center", render: (text, record) => ( {record.efficiencyscore === "--" ? + }}> {record.efficiencyscore} : 90 ? { "color": '#DD1717', "text-align": "center" - , "width": "124px" - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 ? { "color": '#FF6800', "text-align": "center" - , "width": "124px" - } : parseInt(record.efficiencyscore) <= 60 ? { + } : parseInt(record.efficiencyscore) <= 60 ? { "color": '#747A7F', "text-align": "center", } : { "color": '#747A7F', "text-align": "center" - , "width": "124px" - }}>{record.efficiencyscore} + }}>{record.efficiencyscore} } ) @@ -1013,6 +983,10 @@ class Studentshavecompletedthelist extends Component { } // console.log("Studentshavecompletedthelist"); // console.log(props.current_status); + // columnsys 老师列表 + // columnss 学生只能看自己的 未截止页面 + // columnstwo 截止显示自己的 + // columns 截止后显示其他学生 } paginationonChange = (pageNumber) => { @@ -4715,8 +4689,9 @@ class Studentshavecompletedthelist extends Component { (
{Commonheadofthetestpaper === undefined?"":Commonheadofthetestpaper.exercise_name}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 29af983e5..1c12130ed 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -112,9 +112,9 @@ class Listofworksstudentone extends Component { challenges_count:result.data.challenges_count, }) if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { - this.seacthdata(); + this.seacthdata(result.data); } else { - this.seacthdatas(); + this.seacthdatas(result.data,result.data.student_works); } } @@ -166,9 +166,9 @@ class Listofworksstudentone extends Component { challenges_count:result.data.challenges_count, }) if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { - this.seacthdata(); + this.seacthdata(result.data); } else { - this.seacthdatas(); + this.seacthdatas(result.data,result.data.student_works); } } @@ -187,7 +187,7 @@ class Listofworksstudentone extends Component { } - seacthdatas = () => { + seacthdatas = (teacherdata,student_works) => { let {page, limit} = this.state; let datalist = []; let datalists = []; @@ -197,10 +197,10 @@ class Listofworksstudentone extends Component { var teacherlist = undefined; var teacherlists = undefined; - if (this.state.teacherdata !== undefined) { + if (teacherdata !== undefined) { // console.log("seacthdata设置数据") // console.log(this.state.teacherdata.id ) - if (this.state.teacherdata.id === undefined) { + if (teacherdata.id === undefined) { this.setState({ data: [], teacherlist: undefined, @@ -209,36 +209,36 @@ class Listofworksstudentone extends Component { }) } else { - console.log(this.state.teacherdata) - if (this.state.teacherdata.id !== undefined || this.state.teacherdata.id !== null || this.state.teacherdata.id !== "") { + console.log(teacherdata) + if (teacherdata.id !== undefined || teacherdata.id !== null || teacherdata.id !== "") { // console.log("seacthdata设置数据1") // console.log(this.state.teacherdata ) - var timedata = moment(this.state.teacherdata.update_time).format('YYYY-MM-DD HH:mm'); + var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm'); datalist.push({ - myid: this.state.teacherdata.id, + myid: teacherdata.id, number: 1, - name: this.state.teacherdata.user_name, - stduynumber: this.state.teacherdata.student_id, - classroom: this.state.teacherdata.group_name, - submitstate: this.state.teacherdata.work_status === 0 ? "未提交" : this.state.teacherdata.work_status === 1 ? "按时提交" : this.state.teacherdata.work_status === 2 ? "延时提交" : "未提交", + name: teacherdata.user_name, + stduynumber: teacherdata.student_id, + classroom: teacherdata.group_name, + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, - completion: this.state.teacherdata.complete_count === null ? "0" :this.state.teacherdata.complete_count === undefined ? "0": this.state.teacherdata.complete_count, - levelscore: this.state.teacherdata.final_score, - efficiencyscore: this.state.teacherdata.eff_score, - finalscore: this.state.teacherdata.work_score, + completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count, + levelscore: teacherdata.final_score, + efficiencyscore: teacherdata.eff_score, + finalscore: teacherdata.work_score, operating: "查看", - late_penalty: this.state.teacherdata.late_penalty=== null?"0":this.state.teacherdata.late_penalty === undefined?"0":this.state.teacherdata.late_penalty, - ultimate_score:this.state.teacherdata.ultimate_score, - user_name: this.state.teacherdata.user_name, - user_login: this.state.teacherdata.user_login, + late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty, + ultimate_score:teacherdata.ultimate_score, + user_name: teacherdata.user_name, + user_login: teacherdata.user_login, }) // } var teacherlist = { //分页 - total: this.state.teacherdata.student_works.length, //数据总数量 - pageSize: this.state.teacherdata.student_works.length, //一页显示几条 + total: teacherdata.student_works.length, //数据总数量 + pageSize: teacherdata.student_works.length, //一页显示几条 current: this.state.page, } styletable = {"display": "block",} @@ -252,30 +252,30 @@ class Listofworksstudentone extends Component { } - if (this.state.student_works !== undefined) { + if (student_works !== undefined) { - for (var i = 0; i < this.state.student_works.length; i++) { + for (var i = 0; i阶段成绩
-实训详情
+实训详情
{ challenge.map((item,key)=>{ return( -- + 第{item[0].position}关 - {item[0].name} + {item[0].name}
@@ -308,7 +318,7 @@ class shixunAnswer extends Component{ {...this.props} {...this.state} challenge={item[0].outputs} > - { item[0].st===0 ?最近通过的代码 @@ -316,7 +326,7 @@ class shixunAnswer extends Component{
+
- {tableData && tableData.graduation_topic_name}
-
+ 还未上传附件 +
+ : + + } {this.state.updatas===true?请上传附件:""}+ + + + + {item.name} + + + {item.response===undefined?"":bytesToSize(item.size)} + + this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}> +
+ ) + })} {/*{attachments&&attachments.map((item,key)=>{*/} {/*return(*/} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index e6185188a..585986fb2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -2,7 +2,7 @@ import React, {Component} from "React"; import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd"; import {Link} from 'react-router-dom'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -import {WordsBtn, getUrl} from 'educoder'; +import {WordsBtn, getUrl,bytesToSize} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import '../../css/Courses.css'; @@ -133,29 +133,29 @@ class GraduationTasksnew extends Component { this.setState({fileList}); } - onAttachmentRemove = (file) => { - // confirm({ - // title: '确定要删除这个附件吗?', - // okText: '确定', - // cancelText: '取消', - // // content: 'Some descriptions', - // onOk: () => { - // this.deleteAttachment(file) - // }, - // onCancel() { - // console.log('Cancel'); - // }, - // }); - // return false; - - this.setState({ - Modalstype: true, - Modalstopval: '确定要删除这个附件吗?', - ModalSave: () => this.deleteAttachment(file), - ModalCancel: this.cancelAttachment - }) - return false; - } + // onAttachmentRemove = (file) => { + // // confirm({ + // // title: '确定要删除这个附件吗?', + // // okText: '确定', + // // cancelText: '取消', + // // // content: 'Some descriptions', + // // onOk: () => { + // // this.deleteAttachment(file) + // // }, + // // onCancel() { + // // console.log('Cancel'); + // // }, + // // }); + // // return false; + // + // this.setState({ + // Modalstype: true, + // Modalstopval: '确定要删除这个附件吗?', + // ModalSave: () => this.deleteAttachment(file), + // ModalCancel: this.cancelAttachment + // }) + // return false; + // } cancelAttachment = () => { this.setState({ @@ -166,8 +166,9 @@ class GraduationTasksnew extends Component { }) } - deleteAttachment = (file) => { - const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + onAttachmentRemove = (file) => { + // const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + const url = `/attachments/${file}.json` axios.delete(url, {}) .then((response) => { if (response.data) { @@ -256,7 +257,7 @@ class GraduationTasksnew extends Component { multiple: true, // https://github.com/ant-design/ant-design/issues/15505 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, + showUploadList: false, action: `${getUrl()}/api/attachments.json`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, @@ -385,7 +386,7 @@ class GraduationTasksnew extends Component {+ + + + + {item.name} + + + {item.response===undefined?"":bytesToSize(item.size)} + + this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}> +
+ ) + })} +可能会影响某些功能的正常使用
可能会影响某些功能的正常使用