From 05150461ca543e3eff7f869a24f4813e47bd4d8c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 03 Aug 2021 14:59:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
---
src/views/exam/startexam.vue | 166 ++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 133 insertions(+), 33 deletions(-)
diff --git a/src/views/exam/startexam.vue b/src/views/exam/startexam.vue
index ebd62f0..37abb00 100644
--- a/src/views/exam/startexam.vue
+++ b/src/views/exam/startexam.vue
@@ -6,7 +6,7 @@
* menu-name 考试管理
*/
<template>
- <el-row class="morpheus-box-exam">
+ <el-row class="morpheus-box-paper">
<el-col :span="24">
<el-card>
@@ -25,7 +25,10 @@
@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">
@@ -49,6 +52,14 @@
</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">
<el-tag>{{row.examStatus == 0 ? '已发布' : '草稿'}}</el-tag>
@@ -59,10 +70,10 @@
<el-button type="text"
size="mini"
- icon="icon-kaoshi"
+ icon="el-icon-collection"
class="start-kaoshi"
- @click="startExam(row)">开始考试
+ @click="startExam(row)">报名清册
</el-button>
</template>
@@ -78,6 +89,9 @@
<script>
import {
getList,
+ add,
+ remove,
+ update
} from "@/api/examapi/examination";
@@ -102,10 +116,10 @@
form: {},
questionBankOption: {
// 操作栏多余按钮去除
- delBtn: false,
- editBtn: false,
- addBtn: false,
- selection: false,
+ delBtn: true,
+ editBtn: true,
+ addBtn: true,
+ selection: true,
menu: true,
// 导出按钮
excelBtn: false,
@@ -124,13 +138,13 @@
//dialogType: 'drawer',
dialogClickModal: false,
// 操作栏宽度
- menuWidth: 246,
+ menuWidth: 280,
labelWidth: 140,
column: [
{
- label: "试卷名称",
+ label: "考试名称",
prop: "examName",
search: true,
searchSpan: 5,
@@ -153,26 +167,26 @@
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",
@@ -374,11 +388,97 @@
},
startExam (row) {
- this.$router.push({
- path: `/startexam/${row.id}`,
- query: row
+ //正式考试
+ if(row.examType==1){
+ this.$router.push({
+ path: `/applydetailed`,
+ query: row
+ })
+ }
+
+ //模拟考试
+ if(row.examType==2){
+ this.$router.push({
+ path: `/trainApply`,
+ 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>
--
Gitblit v1.9.3