From aa1bceeafb4f894a730b8588c84ccfa35c8fc72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 16 Dec 2024 17:22:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=87=8D=E6=9E=84=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/category/types.ts | 62 ++++++++++++++----- src/api/workflow/definition/index.ts | 24 ++++++- src/api/workflow/definition/types.ts | 2 +- src/views/workflow/category/index.vue | 39 ++++++------ .../workflow/processDefinition/index.vue | 30 ++++----- 5 files changed, 102 insertions(+), 55 deletions(-) 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 @@ - - + +