|
@@ -65,9 +65,10 @@
|
|
|
<div class="right">
|
|
|
<span :class="{ active: stype == 1 }" @click="checkDataType(1)">按题目查看</span>
|
|
|
<span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
|
|
|
+ <span :class="{ active: stype == 3 }" @click="checkDataType(3)">按数量查看</span>
|
|
|
</div>
|
|
|
<div class="left">
|
|
|
- <div style="margin-right: 10px;position: relative;" v-if="stype == 2">
|
|
|
+ <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
|
|
|
<el-input v-model="courseName" class="student_input" placeholder="请输入需要搜索的姓名"></el-input>
|
|
|
<span class="serach_icon" @click="searchCourse"></span>
|
|
|
</div>
|
|
@@ -205,6 +206,67 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+ <div class="table_content" v-if="stype == 3">
|
|
|
+ <div class="student_table">
|
|
|
+ <el-table
|
|
|
+ ref="table"
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ :height="tableHeight"
|
|
|
+ :fit="true"
|
|
|
+ v-loading="isLoading"
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="username"
|
|
|
+ label="提交人"
|
|
|
+ min-width="15"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="time"
|
|
|
+ label="提交时间"
|
|
|
+ min-width="15"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="time"
|
|
|
+ label="是否批改"
|
|
|
+ min-width="15"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.type == 3 ? '是' : '否' }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="200px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click="getTest(scope.row)"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="student_page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -356,7 +418,7 @@ export default {
|
|
|
if (this.stype == 1) {
|
|
|
return
|
|
|
}
|
|
|
- this.tableHeight = this.$refs.stepBox.offsetHeight - 100;
|
|
|
+ this.tableHeight = this.$refs.stepBox.offsetHeight - 120;
|
|
|
if (this.tableHeight <= 530) {
|
|
|
this.tableHeight = 530;
|
|
|
}
|
|
@@ -366,7 +428,7 @@ export default {
|
|
|
if (self.stype == 1) {
|
|
|
return
|
|
|
}
|
|
|
- self.tableHeight = this.$refs.stepBox.offsetHeight - 100;
|
|
|
+ self.tableHeight = this.$refs.stepBox.offsetHeight - 120;
|
|
|
if (self.tableHeight <= 530) {
|
|
|
self.tableHeight = 530;
|
|
|
}
|
|
@@ -375,7 +437,7 @@ export default {
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
this.page = val;
|
|
|
- this.getData();
|
|
|
+ this.getData2();
|
|
|
},
|
|
|
getTest(row) {
|
|
|
this.$router.push(
|
|
@@ -400,12 +462,20 @@ export default {
|
|
|
if (this.stype != type) {
|
|
|
this.stype = type
|
|
|
this.courseName = ''
|
|
|
- this.getData();
|
|
|
+ if(type == 3){
|
|
|
+ this.getData2();
|
|
|
+ }else{
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
this.changeHeight();
|
|
|
}
|
|
|
},
|
|
|
searchCourse() {
|
|
|
- this.getData()
|
|
|
+ if(this.stype == 3){
|
|
|
+ this.getData2()
|
|
|
+ }else{
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
},
|
|
|
getData() {
|
|
|
this.isLoading = true;
|
|
@@ -507,6 +577,25 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ getData2() {
|
|
|
+ this.isLoading = true;
|
|
|
+ let params = {
|
|
|
+ cid: this.cid,
|
|
|
+ page: this.page,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ cn: this.courseName
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "getTestWorksPage3", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
+ this.tableData = res.data[0];
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
setJSON(json) {
|
|
|
return json.filter((item) => {
|
|
|
if (item.array) {
|
|
@@ -690,7 +779,11 @@ export default {
|
|
|
.post(_this.$store.state.api + "deleteTestCourseWorks", params)
|
|
|
.then((res) => {
|
|
|
_this.$message.success("删除成功");
|
|
|
- _this.getData();
|
|
|
+ if(_this.stype == 3){
|
|
|
+ _this.getData2();
|
|
|
+ }else{
|
|
|
+ _this.getData();
|
|
|
+ }
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -882,6 +975,7 @@ export default {
|
|
|
padding: 0 15px 10px;
|
|
|
display: flex;
|
|
|
align-items: flex-end;
|
|
|
+ height: 50px;
|
|
|
}
|
|
|
|
|
|
.search_nav>.right {
|