From 9412cc46c7d135d29dc6bf9b7ae36a3b6b17347c Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 07 六月 2023 18:11:21 +0800
Subject: [PATCH] 分类树组件封装,联调真实表格数据

---
 Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
index 19297f2..6afac39 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
@@ -26,8 +26,10 @@
       <template :slot="item.prop + ''" v-for="item in slotColumnList">
         <vciWebRefer
           v-if="item.type == 'refer'"
-          :value="item.value"
-          :options="item.referConfig || {}"
+          :referConfig="item.referConfig || {}"
+          :value="form[item.referConfig.field] || item.value"
+          :text="form[item.referConfig.showField]"
+          @setReferValue="setReferValue"
         ></vciWebRefer>
       </template>
     </avue-form>
@@ -555,7 +557,16 @@
           display: !formItem.hidden,
           maxlength: formItem.maxlength,
           filterable: true,
-          referConfig: formItem.referConfig,
+          referConfig:formItem.type=='refer'?{
+            title:formItem.text,
+            showField:formItem.showField || formItem.field,
+            field: formItem.field,
+            placeholder: formItem.inputTip,
+            options:formItem.referConfig
+          }:{},
+          change: () => {
+            this.changeFun(formItem.displayExtension, formItem.prop);
+          },
           span: formItem.type === "textarea" ? 24 : this.trendsSpan,
           rules: [
             {
@@ -635,6 +646,11 @@
         return val;
       }
     },
+    changeFun(displayExtension, prop) {
+      // executeCode({displayExtension, data: this.form}).then(res => {
+      //   this.form[prop] = res.data.data
+      // })
+    },
     // 鑾峰彇swich鍜屽凡鎷垮埌鐨勪笅鎷夋暟鎹�
     getDataList(type, dicData) {
       if (type === "truefalse") {
@@ -689,7 +705,7 @@
     },
     // 鑾峰彇琛ㄥ崟璇︽儏鏁版嵁
     getFormDetail() {
-      if (this.type === 'add') return 
+      if (this.type === 'add') return
       if (this.type === "add") return;
       getFormDetail({ templateOid: this.templateOid, oid: '213D13D5-76D3-6B42-0932-705693F6B6E4' }).then(
         (res) => {
@@ -698,6 +714,13 @@
         }
       );
     },
+    setReferValue(data){
+      if(data.field){
+        this.form[data.field]=data.value || '';
+        this.form[data.showField]=data.text || '';
+        this.$emit("getFormData", this.form);
+      }
+    }
   },
   watch: {
     // 琛ㄥ崟鏁版嵁淇敼鍙嶉鍒扮埗缁勪欢

--
Gitblit v1.9.3