diff --git a/src/api/workflow/category/types.ts b/src/api/workflow/category/types.ts index c08f14d..047002e 100644 --- a/src/api/workflow/category/types.ts +++ b/src/api/workflow/category/types.ts @@ -1,13 +1,16 @@ +export interface CategoryTreeVO { + id: number | string; + label: string; + parentId: number | string; + weight: number; + children: CategoryTreeVO[]; +} + export interface CategoryVO { /** * 主键 */ - id: string; - - /** - * 分类名称 - */ - categoryName: string; + categoryId: string | number; /** * 父级id @@ -15,33 +18,60 @@ export interface CategoryVO { parentId: string | number; /** - * 排序 + * 父类别名称 */ - sortNum: number; + parentName: string; + + /** + * 祖级列表 + */ + ancestors: string; + + /** + * 分类名称 + */ + categoryName: string; + + /** + * 显示顺序 + */ + orderNum: number; + + /** + * 流程分类状态(0正常 1停用) + */ + status: number; + + children: CategoryVO[]; - children?: CategoryVO[]; } export interface CategoryForm extends BaseEntity { /** * 主键 */ - id?: string | number; + categoryId?: string | number; + + /** + * 父级id + */ + parentId: string | number; /** * 分类名称 */ categoryName?: string; - /** - * 父级id - */ - parentId?: string | number; - /** * 排序 */ - sortNum?: number; + orderNum?: number; + + /** + * 流程分类状态(0正常 1停用) + */ + status: number; + } export interface CategoryQuery extends PageQuery { diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts index 34337bb..5f95907 100644 --- a/src/api/workflow/definition/index.ts +++ b/src/api/workflow/definition/index.ts @@ -1,19 +1,39 @@ import request from '@/utils/request'; -import { FlowDefinitionQuery, definitionXmlVO, FlowDefinitionForm } from '@/api/workflow/definition/types'; +import { + FlowDefinitionQuery, + definitionXmlVO, + FlowDefinitionForm, + FlowDefinitionVo +} from '@/api/workflow/definition/types'; import { AxiosPromise } from 'axios'; +import {CategoryForm, CategoryTreeVO} from "@/api/workflow/category/types"; /** * 获取流程定义列表 * @param query 流程实例id * @returns */ -export const listDefinition = (query: FlowDefinitionQuery): AxiosPromise => { +export const listDefinition = (query: FlowDefinitionQuery): AxiosPromise => { return request({ url: `/workflow/definition/list`, method: 'get', params: query }); }; + +/** + * 获取流程分类树列表 + * @param query 流程实例id + * @returns + */ +export const categoryTree = (query?: CategoryForm): AxiosPromise => { + return request({ + url: `/workflow/definition/categoryTree`, + method: 'get', + params: query + }); +}; + /** * 按照流程定义key获取流程定义 * @param flowCode 流程编码 diff --git a/src/api/workflow/definition/types.ts b/src/api/workflow/definition/types.ts index d888167..5de7f77 100644 --- a/src/api/workflow/definition/types.ts +++ b/src/api/workflow/definition/types.ts @@ -1,7 +1,7 @@ export interface FlowDefinitionQuery extends PageQuery { flowCode?: string; flowName?: string; - category: string; + category: string | number; isPublish?: number; } diff --git a/src/views/workflow/category/index.vue b/src/views/workflow/category/index.vue index 9cc48c3..59b2911 100644 --- a/src/views/workflow/category/index.vue +++ b/src/views/workflow/category/index.vue @@ -30,7 +30,7 @@ ref="categoryTableRef" v-loading="loading" :data="categoryList" - row-key="id" + row-key="categoryId" :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" > @@ -58,8 +58,8 @@ @@ -67,8 +67,8 @@ - - + +