|
|
@ -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> |
|
|
|