Quellcode durchsuchen

提交题库bug

weiwenhai vor 6 Jahren
Ursprung
Commit
8ee0e85a48

+ 5 - 0
src/modules/questions/styles/Common.css

@@ -102,3 +102,8 @@
   text-overflow: ellipsis;
   overflow: hidden;
 }
+
+.message_style {
+  color: #f56c6c;
+  margin-bottom: -20px;
+}

+ 32 - 9
src/modules/questions/views/ExportStructure.vue

@@ -240,9 +240,9 @@
         </el-form-item>
         <el-row class="margin_top_10 margin_left_120">
           <el-button type="primary" @click="saveCopy">保 存</el-button>
-          <el-button @click="resetForm3"
+          <!-- <el-button @click="resetForm3"
             ><i class="el-icon-refresh"></i> 重 置</el-button
-          >
+          > -->
           <el-button @click="cancleCopy" type="primary"
             ><i class="el-icon-arrow-left"></i> 返 回</el-button
           >
@@ -254,9 +254,10 @@
       <el-form
         :model="exportStructure"
         label-position="right"
-        label-width="120px"
+        label-width="78px"
       >
         <el-row>
+          <div style=" color: #f56c6c; margin-bottom: -30px;">*</div>
           <el-form-item label="考试类型">
             <el-select
               v-model="exportStructure.examType"
@@ -278,6 +279,7 @@
           </el-form-item>
         </el-row>
         <el-row>
+          <div style=" color: #f56c6c; margin-bottom: -30px;">*</div>
           <el-form-item label="考试名称">
             <el-select
               v-model="exportStructure.examId"
@@ -300,6 +302,7 @@
           </el-form-item>
         </el-row>
         <el-row>
+          <div style=" color: #f56c6c; margin-bottom: -30px;">*</div>
           <el-form-item label="导出类型">
             <el-select
               v-model="exportStructure.exportType"
@@ -327,9 +330,14 @@
             :key="index"
           >
             <el-row>
+              <div
+                style=" color: #f56c6c; margin-bottom: -30px;margin-left: 26px;"
+              >
+                *
+              </div>
               <el-form-item
                 :label="item.questionType | questionType"
-                label-width="120px"
+                label-width="78px"
               >
                 <el-input
                   v-model="item.quantity"
@@ -347,10 +355,12 @@
           </div>
         </div>
         <el-row class="margin_top_10 margin_left_120">
-          <el-button type="primary" @click="save">保 存</el-button>
-          <el-button @click="resetForm2"
-            ><i class="el-icon-refresh"></i> 重 置</el-button
+          <el-button type="primary" @click="save" :disabled="button"
+            >保 存</el-button
           >
+          <!-- <el-button @click="resetForm2"
+            ><i class="el-icon-refresh"></i> 重 置</el-button
+          > -->
           <el-button @click="cancel" type="primary"
             ><i class="el-icon-arrow-left"></i> 返 回</el-button
           >
@@ -428,7 +438,9 @@ export default {
       currentPage: 1,
       total: 10,
       button: false,
-      examListNew: []
+      examListNew: [],
+      disMessage: false,
+      reShow: false
     };
   },
   methods: {
@@ -465,6 +477,7 @@ export default {
     add() {
       this.dialogModel = true;
       this.button = false;
+      this.isShow = false;
       this.exportStructure = {
         examType: "",
         examId: "",
@@ -501,6 +514,12 @@ export default {
     },
     //表单验证
     check(value) {
+      if (this.disMessage) {
+        return false;
+      }
+      if (this.reShow) {
+        return false;
+      }
       var r = /^\+?[1-9][0-9]*$/;
       if ((r.test(value) || value === "0") && this.isShow) {
         return false;
@@ -514,6 +533,7 @@ export default {
       return false;
     },
     save() {
+      this.reShow = false;
       this.isShow = true;
       if (this.check_value(this.exportStructure.examType)) {
         return false;
@@ -602,6 +622,7 @@ export default {
     },
     //新增的时候,先查询
     searchExportStructure(type) {
+      this.disMessage = false;
       if (type == "examType") {
         this.$http
           .get(
@@ -611,7 +632,6 @@ export default {
           )
           .then(response => {
             this.examListByExamType = response.data;
-            console.log("this.examListByExamType:", this.examListByExamType);
             this.exportStructure.examId = "";
             this.resetExportStructure();
           });
@@ -624,6 +644,7 @@ export default {
           .then(response => {
             console.log(response);
             if (!response.data.id) {
+              //如果没有数据
               this.resetExportStructure();
             } else {
               this.button = true;
@@ -639,6 +660,7 @@ export default {
                 this.exportStructure.questionTypeNums[i].quantity =
                   response.data.questionTypeNums[i].quantity;
               }
+              this.disMessage = true;
               console.log("非空对象");
             }
           })
@@ -647,6 +669,7 @@ export default {
     },
     resetExportStructure() {
       this.button = false;
+      this.reShow = true;
       this.exportStructure.exportType = "";
       this.exportStructure.useable = "1";
       for (var i = 0; i < this.exportStructure.questionTypeNums.length; i++) {