From 1076926607a12dd4d61f740903489fd227d6ad29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 14:29:22 +0800
Subject: [PATCH 01/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/busyWork/CommonWorkList.js | 11 +-
.../shixunHomework/Listofworksstudentone.js | 149 +++++++++++++-----
2 files changed, 119 insertions(+), 41 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 3b3491675..5a6d460c3 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -112,7 +112,7 @@ function buildColumns(that, student_works, studentData) {
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
-
+ sorter: (a, b) => a.student_id - b.student_id,
render: (text, record) => (
(
-
+
{record.group_name}
),
@@ -201,6 +200,7 @@ function buildColumns(that, student_works, studentData) {
title: '更新时间',
dataIndex: 'update_time',
key: 'update_time',
+ sorter: (a, b) => a.update_time - b.update_time,
render: (update_time, record) => (
@@ -306,10 +306,12 @@ function buildColumns(that, student_works, studentData) {
}
if (!niPingAndIsStudent) {
columns.push({
- width: 70,
+ width: '113px',
title: '最终成绩',
key: 'work_score',
dataIndex: 'work_score',
+ sorter: (a, b) => a.work_score - b.work_score,
+
render: (work_score, record) => {
return (
@@ -412,6 +414,7 @@ class CommonWorkList extends Component{
}
componentDidMount() {
+ console.log("CommonWorkList 分班list 开始加载");
this.fetchList()
on('commonwork_fetch_all', this.fetchAllListener)
$("html").animate({ scrollTop: $('html').scrollTop() - 100 });
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 2bf9035b2..f451ab55a 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -818,6 +818,7 @@ class Listofworksstudentone extends Component {
},
],
b_order: "desc",
+ myorders: "desc",
allow_late: false,
checkedValuesine: undefined,
checkedValuesineinfo: [],
@@ -872,6 +873,7 @@ class Listofworksstudentone extends Component {
key: 'stduynumber',
align: "center",
className: 'font-14 maxnamewidth110',
+ sorter: true,
render: (text, record) => (
{record.stduynumber === undefined ?
@@ -1091,6 +1093,7 @@ class Listofworksstudentone extends Component {
key: 'finalscore',
align: 'center',
className: 'font-14',
+ sorter: true,
render: (text, record) => (
{
@@ -1530,6 +1533,7 @@ class Listofworksstudentone extends Component {
// }
//
// }
+
componentDidMount() {
// console.log("componentDidMount ");
// console.log("调用子组件 ");
@@ -1548,6 +1552,68 @@ class Listofworksstudentone extends Component {
// this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid, false);
}
+
+ //tbale 列表塞选数据
+ table1handleChange = (pagination, filters, sorter) => {
+ //"ascend" 升序
+ //"descend" 降序
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ console.log(sorter);
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "stduynumber") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ myorders: "asc",
+ orders: "student_id",
+ loadingstate: true,
+ });
+ this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ myorders: "desc",
+ orders: "student_id",
+ loadingstate: true,
+ })
+ this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "finalscore") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ myorders: "asc",
+ orders: "work_score",
+ loadingstate: true,
+ })
+ this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ myorders: "desc",
+ orders: "work_score",
+ loadingstate: true,
+ })
+ this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+
+ }
+
+ }
/////////老师操作
// tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid;
@@ -2275,7 +2341,7 @@ class Listofworksstudentone extends Component {
//开始排序操作
- Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => {
+ Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit, myorders) => {
//要提交的作品状态checkedValuesine
//要提交的分班状态checkedValuesineinfo
//searchtext 输入的姓名和学号
@@ -2285,10 +2351,18 @@ class Listofworksstudentone extends Component {
var homeworkid = this.props.match.params.homeworkid;
let urll = `/homework_commons/${homeworkid}/works_list.json?`;
- var order = "asc";
- if (ordervlue === "update_time") {
- order = "desc";
+ var order = this.state.order;
+
+ try {
+ if (myorders === null || myorders === undefined) {
+
+ } else {
+ order = myorders;
+ }
+ } catch (e) {
+
}
+
var checkedValuesines = checkedValuesine;
var checkedValuesineinfos = checkedValuesineinfo;
var searchtexts = searchtext
@@ -2591,7 +2665,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else if (checkedValues.length === data.length) {
this.setState({
unlimited: 0,
@@ -2599,7 +2673,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else {
// console.log(checkedValues);
this.setState({
@@ -2608,7 +2682,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
}
}
@@ -2625,7 +2699,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else if (checkedValues.length === data.length) {
this.setState({
unlimitedtwo: 1,
@@ -2634,7 +2708,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, this.state.checcourse_groupyslstwokedValuesine, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
} else {
this.setState({
checkedValuesineinfo: checkedValues,
@@ -2643,7 +2717,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.myorders);
}
@@ -2676,7 +2750,7 @@ class Listofworksstudentone extends Component {
page: 1,
limit: 20,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
// console.log(value)
@@ -2692,7 +2766,7 @@ class Listofworksstudentone extends Component {
page: 1,
limit: 20,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, 20);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, 20, this.state.myorders);
}
}
//排序
@@ -2704,7 +2778,7 @@ class Listofworksstudentone extends Component {
orders: "update_time",
loadingstate: true,
})
- this.Startsortingt("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsortingt("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
}
if (e === "work_score") {
@@ -2714,7 +2788,7 @@ class Listofworksstudentone extends Component {
orders: "work_score",
loadingstate: true,
})
- this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
}
if (e === "student_id") {
@@ -2724,7 +2798,7 @@ class Listofworksstudentone extends Component {
orders: "student_id",
loadingstate: true,
})
- this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
}
}
@@ -2771,7 +2845,7 @@ class Listofworksstudentone extends Component {
.then((response) => {
if (response.data.status == '0') {
this.setState({visible: false});
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
this.props.showNotification(`调分成功`);
}
})
@@ -2958,7 +3032,7 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
})
- this.Startsortingt(this.state.orders, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.myorders);
}
notlimitedst = () => {
@@ -2969,7 +3043,7 @@ class Listofworksstudentone extends Component {
course_groupysls: undefined,
loadingstate: true,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit, this.state.myorders);
}
//立即截止确定按钮
coursetaskend = () => {
@@ -3050,8 +3124,7 @@ class Listofworksstudentone extends Component {
page: pageNumber,
loadingstate: true,
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit);
-
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, this.state.limit, this.state.myorders);
}
setComputeTimet = () => {
@@ -3454,23 +3527,24 @@ class Listofworksstudentone extends Component {
`
}
-
+
+ {/**/}
@@ -3514,6 +3588,7 @@ class Listofworksstudentone extends Component {
dataSource={datajs}
columns={columns}
pagination={false}
+ onChange={this.table1handleChange}
loading={loadingstate}
/>}
From d8bbbdbae0d156ed589a8be18f4ef472a0331447 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 15:27:01 +0800
Subject: [PATCH 02/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/shixunHomework/Listofworksstudentone.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index f451ab55a..966813852 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -1560,7 +1560,7 @@ class Listofworksstudentone extends Component {
if (JSON.stringify(sorter) === "{}") {
//没有选择
} else {
- console.log(sorter);
+ // console.log(sorter);
try {
//学生学号排序
if (sorter.columnKey === "stduynumber") {
From c0d4fa59c6aad20cf2f9c3c00b9e83ade8cfc85e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 16:04:17 +0800
Subject: [PATCH 03/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/busyWork/CommonWorkList.js | 133 +++++++++++++-----
.../shixunHomework/Listofworksstudentone.js | 2 +
2 files changed, 100 insertions(+), 35 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 5a6d460c3..0d78372ed 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -112,7 +112,7 @@ function buildColumns(that, student_works, studentData) {
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
- sorter: (a, b) => a.student_id - b.student_id,
+ sorter: true,
render: (text, record) => (
a.update_time - b.update_time,
-
+ sorter: true,
render: (update_time, record) => (
{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}
@@ -310,8 +309,7 @@ function buildColumns(that, student_works, studentData) {
title: '最终成绩',
key: 'work_score',
dataIndex: 'work_score',
- sorter: (a, b) => a.work_score - b.work_score,
-
+ sorter: true,
render: (work_score, record) => {
return (
@@ -398,6 +396,7 @@ class CommonWorkList extends Component{
isSpin:true,
left_time: {},
category: {},
+ b_order: 'desc',
}
}
onTablePagination = (page) => {
@@ -433,7 +432,7 @@ class CommonWorkList extends Component{
}
_getRequestParams() {
- const { search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work } = this.state
+ const {search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work, b_order} = this.state
return {
page,
search,
@@ -442,7 +441,7 @@ class CommonWorkList extends Component{
teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0],
order,
limit: PAGE_SIZE,
- b_order: orderMap[order],
+ b_order: b_order,
group_id:arg_course_group,
member_work: arg_member_work
}
@@ -497,8 +496,12 @@ class CommonWorkList extends Component{
this.fetchList()
})
}
- funorder = (order) => {
- this.setState({ order }, () => {
+ funorder = (order, b_order) => {
+ this.setState({
+ order: order
+ ,
+ b_order: b_order
+ }, () => {
this.fetchList()
})
}
@@ -550,6 +553,64 @@ class CommonWorkList extends Component{
}
+ //tbale 列表塞选数据
+ table1handleChange = (pagination, filters, sorter) => {
+ //"ascend" 升序
+ //"descend" 降序
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ // 时间
+ try {
+ if (sorter.columnKey === "update_time") {
+ let myyslorder = "";
+ if (sorter.order === "ascend") {
+ myyslorder = "asc";
+ } else if (sorter.order === "descend") {
+ myyslorder = "desc";
+ }
+ this.funorder("update_time", myyslorder);
+ }
+
+ } catch (e) {
+
+ }
+
+ //成绩
+ try {
+ if (sorter.columnKey === "work_score") {
+ let myyslorder = "";
+ if (sorter.order === "ascend") {
+ myyslorder = "asc";
+ } else if (sorter.order === "descend") {
+ myyslorder = "desc";
+ }
+ this.funorder("work_score", myyslorder)
+ }
+
+ } catch (e) {
+
+ }
+
+ //学号
+ try {
+ if (sorter.columnKey === "student_id") {
+ let myyslorder = "";
+ if (sorter.order === "ascend") {
+ myyslorder = "asc";
+ } else if (sorter.order === "descend") {
+ myyslorder = "desc";
+ }
+ this.funorder("student_id", myyslorder)
+ }
+
+ } catch (e) {
+
+ }
+
+ }
+ }
+
render(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm';
@@ -745,21 +806,21 @@ class CommonWorkList extends Component{
} */}
- {
- isAdminOrStudent && student_works && !!student_works.length &&
-
-
-
- {order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}
-
-
- - this.funorder("update_time")}>更新时间
- - this.funorder("work_score")}>最终成绩
- - this.funorder("student_id")}>学生学号
-
-
-
- }
+ {/*{*/}
+ {/* isAdminOrStudent && student_works && !!student_works.length &&*/}
+ {/* */}
+ {/*
*/}
+ {/* */}
+ {/* {order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}*/}
+ {/* */}
+ {/* */}
+ {/* - this.funorder("update_time")}>更新时间
*/}
+ {/* - this.funorder("work_score")}>最终成绩
*/}
+ {/* - this.funorder("student_id")}>学生学号
*/}
+ {/*
*/}
+ {/* */}
+ {/*
*/}
+ {/*}*/}
}
@@ -794,11 +855,12 @@ class CommonWorkList extends Component{
`}
{ isStudent &&StudentData===undefined?"":StudentData===undefined?"":
}
@@ -836,12 +898,13 @@ class CommonWorkList extends Component{
onChange={this.onTablePagination}
*/}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 966813852..81086a75b 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -1207,6 +1207,7 @@ class Listofworksstudentone extends Component {
key: 'stduynumber',
align: "center",
className: 'font-14 maxnamewidth110',
+ sorter: true,
render: (text, record) => (
{record.stduynumber === undefined ?
@@ -1419,6 +1420,7 @@ class Listofworksstudentone extends Component {
key: 'finalscore',
align: 'center',
className: 'font-14',
+ sorter: true,
render: (text, record) => (
{
From 230dce6bdc10104321ea8865a9dbc612b563eb6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 16:10:14 +0800
Subject: [PATCH 04/13] =?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/modules/courses/busyWork/CommonWorkList.js | 2 +-
.../src/modules/courses/shixunHomework/Listofworksstudentone.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 0d78372ed..13535a61b 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -553,7 +553,7 @@ class CommonWorkList extends Component{
}
- //tbale 列表塞选数据
+ //普通作业tbale 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 81086a75b..fedcde663 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -1555,7 +1555,7 @@ class Listofworksstudentone extends Component {
this.Getalistofworks(homeworkid, false);
}
- //tbale 列表塞选数据
+ //实训作业tbale 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
From 04206f389762da418f3cdde17c5c30c365b7fc00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 16:29:39 +0800
Subject: [PATCH 05/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E6=9F=A5=E9=87=8D=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/Listofworksstudentone.js | 2 +-
.../shixunHomework/ShixunStudentWork.js | 131 ++++++++++--------
2 files changed, 76 insertions(+), 57 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index fedcde663..e94038a28 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -1589,7 +1589,7 @@ class Listofworksstudentone extends Component {
}
try {
- //学生学号排序
+ //学生成绩排序
if (sorter.columnKey === "finalscore") {
if (sorter.order === "ascend") {
//升序
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index 1fdc4303a..a3c2230a0 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -43,7 +43,7 @@ const qs = require('qs');
//课堂作业设置
-//作品列表(教师)
+//代码查重
class ShixunStudentWork extends Component {
constructor(props) {
super(props);
@@ -341,48 +341,15 @@ class ShixunStudentWork extends Component {
this.getcode_review_results(order,b_order,page,limit,group_infolist,search)
}
- funorder=(value)=>{
+ funorder = (value, myyslorder) => {
let {order,b_order,page,limit,group_infolist,search} = this.state;
- let newb_order;
- if(order===value){
- if(b_order==="desc"){
-
- this.setState({
- order:value,
- b_order:"asc"
- })
- newb_order="asc";
- }else{
-
- this.setState({
- order:value,
- b_order:"desc"
- })
- newb_order="desc";
- }
- }else{
- if(b_order==="desc"){
-
- this.setState({
- order:value,
- b_order:"desc"
- })
- newb_order="desc";
- }else{
-
- this.setState({
- order:value,
- b_order:"asc"
- })
- newb_order="asc";
- }
- }
-
this.setState({
loadingstate:true,
+ order: value,
+ b_order: myyslorder
})
- this.getcode_review_results(value,newb_order,page,limit,group_infolist,search)
+ this.getcode_review_results(value, myyslorder, page, limit, group_infolist, search)
}
groupgroup=(checkedValues)=>{
@@ -668,7 +635,56 @@ class ShixunStudentWork extends Component {
DownloadType:false,
DownloadMessageval:undefined
})
+ };
+
+
+ //代码查重tbale 列表塞选数据
+ table1handleChange = (pagination, filters, sorter) => {
+ //"ascend" 升序
+ //"descend" 降序
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ // console.log(sorter);
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "stduynumber") {
+ var myyslorder = "";
+ if (sorter.order === "ascend") {
+ //升序
+ myyslorder = "asc";
+ } else if (sorter.order === "descend") {
+ //降序
+ myyslorder = "desc";
+ }
+ this.funorder("student_id", myyslorder);
+ }
+ } catch (e) {
+
+ }
+
+ try {
+ //相似度排序
+ if (sorter.columnKey === "classroom") {
+ var myyslorder = "";
+ if (sorter.order === "ascend") {
+ //升序
+ myyslorder = "asc";
+ } else if (sorter.order === "descend") {
+ //降序
+ myyslorder = "desc";
+ }
+ this.funorder("code_rate", myyslorder);
+ }
+ } catch (e) {
+
+ }
+
+ }
+
}
+
+
render() {
let {
data,
@@ -708,6 +724,7 @@ class ShixunStudentWork extends Component {
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
+ sorter: true,
render: (text, record) => (
{record.stduynumber}
@@ -718,6 +735,7 @@ class ShixunStudentWork extends Component {
title: '相似度',
key: 'classroom',
dataIndex: 'classroom',
+ sorter: true,
render: (text, record) => (
=90?'#FF6800':"#747A7F", "text-align": "center"}}>{isNaN(record.classroom)?"--":record.classroom}%
@@ -929,24 +947,24 @@ class ShixunStudentWork extends Component {
{data&&data.copy_reviews_count}
个疑似抄袭作品({data&&data.all_reviews_count}作品)
-
+ {/**/}
@@ -968,6 +986,7 @@ class ShixunStudentWork extends Component {
:}
From 2343bd2dba65ebdaa654f354050aa3320861f2dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 17:05:10 +0800
Subject: [PATCH 06/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=AF=95=E8=AE=BE?=
=?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../graduation/tasks/GraduationTaskDetail.js | 2 +-
.../tasks/GraduationTaskssettinglist.js | 163 +++++++++---------
2 files changed, 85 insertions(+), 80 deletions(-)
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js
index 118b92607..5c5a47ccd 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js
@@ -515,7 +515,7 @@ class GraduationTaskDetail extends Component{
-
+ {/*//毕设任务列表*/}
(this.setend_time(time)} tab={`list`}/>)
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
index ebe931eb0..a1f91bb4f 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
@@ -19,7 +19,7 @@ const Search = Input.Search;
const qs = require('qs');
-
+//毕设任务列表
class GraduationTaskssettinglist extends Component{
constructor(props){
@@ -160,12 +160,68 @@ class GraduationTaskssettinglist extends Component{
})
}
- TablePagination=(e)=>{
+ TablePagination = (pagination, filters, sorter) => {
+ // console.log(e.current);
+ // this.setState({
+ // page:e.current
+ // })
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ //stduynumber 学号
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "stduynumber") {
+ let orderlumn = "";
+ if (sorter.order === "ascend") {
+ //升序
+ orderlumn = "asc";
+ } else if (sorter.order === "descend") {
+ //降序
+ orderlumn = "desc";
+ }
+ this.funorder("student_id", orderlumn)
+ }
+ } catch (e) {
- this.setState({
- page:e.current
- })
+ }
+ //turnovertime 时间
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "turnovertime") {
+ let orderlumn = "";
+ if (sorter.order === "ascend") {
+ //升序
+ orderlumn = "asc";
+ } else if (sorter.order === "descend") {
+ //降序
+ orderlumn = "desc";
+ }
+ this.funorder("update_time", orderlumn);
+ }
+ } catch (e) {
+
+ }
+
+ //finalscore 成绩
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "finalscore") {
+ let orderlumn = "";
+ if (sorter.order === "ascend") {
+ //升序
+ orderlumn = "asc";
+ } else if (sorter.order === "descend") {
+ //降序
+ orderlumn = "desc";
+ }
+ this.funorder("work_score", orderlumn);
+ }
+ } catch (e) {
+
+ }
+ }
}
funteachercomment=(list,key)=> {
@@ -234,47 +290,14 @@ class GraduationTaskssettinglist extends Component{
}
- funorder=(value)=>{
+ funorder = (value, newb_order) => {
let {teacher_comment, task_status, course_group, cross_comment, b_order, search,order} = this.state;
- let newb_order;
- if(order===value){
- if(b_order==="desc"){
-
- this.setState({
- order:value,
- b_order:"asc"
- })
- newb_order="asc";
- }else{
-
- this.setState({
- order:value,
- b_order:"desc"
- })
- newb_order="desc";
- }
- }else{
- if(b_order==="desc"){
-
- this.setState({
- order:value,
- b_order:"desc"
- })
- newb_order="desc";
- }else{
-
- this.setState({
- order:value,
- b_order:"asc"
- })
- newb_order="asc";
- }
- }
-
- this.setState({
- loadingstate:true
- })
+ this.setState({
+ order: value,
+ b_order: newb_order,
+ loadingstate: true
+ })
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page);
}
@@ -747,6 +770,7 @@ class GraduationTaskssettinglist extends Component{
dataIndex: 'stduynumber',
key: 'stduynumber',
className:'edu-txt-center',
+ sorter: true,
render: (text, record) => (
{record.stduynumber}
@@ -798,6 +822,7 @@ class GraduationTaskssettinglist extends Component{
dataIndex: 'turnovertime',
key: 'turnovertime',
className:'edu-txt-center',
+ sorter: true,
render: (text, record) => (
@@ -839,6 +864,7 @@ class GraduationTaskssettinglist extends Component{
key: 'finalscore',
dataIndex: 'finalscore',
className:'edu-txt-center',
+ sorter: true,
render: (text, record) => (
@@ -1220,20 +1246,20 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()===true?
{taskslistdata&&taskslistdata.work_count}
个检索结果({taskslistdata&&taskslistdata.all_work_count} 学生):""}
- {this.props.isAdmin()===true?:""}
+ {/*{this.props.isAdmin()===true?:""}*/}
{this.props.isStudent()===true?
@@ -1409,27 +1435,6 @@ class GraduationTaskssettinglist extends Component{
- {this.props.isAdmin()===true?
-
-
- {taskslistdata&&taskslistdata.work_count}
- 个检索结果({taskslistdata&&taskslistdata.work_count} 学生)
-
-
-
- :""}
{this.props.isStudent()===true?
From abb5a7d9c7a322486e0d46bfaa30a567849f9d7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 17:28:01 +0800
Subject: [PATCH 07/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/exercise/Studentshavecompletedthelist.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index ae5a50e6d..2c214bc57 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -2419,7 +2419,6 @@ class Studentshavecompletedthelist extends Component {
//排序
funordersy = (e) => {
console.log(this.state.course_groupyslstwo);
- debugger
if (e === "end_at") {
// 时间
// 时间排序是从小到大
From d5adf9e01ce4c58d207cd71f9be9189e891d0c27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 28 Oct 2019 17:45:21 +0800
Subject: [PATCH 08/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/busyWork/CommonWorkDetailIndex.js | 1 +
.../tasks/GraduationTaskssettinglist.js | 15 +--------------
.../shixunHomework/ShixunStudentWork.js | 19 +------------------
3 files changed, 3 insertions(+), 32 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
index 134be31c3..5799110f2 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
@@ -27,6 +27,7 @@ const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'),
loading:Loading,
})
+//普通作业列表
const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'),
loading:Loading,
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
index a1f91bb4f..a66928927 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js
@@ -1246,20 +1246,7 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()===true?
{taskslistdata&&taskslistdata.work_count}
个检索结果({taskslistdata&&taskslistdata.all_work_count} 学生):""}
- {/*{this.props.isAdmin()===true?:""}*/}
+
{this.props.isStudent()===true?
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index a3c2230a0..d5f1dd7cd 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -947,24 +947,7 @@ class ShixunStudentWork extends Component {
{data&&data.copy_reviews_count}
个疑似抄袭作品({data&&data.all_reviews_count}作品)
- {/*
*/}
+
From d8938438b12f912f04d23278e6712e8bfcd1a3bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 29 Oct 2019 09:24:06 +0800
Subject: [PATCH 09/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/competition/Registration.js | 5 ++---
public/react/src/modules/competition/RegistrationSearch.js | 4 +++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js
index 3517236bf..b9ffb51d6 100644
--- a/public/react/src/modules/competition/Registration.js
+++ b/public/react/src/modules/competition/Registration.js
@@ -888,9 +888,8 @@ class Registration extends React.Component {
{
type === 4 || type === 5 ?
- this.RegistrationSearchvalue(value)}>
+ this.RegistrationSearchvalue(value)}>
: ""
}
{/**/}
diff --git a/public/react/src/modules/competition/RegistrationSearch.js b/public/react/src/modules/competition/RegistrationSearch.js
index 122366e0d..02d4fa861 100644
--- a/public/react/src/modules/competition/RegistrationSearch.js
+++ b/public/react/src/modules/competition/RegistrationSearch.js
@@ -63,7 +63,9 @@ class RegistrationSearch extends React.Component {
lineHeight: " 24px"
}}>战队总数:{this.props.count}个
+ style={{marginLeft: "5px", marginRight: "15px",}}>个 参赛总人数:{this.props.members_count}人
)
}
From 9f6651463e83a64dd05524f01e317359bafef837 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 29 Oct 2019 10:12:33 +0800
Subject: [PATCH 10/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../exercise/Studentshavecompletedthelist.js | 184 ++++++++++--------
1 file changed, 103 insertions(+), 81 deletions(-)
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index 2c214bc57..1c4d051ff 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -877,6 +877,7 @@ class Studentshavecompletedthelist extends Component {
key: 'stduynumber',
align: 'center',
className: "edu-txt-center font-14",
+ sorter: true,
render: (text, record) => (
{record.stduynumber === "--" ?
@@ -930,6 +931,7 @@ class Studentshavecompletedthelist extends Component {
key: 'updatetime',
align: 'center',
className: "edu-txt-center font-14",
+ sorter: true,
render: (text, record) => (
{record.updatetime==="--"?
@@ -978,6 +980,7 @@ class Studentshavecompletedthelist extends Component {
key: 'efficiencyscore',
align: 'center',
className: "edu-txt-center font-14",
+ sorter: true,
render: (text, record) => (
{record.efficiencyscore === "--" ?
@@ -1221,6 +1224,7 @@ class Studentshavecompletedthelist extends Component {
},
],
exercise_status:0,
+ order_type: "desc",
}
// console.log("Studentshavecompletedthelist");
// console.log(props.current_status);
@@ -1244,7 +1248,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, pageNumber, 20, this.state.order_type);
}
paginationonChanges = (pageNumber) => {
@@ -1459,9 +1463,9 @@ class Studentshavecompletedthelist extends Component {
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
- console.log(error);
- console.log("其实数据加载失败了");
- console.log("1111");
+ // console.log(error);
+ // console.log("其实数据加载失败了");
+ // console.log("1111");
});
@@ -2050,7 +2054,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- Searchdatasys = (order, commit_status, review, exercise_group_id, search, page, limit) => {
+ Searchdatasys = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/exercise_lists.json`;
axios.get((url), {
@@ -2062,6 +2066,7 @@ class Studentshavecompletedthelist extends Component {
search: search,
page: page,
limit: limit,
+ order_type: order_type
}
}).then((response) => {
// console.log("528");
@@ -2098,7 +2103,7 @@ class Studentshavecompletedthelist extends Component {
page:1,
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
// notlimiteds = () => {
// this.setState({
@@ -2125,7 +2130,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
checkeboxstwo = (checkedValues, data) => {
// console.log(checkedValues)
@@ -2146,7 +2151,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
@@ -2163,10 +2168,10 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
- this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
if (this.state.loadingstate === false) {
this.setState({
loadingstate: true,
@@ -2196,7 +2201,7 @@ class Studentshavecompletedthelist extends Component {
course_groups: null,
unlimitedtwo: 0
})
- this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, null, null)
+ this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, null, null, this.state.order_type)
}
checkeboxs = (checkedValues, data) => {
@@ -2225,7 +2230,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
@@ -2242,7 +2247,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
if (this.state.loadingstate === false) {
@@ -2260,7 +2265,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
}
@@ -2283,7 +2288,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit)
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit, this.state.order_type)
}
funtaskstatustwo = (checkedValues, data) => {
@@ -2305,7 +2310,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
@@ -2322,7 +2327,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else {
// console.log(checkedValues);
if (this.state.loadingstate === false) {
@@ -2343,7 +2348,7 @@ class Studentshavecompletedthelist extends Component {
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
this.props.setcourse_groupysls(checkedValues)
}
@@ -2364,7 +2369,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
};
//搜索学生按钮输入 老师
@@ -2381,7 +2386,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit);
+ this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit, this.state.order_type);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value)
@@ -2416,59 +2421,92 @@ class Studentshavecompletedthelist extends Component {
};
- //排序
- funordersy = (e) => {
- console.log(this.state.course_groupyslstwo);
- if (e === "end_at") {
- // 时间
- // 时间排序是从小到大
- if (this.state.loadingstate === false) {
- this.setState({
- order: "end_at",
- loadingstate: true,
- })
- } else {
- this.setState({
- order: "end_at",
- })
+ //试卷tbale 列表塞选数据
+ table1handleChange = (pagination, filters, sorter) => {
+ //"ascend" 升序
+ //"descend" 降序
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ try {
+ //时间排序
+ if (sorter.columnKey === "updatetime") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "end_at",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdatasys("end_at", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "end_at",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdatasys("end_at", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
}
- this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit);
- }
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "stduynumber") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "student_id",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdatasys("student_id", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
+
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "student_id",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdatasys("student_id", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
- if (e === "score") {
- // 成绩
- //成绩排序是从大到小
- if (this.state.loadingstate === false) {
- this.setState({
- order: "score",
- loadingstate: true,
- })
- } else {
- this.setState({
- order: "score",
- })
+ }
+ }
+ } catch (e) {
}
- this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit);
- }
+ try {
+ //成绩排序排序
+ if (sorter.columnKey === "efficiencyscore") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "score",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdatasys("score", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "asc");
+
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "score",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdatasys("score", this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, "desc");
+
+ }
+ }
+ } catch (e) {
- if (e === "student_id") {
- //学号
- //学号排序是从大到小
- if (this.state.loadingstate === false) {
- this.setState({
- order: "student_id",
- loadingstate: true,
- })
- } else {
- this.setState({
- order: "student_id",
- })
}
- this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit);
}
}
setExerciseReviewAndAnswer = () => {
@@ -2634,23 +2672,6 @@ class Studentshavecompletedthelist extends Component {
style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}个检索结果({Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users}学生)
-
@@ -2675,6 +2696,7 @@ class Studentshavecompletedthelist extends Component {
columns={columnsys}
className="mysjysltable1"
pagination={false}
+ onChange={this.table1handleChange}
loading={loadingstate}
// onChange={this.TablePaginationsy}
/>}
From 76e7afaf97e746936cd31bf563f4beb7ed811f0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 29 Oct 2019 10:29:18 +0800
Subject: [PATCH 11/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../exercise/Studentshavecompletedthelist.js | 168 ++++++++++--------
1 file changed, 93 insertions(+), 75 deletions(-)
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index 1c4d051ff..80b1babc4 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -110,6 +110,7 @@ class Studentshavecompletedthelist extends Component {
align: 'center',
className: "edu-txt-center font-14 maxnamewidth175",
width:'175px',
+ sorter: true,
render: (text, record) => (
(
(
{record.efficiencyscore === "--" ?
@@ -1265,7 +1268,7 @@ class Studentshavecompletedthelist extends Component {
})
}
- this.Searchdata(this.state.order, null, null, null, null, pageNumber, this.state.limit)
+ this.Searchdata(this.state.order, null, null, null, null, pageNumber, this.state.limit, this.state.order_type);
}
@@ -1617,60 +1620,8 @@ class Studentshavecompletedthelist extends Component {
}
-//排序
- funorder = (e) => {
- if (e === "end_at") {
- // 时间
- // 时间排序是从小到大
- if (this.state.loadingstate === true) {
- this.setState({
- order: "end_at",
- })
- } else {
- this.setState({
- order: "end_at",
- loadingstate: true,
- })
- }
-
- this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit)
- }
-
- if (e === "score") {
- // 成绩
- //成绩排序是从大到小
- if (this.state.loadingstate === true) {
- this.setState({
- order: "score",
- })
- } else {
- this.setState({
- order: "score",
- loadingstate: true,
- })
- }
-
- this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit)
- }
-
- if (e === "student_id") {
- //学号
- //学号排序是从大到小
- if (this.state.loadingstate === true) {
- this.setState({
- order: "student_id",
- })
- } else {
- this.setState({
- order: "student_id",
- loadingstate: true
- })
- }
- this.Searchdata(e, null, null, null, null, this.state.page, this.state.limit)
- }
- }
- Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit) => {
+ Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`;
@@ -1682,6 +1633,7 @@ class Studentshavecompletedthelist extends Component {
search: "",
page: page,
limit: limit,
+ order_type: order_type,
}
axios.get(url, {
params: params
@@ -2421,7 +2373,7 @@ class Studentshavecompletedthelist extends Component {
};
- //试卷tbale 列表塞选数据
+ //老师试卷table 列表塞选数据
table1handleChange = (pagination, filters, sorter) => {
//"ascend" 升序
//"descend" 降序
@@ -2509,6 +2461,89 @@ class Studentshavecompletedthelist extends Component {
}
}
+
+ //学生问卷table 列表塞选数据
+ table1handleChangestuden = (pagination, filters, sorter) => {
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+ try {
+ //时间排序
+ if (sorter.columnKey === "updatetime") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "end_at",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdata("end_at", null, null, null, null, this.state.page, this.state.limit, "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "end_at",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdata("end_at", null, null, null, null, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "stduynumber") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "student_id",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdata("student_id", null, null, null, null, this.state.page, this.state.limit, "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "student_id",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdata("student_id", null, null, null, null, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+
+ try {
+ //成绩排序排序
+ if (sorter.columnKey === "efficiencyscore") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order: "score",
+ loadingstate: true,
+ order_type: "asc"
+ })
+ this.Searchdata("score", null, null, null, null, this.state.page, this.state.limit, "asc");
+
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order: "score",
+ loadingstate: true,
+ order_type: "desc"
+ })
+ this.Searchdata("score", null, null, null, null, this.state.page, this.state.limit, "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+ }
+ }
setExerciseReviewAndAnswer = () => {
}
@@ -2903,26 +2938,8 @@ class Studentshavecompletedthelist extends Component {
{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}}
-
+
+
@@ -2957,6 +2974,7 @@ class Studentshavecompletedthelist extends Component {
columns={columns}
pagination={false}
className="mysjysltable4"
+ onChange={this.table1handleChangestuden}
loading={loadingstate}
/>}
From 213602138ccfe6d007b8b977dfbb0557c1d82d5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 29 Oct 2019 10:54:30 +0800
Subject: [PATCH 12/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/poll/PollDetailTabFirst.js | 122 +++++++++++++-----
.../shixunHomework/Listofworksstudentone.js | 52 --------
2 files changed, 93 insertions(+), 81 deletions(-)
diff --git a/public/react/src/modules/courses/poll/PollDetailTabFirst.js b/public/react/src/modules/courses/poll/PollDetailTabFirst.js
index ad7b957b1..032e9e3b6 100644
--- a/public/react/src/modules/courses/poll/PollDetailTabFirst.js
+++ b/public/react/src/modules/courses/poll/PollDetailTabFirst.js
@@ -49,7 +49,8 @@ class PollDetailTabFirst extends Component{
poll_types:undefined,
course_groups:undefined,
options_Class:[],
- poll_end_at:""
+ poll_end_at: "",
+ order_type: "desc"
}
}
// 搜索框搜索
@@ -59,12 +60,12 @@ class PollDetailTabFirst extends Component{
})
}
searchInfo=()=>{
- let{order,search,commit_status,poll_group_id,page}=this.state
- this.getTableList(order,search,commit_status,poll_group_id,page);
+ let {order, search, commit_status, poll_group_id, page, order_type} = this.state
+ this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
}
// 获取接口数据
- getTableList=(order,search,commit_status,poll_group_id,page)=>{
+ getTableList = (order, search, commit_status, poll_group_id, page, order_type) => {
let pollId=this.props.match.params.pollId;
let courseid=this.props.match.params.coursesId;
let url=`/polls/${pollId}/poll_lists.json`;
@@ -76,7 +77,8 @@ class PollDetailTabFirst extends Component{
search:search,
commit_status:commit_status,
poll_group_id:poll_group_id,
- page:page
+ page: page,
+ order_type: order_type
}
}).then((result)=>{
if(result){
@@ -128,8 +130,8 @@ class PollDetailTabFirst extends Component{
}
componentDidMount(){
- let {order,search,commit_status,poll_group_id,page}=this.state;
- this.getTableList(order,search,commit_status,poll_group_id,page);
+ let {order, search, commit_status, poll_group_id, page, order_type} = this.state;
+ this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
}
// 翻页
@@ -137,17 +139,17 @@ class PollDetailTabFirst extends Component{
this.setState({
page:pageNumber
})
- let {order,search,commit_status,poll_group_id}=this.state;
- this.getTableList(order,search,commit_status,poll_group_id,pageNumber);
+ let {order, search, commit_status, poll_group_id, order_type} = this.state;
+ this.getTableList(order, search, commit_status, poll_group_id, pageNumber, order_type);
}
//排序
- changeOrder=(order)=>{
+ changeOrder = (order, order_type) => {
this.setState({
order:order
})
let {search,commit_status,poll_group_id,page}=this.state;
- this.getTableList(order,search,commit_status,poll_group_id,page);
+ this.getTableList(order, search, commit_status, poll_group_id, page, order_type);
}
//选择分班情况
classOptionsChange = (values,all) => {
@@ -155,8 +157,8 @@ class PollDetailTabFirst extends Component{
this.setState({
poll_group_id:status
})
- let {order,search,commit_status,page}=this.state;
- this.getTableList(order,search,commit_status,status,page);
+ let {order, search, commit_status, page, order_type} = this.state;
+ this.getTableList(order, search, commit_status, status, page, order_type);
}
//选择提交状态
statusOptionChange=(values,all)=>{
@@ -164,10 +166,69 @@ class PollDetailTabFirst extends Component{
this.setState({
commit_status:status
})
- let {order,search,poll_group_id,page}=this.state;
- this.getTableList(order,search,status,poll_group_id,page);
- }
+ let {order, search, poll_group_id, page, order_type} = this.state;
+ this.getTableList(order, search, status, poll_group_id, page, order_type);
+ }
+ //问卷table 列表塞选数据
+ table1handleChange = (pagination, filters, sorter) => {
+ //"ascend" 升序
+ //"descend" 降序
+ if (JSON.stringify(sorter) === "{}") {
+ //没有选择
+ } else {
+
+ try {
+ //学生学号排序
+ if (sorter.columnKey === "StudentNo") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order_type: "asc",
+ order: "student_id",
+ loadingstate: true,
+ });
+ this.changeOrder("student_id", "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order_type: "desc",
+ order: "student_id",
+ loadingstate: true,
+ })
+ this.changeOrder("student_id", "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+
+ try {
+ //提交时间排序
+ if (sorter.columnKey === "time") {
+ if (sorter.order === "ascend") {
+ //升序
+ this.setState({
+ order_type: "asc",
+ order: "end_at",
+ loadingstate: true,
+ })
+ this.changeOrder("end_at", "asc");
+ } else if (sorter.order === "descend") {
+ //降序
+ this.setState({
+ order_type: "desc",
+ order: "end_at",
+ loadingstate: true,
+ })
+ this.changeOrder("end_at", "desc");
+ }
+ }
+ } catch (e) {
+
+ }
+ }
+ }
render(){
let {order,search,data,page,limit,course_groups,poll_types,options_Class,dataInfo,poll_end_at}=this.state;
const isAdmin =this.props.isAdmin();
@@ -197,6 +258,7 @@ class PollDetailTabFirst extends Component{
dataIndex: 'StudentNo',
key: 'StudentNo',
className:"edu-txt-center",
+ sorter: true,
render:(StudentNo,item,index)=>{
return(
item.StudentNo ? {item.StudentNo} : "--"
@@ -230,6 +292,7 @@ class PollDetailTabFirst extends Component{
key: 'time',
className:"edu-txt-center",
width:160,
+ sorter: true,
render:(time,item,index)=>{
return(
item.time == null ? -- : moment(item.time).format('YYYY-MM-DD HH:mm')
@@ -316,22 +379,23 @@ class PollDetailTabFirst extends Component{
:""
}
- {
- isAdmin &&
-
-
- {order=="end_at"?"提交时间":"学生学号"}
-
- - this.changeOrder("end_at")}>提交时间
- - this.changeOrder("student_id")}>学生学号
-
-
-
- }
+ {/*{*/}
+ {/* isAdmin && */}
+ {/* */}
+ {/*
*/}
+ {/* {order=="end_at"?"提交时间":"学生学号"}*/}
+ {/* */}
+ {/* - this.changeOrder("end_at")}>提交时间
*/}
+ {/* - this.changeOrder("student_id")}>学生学号
*/}
+ {/*
*/}
+ {/* */}
+ {/*
*/}
+ {/*}*/}
}
{
- data && data.length>0 ?
:
+ data && data.length > 0 ?
:
}
{
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index e94038a28..3b19630bc 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -2771,39 +2771,6 @@ class Listofworksstudentone extends Component {
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, 20, this.state.myorders);
}
}
- //排序
- funordert = (e) => {
- if (e === "update_time") {
- // 时间
- // 时间排序是从小到大
- this.setState({
- orders: "update_time",
- loadingstate: true,
- })
- this.Startsortingt("update_time", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
- }
-
- if (e === "work_score") {
- // 成绩
- //成绩排序是从大到小
- this.setState({
- orders: "work_score",
- loadingstate: true,
- })
- this.Startsortingt("work_score", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
- }
-
- if (e === "student_id") {
- //学号
- //学号排序是从大到小
- this.setState({
- orders: "student_id",
- loadingstate: true,
- })
- this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit, this.state.myorders);
- }
- }
-
// 调分
@@ -3530,25 +3497,6 @@ class Listofworksstudentone extends Component {
}
- {/**/}
-
-
From 69f62645ae37067c9218a01a5aa2ea1e3df88e28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Tue, 29 Oct 2019 14:46:56 +0800
Subject: [PATCH 13/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/Trainingjobsetting.js | 74 ++++++++++++-------
1 file changed, 48 insertions(+), 26 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index 92d263888..ab8a55dc7 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -127,6 +127,7 @@ class Trainingjobsetting extends Component {
end_timebool:false,
late_timesbool:false,
work_efficiencys:false,
+ task_pass: false, //是否允许跳关
}
// console.log("获取到的值")
// console.log("Trainingjobsetting")
@@ -272,6 +273,7 @@ class Trainingjobsetting extends Component {
publish_timebool:publish_timebools,
end_timebool:end_timebools,
late_timesbool:late_timess,
+ task_pass: result.data.task_pass,
rules:array,
rulest:arrays,
rulesdata:rulesdatas,
@@ -701,33 +703,51 @@ class Trainingjobsetting extends Component {
// console.log(e.target.checked);
}
- //数据表创建
+ //是否跳关设置
onChangedatasheet = (e, index) => {
+
var challenge_settings = this.state.challenge_settings;
- var bool= false;
- for (var i = 0; i < challenge_settings.length; i++) {
- if (i === index) {
- if (challenge_settings[i].checked === true) {
- challenge_settings[i].checked = false
- bool=false;
- } else {
- challenge_settings[i].checked = true
- bool=true;
- }
- }
- }
- for (var i = 0; i < challenge_settings.length; i++) {
- if(bool=== true){
- if (i < index) {
- challenge_settings[i].checked = true
- }
- }else{
- if (i > index) {
- challenge_settings[i].checked = false
- }
- }
+ let {task_pass} = this.state;
+ if (task_pass === true) {
+ // 可以跳关
+ for (var i = 0; i < challenge_settings.length; i++) {
+ if (i === index) {
+ if (challenge_settings[i].checked === true) {
+ challenge_settings[i].checked = false
+ } else {
+ challenge_settings[i].checked = true
+ }
+ }
+ }
+ } else {
+ //不能跳关
+ var bool= false;
+ //先判断如果是点击的关口 checked 根据点击进行切换
+ for (var i = 0; i < challenge_settings.length; i++) {
+ if (i === index) {
+ if (challenge_settings[i].checked === true) {
+ challenge_settings[i].checked = false
+ bool=false;
+ } else {
+ challenge_settings[i].checked = true
+ bool=true;
+ }
+ }
+ }
+ //小于被选中的checked 都被选中 如果是大于被选中的checked 就全部隐藏掉
+ for (var i = 0; i < challenge_settings.length; i++) {
+ if(bool=== true){
+ if (i < index) {
+ challenge_settings[i].checked = true
+ }
+ }else{
+ if (i > index) {
+ challenge_settings[i].checked = false
+ }
+ }
- }
+ }
+ }
// console.log(e.target.checked)
// console.log(index)
this.setState({
@@ -2085,7 +2105,7 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm';
- let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
+ let {flagPageEdit, testscripttiptype, publish_timebool, end_timebool, late_timesbool, work_efficiencys, flagPageEdits, flagPageEditstwo, flagPageEditsbox, whethertopay, handclass, flagPageEditsthrees, flagPageEditsfor, rules, rulest, unifiedsetting, group_settings, course_group, unit_e_tip, borreds, borredss, unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles, task_pass} = this.state;
// console.log(publish_timebool);
// console.log(!flagPageEditstwo);
const radioStyle = {
@@ -2511,7 +2531,8 @@ class Trainingjobsetting extends Component {
关卡名称(需要学生完成的任务请选中,暂不支持跳关选择)
+ className="color-orange-tip font-14 ml10">{task_pass === false ? "(请选中需要学生完成的关卡,该实训不支持跳关学习)" : "(请选中需要学生完成的关卡,该实训支持跳关学习)"}
+
{this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => {
return (
@@ -2528,6 +2549,7 @@ class Trainingjobsetting extends Component {
value={object.challenge_score}
/>
分
+ {object.difficulty}
)
})}