Selaa lähdekoodia

关于elementui Dialog组件destroy-on-close=true的问题

coys 2 vuotta sitten
vanhempi
commit
4c47b05e78

+ 6 - 1
src/views/evaluationRule/addEvaluate.vue

@@ -5,7 +5,7 @@
       :width="'500px'"
       :title="`${id ? '编辑' : '新增'}扣分规则`"
       @close="closeHandler"
-      destroy-on-close
+      
     >
       <el-form
         :model="ruleForm"
@@ -110,6 +110,11 @@ export default {
       this.isShow = false;
     },
     closeHandler() {
+      if(this.$refs.ruleForm){
+
+       
+        this.$refs.ruleForm.resetFields()
+      }
       this.ruleForm = {};
     },
 

+ 7 - 5
src/views/resumptionEvaluate/evaluate/addEvaluate.vue

@@ -5,8 +5,6 @@
       :width="'500px'"
       :title="`${id ? '编辑' : '新增'}外包履职评价计划`"
       @close="closeHandler"
-      
-      destroy-on-close
     >
       <el-form
         :model="ruleForm"
@@ -16,7 +14,10 @@
         class="demo-ruleForm"
       >
         <el-form-item label="评价类型" prop="contentType">
-          <el-select v-model="ruleForm.contentType" placeholder="请选择评价类型">
+          <el-select
+            v-model="ruleForm.contentType"
+            placeholder="请选择评价类型"
+          >
             <el-option
               v-for="item in dict.type.evaluate_type"
               :key="item.value"
@@ -34,7 +35,6 @@
         </el-form-item>
 
         <el-form-item>
-          
           <el-button type="primary" @click="submitForm('ruleForm')"
             >确定</el-button
           >
@@ -75,9 +75,11 @@ export default {
       this.isShow = false;
     },
     closeHandler() {
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields();
+      }
       this.ruleForm = {};
     },
-  
 
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {

+ 1 - 1
src/views/scorestatistics/scorestatisticsDialog.vue

@@ -5,7 +5,7 @@
       title="查看"
       :visible.sync="isShow"
       width="1400px"
-      destroy-on-close
+     
       @open="openHandler"
     >
       <div class="pageNum-body">