From 8f8412c6329f9eef431f964cd67d653d1e3460bb Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 14 九月 2023 09:19:27 +0800
Subject: [PATCH] 代码打包重新部署
---
Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue | 33 +++++++++++++++++++++++++++------
1 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
index 8abf926..16756d9 100644
--- a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
+++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
@@ -123,10 +123,23 @@
this.params=queryParams;
},
- getTree(){
- getTree(this.params,this.treeUrl).then(res => {
- this.treeData=res.data
+ getTree() {
+ getTree(this.params, this.treeUrl).then(res => {
+ res.data.map(item => {
+ if (!item.attribute) {
+ item.attribute = {
+ data: {}
+ }
+ } else {
+ item.attribute.data = item.attribute.data || {}
+ }
+ return {
+ ...item,
+ leaf: !item.hasChildren
+ }
})
+ this.treeData = res.data
+ })
},
treeLoad: function (treeNode, resolve) {
const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid;
@@ -142,6 +155,13 @@
}
getLazyTree(this.params,this.treeUrl).then(res => {
resolve(res.data.data.map(item => {
+ if(!item.attribute){
+ item.attribute={
+ data:{}
+ }
+ }else{
+ item.attribute.data=item.attribute.data || {}
+ }
return {
...item,
leaf: !item.hasChildren
@@ -163,13 +183,13 @@
const textSep =this.config.textSep;
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[this.config.valueField] || item[this.config.valueField])
+ 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])
value.push(v);
var tempRaw = [];
var textFieldArray = this.config.textField.split(",");
for (var i = 0; i < textFieldArray.length; i++) {//鏄剧ず鐨勫瓧娈靛彲鑳芥湁澶氫釜
if (!validatenull(textFieldArray[i])) {
- var t=textFieldArray[i].indexOf("attribute.")>=0?item.attributes[textFieldArray[i].replace("attribute.","")]:(item.attributes[textFieldArray[i]] || item[textFieldArray[i]])
+ var t=textFieldArray[i].indexOf("attribute.")>=0?(item.attributes[textFieldArray[i].replace("attribute.","")] ||item.attributes.data[textFieldArray[i].replace("attribute.","")]):(item.attributes[textFieldArray[i]] || item[textFieldArray[i]] || item.attributes.data[textFieldArray[i]])
tempRaw.push(t);
}
}
@@ -183,7 +203,8 @@
value: this.value,
text: this.text || '',
isTreeMuti:this.isMuti,
- rawData: checkedData.checkedNodes
+ rawData: checkedData.checkedNodes,
+ fieldMap:this.referConfig.fieldMap
});
}
},
--
Gitblit v1.9.3