diff --git a/apps/web-antd/src/api/workflow/category/index.ts b/apps/web-antd/src/api/workflow/category/index.ts new file mode 100644 index 00000000..3497c749 --- /dev/null +++ b/apps/web-antd/src/api/workflow/category/index.ts @@ -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(`/workflow/category/list`, { params }); +} + +/** + * 查询流程分类详情 + * @param id id + * @returns 流程分类详情 + */ +export function categoryInfo(id: ID) { + return requestClient.get(`/workflow/category/${id}`); +} + +/** + * 新增流程分类 + * @param data + * @returns void + */ +export function categoryAdd(data: CategoryForm) { + return requestClient.postWithMsg('/workflow/category', data); +} + +/** + * 更新流程分类 + * @param data + * @returns void + */ +export function categoryUpdate(data: CategoryForm) { + return requestClient.putWithMsg('/workflow/category', data); +} + +/** + * 删除流程分类 + * @param id id + * @returns void + */ +export function categoryRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/workflow/category/${id}`); +} diff --git a/apps/web-antd/src/api/workflow/category/model.d.ts b/apps/web-antd/src/api/workflow/category/model.d.ts new file mode 100644 index 00000000..87937ec8 --- /dev/null +++ b/apps/web-antd/src/api/workflow/category/model.d.ts @@ -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; +} diff --git a/apps/web-antd/src/views/workflow/category/category-modal.vue b/apps/web-antd/src/views/workflow/category/category-modal.vue new file mode 100644 index 00000000..9cd33e69 --- /dev/null +++ b/apps/web-antd/src/views/workflow/category/category-modal.vue @@ -0,0 +1,119 @@ + + + diff --git a/apps/web-antd/src/views/workflow/category/data.ts b/apps/web-antd/src/views/workflow/category/data.ts new file mode 100644 index 00000000..7eefc02c --- /dev/null +++ b/apps/web-antd/src/views/workflow/category/data.ts @@ -0,0 +1,75 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +export const querySchema: FormSchemaGetter = () => [ + { + fieldName: 'categoryName', + label: '分类名称', + component: 'Input', + }, + { + fieldName: 'categoryCode', + label: '分类编码', + component: 'Input', + }, +]; + +export const columns: VxeGridProps['columns'] = [ + { + field: 'categoryName', + title: '分类名称', + treeNode: true, + }, + { + field: 'categoryCode', + title: '分类编码', + }, + { + field: 'sortNum', + title: '排序', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: 'id', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + fieldName: 'parentId', + label: '父级分类', + rules: 'required', + defaultValue: 0, + component: 'TreeSelect', + }, + { + fieldName: 'categoryName', + label: '分类名称', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'categoryCode', + label: '分类编码', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'sortNum', + label: '排序', + component: 'InputNumber', + rules: 'required', + }, +]; diff --git a/apps/web-antd/src/views/workflow/category/index.vue b/apps/web-antd/src/views/workflow/category/index.vue index 06372a15..e457b3af 100644 --- a/apps/web-antd/src/views/workflow/category/index.vue +++ b/apps/web-antd/src/views/workflow/category/index.vue @@ -1,9 +1,144 @@