mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-21 14:35:08 +08:00
refactor: vue3 axios api ...
This commit is contained in:
@ -1,32 +1,34 @@
|
||||
import { defHttp } from '@/config/axios'
|
||||
import { useAxios } from '@/hooks/web/useAxios'
|
||||
import type { DeptVO } from './types'
|
||||
|
||||
const request = useAxios()
|
||||
|
||||
// 查询部门(精简)列表
|
||||
export const listSimpleDeptApi = () => {
|
||||
return defHttp.get({ url: '/system/dept/list-all-simple' })
|
||||
return request.get({ url: '/system/dept/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询部门列表
|
||||
export const getDeptPageApi = ({ params }) => {
|
||||
return defHttp.get<PageResult<DeptVO>>({ url: '/system/dept/list', params })
|
||||
export const getDeptPageApi = (params) => {
|
||||
return request.get({ url: '/system/dept/list', params })
|
||||
}
|
||||
|
||||
// 查询部门详情
|
||||
export const getDeptApi = (id: number) => {
|
||||
return defHttp.get<DeptVO>({ url: '/system/dept/get?id=' + id })
|
||||
return request.get({ url: '/system/dept/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增部门
|
||||
export const createDeptApi = (params: DeptVO) => {
|
||||
return defHttp.post({ url: '/system/dept/create', data: params })
|
||||
export const createDeptApi = (data: DeptVO) => {
|
||||
return request.post({ url: '/system/dept/create', data: data })
|
||||
}
|
||||
|
||||
// 修改部门
|
||||
export const updateDeptApi = (params: DeptVO) => {
|
||||
return defHttp.put({ url: '/system/dept/update', data: params })
|
||||
return request.put({ url: '/system/dept/update', data: params })
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export const deleteDeptApi = (id: number) => {
|
||||
return defHttp.delete({ url: '/system/dept/delete?id=' + id })
|
||||
return request.delete({ url: '/system/dept/delete?id=' + id })
|
||||
}
|
||||
|
Reference in New Issue
Block a user