zhangjie 2 lat temu
rodzic
commit
e69ae74cd5

+ 25 - 6
src/modules/question/components/QuestionEditDialog.vue

@@ -23,9 +23,6 @@
           @click="confirm"
           >确定</el-button
         >
-        <el-button v-if="!isEdit" size="small" type="primary" @click="initData"
-          >继续出题</el-button
-        >
         <el-button size="small" @click="cancel">取消</el-button>
       </div>
     </div>
@@ -98,6 +95,7 @@ export default {
       detailName: "",
       questionKey: "",
       loading: false,
+      hasModifyQuestion: false,
     };
   },
   computed: {
@@ -116,6 +114,7 @@ export default {
       this.initData();
     },
     initData() {
+      this.hasModifyQuestion = false;
       this.questionKey = randomCode();
       this.curQuestionType = this.question.questionType || this.curQuestionType;
       this.questionModel = { ...this.question };
@@ -123,12 +122,16 @@ export default {
         this.questionModel.questionType = this.curQuestionType;
       this.loading = false;
     },
-    cancel() {
+    close() {
       this.modalIsShow = false;
     },
     open() {
       this.modalIsShow = true;
     },
+    cancel() {
+      if (this.hasModifyQuestion) this.$emit("modified");
+      this.close();
+    },
     async switchType(item) {
       if (this.isEdit) return;
       if (this.curQuestionType === item.code) return;
@@ -161,8 +164,24 @@ export default {
       if (!res) return;
 
       this.$message.success(this.title + "成功");
-      this.cancel();
-      this.$emit("modified", this.questionModel);
+
+      this.hasModifyQuestion = true;
+
+      if (this.isEdit) {
+        this.$emit("modified");
+        this.close();
+        return;
+      }
+
+      const confirm = await this.$confirm("是否继续出题吗?", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") {
+        this.$emit("modified");
+        this.close();
+      } else {
+        this.initData();
+      }
     },
   },
 };

+ 7 - 7
src/modules/questions/views/OrgProperty.vue

@@ -27,7 +27,7 @@
     </div>
     <div class="org-body part-box">
       <!-- 题型设置 -->
-      <el-form v-if="activeName === 'tab1'" label-width="160px">
+      <!-- <el-form v-if="activeName === 'tab1'" label-width="160px">
         <h3 class="org-body-title">可用题型</h3>
 
         <el-form-item
@@ -96,7 +96,7 @@
             >
           </el-checkbox-group>
         </el-form-item>
-      </el-form>
+      </el-form> -->
       <!-- 审核配置 -->
       <el-form v-if="activeName === 'tab2'" label-width="160px">
         <el-form-item class="label-title" label="题库审核" label-width="90px">
@@ -216,10 +216,10 @@ export default {
         label_width_tab3: "120px",
       },
       menus: [
-        {
-          name: "题型设置",
-          val: "tab1",
-        },
+        // {
+        //   name: "题型设置",
+        //   val: "tab1",
+        // },
         {
           name: "审核配置",
           val: "tab2",
@@ -233,7 +233,7 @@ export default {
           val: "tab4",
         },
       ],
-      activeName: "tab1",
+      activeName: "tab2",
       rootOrgName: "",
       form: {
         orgId: null,