| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="form" ref="form" label-width="200px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="考生:" prop="menuIds" required> |
| | | <el-select v-model="form.menuIds" :collapse-tags="true" multiple placeholder="请选择" @focus="selectStudent" |
| | | popper-class="examinee-popper" |
| | | > |
| | | <el-form-item label="考生:" prop="examineeList" required> |
| | | <el-select v-model="form.examineeList" :collapse-tags="true" multiple placeholder="请选择" @focus="selectStudent" |
| | | popper-class="examinee-popper"> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="课目:" prop="subjectId" required> |
| | |
| | | <el-button type="primary" @click="selectStudent">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <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 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> |
| | | <el-table-column prop="realName" label="学员" /> |
| | | </el-table> |
| | |
| | | suggestTime: null, |
| | | titleItems: [], |
| | | subjectSource: {}, |
| | | questionTypeVMS: [] |
| | | questionTypeVMS: [], |
| | | examineeList: [] |
| | | }, |
| | | subjectFilter: null, |
| | | formLoading: false, |
| | | rules: { |
| | | menuIds: [ |
| | | examineeList: [ |
| | | { required: true, message: '请选择', trigger: 'change' } |
| | | ], |
| | | subjectId: [ |
| | |
| | | total: 0 |
| | | }, |
| | | currentTitleItem: null, |
| | | |
| | | |
| | | examineeList: [], |
| | | |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | _this.formLoading = true; |
| | | examPaperApi.select(id).then(re => { |
| | | _this.form = re.response; |
| | | _this.form.menuIds = JSON.parse(re.response.menuIds); |
| | | // _this.form.menuIds = JSON.parse(re.response.menuIds); |
| | | _this.examineeList = JSON.parse(re.response.userIds).map(item => item.realName); |
| | | console.log(_this.form); |
| | | _this.formLoading = false; |
| | | }); |
| | |
| | | |
| | | this.$nextTick(() => { |
| | | this.tableData.map(data => { |
| | | if (this.form.menuIds.find(item => item === data.id)) { |
| | | if (this.form.userIds.find(item => item === data.id)) { |
| | | this.$refs.multipleTable.toggleRowSelection(data, true); |
| | | } else { |
| | | this.$refs.multipleTable.toggleRowSelection(data, false); |
| | |
| | | tempForm.subjectId = tempForm.subjectId; |
| | | }; |
| | | tempForm.userIds = tempForm.menuIds; |
| | | tempForm.menuIds = JSON.stringify(tempForm.menuIds); |
| | | // tempForm.menuIds = JSON.stringify(tempForm.menuIds); |
| | | |
| | | if (tempForm.questionTypeVMS == null) { |
| | | tempForm.questionTypeVMS = []; |
| | |
| | | this.questionPage.showDialog = false; |
| | | }, |
| | | confirmStudentSelect() { |
| | | this.form.menuIds = this.student.multipleSelection.map((item) => item.id); |
| | | // this.form.menuIds = this.student.multipleSelection.map((item) => item.id); |
| | | this.form.userIds = this.student.multipleSelection.map((item) => { |
| | | return { |
| | | id: item.id, |
| | | realName: item.realName |
| | | }; |
| | | }); |
| | | this.form.examineeList = this.student.multipleSelection.map((item) => item.realName); |
| | | |
| | | this.studentDialog = false; |
| | | }, |
| | | |
| | |
| | | paperTypeEnum: state => state.exam.examPaper.paperTypeEnum, |
| | | levelEnum: state => state.user.levelEnum |
| | | }), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | ...mapState('exam', { subjects: state => state.subjects }), |
| | | |
| | | examineeFormat() { |
| | | return this.examineeList.map(item => item.realName); |
| | | } |
| | | } |
| | | }; |
| | | </script> |