點擊機構樹查詢人員信息和行政區域數據,但他們是兩個接口。
template結構
<div class="organize-view">
<el-tree
:data="treeData"
:props="defaultProps"
ref="tree"
:show-checkbox="false"
:load="loadSubOrg"
lazy
@node-click="getData"
:expand-on-click-node='false'
:default-expand-all='false'>
<span class="custom-tree-node" slot-scope="{ node}">
<span class="tree-node_left">{{node.label}}</span>
</span>
</el-tree>
</div>
//點擊機構獲取某機構人員數據
getData(node) {
// let orgId = node.id;
let that = this;
this.paulId = node.id;
this.$axios.all([ that.getHaveUser(), that.getDistrict()])
.then(that.$axios.spread((resUser, resDist) => {
console.log(resUser.users, '人員')
this.tableData = resUser.users;
console.log(resDist.district, '行政區域')
}))
},
getHaveUser() {
return this.$axios({
method: 'post',
url: this.$api.personManage.findUsersHaveResources,
data: { "orgId" : this.paulId}
})
},
getDistrict() {
return this.$axios({
method: 'get',
url: this.$api.organization.findByOrgId + '/' + this.paulId,
})
},

