Sfoglia il codice sorgente

去除异常表单中表单名称前缀/绑定数据源按钮添加防抖

lph 1 anno fa
parent
commit
690957679d

+ 2 - 5
zkqy-ui/src/views/system/bpmnPro/components/bo-utils/getNodeMsg.js

@@ -139,11 +139,8 @@ function getNodeException(node, nodeObj) {
         if (item.nodeName == `${prefix}:unusualTask`) {
           let formName = '', formType = item.attributes.formType?.nodeValue || '';
 
-          // if (formType == 'designForm') {
-          formName = item.getAttribute('compName') + '-' + item.getAttribute('scriptName');
-          // } else {
-          //   formName = item.getAttribute('scriptName');
-          // }
+          // formName = item.getAttribute('compName') + '-' + item.getAttribute('scriptName');
+          formName = item.getAttribute('scriptName');
           res.push({
             scriptKey: item.attributes.scriptKey?.nodeValue,
             // scriptTriggerType: item.attributes?.scriptTriggerType?.nodeValue || 0,

+ 37 - 8
zkqy-ui/src/views/system/tenant/index.vue

@@ -487,7 +487,9 @@ export default {
           { required: true, message: "请输入租户激活码", trigger: "blur" },
         ],
       },
-      currentPage:""
+      currentPage: "",
+      // 已存在的数据库名称
+      databaseNameList: [],
     };
   },
   computed: {
@@ -532,14 +534,38 @@ export default {
       }
       callback();
     },
+    // 数据库名自定义校验规则--请求后端校验
+    // async databaseNameValidator(rule, value, callback) {
+    //   if (value) {
+    //     await getDataSourceInfo({ databaseName: value }).then((res) => {
+    //       if (res.code == 200) {
+    //         if (res.data) {
+    //           callback();
+    //         } else {
+    //           callback(new Error("数据库名已存在"));
+    //         }
+    //       } else {
+    //         callback(new Error("数据库名校验失败,请重新输入"));
+    //       }
+    //     });
+    //   }
+    // },
     // 数据库名称校验规则
     databaseNameValidator(rule, value, callback) {
+      // 正则校验
       let regex = /^[a-z][a-z0-9]*$/;
       if (regex.test(value)) {
-        callback(); // 输入内容符合规则
+        // callback(); // 输入内容符合规则
       } else {
         callback(new Error("只能包含小写字母和数字,且以小写字母开头"));
       }
+      // 重名校验
+      let isRepeat = this.databaseNameList.filter((item) => item == value);
+      if (isRepeat.length !== 0) {
+        callback(new Error("数据库名重复"));
+      } else {
+        callback();
+      }
     },
     // 数据源类型改变回调
     dataSourceTypeChange(type) {
@@ -552,9 +578,9 @@ export default {
     handleOpe() {},
     /** 查询租户信息列表 */
     getList() {
-      console.log("dddddd",)
+      console.log("dddddd");
       this.loading = true;
-      this.currentPage=this.queryParams.pageNum;
+      this.currentPage = this.queryParams.pageNum;
       //alert("ddddddddd")
       listTenant(this.queryParams).then((response) => {
         this.tenantList = response.rows;
@@ -673,6 +699,8 @@ export default {
     },
     /** 提交按钮 */
     submitForm1() {
+      if (this.dialogLoading) return;
+      this.dialogLoading = true;
       this.$refs["dataSourceForm"].validate((valid) => {
         if (valid) {
           // const loading = servicesLoading(
@@ -680,13 +708,13 @@ export default {
           //   "正在绑定数据源",
           //   true
           // );
-          this.dialogLoading = true;
           if (this.dataSourceForm.id != null) {
             // bindDatasource(this.dataSourceForm).then((response) => {
             //   this.$modal.msgSuccess("修改成功");
             //   this.dataSourceOpen = false;
             //   this.getList();
             // });
+            this.dialogLoading = false;
           } else {
             let query = {
               tenantId: this.fromTenantId,
@@ -718,12 +746,12 @@ export default {
                       }
                     })
                     .finally(() => {
-                      this.dialogLoading = fasle;
+                      this.dialogLoading = false;
                     });
                 }
               })
               .finally(() => {
-                this.dialogLoading = fasle;
+                this.dialogLoading = false;
               });
           }
         }
@@ -778,6 +806,7 @@ export default {
       }
       getDataSourceInfo(qar).then((res) => {
         // console.log(res);
+        this.databaseNameList = res.data;
       });
     },
     handleTest() {
@@ -838,7 +867,7 @@ export default {
         tenantId: null,
         tenantExpirationTime: null,
       };
-    }
+    },
   },
 };
 </script>