Prechádzať zdrojové kódy

站点管理bug修复

ming 3 rokov pred
rodič
commit
bb9cdcb9be

+ 12 - 2
src/views/siteManage/basicInfo/index.vue

@@ -222,7 +222,7 @@
               >
                 保存
               </el-button>
-              <el-button @click="resetForm('formInfo')">取消</el-button>
+              <!-- <el-button @click="resetForm('formInfo')">取消</el-button> -->
             </el-form-item>
           </div>
         </el-col>
@@ -377,7 +377,7 @@ export default defineComponent({
     }
 
     function resetForm() {
-      formInfo.value.resetFields()
+      formInfo.value.clearValidate()
     }
 
     // 动态属性下拉请求
@@ -580,9 +580,16 @@ export default defineComponent({
           dataSet.fileList = []
           newArray.value = []
 
+          resetForm()
+        
+
+          
+
           getSite()
           dynamicPropertiesDroplist(2)
           dynamicPropertiesDroplist(1)
+
+          
         }
       }
     )
@@ -592,6 +599,9 @@ export default defineComponent({
         if (newVal == 'first') {
           dataSet.fileList = []
           newArray.value = []
+
+          resetForm()
+          
           getSite()
           dynamicPropertiesDroplist(2)
           dynamicPropertiesDroplist(1)

+ 7 - 0
src/views/siteManage/powerScore/index.vue

@@ -108,6 +108,10 @@ export default defineComponent({
         })
     }
 
+    function resetForm() {
+      formInfo.value.clearValidate()
+    }
+
     //表单提交
     function submitForm() {
       ruleForm.value.siteId = props.siteId
@@ -162,6 +166,7 @@ export default defineComponent({
         console.log(newVal)
         ruleForm.value.siteId = newVal
         if (props.activeName == 'six') {
+          resetForm()
           powerQualityList()
         }
       }
@@ -170,6 +175,7 @@ export default defineComponent({
       () => props.activeName,
       (newVal) => {
         if (newVal == 'six') {
+          resetForm()
           powerQualityList()
         }
       }
@@ -210,6 +216,7 @@ export default defineComponent({
       },
       submitForm,
       isDisable,
+      resetForm
     }
   },
 })

+ 0 - 1
src/views/siteManage/variableList/dialogComponent.vue

@@ -183,7 +183,6 @@ export default defineComponent({
     const submitForm = () => {
       formInfo.value.validate((valid) => {
         if (valid) {
-  
           if (props.dialogTitle === '新增') {
             api.variableAdd(form.value).then((requset) => {
               if (requset.status === 'SUCCESS') {

+ 1 - 0
src/views/siteManage/variableList/index.vue

@@ -355,6 +355,7 @@ export default defineComponent({
         coefficient: row.coefficient,
         saveCycle: row.saveCycle,
         dataArea: row.dataArea.toString(),
+        id:row.id
       }
       dialogTitle.value = '编辑'
       showDialog.value = true