Explorar o código

fix: 考试题卡自动选中

zhangjie hai 7 meses
pai
achega
e50535b4e1

+ 6 - 0
src/components/base/CardRuleSelect.vue

@@ -32,6 +32,10 @@ export default {
     clearable: { type: Boolean, default: true },
     showCommonCard: { type: Boolean, default: true },
     examId: { type: String, default: "" },
+    watchResponse: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {
@@ -47,6 +51,8 @@ export default {
       },
     },
     examId(val, oldval) {
+      if (!this.watchResponse) return;
+
       if (val !== oldval) {
         this.search();
         this.$emit("input", "");

+ 4 - 0
src/modules/base/components/ModifyExamConfigDetail.vue

@@ -47,6 +47,7 @@
           placeholder="请选择"
           clearable
           :exam-id="modalForm.examId"
+          :watch-response="false"
         ></card-rule-select>
         <div class="tips-info">
           <p>说明:</p>
@@ -455,6 +456,9 @@ export default {
       let val = data.records[0] || {};
       val.examId = this.exam.id;
       this.initData(val);
+      this.$nextTick(() => {
+        this.$refs.CardRuleSelect.search();
+      });
     },
     cancel() {
       this.modalIsShow = false;