From 7d8e7438ab28e9729b36a96ff73e5587114319aa Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 14 九月 2023 15:09:12 +0800
Subject: [PATCH] 集成模块 模糊查询

---
 Source/UBCS-WEB/src/components/refer/vciWebRefer.vue |   53 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue
index 9d6f311..7aab2aa 100644
--- a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue
+++ b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue
@@ -1,31 +1,60 @@
 <template>
-  <vciWebReferTree v-if="refertype=='tree'" :value="value" :options="options"></vciWebReferTree>
-  <vciWebReferTable v-else-if="refertype=='table'" :value="value" :options="options"></vciWebReferTable>
-  <vciWebReferDefalut v-else :value="value" :options="options"></vciWebReferDefalut>
+  <div v-if="display">
+    <vciWebReferTree ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree>
+    <vciWebReferTable v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable>
+    <vciWebReferDefalut v-else  @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut>
+
+  </div>
 </template>
 
 <script>
 import vciWebReferTree from "./vciWebReferTree.vue";
 import vciWebReferTable from "./vciWebReferTable.vue";
-import vciWebReferDefalut from "./vciWebReferTable.vue";
+import vciWebReferDefalut from "./vciWebReferDefalut.vue";
 export default {
   name: "vciWebRefer",
-  props:["options","value"],
-  components: { vciWebReferTree,vciWebReferTable,vciWebReferDefalut},
+  props: ["referConfig","value","text","disabled","display"],
+  components: {vciWebReferTree, vciWebReferTable, vciWebReferDefalut},
   data() {
     return {
-      refertype:this.options.type
+      reterTypeLeavl:'213',
+      refertype: this.referConfig.options.type,
+      emitData:{},
+      title:'',
+      display:this.display || true,
+      disabled:this.disabled || false
     };
   },
   created() {
-    if(this.refertype=='tree'){
-      console.log('referConfig:')
-      console.log(this.options)
+    console.log('referer')
+    if (!this.referConfig.options) {
+      this.referConfig.options = {
+        isMuti: false
+      }
     }
-
   },
   mounted() {
-
+    var title = this.referConfig.title || '';
+    title = title.replace(":", "");
+    title = title ? ('涓恒��' + title + '銆戦�夊彇鍊�') : ('涓恒��' + this.referConfig.showField + '銆戦�夊彇鍊�');
+    this.title=title;
+  },
+  methods: {
+    setValue(value) {
+      this.emitData = value;
+    }
+  },
+  watch:{
+    // 淇敼鍙嶉鍒扮埗缁勪欢
+    emitData: {
+      deep: true,
+      immediate: true,
+      handler(newV) {
+        this.text=newV.text;
+        this.value=newV.value;
+        this.$emit("setReferValue", newV);
+      }
+    },
   }
 }
 </script>

--
Gitblit v1.9.3