From e219ccb67e233945ad59abcb16161f854989efdc Mon Sep 17 00:00:00 2001
From: hailu <962012470@qq.com>
Date: 星期四, 12 一月 2023 19:34:46 +0800
Subject: [PATCH] 高级搜索
---
src/components/SeniorTranfer.vue | 32 +++++++++++++++++++-------------
1 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/components/SeniorTranfer.vue b/src/components/SeniorTranfer.vue
index 2cf8ed0..91fb4a8 100644
--- a/src/components/SeniorTranfer.vue
+++ b/src/components/SeniorTranfer.vue
@@ -99,6 +99,7 @@
treeDimensions: { children: 'children', title: 'Desc', key: 'Code' },
parentCodeSearch: '',
fitst: true,
+ copy:'1',
}
},
computed: {
@@ -205,7 +206,7 @@
}
this.treeLoading = true
url(params).then(res => {
- this.treeData = this.formatTreeData(res.Data,0)
+ this.treeData = this.formatTreeData(res.Data)
// console.log(this.treeData);
// if (url.toString().indexOf('GetCpcClass') > 0) {
// // this.treeData
@@ -310,7 +311,7 @@
}
this.treeLoading = true
url(params).then(res => {
- this.treeData = this.formatTreeData(res.Data,1)
+ this.treeData = this.formatTreeData(res.Data)
// console.log(this.treeData);
if (url.toString().indexOf('GetStraindustryTree') > 0) {
// this.treeData
@@ -363,25 +364,22 @@
})
},
//缁熶竴鏍煎紡 key title
- formatTreeData(listData,search) {
+ formatTreeData(listData) {
+ // console.log(search);
let tempList = []
let that = this
function flatten(list = []) {
list.forEach(item => {
- if(search===1){
- item.title = that.activeKey === 'cpcCodeSort' || (that.activeKey === 'ipcCodeSort' && item.ParentCode) ? item.Code + " " + item[that.treeDimensions.title] : item[that.treeDimensions.title]
- }else{
- item.title= item.valueshow
- }
-
- // console.log(item,that.treeDimensions);
- // item.valueshow = that.treeDimensions.valueshow
+ item.title= item.valueshow
item.key = item[that.treeDimensions.key]
flatten(item.children);
+
});
+
}
tempList = JSON.parse(JSON.stringify(listData))
flatten(tempList);
+ that.copy=''
return tempList
},
transferChange(targetKeys) {
@@ -393,7 +391,7 @@
itemSelect(eventKey, !isChecked(checkedKeys, eventKey));
},
onLoadData(treeNode) {
- // console.log(treeNode);
+ console.log(treeNode);
return new Promise(resolve => {
if (treeNode.dataRef.children) {
resolve();
@@ -405,13 +403,21 @@
if (this.activeKey == 'cpcCodeSort') {
url = GetCpcClassTree
}
+ this.copy=treeNode.dataRef.key
+
url({
// year: this.activeKey == 'cpcCodeSort' ? this.ICPYear : undefined,
year: this.activeKey == 'ipcCodeSort' ? this.ICPYear : undefined,
parentCode: treeNode.dataRef.key
+
}).then(res => {
- treeNode.dataRef.children = this.formatTreeData(res.Data)
+ // if(this.parentCodeSearch){
+ // treeNode.dataRef.children = this.formatTreeData(res.Data,0)
+ // }else{
+ treeNode.dataRef.children = this.formatTreeData(res.Data)
+ // }
+
this.treeData = [...this.treeData];
resolve();
})
--
Gitblit v1.8.0