|
|
@@ -8,6 +8,8 @@
|
|
|
:page-current="1"
|
|
|
:total="total"
|
|
|
:expand-row-keys="expandRowKeys"
|
|
|
+ lazy
|
|
|
+ :load="load"
|
|
|
:tree-props="{children: 'child'}"
|
|
|
:default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
></m-table>
|
|
|
@@ -15,7 +17,8 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getOrganizationTree
|
|
|
+ getOrganizationTree,
|
|
|
+ drillEmployee
|
|
|
} from '@/api/system'
|
|
|
export default {
|
|
|
name: 'organization-structure',
|
|
|
@@ -45,6 +48,14 @@ export default {
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
|
}
|
|
|
+ },
|
|
|
+ async load (tree, treeNode, resolve) {
|
|
|
+ try {
|
|
|
+ const { data } = await drillEmployee({ deptName: tree.organizationName })
|
|
|
+ resolve(data)
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|