龚焕茏
2024-07-08 c19bb5ac1b4013aa700c0a658f20375be9703ea3
src/views/exam/paper/edit.vue
@@ -164,6 +164,7 @@
          <el-button type="primary" @click="selectStudent">查询</el-button>
        </el-form-item>
      </el-form>
      <el-button type="primary" @click="selectAllBoolean ? selectAll() : unselectAll()">{{ selectAllBoolean ? '全选' : '取消全选' }}</el-button>
      <el-table ref="multipleTable" v-loading="student.listLoading" :data="tableData" border fit highlight-current-row
        style="width: 100%" @selection-change="handleSelection" row-key="id">
        <el-table-column type="selection" :reserve-selection="true"></el-table-column>
@@ -194,6 +195,7 @@
  components: { Pagination, QuestionShow },
  data() {
    return {
      selectAllBoolean: true,
      tags: [],
      depts: [],
      studentDialog: false,
@@ -324,7 +326,22 @@
      this.student.listLoading = true;
      this.getStudent();
    },
    selectAll () {
      this.selectAllBoolean = false;
      let param = { ...this.student };
      param.pageSize = 999999;
      examPaperApi.selectStudent(param).then(res => {
        this.handleSelection(res.response.list);
        res.response.list.forEach(item => {
          this.$refs.multipleTable.toggleRowSelection(item, true);
        })
        this.getStudent();
      });
    },
    unselectAll () {
      this.selectAllBoolean = true;
      this.$refs.multipleTable.clearSelection();
    },
    getStudent() {
      this.student.listLoading = true;
      examPaperApi.selectStudent(this.student).then(res => {