Browse Source

党组织管理懒加载子节点没数据不显示下拉

V1.0
mk 2 years ago
parent
commit
d2ef30e203
  1. 28
      src/views/modules/communityParty/partyOrg/orgTree.vue

28
src/views/modules/communityParty/partyOrg/orgTree.vue

@ -41,8 +41,8 @@
:load="handleTreeNodeExpand"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
ref="table"
>
:row-class-name="rowClassName"
>
<el-table-column
prop="partyOrgName"
label="党组织名称"
@ -197,7 +197,15 @@ export default {
}
});
},
rowClassName(row, rowIndex) {
if (row.row.childrenQty == 0) {
return 'no-expand';
}
return '';
},
hasChildren(row){
console.log(row);
},
/**
* 点击"新增"
*/
@ -259,8 +267,14 @@ export default {
if (!data) {
return;
}
this.partyOrgTree=[]
this.partyOrgTree.push(data);
data.children.forEach(item=>{
if(item.childrenQty != 0){
item.hasChildren = true
}
})
this.tableKey = new Date().getTime();
// 2
console.log(">>>>", this.partyOrgTree)
@ -285,6 +299,11 @@ export default {
})
this.epmetResultResolver.success((data) => {
data.forEach(item=>{
if(item.childrenQty != 0){
item.hasChildren = true
}
})
row.children = data; //
resolve(row.children); //
// this.partyOrgTree.push(data);
@ -379,4 +398,7 @@ export default {
margin-top: 20px;
text-align: center;
}
::v-deep .no-expand>:nth-child(1) .cell .el-table__expand-icon{
display: none;
}
</style>

Loading…
Cancel
Save