1.【template】
<el-tree :data="orginOrgnData"
node-key="id"
ref="tree"
:highlight-current="true"
@node-click="getNodeData"
:default-expanded-keys="[2, 3]"
:default-checked-keys="[5]"
:default-expand-all="true"
:props="defaultProps"
>
</el-tree>
2.【method】
//获取菜单数据
getData(orgnCode) {
//let orgnCode = JSON.parse(sessionStorage.getItem('sessionData')).orgnCode
// sessionStorage.setItem('sessionData',JSON.stringify(sessData));
let parames = {
"moduleName":this.A,
"functionName": "uniformcertificationbiz.service.organ.OrgnService",
"methodName": "qryOrgnList",
"data": {
"orgnCode": orgnCode,
// "orgnStatus": "1"
}
}
this.http(JSON.stringify(parames))
.then((res) => {
console.log(res,"test>>>>>>>>>>>>>")
this.organData = res.data.orgns.children;
//console.log('>>>>>>>>>')
// console.log(this.organData.children)
// this.orginOrgnData = res.data.orgns
})
.catch(err => {
console.log(err)
})
},
//获取菜单树节点数据
getNodeData(n, m, j) {
//children id title
console.log("=n===========================================================",n);
//node 结点
console.log("=m=========================================================",m);
//Vue.component
console.log("=i========================================================",j)
this.nodeData = n;
this.isShow = true;
this.addShow = false;
this.editShow = false;
this.getFormData();
this.getData(this.nodeData.id);
console.log("99999999===========================================================",this.nodeData.id);
console.log(this.orginOrgnData)
this.nodeData.children=this.organData;
},