|
@@ -9,7 +9,7 @@
|
|
>
|
|
>
|
|
<div class="boxnei" style="display: flex;flex-direction: column;">
|
|
<div class="boxnei" style="display: flex;flex-direction: column;">
|
|
<div style="overflow: auto;flex:1">
|
|
<div style="overflow: auto;flex:1">
|
|
- <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" ></avue-tree>
|
|
|
|
|
|
+ <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" :default-expanded-keys="defaultExpandKey" ></avue-tree>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -667,8 +667,9 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
treeData:'',
|
|
treeData:'',
|
|
- projectid:""
|
|
|
|
-
|
|
|
|
|
|
+ projectid:"",
|
|
|
|
+ curNode:{},
|
|
|
|
+ defaultExpandKey:[],//默认展开的节点
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed:{
|
|
computed:{
|
|
@@ -751,6 +752,7 @@ export default {
|
|
},
|
|
},
|
|
nodeClick(data,node){
|
|
nodeClick(data,node){
|
|
console.log(data,'treedata');
|
|
console.log(data,'treedata');
|
|
|
|
+ this.curNode=node
|
|
if(data.hasChildren){
|
|
if(data.hasChildren){
|
|
this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
|
|
this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
|
|
this.loadData=res.records
|
|
this.loadData=res.records
|
|
@@ -821,7 +823,15 @@ export default {
|
|
// console.log(this.ids,'this.ids删除');
|
|
// console.log(this.ids,'this.ids删除');
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
- this.onLoad(this.page);
|
|
|
|
|
|
+ this.onLoad(this.page);//刷新表格数据
|
|
|
|
+ //刷新左边树形数据
|
|
|
|
+ const parentId =12345678910
|
|
|
|
+ tabTypeLazyTreeAll({parentId,current:1,size:200}).then(res => {
|
|
|
|
+ this.treeData=res.data.data.records;
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ this.defaultExpandKey.push(this.curNode.data.parentId)
|
|
|
|
+ })
|
|
|
|
+ });
|
|
this.$message({
|
|
this.$message({
|
|
type: "success",
|
|
type: "success",
|
|
message: "操作成功!"
|
|
message: "操作成功!"
|