From 817c65f7e21b675368a384fd7209c7bee573d23c Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 21 六月 2024 12:31:25 +0800 Subject: [PATCH] !126 fix: 进入审批页面会多次加载用户列表和部门等接口 进入点击取消之后也会重新加载接口 Merge pull request !126 from 玲娜贝er/dev --- src/api/system/post/index.ts | 58 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 35 insertions(+), 23 deletions(-) diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 84d5615..5f6ab18 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -4,43 +4,55 @@ // 鏌ヨ宀椾綅鍒楄〃 export function listPost(query: PostQuery): AxiosPromise<PostVO[]> { - return request({ - url: '/system/post/list', - method: 'get', - params: query - }); + return request({ + url: '/system/post/list', + method: 'get', + params: query + }); } // 鏌ヨ宀椾綅璇︾粏 export function getPost(postId: string | number): AxiosPromise<PostVO> { - return request({ - url: '/system/post/' + postId, - method: 'get' - }); + return request({ + url: '/system/post/' + postId, + method: 'get' + }); +} + +// 鑾峰彇宀椾綅閫夋嫨妗嗗垪琛� +export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> { + return request({ + url: '/system/post/optionselect', + method: 'get', + params: { + postIds: postIds, + deptId: deptId + } + }); } // 鏂板宀椾綅 export function addPost(data: PostForm) { - return request({ - url: '/system/post', - method: 'post', - data: data - }); + return request({ + url: '/system/post', + method: 'post', + data: data + }); } // 淇敼宀椾綅 export function updatePost(data: PostForm) { - return request({ - url: '/system/post', - method: 'put', - data: data - }); + return request({ + url: '/system/post', + method: 'put', + data: data + }); } // 鍒犻櫎宀椾綅 export function delPost(postId: string | number | (string | number)[]) { - return request({ - url: '/system/post/' + postId, - method: 'delete' - }); + return request({ + url: '/system/post/' + postId, + method: 'delete' + }); } -- Gitblit v1.9.3