|
@@ -72,6 +72,7 @@
|
|
|
@current-change="currentChangeChild"
|
|
@current-change="currentChangeChild"
|
|
|
@size-change="sizeChangeChild"
|
|
@size-change="sizeChangeChild"
|
|
|
@refresh-change="refreshChangeChild"
|
|
@refresh-change="refreshChangeChild"
|
|
|
|
|
+ @tree-load="onLoadChildTree"
|
|
|
@on-load="onLoadChild"
|
|
@on-load="onLoadChild"
|
|
|
>
|
|
>
|
|
|
<template slot="menuLeft">
|
|
<template slot="menuLeft">
|
|
@@ -98,7 +99,7 @@
|
|
|
icon="el-icon-circle-plus-outline"
|
|
icon="el-icon-circle-plus-outline"
|
|
|
size="small"
|
|
size="small"
|
|
|
@click.stop="handleAdd(scope.row,scope.index)"
|
|
@click.stop="handleAdd(scope.row,scope.index)"
|
|
|
- v-if="userInfo.role_name.includes('admin')"
|
|
|
|
|
|
|
+ v-if="userInfo.role_name.includes('admin') && scope.row.hasChildren"
|
|
|
>新增子项
|
|
>新增子项
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -482,6 +483,17 @@ export default {
|
|
|
this.selectionClear();
|
|
this.selectionClear();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ onLoadChildTree(tree, treeNode, resolve) {
|
|
|
|
|
+ this.loadingChild = true;
|
|
|
|
|
+ getChildList(1,9999,tree.id).then(res => {
|
|
|
|
|
+ res.data.data.records.forEach(ele => {
|
|
|
|
|
+ ele.hasChildren = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ resolve(res.data.data.records);
|
|
|
|
|
+ }).finally(()=>{
|
|
|
|
|
+ this.loadingChild = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
handleImport() {
|
|
handleImport() {
|
|
|
this.excelBox = true;
|
|
this.excelBox = true;
|
|
|
},
|
|
},
|