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

@ -112,7 +112,7 @@ function buildColumns(that, student_works, studentData) {
title: '学号', title: '学号',
dataIndex: 'student_id', dataIndex: 'student_id',
key: 'student_id', key: 'student_id',
sorter: (a, b) => a.student_id - b.student_id,
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" <a href="javascript:;"
@ -131,9 +131,8 @@ function buildColumns(that, student_works, studentData) {
title: '分班', title: '分班',
key: 'group_name', key: 'group_name',
dataIndex: 'group_name', dataIndex: 'group_name',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a> <a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a>
</span> </span>
), ),
@ -201,6 +200,7 @@ function buildColumns(that, student_works, studentData) {
title: '更新时间', title: '更新时间',
dataIndex: 'update_time', dataIndex: 'update_time',
key: 'update_time', key: 'update_time',
sorter: (a, b) => a.update_time - b.update_time,
render: (update_time, record) => ( render: (update_time, record) => (
<span> <span>
@ -306,10 +306,12 @@ function buildColumns(that, student_works, studentData) {
} }
if (!niPingAndIsStudent) { if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 70, width: '113px',
title: '最终成绩', title: '最终成绩',
key: 'work_score', key: 'work_score',
dataIndex: 'work_score', dataIndex: 'work_score',
sorter: (a, b) => a.work_score - b.work_score,
render: (work_score, record) => { render: (work_score, record) => {
return ( return (
<span> <span>
@ -412,6 +414,7 @@ class CommonWorkList extends Component{
} }
componentDidMount() { componentDidMount() {
console.log("CommonWorkList 分班list 开始加载");
this.fetchList() this.fetchList()
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
$("html").animate({ scrollTop: $('html').scrollTop() - 100 }); $("html").animate({ scrollTop: $('html').scrollTop() - 100 });

@ -818,6 +818,7 @@ class Listofworksstudentone extends Component {
}, },
], ],
b_order: "desc", b_order: "desc",
myorders: "desc",
allow_late: false, allow_late: false,
checkedValuesine: undefined, checkedValuesine: undefined,
checkedValuesineinfo: [], checkedValuesineinfo: [],
@ -872,6 +873,7 @@ class Listofworksstudentone extends Component {
key: 'stduynumber', key: 'stduynumber',
align: "center", align: "center",
className: 'font-14 maxnamewidth110', className: 'font-14 maxnamewidth110',
sorter: true,
render: (text, record) => ( render: (text, record) => (
<span className="maxnamewidth110"> <span className="maxnamewidth110">
{record.stduynumber === undefined ? {record.stduynumber === undefined ?
@ -1091,6 +1093,7 @@ class Listofworksstudentone extends Component {
key: 'finalscore', key: 'finalscore',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
sorter: true,
render: (text, record) => ( render: (text, record) => (
<span> <span>
{ {
@ -1530,6 +1533,7 @@ class Listofworksstudentone extends Component {
// } // }
// //
// } // }
componentDidMount() { componentDidMount() {
// console.log("componentDidMount "); // console.log("componentDidMount ");
// console.log("调用子组件 "); // console.log("调用子组件 ");
@ -1548,6 +1552,68 @@ class Listofworksstudentone extends Component {
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid, false); 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=()=>{ // tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid; // 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 //要提交的作品状态checkedValuesine
//要提交的分班状态checkedValuesineinfo //要提交的分班状态checkedValuesineinfo
//searchtext 输入的姓名和学号 //searchtext 输入的姓名和学号
@ -2285,10 +2351,18 @@ class Listofworksstudentone extends Component {
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
let urll = `/homework_commons/${homeworkid}/works_list.json?`; let urll = `/homework_commons/${homeworkid}/works_list.json?`;
var order = "asc"; var order = this.state.order;
if (ordervlue === "update_time") {
order = "desc"; try {
if (myorders === null || myorders === undefined) {
} else {
order = myorders;
}
} catch (e) {
} }
var checkedValuesines = checkedValuesine; var checkedValuesines = checkedValuesine;
var checkedValuesineinfos = checkedValuesineinfo; var checkedValuesineinfos = checkedValuesineinfo;
var searchtexts = searchtext var searchtexts = searchtext
@ -2591,7 +2665,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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) { } else if (checkedValues.length === data.length) {
this.setState({ this.setState({
unlimited: 0, unlimited: 0,
@ -2599,7 +2673,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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 { } else {
// console.log(checkedValues); // console.log(checkedValues);
this.setState({ this.setState({
@ -2608,7 +2682,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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, loadingstate: true,
page: 1, 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) { } else if (checkedValues.length === data.length) {
this.setState({ this.setState({
unlimitedtwo: 1, unlimitedtwo: 1,
@ -2634,7 +2708,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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 { } else {
this.setState({ this.setState({
checkedValuesineinfo: checkedValues, checkedValuesineinfo: checkedValues,
@ -2643,7 +2717,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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, page: 1,
limit: 20, 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) // console.log(value)
@ -2692,7 +2766,7 @@ class Listofworksstudentone extends Component {
page: 1, page: 1,
limit: 20, 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", orders: "update_time",
loadingstate: true, 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") { if (e === "work_score") {
@ -2714,7 +2788,7 @@ class Listofworksstudentone extends Component {
orders: "work_score", orders: "work_score",
loadingstate: true, 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") { if (e === "student_id") {
@ -2724,7 +2798,7 @@ class Listofworksstudentone extends Component {
orders: "student_id", orders: "student_id",
loadingstate: true, 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) => { .then((response) => {
if (response.data.status == '0') { if (response.data.status == '0') {
this.setState({visible: false}); 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(`调分成功`); this.props.showNotification(`调分成功`);
} }
}) })
@ -2958,7 +3032,7 @@ class Listofworksstudentone extends Component {
loadingstate: true, loadingstate: true,
page: 1, 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 = () => { notlimitedst = () => {
@ -2969,7 +3043,7 @@ class Listofworksstudentone extends Component {
course_groupysls: undefined, course_groupysls: undefined,
loadingstate: true, 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 = () => { coursetaskend = () => {
@ -3050,8 +3124,7 @@ class Listofworksstudentone extends Component {
page: pageNumber, page: pageNumber,
loadingstate: true, 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 = () => { setComputeTimet = () => {
@ -3454,23 +3527,24 @@ class Listofworksstudentone extends Component {
` `
} }
</style> </style>
<div className="fr edu-menu-panel">
<ul> {/*<div className="fr edu-menu-panel">*/}
<li className="edu-position edu-position-hidebox"> {/* <ul>*/}
<a className="font-12"> {/* <li className="edu-position edu-position-hidebox">*/}
{orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a> {/* <a className="font-12">*/}
<i className="iconfont icon-xiajiantou ml5 font-12 "></i> {/* {orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a>*/}
<ul className="edu-position-hide undis mt10"> {/* <i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/}
<li><a onClick={(e) => this.funordert("update_time")} data-remote="true" {/* <ul className="edu-position-hide undis mt10">*/}
className=" font-12" style={{textAlign: "center"}}>更新时间</a></li> {/* <li><a onClick={(e) => this.funordert("update_time")} data-remote="true"*/}
<li><a onClick={(e) => this.funordert("work_score")} data-remote="true" {/* className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>*/}
className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li> {/* <li><a onClick={(e) => this.funordert("work_score")} data-remote="true"*/}
<li><a onClick={(e) => this.funordert("student_id")} data-remote="true" {/* className=" font-12" style={{textAlign: "center"}}>当前成绩</a></li>*/}
className=" font-12" style={{textAlign: "center"}}>学生学号</a></li> {/* <li><a onClick={(e) => this.funordert("student_id")} data-remote="true"*/}
</ul> {/* className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>*/}
</li> {/* </ul>*/}
</ul> {/* </li>*/}
</div> {/* </ul>*/}
{/*</div>*/}
</div> </div>
@ -3514,6 +3588,7 @@ class Listofworksstudentone extends Component {
dataSource={datajs} dataSource={datajs}
columns={columns} columns={columns}
pagination={false} pagination={false}
onChange={this.table1handleChange}
loading={loadingstate} loading={loadingstate}
/>} />}
</div> </div>

Loading…
Cancel
Save