From d1eb1ce1d2fcb0c76f5d3b1a6ae00bf3f263b2f1 Mon Sep 17 00:00:00 2001
From: fujunling <2984387807@qq.com>
Date: 星期五, 09 六月 2023 14:21:54 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue
index 19297f2..2166a83 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,13 @@
           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
+          }:{},
           span: formItem.type === "textarea" ? 24 : this.trendsSpan,
           rules: [
             {
@@ -635,6 +643,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") {
@@ -676,8 +689,7 @@
     // 琛ㄥ崟鏍¢獙
     validate() {
       return new Promise((resolve) => {
-        this.$refs.form.validate((valid, done, msg) => {
-          console.error(msg, valid);
+        this.$refs.form.validate((valid, done) => {
           if (valid) {
             done();
             resolve(true);
@@ -689,15 +701,21 @@
     },
     // 鑾峰彇琛ㄥ崟璇︽儏鏁版嵁
     getFormDetail() {
-      if (this.type === 'add') return 
-      if (this.type === "add") return;
-      getFormDetail({ templateOid: this.templateOid, oid: '213D13D5-76D3-6B42-0932-705693F6B6E4' }).then(
+      if (this.type === 'add') return
+      getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then(
         (res) => {
           this.form = Object.assign(this.form, res.obj)
           console.log(res, "res");
         }
       );
     },
+    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