From bf0d17303691e7c2483e7cfa325a7ef3d8a7b322 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 06 Aug 2021 16:17:34 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/views/applyexam/index.vue            |   22 
 src/views/trainingRegistration/data.js   |    5 
 public/papers.html                       |   16 
 src/api/examapi/examSubjects.js          |   57 +-
 src/views/exam/addsubject.vue            | 1003 +++++++++++++++++++++++++++++++++++++++++++++
 src/views/trainingRegistration/index.vue |   32 
 src/styles/element-ui.scss               |   24 
 src/views/exam/performance.vue           |    3 
 src/views/exam/subject.vue               |  121 +++++
 9 files changed, 1,216 insertions(+), 67 deletions(-)

diff --git a/public/papers.html b/public/papers.html
index c7f8f3d..f4829ce 100644
--- a/public/papers.html
+++ b/public/papers.html
@@ -12,7 +12,7 @@
             justify-content: center;
             flex-direction: column;
         }
-
+        
         .user-info-table {
             margin-top: 30px;
             width: 60%;
@@ -20,25 +20,25 @@
             border: 1px solid #000;
             background-color: #fff;
         }
-
+        
         .user-info-tr {
             height: 50px;
         }
-
+        
         .avatar {
             width: 140px;
             height: 190px;
         }
-
+        
         .title {
             margin-top: 20px;
         }
-
+        
         .avatar {
             width: 140px;
             height: 190px;
         }
