From bc90fb7e0c6c8313e7d5fcf3aba57e3a1f975c93 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 15 八月 2024 17:39:45 +0800
Subject: [PATCH] 对象建模模块,保存统一先进行正则校验(之间是失焦才进行校验)

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue |   74 +++++++++++++++++++++----------------
 1 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
index 2fdceb0..ad7dfe9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -737,8 +737,12 @@
         row,
         this.$refs.userCrud,
         this.lastIndex,
-        (newIndex) => { this.lastIndex = newIndex; },
-        () => { this.selectList = []; }
+        (newIndex) => {
+          this.lastIndex = newIndex;
+        },
+        () => {
+          this.selectList = [];
+        }
       );
     },
 
@@ -1213,38 +1217,44 @@
         linkTypeName: "",
         rangeValue: ""
       };
-      if (this.dialogTitle === 'add') {
-        this.form.range = this.form.rangeValue.replace(/\n/g, ';');
-        if (this.form.attributeSelectType === 'business') {
-          this.form.btmTypeId = this.form.referValue;
-        } else {
-          this.form.linkTypeName = this.form.referValue;
-        }
-        addAttribute(this.form).then(res => {
-          if (res.data.code === 200) {
-            this.$message.success(res.data.obj);
-            this.getTableList();
-            this.form = form;
-            this.addVisible = false;
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          if (this.dialogTitle === 'add') {
+            this.form.range = this.form.rangeValue.replace(/\n/g, ';');
+            if (this.form.attributeSelectType === 'business') {
+              this.form.btmTypeId = this.form.referValue;
+            } else {
+              this.form.linkTypeName = this.form.referValue;
+            }
+            addAttribute(this.form).then(res => {
+              if (res.data.code === 200) {
+                this.$message.success(res.data.obj);
+                this.getTableList();
+                this.form = form;
+                this.addVisible = false;
+              }
+            })
           }
-        })
-      }
-      if (this.dialogTitle === 'edit') {
-        this.form.range = this.form.rangeValue.replace(/\n/g, ';');
-        if (this.form.attributeSelectType === 'business') {
-          this.form.btmTypeId = this.form.referValue;
-        } else {
-          this.form.linkTypeName = this.form.referValue;
-        }
-        updateAttribute(this.form).then(res => {
-          if (res.data.code === 200) {
-            this.$message.success(res.data.obj);
-            this.getTableList();
-            this.form = form;
-            this.addVisible = false;
+          if (this.dialogTitle === 'edit') {
+            this.form.range = this.form.rangeValue.replace(/\n/g, ';');
+            if (this.form.attributeSelectType === 'business') {
+              this.form.btmTypeId = this.form.referValue;
+            } else {
+              this.form.linkTypeName = this.form.referValue;
+            }
+            updateAttribute(this.form).then(res => {
+              if (res.data.code === 200) {
+                this.$message.success(res.data.obj);
+                this.getTableList();
+                this.form = form;
+                this.addVisible = false;
+              }
+            })
           }
-        })
-      }
+        } else {
+          return false;
+        }
+      });
     },
 
     // 瀵煎叆

--
Gitblit v1.9.3