|
@@ -214,7 +214,10 @@ export default {
|
|
"createTime": "2023-05-11 17:28:06"
|
|
"createTime": "2023-05-11 17:28:06"
|
|
}
|
|
}
|
|
],
|
|
],
|
|
|
|
+ // 节点的展开
|
|
expandedKeys:[],
|
|
expandedKeys:[],
|
|
|
|
+ // 当前节点下的所有数据
|
|
|
|
+ nodeChildrenData:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -302,8 +305,9 @@ export default {
|
|
handleNodeClick(data, node) {
|
|
handleNodeClick(data, node) {
|
|
// console.log(data, node);
|
|
// console.log(data, node);
|
|
if (data.children && data.children.length>0) {
|
|
if (data.children && data.children.length>0) {
|
|
- this.tableData = data.children
|
|
|
|
- this.handleCurrent(data.children)
|
|
|
|
|
|
+ // this.tableData =
|
|
|
|
+ this.nodeChildrenData = data.children
|
|
|
|
+ this.handleCurrent()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 请求数据(tree)
|
|
// 请求数据(tree)
|
|
@@ -314,8 +318,8 @@ export default {
|
|
this.$api.queryList(params).then(res => {
|
|
this.$api.queryList(params).then(res => {
|
|
if (res.code == 200 ) {
|
|
if (res.code == 200 ) {
|
|
this.treeData = res.data
|
|
this.treeData = res.data
|
|
- this.tableData = res.data.children
|
|
|
|
- this.handleCurrent(res.data.children)
|
|
|
|
|
|
+ this.nodeChildrenData = res.data.children
|
|
|
|
+ this.handleCurrent()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -333,13 +337,14 @@ export default {
|
|
// 分页
|
|
// 分页
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
this.queryParams.current = val;
|
|
this.queryParams.current = val;
|
|
|
|
+ this.handleCurrent()
|
|
},
|
|
},
|
|
// 分页处理
|
|
// 分页处理
|
|
- handleCurrent(nodeData) {
|
|
|
|
- this.total=nodeData.length
|
|
|
|
|
|
+ handleCurrent() {
|
|
|
|
+ this.total=this.nodeChildrenData.length
|
|
let start = this.queryParams.size * (this.queryParams.current - 1)
|
|
let start = this.queryParams.size * (this.queryParams.current - 1)
|
|
let end =this.queryParams.size * this.queryParams.current
|
|
let end =this.queryParams.size * this.queryParams.current
|
|
- this.tableData = nodeData.slice(start, end)
|
|
|
|
|
|
+ this.tableData = this.nodeChildrenData.slice(start, end)
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|