From 997f4a2d617c8b362e0e2c1e1b738bba5f0f1f3e Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Fri, 13 Jun 2025 00:20:45 +0800 Subject: [PATCH] =?UTF-8?q?feat-wip(projects):=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/sql/sys_menu.sql | 3 + src/locales/langs/en-us.ts | 1 + src/locales/langs/zh-cn.ts | 1 + src/router/elegant/imports.ts | 3 +- src/router/elegant/routes.ts | 3 +- src/router/elegant/transform.ts | 3 +- src/service/api/workflow/definition.ts | 8 ++ src/typings/elegant-router.d.ts | 8 +- .../{ => definition}/index.vue | 76 ++++++++++++++++--- .../process-definition/design/index.vue | 48 ++++++++++++ 10 files changed, 138 insertions(+), 16 deletions(-) rename src/views/workflow/process-definition/{ => definition}/index.vue (84%) create mode 100644 src/views/workflow/process-definition/design/index.vue diff --git a/docs/sql/sys_menu.sql b/docs/sql/sys_menu.sql index a04de6d6..02eee687 100644 --- a/docs/sql/sys_menu.sql +++ b/docs/sql/sys_menu.sql @@ -36,3 +36,6 @@ UPDATE `sys_menu` SET `path` = 'https://gitee.com/xlsea/ruoyi-plus-soybean', `co -- plus-ui 需要禁用的页面 UPDATE `sys_menu` SET `status` = '1' WHERE `menu_id` IN ( '116', '130', '131', '132', '11700', '11701' ); + +-- 工作流菜单 +UPDATE `sys_menu` SET `component` = 'workflow/processDefinition/index', WHERE `menu_id` = 11620; diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 92be6f67..37e5f884 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -236,6 +236,7 @@ const local: App.I18n.Schema = { exception_404: '404', exception_500: '500', 'workflow_process-definition': 'Process Definition', + 'workflow_process-definition_design': 'Process Definition Design', 'workflow_process-instance': 'Process Instance', workflow_leave: 'Leave Apply' }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 64a840d9..d5b0f090 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -236,6 +236,7 @@ const local: App.I18n.Schema = { exception_404: '404', exception_500: '500', 'workflow_process-definition': '流程定义', + 'workflow_process-definition_design': '流程设计', 'workflow_process-instance': '流程实例', workflow_leave: '请假申请' }, diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 6e7b0b32..eaf67c8e 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -45,6 +45,7 @@ export const views: Record Promise import("@/views/tool/gen/index.vue"), workflow_category: () => import("@/views/workflow/category/index.vue"), workflow_leave: () => import("@/views/workflow/leave/index.vue"), - "workflow_process-definition": () => import("@/views/workflow/process-definition/index.vue"), + "workflow_process-definition": () => import("@/views/workflow/process-definition/definition/index.vue"), + "workflow_process-definition_design": () => import("@/views/workflow/process-definition/design/index.vue"), "workflow_process-instance": () => import("@/views/workflow/process-instance/index.vue"), }; diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index b38619f8..38c4bd76 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -361,13 +361,14 @@ export const generatedRoutes: GeneratedRoute[] = [ }, { name: 'workflow_process-definition', - path: '/workflow/process-definition', + path: '/workflow/process-definition/definition', component: 'view.workflow_process-definition', meta: { title: 'workflow_process-definition', i18nKey: 'route.workflow_process-definition' } }, + { name: 'workflow_process-instance', path: '/workflow/process-instance', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index 2b3d39b6..36975b88 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -202,7 +202,8 @@ const routeMap: RouteMap = { "workflow": "/workflow", "workflow_category": "/workflow/category", "workflow_leave": "/workflow/leave", - "workflow_process-definition": "/workflow/process-definition", + "workflow_process-definition": "/workflow/process-definition/definition", + "workflow_process-definition_design": "/workflow/process-definition/design", "workflow_process-instance": "/workflow/process-instance" }; diff --git a/src/service/api/workflow/definition.ts b/src/service/api/workflow/definition.ts index c5c7c348..14f06e83 100644 --- a/src/service/api/workflow/definition.ts +++ b/src/service/api/workflow/definition.ts @@ -62,3 +62,11 @@ export function fetchPublishDefinition(id: CommonType.IdType) { method: 'put' }); } + +/** 复制流程定义 */ +export function fetchCopyDefinition(id: CommonType.IdType) { + return request({ + url: `/workflow/definition/copy/${id}`, + method: 'post' + }); +} diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index 2fe6f29a..4cfed3f0 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -56,7 +56,8 @@ declare module "@elegant-router/types" { "workflow": "/workflow"; "workflow_category": "/workflow/category"; "workflow_leave": "/workflow/leave"; - "workflow_process-definition": "/workflow/process-definition"; + "workflow_process-definition": "/workflow/process-definition/definition"; + "workflow_process-definition_design": "/workflow/process-definition/design"; "workflow_process-instance": "/workflow/process-instance"; }; @@ -154,6 +155,7 @@ declare module "@elegant-router/types" { | "workflow_category" | "workflow_leave" | "workflow_process-definition" + | "workflow_process-definition_design" | "workflow_process-instance" >; @@ -229,7 +231,7 @@ declare module "@elegant-router/types" { component: `view.${K}`; } : never; - + /** * the center level route */ @@ -252,7 +254,7 @@ declare module "@elegant-router/types" { children: (CenterLevelRoute> | LastLevelRoute>)[]; } : never; - + /** * the custom first level route */ diff --git a/src/views/workflow/process-definition/index.vue b/src/views/workflow/process-definition/definition/index.vue similarity index 84% rename from src/views/workflow/process-definition/index.vue rename to src/views/workflow/process-definition/definition/index.vue index ed6db26e..61f9fa44 100644 --- a/src/views/workflow/process-definition/index.vue +++ b/src/views/workflow/process-definition/definition/index.vue @@ -7,6 +7,7 @@ import { workflowPublishStatusRecord } from '@/constants/workflow'; import { fetchActiveDefinition, fetchBatchDeleteDefinition, + fetchCopyDefinition, fetchGetCategoryTree, fetchGetDefinitionList, fetchGetUnPublishDefinitionList, @@ -16,11 +17,12 @@ import { useAppStore } from '@/store/modules/app'; import { useAuth } from '@/hooks/business/auth'; import { useDownload } from '@/hooks/business/download'; import { useTable, useTableOperate } from '@/hooks/common/table'; +import { useRouterPush } from '@/hooks/common/router'; import { $t } from '@/locales'; import ButtonIcon from '@/components/custom/button-icon.vue'; -import DefinitionOperateDrawer from './modules/definition-operate-drawer.vue'; -import DefinitionSearch from './modules/definition-search.vue'; -import DefinitionImportModal from './modules/definition-import-modal.vue'; +import DefinitionOperateDrawer from '../modules/definition-operate-drawer.vue'; +import DefinitionSearch from '../modules/definition-search.vue'; +import DefinitionImportModal from '../modules/definition-import-modal.vue'; defineOptions({ name: 'DefinitionList' @@ -34,9 +36,9 @@ interface IsPublishOption { const appStore = useAppStore(); const { download } = useDownload(); const { hasAuth } = useAuth(); +const { routerPushByKey } = useRouterPush(); const { bool: importVisible, setTrue: showImportModal } = useBoolean(); - const isPublish = ref(true); const isPublishOptions = ref([ { @@ -196,9 +198,23 @@ const { onPositiveClick={() => handleDelete(row.id)} /> ), - design: , + design: ( + handleDesign(row.id)} + /> + ), preview: ( - + handlePreview(row.id)} + /> ), publish: ( handlePublish(row.id)} + popconfirmContent={`确定要发布 ${row.flowName} 吗?`} + onPositiveClick={() => handlePublish(row.id)} + /> + ), + copy: ( + handleCopy(row.id)} /> ), - copy: , export: ( ) { download(`/workflow/definition/exportDef/${row.id}`, {}, `${row.flowCode}.json`); } @@ -325,7 +381,7 @@ const selectable = computed(() => {