-
+        
         .my-picture {
             width: 150px;
             /* height: 200px; */
@@ -121,7 +121,7 @@
             var examType = JSON.parse(getData("data")).examType;
             // console.log(JSON.parse(getData("data")), 111);
 
-            axios.get('http://47.49.21.216:82/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) {
+            axios.get('http://localhost:81/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) {
                 var data = res.data.data;
                 var str = `<span class="title">${data.examName}</span>
                     <span class="title">准考证信息</span>
@@ -204,4 +204,4 @@
         </script>
 </body>
 
-</html>
+</html>
\ No newline at end of file
diff --git a/src/api/examapi/examSubjects.js b/src/api/examapi/examSubjects.js
index 36f863b..b5bd82f 100644
--- a/src/api/examapi/examSubjects.js
+++ b/src/api/examapi/examSubjects.js
@@ -1,37 +1,46 @@
 import request from '@/router/axios';
 
 export const getPaperList = (current, size, params) => {
-  return request({
-    url: '/api/examSubjectChoices/getEexPaperChoices',
-    method: 'get',
-    params: {
-      ...params,
-      current,
-      size
-    }
-  })
+    return request({
+        url: '/api/examSubjectChoices/getEexPaperChoices',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size
+        }
+    })
 }
 
 
 export const updatePaper = (row) => {
-  return request({
-    url: '/api/examSubjectChoices/updateChoicesValue',
-    method: 'post',
-    params: {
-      ...row
-    }
-  })
+    return request({
+        url: '/api/examSubjectChoices/updateChoicesValue',
+        method: 'post',
+        params: {
+            ...row
+        }
+    })
+}
+
+
+export const saveSubjectChoicesAndOption = (row) => {
+    return request({
+        url: '/api/examSubjectChoices/saveSubjectChoicesAndOption',
+        method: 'post',
+        data: row
+    })
 }
 
 
 
 
 export const remove = (params) => {
-  return request({
-    url: '/api/exampaper/UnbindSubject',
-    method: 'get',
-    params: {
-      ...params
-    }
-  })
-}
+    return request({
+        url: '/api/exampaper/UnbindSubject',
+        method: 'get',
+        params: {
+            ...params
+        }
+    })
+}
\ No newline at end of file
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index c59c468..6f6daed 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -20,7 +20,7 @@
 }
 
 .el-menu--display,
-.el-menu--display + .el-submenu__icon-arrow {
+.el-menu--display+.el-submenu__icon-arrow {
     display: none;
 }
 
@@ -49,17 +49,17 @@
 
 .el-dropdown-menu__item--divided:before,
 .el-menu,
-.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
-.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
-.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
+.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
     background-color: transparent;
 }
 
 .el-dropdown-menu__item--divided:before,
 .el-menu,
-.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
-.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
-.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
+.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
     background-color: transparent !important;
 }
 
@@ -136,7 +136,7 @@
 
 .recruitmentManagement .el-card.is-never-shadow.avue-crud__search {
     width: calc(100% - 380px) !important;
-    left: 200px !important;
+    left: 120px !important;
 }
 
 .hasButOne .el-card.is-never-shadow.avue-crud__search {
@@ -160,8 +160,8 @@
 }
 
 .morpheus-box .el-card.is-never-shadow.avue-crud__search {
-    width: calc(100% - 390px) !important;
-    left: 270px !important;
+    width: calc(100% - 590px) !important;
+    left: 420px !important;
 }
 
 .morpheus-box-exam .el-card.is-never-shadow.avue-crud__search {
@@ -246,8 +246,8 @@
 }
 
 //top 导航 按钮
-.el-menu--horizontal > .el-menu-item.is-active,
+.el-menu--horizontal>.el-menu-item.is-active,
 .avue-top,
 .el-dropdown {
     color: #fff !important;
-}
+}
\ No newline at end of file
diff --git a/src/views/applyexam/index.vue b/src/views/applyexam/index.vue
index 469d25a..e084e1a 100644
--- a/src/views/applyexam/index.vue
+++ b/src/views/applyexam/index.vue
@@ -202,7 +202,7 @@
                         label: "考试名称",
                         prop: "examName",
                         type: 'tree',
-                        dicUrl: '/api/exampaper/page-tree',
+                        dicUrl: '/api/exampaper/page-tree?examType=1',
                         // search: true,
                         slot: true,
                         // 表单新增时是否禁止
@@ -528,12 +528,24 @@
         // 新增
         questionBankRowSave (row, done, loading) {
             // debugger;
-            addApply({ userId: row.userId, examId: row.examName, applyTime: row.applyTime }).then(() => {
+            addApply({ userId: row.userId, examId: row.examName, applyTime: row.applyTime }).then((res) => {
                 this.questionBankOnLoad(this.questionBankPage);
-                this.$message({
+                if(res.data.data==201){
+                    this.$message({
+                    type: "warning",
+                    message:"已报名,不能重复报名",
+                    });
+                }else if(res.data.data==201){
+                    this.$message({
+                    type: "warning",
+                    message:"报名失败",
+                    });
+                }else{
+                    this.$message({
                     type: "success",
-                    message: "操作成功!"
-                });
+                    message:"报名成功",
+                    });
+                }
                 done();
             }, error => {
                 window.console.log(error);
diff --git a/src/views/exam/addsubject.vue b/src/views/exam/addsubject.vue
new file mode 100644
index 0000000..8cb7065
--- /dev/null
+++ b/src/views/exam/addsubject.vue
@@ -0,0 +1,1003 @@
+<template>
+    <el-dialog
+      :title="this.id?'修改':'新增'"
+      width="60%"
+      modal-append-to-body='false'
+      append-to-body='true'
+      :close-on-click-model="true"
+      :visible.sync="visible"
+      @close='closeDialog'
+    >
+        <el-row style="margin-left:60px;margin-bottom:40px">
+          <el-radio-group v-model="choicesType">
+            <el-radio label="0">单选题</el-radio>
+            <el-radio label="1">多选题</el-radio>
+            <el-radio label="2">判断题</el-radio>
+            <el-radio label="3">实操题</el-radio>
+          </el-radio-group>
+        </el-row>
+        <avue-form ref="form" :option="option" v-model="form" @submit="submit" v-if="choicesType=='0'"></avue-form>
+        <avue-form ref="formCheckbox" :option="optionCheckbox" v-model="formCheckbox" @submit="submitCheckbox" v-if="choicesType=='1'"></avue-form>
+        <avue-form ref="formJudge" :option="optionJudge" v-model="formJudge" @submit="submitJudge" v-if="choicesType=='2'"></avue-form>
+        <avue-form ref="formFill" :option="optionFill" v-model="formFill" @submit="submitFill" v-if="choicesType=='3'">
+          <template slot="optionContent">
+              <!-- <el-button type="success" icon="el-icon-plus" circle style="margin-bottom:20px" @click="addRows"></el-button>
+              <div v-for="(item,index) in list" :key="index">
+                <div class="optionContent-suffix">
+                  <span>{{index+1}}: </span>
+                  <el-input class="optionContent-input"
+                    placeholder="请输入内容"
+                    v-model="inputs[`input${index + 1}`]">
+                  </el-input>
+                  <el-button type="danger" class="optionContent-botton" icon="el-icon-delete" circle @click="deleteRows(index)"></el-button>
+                </div>
+              </div> -->
+          </template>
+        </avue-form>
+    </el-dialog>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+import {saveSubjectChoicesAndOption} from "@/api/examapi/examSubjects";
+import {getSubjectAnswer} from "@/api/exam/subject";
+
+export default {
+  name: "add",
+  data() {
+    return {
+      inputs:{
+        input1: 1,
+      },
+      optionContentAId:null,
+      optionContentBId:null,
+      optionContentCId:null,
+      optionContentDId:null,
+      arrContent:["1"],
+      list:[
+        {
+          data:1
+        },
+        {
+          data:1
+        },
+        {
+          data:1
+        },
+      ],
+      // index:1,
+      visible:false,
+      choicesType:"0",
+      loading: true,
+      form:{
+        score:1
+      },
+      option: {
+        height: "auto",
+        calcHeight: 80,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: false,
+        stripe: true,
+        align: "center",
+        index: true,
+        selection: true,
+        viewBtn: true,
+        defaultExpandAll: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "题目名称",
+            prop: "subjectName",
+            search: true,
+            type:"textarea",
+            rules: [
+              {
+                required: true,
+                message: "请输入题目名称",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "类型",
+            prop: "tktype",
+            slot: true,
+            type: "checkbox",
+            dicData: [
+              {
+                label: '简易题库',
+                value: 'A'
+              }, 
+              {
+                label: '复杂题库',
+                value: 'B'
+              }, 
+              {
+                label: '模拟题库',
+                value: 'C'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "选项",
+            prop: "",
+            type:"text",
+            span:24
+          },
+          {
+            label: "A",
+            prop: "optionContentA",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "B",
+            prop: "optionContentB",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "C",
+            prop: "optionContentC",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "D",
+            prop: "optionContentD",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "答案",
+            prop: "answer",
+            span: 24,
+            // type: "checkbox",
+            type: "radio",
+            dicData: [
+              {
+                label: 'A',
+                value: 'A'
+              }, 
+              {
+                label: 'B',
+                value: 'B'
+              }, 
+              {
+                label: 'C',
+                value: 'C'
+              }, 
+              {
+                label: 'D',
+                value: 'D'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择答案",
+                trigger: "blur",
+              },
+            ],
+          }, 
+          {
+            label: "解析",
+            prop: "analysis",
+            span:24,
+            type:"textarea"
+          },
+          {
+            label: "分值",
+            prop: "score",
+            span:24,
+            rules: [
+              {
+                required: true,
+                message: "请输入分值",
+                trigger: "blur",
+              },
+            ],
+          },
+          
+        ],
+        
+      },
+      formCheckbox:{
+        score:1
+      },
+      optionCheckbox: {
+        height: "auto",
+        calcHeight: 80,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: false,
+        stripe: true,
+        align: "center",
+        index: true,
+        selection: true,
+        viewBtn: true,
+        defaultExpandAll: true,
+        dialogClickModal: false,
+        column: [
+         {
+            label: "题目名称",
+            prop: "subjectName",
+            search: true,
+            type:"textarea",
+            rules: [
+              {
+                required: true,
+                message: "请输入题目名称",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "类型",
+            prop: "tktype",
+            slot: true,
+            type: "checkbox",
+            dicData: [
+              {
+                label: '简易题库',
+                value: 'A'
+              }, 
+              {
+                label: '复杂题库',
+                value: 'B'
+              }, 
+              {
+                label: '模拟题库',
+                value: 'C'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "选项",
+            prop: "",
+            type:"text",
+            span:24
+          },
+          {
+            label: "A",
+            prop: "optionContentA",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "B",
+            prop: "optionContentB",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "C",
+            prop: "optionContentC",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "D",
+            prop: "optionContentD",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "答案",
+            prop: "answer",
+            span: 24,
+            type: "checkbox",
+            // type: "radio",
+            dicData: [
+              {
+                label: 'A',
+                value: 'A'
+              }, 
+              {
+                label: 'B',
+                value: 'B'
+              }, 
+              {
+                label: 'C',
+                value: 'C'
+              }, 
+              {
+                label: 'D',
+                value: 'D'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择答案",
+                trigger: "blur",
+              },
+            ],
+          }, 
+          {
+            label: "解析",
+            prop: "analysis",
+            span:24,
+            type:"textarea"
+          },
+          {
+            label: "分值",
+            prop: "score",
+            span:24,
+            rules: [
+              {
+                required: true,
+                message: "请输入分值",
+                trigger: "blur",
+              },
+            ],
+          },
+          
+        ],
+        
+      },
+      formJudge:{
+        score:1
+      },
+      optionJudge: {
+        height: "auto",
+        calcHeight: 80,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: false,
+        stripe: true,
+        align: "center",
+        index: true,
+        selection: true,
+        viewBtn: true,
+        defaultExpandAll: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "题目名称",
+            prop: "subjectName",
+            search: true,
+            type:"textarea",
+            rules: [
+              {
+                required: true,
+                message: "请输入题目名称",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "类型",
+            prop: "tktype",
+            slot: true,
+            type: "checkbox",
+            dicData: [
+              {
+                label: '简易题库',
+                value: 'A'
+              }, 
+              {
+                label: '复杂题库',
+                value: 'B'
+              }, 
+              {
+                label: '模拟题库',
+                value: 'C'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          // {
+          //   label: "选项",
+          //   prop: "",
+          //   type:"text",
+          //   span:24
+          // },
+          // {
+          //   label: "正确",
+          //   prop: "optionContentA",
+          //   span:24
+          // },
+          // {
+          //   label: "错误",
+          //   prop: "optionContentB",
+          //   span:24
+          // },
+          {
+            label: "答案",
+            prop: "answer",
+            span: 24,
+            type: "radio",
+            dicData: [
+              {
+                label: '正确',
+                value: '正确'
+              }, 
+              {
+                label: '错误',
+                value: '错误'
+              }
+            ],
+            mock:{
+              type:'dic',
+            },
+            rules: [
+              {
+                required: true,
+                message: "请选择答案",
+                trigger: "blur",
+              },
+            ],
+          }, 
+          {
+            label: "解析",
+            prop: "analysis",
+            span:24,
+            type:"textarea"
+          },
+          {
+            label: "分值",
+            prop: "score",
+            defaultValue:2,
+            span:24,
+            rules: [
+              {
+                required: true,
+                message: "请输入分值",
+                trigger: "blur",
+              },
+            ],
+          },
+          
+        ],
+        
+      },
+      formFill:{
+        score:1
+      },
+      optionFill: {
+        height: "auto",
+        calcHeight: 80,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: false,
+        stripe: true,
+        align: "center",
+        index: true,
+        selection: true,
+        viewBtn: true,
+        defaultExpandAll: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "题目名称",
+            prop: "subjectName",
+            type:"textarea",
+            search: true,
+            rules: [
+              {
+                required: true,
+                message: "请输入题目名称",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "类型",
+            prop: "tktype",
+            slot: true,
+            type: "checkbox",
+            dicData: [
+              {
+                label: '简易题库',
+                value: 'A'
+              }, 
+              {
+                label: '复杂题库',
+                value: 'B'
+              }, 
+              {
+                label: '模拟题库',
+                value: 'C'
+              }
+            ],
+            rules: [
+              {
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              },
+            ],
+            span:24
+          },
+          {
+            label: "选项",
+            prop: "",
+            type:"text",
+            span:24
+          },
+          {
+            label: "1",
+            prop: "optionContent1",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "2",
+            prop: "optionContent2",
+            span:24,
+            placeholder:"请输入内容",
+            rules: [
+              {
+                required: true,
+                message: "请输入内容",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "3",
+            prop: "optionContent3",
+            span:24,
+            placeholder:"请输入内容"
+          },
+          {
+            label: "4",
+            prop: "optionContent4",
+            span:24,
+            placeholder:"请输入内容"
+          },
+          {
+            label: "5",
+            prop: "optionContent5",
+            span:24,
+            placeholder:"请输入内容"
+          },
+          {
+            label: "答案",
+            prop: "answer",
+            span: 24,
+            rules: [
+              {
+                required: true,
+                message: "请输入答案",
+                trigger: "blur",
+              },
+            ],
+          }, 
+          {
+            label: "解析",
+            prop: "analysis",
+            span:24,
+            type:"textarea"
+          },
+          {
+            label: "分值",
+            prop: "score",
+            span:24,
+            rules: [
+              {
+                required: true,
+                message: "请输入分值",
+                trigger: "blur",
+              },
+            ],
+          }
+          
+        ],
+        
+      },
+      data: [],
+    }
+  },
+  computed: {
+    ...mapState({
+            userInfo: state => state.user.userInfo
+        })
+  },
+  mounted() {
+
+  },
+  methods: {
+    //初始化
+    inits(id) {
+      this.id = id || 0;
+      this.visible = true;
+      this.list = [{data:1}]
+      if(this.id){
+        //查询题目信息
+        this.getSubjectInfo(id);
+      }
+    },
+    //查询题目信息
+    getSubjectInfo(id){
+      var that = this;
+      var param = {
+        id:id
+      }
+      getSubjectAnswer((param)).then(res => {
+        var data = res.data.data;
+        that.choicesType = data.choicesType.toString();
+        //单选题
+        if(data.choicesType==0){
+           that.form = data;
+           that.optionContentAId = data.examSubjectOptions[0].id;
+           that.optionContentBId = data.examSubjectOptions[1].id;
+           that.optionContentCId = data.examSubjectOptions[2].id;
+           that.optionContentDId = data.examSubjectOptions[3].id;
+           that.form.optionContentA = data.examSubjectOptions[0].optionContent;
+           that.form.optionContentB = data.examSubjectOptions[1].optionContent;
+           that.form.optionContentC = data.examSubjectOptions[2].optionContent;
+           that.form.optionContentD = data.examSubjectOptions[3].optionContent;
+        }
+        //多选题
+        if(data.choicesType==1){
+           that.formCheckbox = data;
+           that.optionContentAId = data.examSubjectOptions[0].id;
+           that.optionContentBId = data.examSubjectOptions[1].id;
+           that.optionContentCId = data.examSubjectOptions[2].id;
+           that.optionContentDId = data.examSubjectOptions[3].id;
+           that.formCheckbox.optionContentA = data.examSubjectOptions[0].optionContent;
+           that.formCheckbox.optionContentB = data.examSubjectOptions[1].optionContent;
+           that.formCheckbox.optionContentC = data.examSubjectOptions[2].optionContent;
+           that.formCheckbox.optionContentD = data.examSubjectOptions[3].optionContent;
+        }
+        //判断题
+        if(data.choicesType==2){
+           that.formJudge = data;
+        }
+        //实操题
+        if(data.choicesType==3){
+           that.formFill = data;
+           that.formFill.optionContent1 = data.examSubjectOptions[0].optionContent;
+           that.formFill.optionContent2 = data.examSubjectOptions[1].optionContent;
+           that.formFill.optionContent3 = data.examSubjectOptions[2].optionContent;
+           that.formFill.optionContent4 = data.examSubjectOptions[3].optionContent;
+           that.formFill.optionContent5 = data.examSubjectOptions[4].optionContent;
+        }
+      });
+    },
+    //加一行
+    addRows(){
+      //获取已有行的数据
+      // debugger;
+      if(this.index==6){
+        return;
+      }
+      this.index++;
+      this.list.push({
+        data:this.index
+      })
+      this.inputs[`input${this.index+1}`] = '';
+      console.log(this.inputs)
+      console.log(this.list,111);
+    },
+    //减一行
+    deleteRows(index){
+      if(this.index==1){
+        return;
+      }
+      this.index--;
+      this.list.splice(index,1);
+    },
+    //单选题提交(新增)数据
+    submit(row, done, loading) {
+      var that = this;
+      row['choicesType'] = this.choicesType;
+      row['creator'] = this.userInfo.user_name;
+      row.tktype = row.tktype.join(",");
+      //选项信息
+      const examSubjectOptions = [
+        {
+         id:that.optionContentAId,
+         optionName:"A",
+         optionContent:row.optionContentA,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentBId,
+         optionName:"B",
+         optionContent:row.optionContentB,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentCId,
+         optionName:"C",
+         optionContent:row.optionContentC,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentDId,
+         optionName:"D",
+         optionContent:row.optionContentD,
+         creator:this.userInfo.user_name,
+        }
+      ]
+      row['examSubjectOptions'] = examSubjectOptions;
+      saveSubjectChoicesAndOption(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          that.visible = false;
+          that.$refs.form.resetFields();
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //多选题提交(新增)数据
+    submitCheckbox(row, done, loading) {
+      var that = this;
+      row['choicesType'] = this.choicesType;
+      row['creator'] = this.userInfo.user_name;
+      row.tktype = row.tktype.join(",");
+      row.answer = row.answer.join(",");
+      //选项信息
+      const examSubjectOptions = [
+        {
+         id:that.optionContentAId,
+         optionName:"A",
+         optionContent:row.optionContentA,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentBId,
+         optionName:"B",
+         optionContent:row.optionContentB,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentCId,
+         optionName:"C",
+         optionContent:row.optionContentC,
+         creator:this.userInfo.user_name,
+        },
+        {
+         id:that.optionContentDId,
+         optionName:"D",
+         optionContent:row.optionContentD,
+         creator:this.userInfo.user_name,
+        }
+      ]
+      row['examSubjectOptions'] = examSubjectOptions;
+      saveSubjectChoicesAndOption(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          that.visible = false;
+          that.$refs.formCheckbox.resetFields();
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //判断题提交(新增)数据
+    submitJudge(row, done, loading) {
+      var that = this;
+      row['choicesType'] = this.choicesType;
+      row['creator'] = this.userInfo.user_name;
+      row.tktype = row.tktype.join(",");
+      saveSubjectChoicesAndOption(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          that.visible = false;
+          that.$refs.formJudge.resetFields();
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //填空排序题提交(新增)数据
+    submitFill(row, done, loading) {
+      var that = this;
+      row['choicesType'] = this.choicesType;
+      row['creator'] = this.userInfo.user_name;
+      row.tktype = row.tktype.join(",");
+      //选项信息
+      var examSubjectOptions = [];
+      if(row.optionContent1){
+          examSubjectOptions.push({
+            optionName:"1",
+            optionContent:row.optionContent1,
+            creator:this.userInfo.user_name,
+          })
+      }
+      if(row.optionContent2){
+          examSubjectOptions.push({
+            optionName:"2",
+            optionContent:row.optionContent2,
+            creator:this.userInfo.user_name,
+          })
+      }
+      if(row.optionContent3){
+          examSubjectOptions.push({
+            optionName:"3",
+            optionContent:row.optionContent3,
+            creator:this.userInfo.user_name,
+          })
+      }
+      if(row.optionContent4){
+          examSubjectOptions.push({
+            optionName:"4",
+            optionContent:row.optionContent4,
+            creator:this.userInfo.user_name,
+          })
+      }
+      if(row.optionContent5){
+          examSubjectOptions.push({
+            optionName:"5",
+            optionContent:row.optionContent5,
+            creator:this.userInfo.user_name,
+          })
+      }
+      row['examSubjectOptions'] = examSubjectOptions;
+      saveSubjectChoicesAndOption(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          that.visible = false;
+          that.$refs.formFill.resetFields();
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //关闭窗口清除数据
+    closeDialog(){
+      if(this.choicesType==0){
+          this.$refs.form.resetFields();
+      }
+      
+      if(this.choicesType==1){
+        this.$refs.formCheckbox.resetFields();
+      }
+
+      if(this.choicesType==2){
+        this.$refs.formJudge.resetFields();
+      }
+
+      if(this.choicesType==3){
+        this.$refs.formFill.resetFields();
+      }
+    }
+  },
+};
+</script>
+<style scoped>
+
+.optionContent-suffix{
+  margin-top: 5px;
+}
+
+.optionContent-suffix span{
+  margin-left: -20px;
+}
+
+
+.optionContent-suffix .optionContent-input{
+  width: 90%;
+  margin-left: 10px;
+}
+
+
+.optionContent-suffix .optionContent-botton{
+  margin-left: 10px;
+}
+
+</style>
\ No newline at end of file
diff --git a/src/views/exam/performance.vue b/src/views/exam/performance.vue
index d65578f..186369b 100644
--- a/src/views/exam/performance.vue
+++ b/src/views/exam/performance.vue
@@ -476,6 +476,9 @@
             this.refreshChange();
             done();
         },
+        refreshChange() {
+            this.questionBankOnLoad(this.page, this.query);
+        },
 
     }
 }
diff --git a/src/views/exam/subject.vue b/src/views/exam/subject.vue
index 22c054e..e228337 100644
--- a/src/views/exam/subject.vue
+++ b/src/views/exam/subject.vue
@@ -6,6 +6,7 @@
  * menu-name 题库查询
  */
 <template>
+    <div>
     <el-row class="morpheus-box">
         <el-col :span="24">
             <el-card>
@@ -28,6 +29,19 @@
                                @row-del="questionBankHandleDel">
 
                         <template slot="menuLeft">
+                            <el-button type="primary"
+                                       size="small"
+                                       icon="el-icon-plus"
+                                       @click="questionBankHandleAdd">新 增
+                            </el-button>
+                            <el-button
+                                type="success"
+                                size="small"
+                                plain
+                                icon="el-icon-upload2"
+                                @click="handleImport"
+                                >题库导入
+                            </el-button>
                             <el-button type="danger"
                                        size="small"
                                        icon="el-icon-delete"
@@ -35,13 +49,47 @@
                             </el-button>
                         </template>
 
+                        <template slot-scope="{row}" slot="menu">
+                            <el-button type="text"
+                                       size="mini"
+                                       icon="el-icon-edit"
+                                       @click="questionBankHandleAdd(row)">编辑
+                            </el-button>
+                            <el-button type="text"
+                                       size="mini"
+                                       icon="el-icon-delete"
+                                       @click="questionBankHandleDel(row)">删除
+                            </el-button>
+                        </template>
+
                     </avue-crud>
+
+                    <el-dialog
+                        title="题库导入"
+                        append-to-body
+                        :visible.sync="excelBox"
+                        width="555px"
+                        >
+                        <avue-form
+                            :option="excelOption"
+                            v-model="excelForm"
+                            :upload-after="uploadAfter"
+                        >
+                            <template slot="excelTemplate">
+                            <el-button type="primary" @click="handleTemplate">
+                                点击下载<i class="el-icon-download el-icon--right"></i>
+                            </el-button>
+                            </template>
+                        </avue-form>
+                    </el-dialog>
 
                 </div>
 
             </el-card>
         </el-col>
     </el-row>
+    <addsubject ref="addsubject"></addsubject>
+</div>
 </template>
 
 <script>
@@ -50,25 +98,52 @@
     remove,
 } from "@/api/examapi/subject";
 
+import addsubject from "./addsubject.vue";
 
 export default {
+    components:{
+        addsubject
+    },
     data () {
         return {
+            excelBox:false,
+            excelForm: {},
+            excelOption: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                {
+                    label: "模板上传",
+                    prop: "excelFile",
+                    type: "upload",
+                    drag: true,
+                    loadText: "模板上传中,请稍等",
+                    span: 24,
+                    propsHttp: {
+                    res: "data",
+                    },
+                    tip: "请上传 .xls,.xlsx 标准格式文件",
+                    action: "/api/examSubjectChoices/import-examSubject",
+                },
+                {
+                    label: "模板下载",
+                    prop: "excelTemplate",
+                    formslot: true,
+                    span: 24,
+                },
+                ],
+            },
             questionBankOption: {
                 // 操作栏多余按钮去除
-                delBtn: true,
-
+                delBtn: false,
                 editBtn: false,
-
                 addBtn: false,
-
                 selection: true,
                 menu: true,
                 // 导出按钮
                 excelBtn: true,
                 excelBtnText: '题库导出',
                 // title: '题库',
-
                 align: 'center',
                 height: 'auto',
                 calcHeight: 80,
@@ -82,11 +157,11 @@
                 dialogClickModal: false,
                 // 操作栏宽度
                 menuWidth: 226,
-
                 column: [
                     {
                         label: "题目名称",
                         prop: "subjectName",
+                        
                         search: true,
                         slot: true,
                     },
@@ -104,6 +179,9 @@
                         }, {
                             label: '判断题',
                             value: 2,
+                        }, {
+                            label: '实操题',
+                            value: 3,
                         }],
                         slot: true,
                         width: 96,
@@ -178,6 +256,9 @@
         },
     },
     methods: {
+        questionBankHandleAdd(row){
+            this.$refs.addsubject.inits(row.id);
+        },
         questionBankOnLoad (page, params = {}) {
             this.questionBankLoading = false;
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
@@ -254,7 +335,33 @@
                 });
         },
 
-
+        //导出数据
+        handleExport() {
+            this.$confirm("是否导出清册数据?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                window.open(`/api/apply/export-apply?examId=${this.$route.query.id}`);
+            });
+        },
+        handleImport() {
+            this.excelBox = true;
+        },
+        handleTemplate() {
+            window.open(
+                `/api/examSubjectChoices/export-template`
+            );
+        },
+        uploadAfter(res, done, loading, column) {
+            window.console.log(column);
+            this.excelBox = false;
+            this.refreshChange();
+            done();
+        },
+        refreshChange() {
+            this.questionBankOnLoad(this.page, this.query);
+        },
     }
 }
 </script>
diff --git a/src/views/trainingRegistration/data.js b/src/views/trainingRegistration/data.js
index cd66727..6533b78 100644
--- a/src/views/trainingRegistration/data.js
+++ b/src/views/trainingRegistration/data.js
@@ -50,6 +50,11 @@
             value: "id"
         },
         searchSpan: 5,
+        rules: [{
+            required: true,
+            message: "请输入姓名",
+            trigger: "blur"
+        }],
     }, {
         label: "姓名",
         prop: "realName",
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 6feb547..ee52516 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -23,6 +23,7 @@
     >
       <template slot="menuLeft">
         <el-button
+          style="display:none"
           type="danger"
           size="small"
           plain
@@ -38,7 +39,7 @@
           :size="size"
           :type="type"
            :disabled="row.cancel==2"
-          >撤销报名</el-button
+          >取消报名</el-button
         >
         <el-button
           icon="el-icon-folder-checked"
@@ -87,6 +88,7 @@
         selection: true,
         column: column,
         delBtn: false,
+        editBtn: false,
       },
     };
   },
@@ -113,16 +115,25 @@
     },
     rowSave(form, done, loading) {
       var that = this;
-      //   var form = this.data[0];
-      //   delete form.id;
-      //   for (var k = 0; k < 13; k++) {
       adddata(form).then(
         (res) => {
           this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
+          if(res.data.data==201){
+            this.$message({
+              type: "warning",
+              message:"已报名,不能重复报名",
+            });
+          }else if(res.data.data==201){
+            this.$message({
+              type: "warning",
+              message:"报名失败",
+            });
+          }else{
+            this.$message({
+              type: "success",
+              message:"报名成功",
+            });
+          }
           done();
         },
         (error) => {
@@ -130,7 +141,6 @@
           loading();
         }
       );
-      //   }
     },
     searchChange(params, done) {
       this.query = params;
@@ -186,7 +196,7 @@
       })
     },
     revoke(row,done,loading) {
-      this.$confirm("确定撤销报名?", {
+      this.$confirm("确定取消报名?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -198,7 +208,7 @@
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "成功撤销报名!",
+            message: "取消报名成功!",
           });
           done();
         },

--
Gitblit v1.9.3