| | |
| | | }] |
| | | }, |
| | | { |
| | | label: "试卷分数", |
| | | prop: "totalScore", |
| | | slot: true, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: true, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | |
| | | rules: [{ validator: validatePass, required: true, trigger: 'blur' }], |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "考试时间", |
| | | prop: "examTime", |
| | | type: "daterange", |
| | |
| | | * menu-name 考试管理 |
| | | */ |
| | | <template> |
| | | <el-row class="morpheus-box-exam"> |
| | | <el-row class="morpheus-box-paper"> |
| | | <el-col :span="24"> |
| | | <el-card> |
| | | |
| | |
| | | @search-change="questionBankSearchChange" |
| | | @search-reset="questionBankSearchReset" |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange"> |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-update="questionBankRowUpdate" |
| | | @row-del="questionBankRowDel"> |
| | | |
| | | <!-- 自定义按钮 --> |
| | | <!-- <template slot="menuLeft"> |
| | |
| | | @click="handleDelete">导出 |
| | | </el-button> |
| | | </template> --> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | @click="questionBankHandleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" |
| | | slot="examStatus"> |
| | |
| | | <script> |
| | | import { |
| | | getList, |
| | | add, |
| | | remove, |
| | | update |
| | | } from "@/api/examapi/examination"; |
| | | |
| | | |
| | |
| | | form: {}, |
| | | questionBankOption: { |
| | | // 操作栏多余按钮去除 |
| | | delBtn: false, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | selection: false, |
| | | delBtn: true, |
| | | editBtn: true, |
| | | addBtn: true, |
| | | selection: true, |
| | | menu: true, |
| | | // 导出按钮 |
| | | excelBtn: false, |
| | |
| | | //dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | // 操作栏宽度 |
| | | menuWidth: 246, |
| | | menuWidth: 280, |
| | | |
| | | labelWidth: 140, |
| | | |
| | |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "试卷分数", |
| | | prop: "totalScore", |
| | | slot: true, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: true, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | // { |
| | | // label: "试卷分数", |
| | | // prop: "totalScore", |
| | | // slot: true, |
| | | // // 表单新增时是否禁止 |
| | | // addDisabled: false, |
| | | // // 表单新增时是否可见 |
| | | // addDisplay: true, |
| | | // // 表单新增时是否为查看模式 |
| | | // addDetail: false, |
| | | // // 表单编辑时是否禁止 |
| | | // editDisabled: false, |
| | | // // 表单编辑时是否可见 |
| | | // editDisplay: true, |
| | | // // 表单编辑时是否为查看模式 |
| | | // editDetail: false, |
| | | |
| | | rules: [{ validator: validatePass, required: true, trigger: 'blur' }], |
| | | width: 100 |
| | | }, |
| | | // rules: [{ validator: validatePass, required: true, trigger: 'blur' }], |
| | | // width: 100 |
| | | // }, |
| | | { |
| | | label: "考试时间", |
| | | prop: "examTime", |
| | |
| | | path: `/startexam/${row.id}`, |
| | | query: row |
| | | }) |
| | | } |
| | | }, |
| | | // 新增 |
| | | questionBankRowSave (row, done, loading) { |
| | | row.startTime = row.examTime[0] |
| | | row.endTime = row.examTime[1] |
| | | row.examTime = JSON.stringify(row.examTime) |
| | | add(row).then(() => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | questionBankRowUpdate (row, index, done, loading) { |
| | | if (Array.isArray(row.examTime) != true) { |
| | | row.examTime = row.examTime.split(",") |
| | | } |
| | | row.startTime = row.examTime[0] |
| | | row.endTime = row.examTime[1] |
| | | row.examTime = JSON.stringify(row.examTime) |
| | | update(row).then(() => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | questionBankRowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | questionBankHandleDelete () { |
| | | if (this.questionBankSelectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.questionBankCrud.toggleSelection(); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |