修改bug

This commit is contained in:
caoyang
2022-03-11 10:33:36 +08:00
parent 4f20d5b922
commit 91bba84c42
4 changed files with 30 additions and 20 deletions
@@ -279,9 +279,10 @@
},
//跳转详情
onDetail(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
query: { id:item.documentId }
})
window.open(newUrl.href, '_blank')
}
@@ -46,10 +46,12 @@
selectedKeys: [],
expandedKeys: [],
autoExpandParent: true,
treeData1: [],
treeData: [],
dataList:[],
searchValue:'',
data:[]
data:[],
parentItem:[]
}
},
props:{
@@ -70,13 +72,15 @@
//获取数据
loadData(){
let params = {
title:this.searchValue
}
getAction(`sys/category/getSysCategoryTree`,params).then(res=> {
if(res.success){
console.log('result',res.result)
this.data=[...res.result]
this.treeData=[...this.addAttr(this.data)]
this.treeData1=[...this.addAttr(this.data)]
this.treeData=[...this.treeData1]
// console.log('treeData',this.treeData)
}
})
@@ -84,6 +88,7 @@
onSearch(){
// this.treeData=[]
// this.treeData=this.getSearch(this.data)
// this.getSearch(this.searchValue,this.treeData1)
},
//获取用户的订阅
getSubscribtion(){
@@ -111,21 +116,26 @@
// console.log('dataI',dataI)
return dataI
},
getSearch(dataI){
getSearch(key,tree){
let dataSearch=[]
console.log('tree',this.treeData,this.data)
if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{
this.$set(item,'key',item.id)
if(item.title.indexOf(this.searchValue)>-1){
dataSearch.push(item)
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.title.indexOf(key)>-1)) {
console.log('titel',node)
parentKey = node.key;
this.parentItem.push(node)
} else if (this.getParentKey(key, node.children)) {
parentKey = this.getParentKey(key, node.children);
}
let arr = [];
this.addAttr(item.children,arr);
});
}
}
console.log('dataSearch',dataSearch)
return dataSearch
console.log('dataSearch',this.parentItem)
return this.parentItem
// return dataSearch
},
afterVisibleChange(val) {
// console.log('visible', val);