From 2d1f7bd9e68a2ee60bbd1adcc9cd43c94db08c0d Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期三, 24 七月 2024 15:05:37 +0800 Subject: [PATCH] feat:选人增加姓名 --- src/views/exam/paper/edit.vue | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/views/exam/paper/edit.vue b/src/views/exam/paper/edit.vue index a269634..09df0c0 100644 --- a/src/views/exam/paper/edit.vue +++ b/src/views/exam/paper/edit.vue @@ -155,6 +155,7 @@ </el-select> --> <el-cascader clearable + collapse-tags v-model="student.deptIds" :options="depts" :props="{ emitPath: false, multiple: true, value: 'id', label: 'name', checkStrictly: true }" @@ -164,6 +165,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 +196,7 @@ components: { Pagination, QuestionShow }, data() { return { + selectAllBoolean: true, tags: [], depts: [], studentDialog: false, @@ -220,6 +223,7 @@ }, subjectIdList: [], form: { + deptId: '', menuIds: [], aggregateSource: 100, id: null, @@ -230,7 +234,10 @@ limitDateTime: [], name: '', suggestTime: null, - titleItems: [], + titleItems: [{ + name: '', + questionItems: [] + }], subjectSource: {}, questionTypeVMS: [], examineeList: [], @@ -276,12 +283,18 @@ }; }, created() { + // departmentApi.getCurrentDeptId().then(res => { + // if (res.response && res.response[0]) { + // this.form.deptId = res.response[0]; + // } + // }); let id = this.$route.query.id; let _this = this; this.initSubject(function () { _this.subjectFilter = _this.subjects; }); if (id && parseInt(id) !== 0) { + _this.selectAllBoolean = false; _this.formLoading = true; examPaperApi.select(id).then(re => { const { userIds, userNames } = re.response; @@ -324,7 +337,22 @@ this.student.listLoading = true; this.getStudent(); }, - + selectAll () { + 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.selectAllBoolean = false; + }) + this.getStudent(); + }); + }, + unselectAll () { + this.$refs.multipleTable.clearSelection(); + this.selectAllBoolean = true; + }, getStudent() { this.student.listLoading = true; examPaperApi.selectStudent(this.student).then(res => { -- Gitblit v1.8.0