mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
feat(projects): 新增岗位部门树接口
This commit is contained in:
@ -43,3 +43,10 @@ export function fetchGetPostSelect(deptId?: CommonType.IdType, postIds?: CommonT
|
||||
params: { postIds, deptId }
|
||||
});
|
||||
}
|
||||
/** 获取部门选择框列表 */
|
||||
export function fetchGetPostDeptSelect() {
|
||||
return request<Api.Common.CommonTreeRecord>({
|
||||
url: '/system/post/deptTree',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -2,8 +2,7 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { NButton, NDivider } from 'naive-ui';
|
||||
import { useLoading } from '@sa/hooks';
|
||||
import { fetchBatchDeletePost, fetchGetPostList } from '@/service/api/system/post';
|
||||
import { fetchGetDeptTree } from '@/service/api/system';
|
||||
import { fetchBatchDeletePost, fetchGetPostDeptSelect, fetchGetPostList } from '@/service/api/system/post';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { useAuth } from '@/hooks/business/auth';
|
||||
import { useDownload } from '@/hooks/business/download';
|
||||
@ -191,16 +190,17 @@ const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTre
|
||||
const deptPattern = ref<string>();
|
||||
const deptData = ref<Api.Common.CommonTreeRecord>([]);
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
async function getTreeData() {
|
||||
|
||||
async function getDeptOptions() {
|
||||
// 加载
|
||||
startTreeLoading();
|
||||
const { data: tree, error } = await fetchGetDeptTree();
|
||||
const { data: tree, error } = await fetchGetPostDeptSelect();
|
||||
if (!error) {
|
||||
deptData.value = tree;
|
||||
}
|
||||
endTreeLoading();
|
||||
}
|
||||
|
||||
getTreeData();
|
||||
getDeptOptions();
|
||||
|
||||
function handleClickTree(keys: string[]) {
|
||||
searchParams.belongDeptId = keys.length ? keys[0] : null;
|
||||
@ -210,7 +210,7 @@ function handleClickTree(keys: string[]) {
|
||||
|
||||
function handleResetTreeData() {
|
||||
deptPattern.value = undefined;
|
||||
getTreeData();
|
||||
getDeptOptions();
|
||||
}
|
||||
|
||||
function handleResetSearch() {
|
||||
|
Reference in New Issue
Block a user