From 5d641e5de49e64b89c998f28f9f1cf65515e1721 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: 星期二, 30 四月 2024 22:09:53 +0800 Subject: [PATCH] fix: 用户管理-部门变化后需要重新选择岗位 --- src/views/system/user/index.vue | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1e15998..148e8af 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -287,10 +287,11 @@ 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,17 @@ initPassword.value = response.data; }); }); + +// 鐩戞祴閮ㄩ棬鍙樺寲鍔犺浇宀椾綅 +watch( + () => form.value.deptId, + async () => { + const response = await optionselect(form.value.deptId); + postOptions.value = response.data; + /** 鍙樺寲鍚庨渶瑕侀噸鏂伴�夋嫨宀椾綅 */ + form.value.postIds = []; + } +); </script> <style lang="scss" scoped></style> -- Gitblit v1.9.3