| | |
| | | import type { |
| | | CategoryForm, |
| | | CategoryQuery, |
| | | CategoryTree, |
| | | CategoryVO, |
| | | } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | // import request from '#/utils/request'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | /** |
| | | * 获取流程分类树列表 |
| | | * @returns tree |
| | | */ |
| | | export function categoryTree() { |
| | | return requestClient.get<CategoryTree[]>('/workflow/category/categoryTree'); |
| | | // 查询流程分类列表 |
| | | export function listCategory(query) { |
| | | return requestClient.get('/category/list', { params: query }); |
| | | } |
| | | |
| | | /** |
| | | * 查询流程分类列表 |
| | | * @param params |
| | | * @returns 流程分类列表 |
| | | */ |
| | | export function categoryList(params?: CategoryQuery) { |
| | | return requestClient.get<CategoryVO[]>(`/workflow/category/list`, { params }); |
| | | // 查询流程分类列表 |
| | | export function listAllCategory(query) { |
| | | return requestClient.get('/category/listAll', { params: query }); |
| | | } |
| | | // 查询流程分类详细 |
| | | export function getCategory(categoryId) { |
| | | return requestClient.get(`/category/${categoryId}`); |
| | | } |
| | | // 新增流程分类 |
| | | export function addCategory(data) { |
| | | return requestClient.post('/category', { data }); |
| | | } |
| | | |
| | | /** |
| | | * 查询流程分类详情 |
| | | * @param id id |
| | | * @returns 流程分类详情 |
| | | */ |
| | | export function categoryInfo(id: ID) { |
| | | return requestClient.get<CategoryVO>(`/workflow/category/${id}`); |
| | | // 修改流程分类 |
| | | export function updateCategory(data) { |
| | | return requestClient.put('/category', { data }); |
| | | } |
| | | |
| | | /** |
| | | * 新增流程分类 |
| | | * @param data |
| | | * @returns void |
| | | */ |
| | | export function categoryAdd(data: CategoryForm) { |
| | | return requestClient.postWithMsg<void>('/workflow/category', data); |
| | | } |
| | | |
| | | /** |
| | | * 更新流程分类 |
| | | * @param data |
| | | * @returns void |
| | | */ |
| | | export function categoryUpdate(data: CategoryForm) { |
| | | return requestClient.putWithMsg<void>('/workflow/category', data); |
| | | } |
| | | |
| | | /** |
| | | * 删除流程分类 |
| | | * @param id id |
| | | * @returns void |
| | | */ |
| | | export function categoryRemove(id: ID | IDS) { |
| | | return requestClient.deleteWithMsg<void>(`/workflow/category/${id}`); |
| | | // 删除流程分类 |
| | | export function delCategory(categoryIds) { |
| | | return requestClient.delete(`/category/${categoryIds}`); |
| | | } |