From 8835c9e1dec836d6d8159e78b9df12ad6402ad98 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 14 十一月 2024 10:03:24 +0800
Subject: [PATCH] 修复bug 整合代码

---
 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 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 ca5e5b4..5131082 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
@@ -1,6 +1,6 @@
 <template>
   <!--鍔ㄦ�佹ā鏉�-->
-  <avue-form ref="form" :option="option" v-model="form">
+  <avue-form ref="form" :option="option" v-model="form" v-loading="loading">
     <template v-for="item in allColumn" :slot="item.prop+ ''">
       <vciWebRefer
         v-if="item.type === 'refer'"
@@ -83,6 +83,7 @@
   },
   data() {
     return {
+      loading:false,
       form: this.formData,
       option: {
         menuBtn:false,
@@ -121,6 +122,7 @@
           Object.assign(this.form, this.initValue);
         }
       },
+      deep:true,
       immediate: true,
     },
     formData: {
@@ -184,14 +186,15 @@
     },
     initItem(item){
       const type=this.columnType[item.type] || item.type;
-      const col= {
+      item.text=item.text || item.label;
+      let col= {
         ...item,
         label: item.text,
         prop: item.field,
         showProp:item.showField,
         type: type,
         labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90),
-        disabled: !this.isEdit || item.readOnly || this.disabled,
+        disabled: item.readOnly || this.disabled,
         span: item.span
           ? item.span
           : item.type === "textarea"
@@ -206,25 +209,26 @@
         valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss",
         format: item.dateFormate,
         rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{
-          required: item.required,
+          required: item.required || false,
           message: `璇烽�夋嫨${item.text}!`,
           trigger: "change"
         },{
-          required: item.required,
+          required: item.required|| false,
           message: `璇烽�夋嫨${item.text}!`,
           trigger: "submit"
         }]:[{
-          required: item.required,
+          required: item.required|| false,
           message: `璇疯緭鍏�${item.text}!`,
           trigger: "blur"
         },{
-          required: item.required,
+          required: item.required|| false,
           message: `璇疯緭鍏�${item.text}!`,
           trigger: "submit"
         }]):[]
       };
       if(!this.isEdit){
         col.placeholder=col.label;
+        col.disabled=true;
       }
       if(col.type === 'richText'){
         this.subitemName = col.field;
@@ -340,6 +344,9 @@
     },
     clearValidate(props){
       this.$refs.form.clearValidate(props)
+    },
+    updateDic(prop,data){
+      this.$refs.form.updateDic(prop,data)
     }
   },
 };

--
Gitblit v1.9.3