This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from Jzow/master
Add department add update delete api and views CC #41
- Loading branch information
Showing
6 changed files
with
186 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
import { | ||
addOrUpdateDeptReq, | ||
DeptListItem, | ||
GetDeptInfoModel, | ||
} from './model/dpetModel'; | ||
|
||
import { defHttp } from '/@/utils/http/axios'; | ||
import {BaseDataResp} from "@/api/model/baseModel"; | ||
import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; | ||
import {ErrorMessageMode} from "#/axios"; | ||
|
||
enum Api { | ||
DeptList = '/dept/list', | ||
UserBindDept = '/dept/userBindDept', | ||
AddOrUpdateDept = '/dept/addOrUpdate', | ||
DeleteDept = '/dept/delete', | ||
} | ||
|
||
|
||
export function getDeptList(params?: DeptListItem) { | ||
return defHttp.get<BaseDataResp<GetDeptInfoModel>>({url: Api.DeptList, params}) | ||
} | ||
|
||
export function getUserBindDept(params?: DeptListItem) { | ||
export function getUserBindDept() { | ||
return defHttp.get<BaseDataResp<GetDeptInfoModel>>({url: Api.UserBindDept}) | ||
} | ||
|
||
export function addOrUpdateDept(params: addOrUpdateDeptReq, mode: ErrorMessageMode = 'notice') { | ||
return defHttp.post<BaseResp>({ | ||
url: Api.AddOrUpdateDept, params}, | ||
{ | ||
errorMessageMode: mode, | ||
successMessageMode: mode, | ||
} | ||
) | ||
} | ||
|
||
export function deleteDept(id: number | string, mode: ErrorMessageMode = 'notice') { | ||
return defHttp.post<BaseResp>({ | ||
url: `${Api.DeleteDept}?id=${id}`}, | ||
{ | ||
errorMessageMode: mode, | ||
successMessageMode: mode, | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters