feat: 流程分类
This commit is contained in:
50
apps/web-antd/src/api/workflow/category/index.ts
Normal file
50
apps/web-antd/src/api/workflow/category/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { CategoryForm, CategoryQuery, CategoryVO } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询流程分类列表
|
||||
* @param params
|
||||
* @returns 流程分类列表
|
||||
*/
|
||||
export function categoryList(params?: CategoryQuery) {
|
||||
return requestClient.get<CategoryVO[]>(`/workflow/category/list`, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程分类详情
|
||||
* @param id id
|
||||
* @returns 流程分类详情
|
||||
*/
|
||||
export function categoryInfo(id: ID) {
|
||||
return requestClient.get<CategoryVO>(`/workflow/category/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程分类
|
||||
* @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}`);
|
||||
}
|
87
apps/web-antd/src/api/workflow/category/model.d.ts
vendored
Normal file
87
apps/web-antd/src/api/workflow/category/model.d.ts
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import type { BaseEntity } from '#/api/common';
|
||||
|
||||
export interface CategoryVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: number | string;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
categoryName: string;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
categoryCode: string;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
parentId: number | string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sortNum: number;
|
||||
|
||||
/**
|
||||
* 子对象
|
||||
*/
|
||||
children: CategoryVO[];
|
||||
}
|
||||
|
||||
export interface CategoryForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: number | string;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
categoryName?: string;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
categoryCode?: string;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
parentId?: number | string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sortNum?: number;
|
||||
}
|
||||
|
||||
export interface CategoryQuery {
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
categoryName?: string;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
categoryCode?: string;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
parentId?: number | string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sortNum?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
Reference in New Issue
Block a user