|
@@ -475,6 +475,10 @@ export default {
|
|
|
type:String,
|
|
|
default:''
|
|
|
},
|
|
|
+ fromcurNode:{
|
|
|
+ type:Object,
|
|
|
+ default:{}
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -617,12 +621,38 @@ export default {
|
|
|
this.treeLoad = false;
|
|
|
this.treeData = res.data.data;
|
|
|
this.defaultExpanded = [this.nodeid];
|
|
|
+
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ let isArray = Array.isArray(this.$refs.tree)
|
|
|
+ if (isArray) {
|
|
|
+ // 根据 id 获取节点信息
|
|
|
+ this.$refs.tree[0].setCurrentKey(this.nodeid);
|
|
|
+ } else {
|
|
|
+ this.$refs.tree.setCurrentKey(this.nodeid);
|
|
|
+ }
|
|
|
+ this.getNodeDetail(this.fromcurNode)
|
|
|
+ this. getNodeDetailComp(this.fromcurNode)
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
}else{
|
|
|
getAlltree(this.userInfo.tenant_id, 1, this.wbsid).then((res) => {
|
|
|
this.treeLoad = false;
|
|
|
this.treeData = res.data.data;
|
|
|
this.defaultExpanded = [this.nodeid];
|
|
|
+ console.log(this.$refs.tree,'tree');
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ let isArray = Array.isArray(this.$refs.tree)
|
|
|
+ if (isArray) {
|
|
|
+ // 根据 id 获取节点信息
|
|
|
+ this.$refs.tree[0].setCurrentKey(this.nodeid);
|
|
|
+ } else {
|
|
|
+ this.$refs.tree.setCurrentKey(this.nodeid);
|
|
|
+ }
|
|
|
+ this.getNodeDetail(this.fromcurNode)
|
|
|
+ this. getNodeDetailComp(this.fromcurNode)
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -1268,6 +1298,7 @@ export default {
|
|
|
getNodeDetail(data) {
|
|
|
if(this.pid){
|
|
|
this.eleListable=true;
|
|
|
+ console.log(data.id,'data.id');
|
|
|
wbsPrivateGetNodeTabAndParam(data.id, this.pid, this.wbsid).then((res) => {
|
|
|
if(res.data.data.tabData.length){
|
|
|
this.eleTableList = res.data.data.tabData;
|
|
@@ -1379,6 +1410,7 @@ export default {
|
|
|
|
|
|
//方法下面的点击树节点
|
|
|
getNodeDetailComp(data) {
|
|
|
+ console.log(data.id,'data.id111111111');
|
|
|
if(this.pid){
|
|
|
wbsPrivateGetNodeTabAndParam(data.id, this.pid, this.wbsid).then((res) => {
|
|
|
if(res.data.data.tabData.length){
|