From 749768b9d076d02fb151ad94fff6a7ce45dff55d Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 05 十二月 2024 11:30:31 +0800
Subject: [PATCH] 修改UI定义表单传值

---
 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
index 3a28de4..dc51274 100644
--- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
+++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -187,11 +187,11 @@
         ...item,
         label: item.text,
         prop: item.prop || item.field,
-        showProp:item.showProp || item.showField,
+        showProp: item.showProp || item.showField,
         type: type,
-        labelWidth:item.labelWidth || this.labelWidth || (item.text.length >= 6 ? 115 : 90),
+        labelWidth: item.labelWidth || this.labelWidth || (item.text.length >= 6 ? 115 : 90),
         disabled: item.disabled || this.disabled,
-        readonly:item.readonly || item.readOnly,
+        readonly: item.readonly || item.readOnly,
         span: item.span
           ? item.span
           : item.type === "textarea"
@@ -202,27 +202,28 @@
         labelSuffix: item.labelSuffix || item.suffix,
         tip: item.tip || item.tooltips,
         dictCode: item.dictCode || item.comboxKey,
-        valueFormat: item.valueFormat ||item.dateFormate ,
+        valueFormat: item.valueFormat || item.dateFormate,
         format: item.format || item.dateFormate,
-        rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{
+      };
+      if(!item.rules || item.rules.length==0){
+        col.rules=this.isEdit ? (type == "select" || type == "refer" || type == "date" || type == "datetime" ? [{
           required: item.required || false,
           message: `璇烽�夋嫨${item.text}!`,
           trigger: "change"
-        },{
-          required: item.required|| false,
+        }, {
+          required: item.required || false,
           message: `璇烽�夋嫨${item.text}!`,
           trigger: "submit"
-        }]:[{
-          required: item.required|| false,
+        }] : [{
+          required: item.required || false,
           message: `璇疯緭鍏�${item.text}!`,
           trigger: "blur"
-        },{
-          required: item.required|| false,
+        }, {
+          required: item.required || false,
           message: `璇疯緭鍏�${item.text}!`,
           trigger: "submit"
-        }]):[],
-
-      };
+        }]) : []
+      }
       if(!this.isEdit){
         col.placeholder=col.label;
         col.disabled=true;

--
Gitblit v1.9.3