|
|
@@ -1,12 +1,25 @@
|
|
|
<template>
|
|
|
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
|
|
- <OrgTree class="w-1/4 xl:w-1/5" @select="handleSelect" ref="OrgTreeChild"/>
|
|
|
- <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
|
|
|
+ <OrgTree
|
|
|
+ class="w-1/4 xl:w-1/5"
|
|
|
+ style="overflow: auto"
|
|
|
+ @select="handleSelect"
|
|
|
+ ref="OrgTreeChild"
|
|
|
+ />
|
|
|
+ <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
|
|
|
<template #toolbar>
|
|
|
- <a-button type="primary" @click="handleCreatebrother" :disabled="!hasPermission('sysOrg:add')">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ @click="handleCreatebrother"
|
|
|
+ :disabled="!hasPermission('sysOrg:add')"
|
|
|
+ >
|
|
|
添加同级单位
|
|
|
</a-button>
|
|
|
- <a-button type="primary" @click="handleCreatechild()" :disabled="!hasPermission('sysOrg:add')">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ @click="handleCreatechild()"
|
|
|
+ :disabled="!hasPermission('sysOrg:add')"
|
|
|
+ >
|
|
|
添加下级单位
|
|
|
</a-button>
|
|
|
</template>
|
|
|
@@ -37,7 +50,7 @@
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import {defineComponent, onMounted, reactive, ref, unref} from 'vue';
|
|
|
+ import { defineComponent, reactive, ref, unref } from 'vue';
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
@@ -52,7 +65,7 @@
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'OrgManagement',
|
|
|
- components: { BasicTable, OrgModal, TableAction , PageWrapper, OrgTree},
|
|
|
+ components: { BasicTable, OrgModal, TableAction, PageWrapper, OrgTree },
|
|
|
setup() {
|
|
|
const { hasPermission } = usePermission();
|
|
|
const OrgTreeChild = ref(null);
|
|
|
@@ -73,7 +86,7 @@
|
|
|
showTableSetting: true,
|
|
|
bordered: true,
|
|
|
showIndexColumn: false,
|
|
|
- canResize: false,
|
|
|
+ canResize: true,
|
|
|
actionColumn: {
|
|
|
width: 150,
|
|
|
title: '操作',
|
|
|
@@ -86,7 +99,7 @@
|
|
|
function getTree() {
|
|
|
const tree = unref(OrgTreeChild);
|
|
|
if (!tree) {
|
|
|
- throw new Error('tree is null!');
|
|
|
+ throw new Error('Tree is null!');
|
|
|
}
|
|
|
return tree;
|
|
|
}
|
|
|
@@ -96,7 +109,7 @@
|
|
|
}
|
|
|
|
|
|
function updateNodeByKey(key, values) {
|
|
|
- getTree().updateNodeByKey(key,values); //子组件里的方法
|
|
|
+ getTree().updateNodeByKey(key, values); // 子组件里的方法
|
|
|
}
|
|
|
|
|
|
function deleteNodeByKey(key) {
|
|
|
@@ -132,14 +145,14 @@
|
|
|
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
await deleteOrg(record.id);
|
|
|
- deleteNodeByKey(record.id )
|
|
|
+ deleteNodeByKey(record.id);
|
|
|
searchInfo.Id = record.pid;
|
|
|
reload();
|
|
|
}
|
|
|
|
|
|
function handleSelect(orgId: number, obj) {
|
|
|
searchInfo.Id = orgId;
|
|
|
- searchInfo.pId = obj.pid? obj.pid : 0;
|
|
|
+ searchInfo.pId = obj.pid ? obj.pid : 0;
|
|
|
reload();
|
|
|
}
|
|
|
|