From 8cc891b06558d9998723942aacd20ca3d894336e Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 22 九月 2023 18:05:16 +0800
Subject: [PATCH] 修改参照

---
 Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
index fa3ea8d..f1ac96e 100644
--- a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
+++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
@@ -1,5 +1,6 @@
 <template>
-  <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :blur="valueChange" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree>
+  <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked"
+                   :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree>
 </template>
 
 <script>
@@ -11,6 +12,7 @@
   props:["referConfig","value","text","title","disabled"],
   data() {
     return {
+      visible: false,
       options: this.referConfig.options,
       lazy: this.referConfig.options.loadType == 'node',
       isMuti:("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false,
@@ -127,14 +129,15 @@
 
     },
     getTree() {
+      //鍔犺浇鍏ㄩ儴
       getTree(this.params, this.treeUrl).then(res => {
         res.data.map(item => {
-          if (!item.attribute) {
-            item.attribute = {
+          if (!item.attributes) {
+            item.attributes = {
               data: {}
             }
           } else {
-            item.attribute.data = item.attribute.data || {}
+            item.attributes.data = item.attributes.data || {}
           }
           return {
             ...item,
@@ -145,6 +148,7 @@
       })
     },
     treeLoad: function (treeNode, resolve) {
+      //閫愮骇鍔犺浇
       const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid;
       this.params.parentOid=parentOid.indexOf('@vcitreesep@') > -1 ? parentOid.split('@vcitreesep@')[1] : parentOid;
       this.params.parentValue=this.params.parentOid;
@@ -158,12 +162,12 @@
       }
       getLazyTree(this.params,this.treeUrl).then(res => {
         resolve(res.data.data.map(item => {
-          if(!item.attribute){
-            item.attribute={
+          if(!item.attributes){
+            item.attributes={
               data:{}
             }
           }else{
-            item.attribute.data=item.attribute.data || {}
+            item.attributes.data=item.attributes.data || {}
           }
           return {
             ...item,
@@ -178,17 +182,13 @@
       }
     },
     checked(checkedNode, checkedData) {
-      this.checkedData=checkedData
-    },
-    valueChange(){
-      if(this.isMuti){
-        // this.setValue(this.checkedData)
-      }
+      this.setValue(checkedData)
     },
     setValue:function (checkedData){
+      this.checkedData=checkedData
       var value = [];
       var text = [];
-      const textSep =this.config.textSep;
+      const textSep =this.config.textSep;debugger;
       for(var j =0;j<checkedData.checkedNodes.length;j++){
         const item=checkedData.checkedNodes[j];
         var v=this.config.valueField.indexOf("attribute.")>=0?(item.attributes[this.config.valueField.replace("attribute.","")] || item.attributes.data[this.config.valueField.replace("attribute.","")]):(item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField])

--
Gitblit v1.9.3