dev_auth
杨树林 5 years ago
parent 932779e882
commit 1076926607

@ -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) => (
<span>
<a href="javascript:;"
@ -131,7 +131,6 @@ function buildColumns(that, student_works, studentData) {
title: '分班',
key: 'group_name',
dataIndex: 'group_name',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a>
@ -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) => (
<span>
@ -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 (
<span>
@ -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 });

@ -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) => (
<span className="maxnamewidth110">
{record.stduynumber === undefined ?
@ -1091,6 +1093,7 @@ class Listofworksstudentone extends Component {
key: 'finalscore',
align: 'center',
className: 'font-14',
sorter: true,
render: (text, record) => (
<span>
{
@ -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 {
`
}
</style>
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12">
{orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funordert("update_time")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>
<li><a onClick={(e) => this.funordert("work_score")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li>
<li><a onClick={(e) => this.funordert("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>
</ul>
</li>
</ul>
</div>
{/*<div className="fr edu-menu-panel">*/}
{/* <ul>*/}
{/* <li className="edu-position edu-position-hidebox">*/}
{/* <a className="font-12">*/}
{/* {orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a>*/}
{/* <i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/}
{/* <ul className="edu-position-hide undis mt10">*/}
{/* <li><a onClick={(e) => this.funordert("update_time")} data-remote="true"*/}
{/* className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>*/}
{/* <li><a onClick={(e) => this.funordert("work_score")} data-remote="true"*/}
{/* className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li>*/}
{/* <li><a onClick={(e) => this.funordert("student_id")} data-remote="true"*/}
{/* className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>*/}
{/* </ul>*/}
{/* </li>*/}
{/* </ul>*/}
{/*</div>*/}
</div>
@ -3514,6 +3588,7 @@ class Listofworksstudentone extends Component {
dataSource={datajs}
columns={columns}
pagination={false}
onChange={this.table1handleChange}
loading={loadingstate}
/>}
</div>

Loading…
Cancel
Save