| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-05 16:31:54 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-11-23 14:16:42 |
| | | * menu-name 考试管理 |
| | | */ |
| | | /* * @Author: Morpheus * @Date: 2021-07-05 16:31:54 * @Last Modified by: liu * |
| | | @Last Modified time: 2021-11-23 14:16:42 * menu-name 考试管理 */ |
| | | <template> |
| | | <el-row class="morpheus-box-paper"> |
| | | <el-col :span="24"> |
| | | <el-card> |
| | | <div |
| | | :class="[ |
| | | 'exam-card-body', |
| | | $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '', |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | v-model="form" |
| | | class="company-box" |
| | | :option="questionBankOption" |
| | | :search.sync="questionBankSearch" |
| | | :table-loading="questionBankLoading" |
| | | :data="questionBankData" |
| | | :permission="permissionList" |
| | | ref="questionBankCrud" |
| | | :page.sync="questionBankPage" |
| | | @on-load="questionBankOnLoad" |
| | | @selection-change="questionBankSelectionChange" |
| | | @search-change="questionBankSearchChange" |
| | | @search-reset="questionBankSearchReset" |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-update="questionBankRowUpdate" |
| | | @row-del="questionBankRowDel" |
| | | > |
| | | <!-- 自定义按钮 --> |
| | | <!-- <template slot="menuLeft"> |
| | | <basic-container |
| | | :class="[ |
| | | 'exam-card-body', |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | v-model="form" |
| | | class="company-box tablesss" |
| | | :option="questionBankOption" |
| | | :search.sync="questionBankSearch" |
| | | :table-loading="questionBankLoading" |
| | | :data="questionBankData" |
| | | :permission="permissionList" |
| | | ref="questionBankCrud" |
| | | :page.sync="questionBankPage" |
| | | @on-load="questionBankOnLoad" |
| | | @selection-change="questionBankSelectionChange" |
| | | @search-change="questionBankSearchChange" |
| | | @search-reset="questionBankSearchReset" |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-update="questionBankRowUpdate" |
| | | @row-del="questionBankRowDel" |
| | | > |
| | | <!-- 自定义按钮 --> |
| | | <!-- <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | |
| | | </el-button> |
| | | </template> --> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | style="display: none" |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.startexam_delete" |
| | | @click="questionBankHandleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | style="display: none" |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.startexam_delete" |
| | | @click="questionBankHandleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="examStatus"> |
| | | <el-tag>{{ row.examStatus == 0 ? "已发布" : "草稿" }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="examStatus"> |
| | | <el-tag>{{ row.examStatus == 0 ? "已发布" : "草稿" }}</el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | icon="el-icon-collection" |
| | | class="start-kaoshi" |
| | | v-if="permission.startexam_applyPapers" |
| | | @click="startExam(row)" |
| | | >报名清册 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <template slot-scope="{ row }" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | icon="el-icon-collection" |
| | | class="start-kaoshi" |
| | | v-if="permission.startexam_applyPapers" |
| | | @click="startExam(row)" |
| | | >报名清册 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | |
| | | labelWidth: 140, |
| | | ...this.$store.state.control.clearOtherBut, |
| | | ...this.$store.state.control.searchOpen, |
| | | column: [ |
| | | { |
| | | label: "考试名称", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入试卷名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // label: "试卷分数", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择考试时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // label: "考试结束时间", |
| | |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | hide: true, |
| | | display: false, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "备注", |
| | |
| | | // 表单编辑时是否可见 |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | editDetail: false |
| | | }, |
| | | { |
| | | label: "注意事项", |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | width: 240, |
| | | }, |
| | | ], |
| | | width: 240 |
| | | } |
| | | ] |
| | | }, |
| | | questionBankSearch: {}, |
| | | questionBankLoading: true, |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 16, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | questionBankQuery: {}, |
| | | questionBankSelectionList: [], |
| | | questionBankSelectionList: [] |
| | | }; |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | computed: { |
| | | ids() { |
| | | let ids = []; |
| | | this.questionBankSelectionList.forEach((ele) => { |
| | | this.questionBankSelectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | |
| | | addBtn: this.vaildData(this.permission.startexam_add, false), |
| | | viewBtn: this.vaildData(this.permission.startexam_view, false), |
| | | delBtn: this.vaildData(this.permission.startexam_delete, false), |
| | | editBtn: this.vaildData(this.permission.startexam_edit, false), |
| | | editBtn: this.vaildData(this.permission.startexam_edit, false) |
| | | }; |
| | | }, |
| | | } |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.questionBankQuery) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.questionBankPage.total = data.total; |
| | | this.questionBankData = data.records; |
| | | this.questionBankLoading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.questionBankSelectionClear(); |
| | | }); |
| | | }, |
| | |
| | | if (row.examType == 1) { |
| | | this.$router.push({ |
| | | path: `/applydetailed`, |
| | | query: row, |
| | | query: row |
| | | }); |
| | | } |
| | | |
| | |
| | | if (row.examType == 2) { |
| | | this.$router.push({ |
| | | path: `/trainApply`, |
| | | query: row, |
| | | query: row |
| | | }); |
| | | } |
| | | }, |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.questionBankCrud.toggleSelection(); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | </style> |
| | | <style lang="scss" scoped></style> |