|
|
@ -92,11 +92,10 @@ |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useMethods } from '/@/hooks/system/useMethods'; |
|
|
|
import { useMethods } from '/@/hooks/system/useMethods'; |
|
|
|
import { Api, deleteBatchDepart, queryDepartTreeSync4ZhuGuanBuMen } from '../depart.api'; |
|
|
|
import { Api, deleteBatchDepart, queryDepartTreeSync } from '../depart.api'; |
|
|
|
import { searchByKeywords } from '/@/views/system/departUser/depart.user.api'; |
|
|
|
import { searchByKeywords } from '/@/views/system/departUser/depart.user.api'; |
|
|
|
import DepartFormModal from '/@/views/system/depart/components/DepartFormModal.vue'; |
|
|
|
import DepartFormModal from '/@/views/system/depart/components/DepartFormModal.vue'; |
|
|
|
import { Popconfirm } from 'ant-design-vue'; |
|
|
|
import { Popconfirm } from 'ant-design-vue'; |
|
|
|
import {useUserStore} from "@/store/modules/user"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const prefixCls = inject('prefixCls'); |
|
|
|
const prefixCls = inject('prefixCls'); |
|
|
|
const emit = defineEmits(['select', 'rootTreeData']); |
|
|
|
const emit = defineEmits(['select', 'rootTreeData']); |
|
|
@ -125,16 +124,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
// 注册 modal |
|
|
|
// 注册 modal |
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
const userStore = useUserStore(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 加载顶级部门信息 |
|
|
|
// 加载顶级部门信息 |
|
|
|
async function loadRootTreeData() { |
|
|
|
async function loadRootTreeData() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
loading.value = true; |
|
|
|
loading.value = true; |
|
|
|
treeData.value = []; |
|
|
|
treeData.value = []; |
|
|
|
const result = await queryDepartTreeSync4ZhuGuanBuMen({ |
|
|
|
const result = await queryDepartTreeSync(); |
|
|
|
parentOrgCode: userStore.getUserInfo.orgCode, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (Array.isArray(result)) { |
|
|
|
if (Array.isArray(result)) { |
|
|
|
treeData.value = result; |
|
|
|
treeData.value = result; |
|
|
|
} |
|
|
|
} |
|
|
@ -162,9 +158,8 @@ |
|
|
|
// 加载子级部门信息 |
|
|
|
// 加载子级部门信息 |
|
|
|
async function loadChildrenTreeData(treeNode) { |
|
|
|
async function loadChildrenTreeData(treeNode) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const result = await queryDepartTreeSync4ZhuGuanBuMen({ |
|
|
|
const result = await queryDepartTreeSync({ |
|
|
|
// pid: treeNode.dataRef.id, |
|
|
|
pid: treeNode.dataRef.id, |
|
|
|
parentOrgCode: treeNode.dataRef.orgCode, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
if (result.length == 0) { |
|
|
|
if (result.length == 0) { |
|
|
|
treeNode.dataRef.isLeaf = true; |
|
|
|
treeNode.dataRef.isLeaf = true; |
|
|
|