提交 91c4a786 编写于 作者: a1695929110's avatar a1695929110
...@@ -49,7 +49,13 @@ ...@@ -49,7 +49,13 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card style="margin-top: 20px"> <el-card style="margin-top: 20px">
<el-table :data="competeList" stripe border style="width: 100%"> <el-table
:data="competeList"
stripe
border
style="width: 100%"
@sort-change="onSortChange"
>
<!-- <el-table-column label="序号" width="50" align="center"> <!-- <el-table-column label="序号" width="50" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{
...@@ -95,7 +101,8 @@ ...@@ -95,7 +101,8 @@
width="200" width="200"
align="center" align="center"
header-align="center" header-align="center"
sortable sortable="custom"
:sort-orders="['1', '2']"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -179,6 +186,7 @@ export default { ...@@ -179,6 +186,7 @@ export default {
}, },
], ],
}, },
type: 0,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
pageTotal: 8, pageTotal: 8,
...@@ -374,6 +382,7 @@ export default { ...@@ -374,6 +382,7 @@ export default {
teacherNo: localStorage.getItem("userId").replace(/\"/g, ""), //去掉双引号 teacherNo: localStorage.getItem("userId").replace(/\"/g, ""), //去掉双引号
page: this.currentPage, page: this.currentPage,
limit: this.pageSize, limit: this.pageSize,
type: this.type,
}, },
}) })
.then((res) => { .then((res) => {
...@@ -428,6 +437,7 @@ export default { ...@@ -428,6 +437,7 @@ export default {
teacherNo: localStorage.getItem("userId"), teacherNo: localStorage.getItem("userId"),
page: this.currentPage, page: this.currentPage,
limit: this.pageSize, limit: this.pageSize,
type: this.type,
}, },
}) })
.then((res) => { .then((res) => {
...@@ -511,6 +521,7 @@ export default { ...@@ -511,6 +521,7 @@ export default {
teacherNo: localStorage.getItem("userId").replace(/\"/g, ""), //去掉双引号 teacherNo: localStorage.getItem("userId").replace(/\"/g, ""), //去掉双引号
page: this.currentPage, page: this.currentPage,
limit: this.pageSize, limit: this.pageSize,
type: this.type,
// limit: 30, // limit: 30,
// token:localStorage.token // token:localStorage.token
// headers:{token:localStorage.token}, // headers:{token:localStorage.token},
...@@ -541,6 +552,39 @@ export default { ...@@ -541,6 +552,39 @@ export default {
return this.$message.error("获取竞赛列表信息失败!"); return this.$message.error("获取竞赛列表信息失败!");
}); });
}, },
//分页升降序
onSortChange({ prop, order }) {
if (order == "ascending") this.type = 1;
else this.type = 2;
this.$axios({
method: "get",
url: "http://124.220.174.249:8085/backend/teacher/showAllCompetitions",
headers: { token: localStorage.token },
params: {
// teacherNo: 101,
teacherNo: localStorage.getItem("userId").replace(/\"/g, ""), //去掉双引号
page: this.currentPage,
limit: this.pageSize,
type: this.type,
},
})
.then((res) => {
console.log(res);
if (res.data.code == "200") {
this.competeList = res.data.data;
console.log("res.data.data");
console.log(this.competeList);
console.log("res.data.details.infoCount");
console.log(res.data.details.infoCount);
console.log(res.data.data.length);
this.pageTotal = Number(res.data.details.infoCount);
console.log("res.data.data");
}
})
.catch((err) => {
return this.$message.error("获取竞赛列表信息失败!");
});
},
}, },
}; };
</script> </script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册