From 498f846560b09022dd474670d80de2eee00232da Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Fri, 5 Sep 2025 13:59:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E9=83=A8=E9=97=A8=E6=A0=91=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=B9=B6=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 post api 中添加 postDeptTreeSelect 接口 - 在 post 组件中使用新的 postDeptTreeSelect 接口 - 修改 dept-tree 组件,增加 api 属性以支持不同的数据源 --- apps/web-antd/src/api/system/post/index.ts | 9 +++++++++ apps/web-antd/src/views/system/post/index.vue | 8 +++++++- .../src/views/system/user/dept-tree.vue | 18 ++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/apps/web-antd/src/api/system/post/index.ts b/apps/web-antd/src/api/system/post/index.ts index 3e1ef2e2..e39f52da 100644 --- a/apps/web-antd/src/api/system/post/index.ts +++ b/apps/web-antd/src/api/system/post/index.ts @@ -1,3 +1,4 @@ +import type { DeptTree } from '../user/model'; import type { Post } from './model'; import type { ID, IDS, PageQuery } from '#/api/common'; @@ -74,3 +75,11 @@ export function postRemove(postIds: IDS) { export function postOptionSelect(deptId: ID) { return requestClient.get(Api.postSelect, { params: { deptId } }); } + +/** + * 岗位专用 - 获取部门树 + * @returns 部门树 + */ +export function postDeptTreeSelect() { + return requestClient.get('/system/post/deptTree'); +} diff --git a/apps/web-antd/src/views/system/post/index.vue b/apps/web-antd/src/views/system/post/index.vue index 7c18a4fc..8abe160a 100644 --- a/apps/web-antd/src/views/system/post/index.vue +++ b/apps/web-antd/src/views/system/post/index.vue @@ -12,7 +12,12 @@ import { getVxePopupContainer } from '@vben/utils'; import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table'; -import { postExport, postList, postRemove } from '#/api/system/post'; +import { + postDeptTreeSelect, + postExport, + postList, + postRemove, +} from '#/api/system/post'; import { commonDownloadExcel } from '#/utils/file/download'; import DeptTree from '#/views/system/user/dept-tree.vue'; @@ -122,6 +127,7 @@ function handleDownloadExcel() {