From e2254651ca3e83f4343c5590b10635331fa801a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 24 Apr 2024 23:45:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20!pr107=20=E9=81=97?= =?UTF-8?q?=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update 优化 岗位下拉框样式问题 --- src/api/system/post/index.ts | 7 +++++-- src/views/system/post/index.vue | 25 ++++++++++++------------- src/views/system/user/index.vue | 12 +++++++++++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 1b565a8..5f6ab18 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -20,11 +20,14 @@ export function getPost(postId: string | number): AxiosPromise { } // 获取岗位选择框列表 -export function optionselect(query: PostQuery): AxiosPromise { +export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise { return request({ url: '/system/post/optionselect', method: 'get', - params: query + params: { + postIds: postIds, + deptId: deptId + } }); } diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 87ccf92..fa1c6dc 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -40,7 +40,8 @@ :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择部门" - check-strictly/> + check-strictly + /> @@ -114,18 +115,16 @@ - - - - - + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1e15998..e8e0c23 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -287,10 +287,11 @@ import api from '@/api/system/user'; import { UserForm, UserQuery, UserVO } from '@/api/system/user/types'; import { DeptVO } from '@/api/system/dept/types'; import { RoleVO } from '@/api/system/role/types'; -import { PostVO } from '@/api/system/post/types'; +import {PostQuery, PostVO} from '@/api/system/post/types'; import { treeselect } from '@/api/system/dept'; import { globalHeaders } from '@/utils/request'; import { to } from 'await-to-js'; +import {optionselect} from "@/api/system/post"; const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -645,6 +646,15 @@ onMounted(() => { initPassword.value = response.data; }); }); + +// 监测部门变化加载岗位 +watch( + () => form.value.deptId, + async () => { + const response = await optionselect(form.value.deptId); + postOptions.value = response.data; + } +);