diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts index 494745c..adaefd2 100644 --- a/src/api/system/dept/types.ts +++ b/src/api/system/dept/types.ts @@ -28,6 +28,18 @@ export interface DeptVO extends BaseEntity { menuId: string | number; } +/** + * 部门类型 + */ +export interface DeptTreeVO extends BaseEntity { + id: number | string; + label: string; + parentId: number | string; + weight: number; + children: DeptTreeVO[]; + disabled: boolean; +} + /** * 部门表单类型 */ diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 25c7884..0867c48 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -1,4 +1,4 @@ -import { DeptVO } from './../dept/types'; +import {DeptTreeVO, DeptVO} from './../dept/types'; import { RoleVO } from '@/api/system/role/types'; import request from '@/utils/request'; import { AxiosPromise } from 'axios'; @@ -202,7 +202,7 @@ export const listUserByDeptId = (deptId: string | number): AxiosPromise => { +export const deptTreeSelect = (): AxiosPromise => { return request({ url: '/system/user/deptTree', method: 'get' diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 7f86ef4..0d402f2 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -20,6 +20,7 @@ import useTagsViewStore from '@/store/modules/tagsView'; import IframeToggle from './IframeToggle/index.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const route = useRoute(); const tagsViewStore = useTagsViewStore(); // 随机动画集合 @@ -37,6 +38,20 @@ watch( }, { immediate: true } ); + +onMounted(() => { + addIframe() +}) + +watchEffect((route) => { + addIframe() +}) + +function addIframe() { + if (route.meta.link) { + useTagsViewStore().addIframeView(route) + } +}