From 3d947029910b9095029ca5ebfea5c39c10ea0a25 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Thu, 30 May 2024 05:09:21 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20src/?= =?UTF-8?q?router/elegant/transform.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/elegant/transform.ts | 249 -------------------------------- 1 file changed, 249 deletions(-) delete mode 100644 src/router/elegant/transform.ts diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts deleted file mode 100644 index 9a07c1a..0000000 --- a/src/router/elegant/transform.ts +++ /dev/null @@ -1,249 +0,0 @@ -/* eslint-disable */ -/* prettier-ignore */ -// Generated by elegant-router -// Read more: https://github.com/soybeanjs/elegant-router - -import type { RouteRecordRaw, RouteComponent } from 'vue-router'; -import type { ElegantConstRoute } from '@elegant-router/vue'; -import type { RouteMap, RouteKey, RoutePath } from '@elegant-router/types'; - -/** - * transform elegant const routes to vue routes - * @param routes elegant const routes - * @param layouts layout components - * @param views view components - */ -export function transformElegantRoutesToVueRoutes( - routes: ElegantConstRoute[], - layouts: Record Promise)>, - views: Record Promise)> -) { - return routes.flatMap(route => transformElegantRouteToVueRoute(route, layouts, views)); -} - -/** - * transform elegant route to vue route - * @param route elegant const route - * @param layouts layout components - * @param views view components - */ -function transformElegantRouteToVueRoute( - route: ElegantConstRoute, - layouts: Record Promise)>, - views: Record Promise)> -) { - const LAYOUT_PREFIX = 'layout.'; - const VIEW_PREFIX = 'view.'; - const ROUTE_DEGREE_SPLITTER = '_'; - const FIRST_LEVEL_ROUTE_COMPONENT_SPLIT = '$'; - - function isLayout(component: string) { - return component.startsWith(LAYOUT_PREFIX); - } - - function getLayoutName(component: string) { - const layout = component.replace(LAYOUT_PREFIX, ''); - - if(!layouts[layout]) { - throw new Error(`Layout component "${layout}" not found`); - } - - return layout; - } - - function isView(component: string) { - return component.startsWith(VIEW_PREFIX); - } - - function getViewName(component: string) { - const view = component.replace(VIEW_PREFIX, ''); - - if(!views[view]) { - throw new Error(`View component "${view}" not found`); - } - - return view; - } - - function isFirstLevelRoute(item: ElegantConstRoute) { - return !item.name.includes(ROUTE_DEGREE_SPLITTER); - } - - function isSingleLevelRoute(item: ElegantConstRoute) { - return isFirstLevelRoute(item) && !item.children?.length; - } - - function getSingleLevelRouteComponent(component: string) { - const [layout, view] = component.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT); - - return { - layout: getLayoutName(layout), - view: getViewName(view) - }; - } - - const vueRoutes: RouteRecordRaw[] = []; - - // add props: true to route - if (route.path.includes(':') && !route.props) { - route.props = true; - } - - const { name, path, component, children, ...rest } = route; - - const vueRoute = { name, path, ...rest } as RouteRecordRaw; - - try { - if (component) { - if (isSingleLevelRoute(route)) { - const { layout, view } = getSingleLevelRouteComponent(component); - - const singleLevelRoute: RouteRecordRaw = { - path, - component: layouts[layout], - children: [ - { - name, - path: '', - component: views[view], - ...rest - } as RouteRecordRaw - ] - }; - - return [singleLevelRoute]; - } - - if (isLayout(component)) { - const layoutName = getLayoutName(component); - - vueRoute.component = layouts[layoutName]; - } - - if (isView(component)) { - const viewName = getViewName(component); - - vueRoute.component = views[viewName]; - } - - } - } catch (error: any) { - console.error(`Error transforming route "${route.name}": ${error.toString()}`); - return []; - } - - - // add redirect to child - if (children?.length && !vueRoute.redirect) { - vueRoute.redirect = { - name: children[0].name - }; - } - - if (children?.length) { - const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views)); - - if(isFirstLevelRoute(route)) { - vueRoute.children = childRoutes; - } else { - vueRoutes.push(...childRoutes); - } - } - - vueRoutes.unshift(vueRoute); - - return vueRoutes; -} - -/** - * map of route name and route path - */ -const routeMap: RouteMap = { - "root": "/", - "not-found": "/:pathMatch(.*)*", - "exception": "/exception", - "exception_403": "/exception/403", - "exception_404": "/exception/404", - "exception_500": "/exception/500", - "document": "/document", - "document_project": "/document/project", - "document_project-link": "/document/project-link", - "document_vue": "/document/vue", - "document_vite": "/document/vite", - "document_unocss": "/document/unocss", - "document_naive": "/document/naive", - "document_antd": "/document/antd", - "403": "/403", - "404": "/404", - "500": "/500", - "about": "/about", - "function": "/function", - "function_hide-child": "/function/hide-child", - "function_hide-child_one": "/function/hide-child/one", - "function_hide-child_three": "/function/hide-child/three", - "function_hide-child_two": "/function/hide-child/two", - "function_multi-tab": "/function/multi-tab", - "function_request": "/function/request", - "function_super-page": "/function/super-page", - "function_tab": "/function/tab", - "function_toggle-auth": "/function/toggle-auth", - "group": "/group", - "home": "/home", - "iframe-page": "/iframe-page/:url", - "job": "/job", - "job_batch": "/job/batch", - "job_task": "/job/task", - "login": "/login/:module(pwd-login)?", - "manage": "/manage", - "manage_menu": "/manage/menu", - "manage_role": "/manage/role", - "manage_user": "/manage/user", - "manage_user-detail": "/manage/user-detail/:id", - "multi-menu": "/multi-menu", - "multi-menu_first": "/multi-menu/first", - "multi-menu_first_child": "/multi-menu/first/child", - "multi-menu_second": "/multi-menu/second", - "multi-menu_second_child": "/multi-menu/second/child", - "multi-menu_second_child_home": "/multi-menu/second/child/home", - "namespace": "/namespace", - "notify": "/notify", - "notify_recipient": "/notify/recipient", - "notify_scene": "/notify/scene", - "pods": "/pods", - "retry": "/retry", - "retry_dead-letter": "/retry/dead-letter", - "retry_log": "/retry/log", - "retry_scene": "/retry/scene", - "retry_task": "/retry/task", - "user": "/user", - "user_manager": "/user/manager", - "user-center": "/user-center", - "workflow": "/workflow", - "workflow_batch": "/workflow/batch", - "workflow_form": "/workflow/form", - "workflow_form_batch": "/workflow/form/batch", - "workflow_form_copy": "/workflow/form/copy", - "workflow_form_detail": "/workflow/form/detail", - "workflow_form_edit": "/workflow/form/edit", - "workflow_task": "/workflow/task" -}; - -/** - * get route path by route name - * @param name route name - */ -export function getRoutePath(name: T) { - return routeMap[name]; -} - -/** - * get route name by route path - * @param path route path - */ -export function getRouteName(path: RoutePath) { - const routeEntries = Object.entries(routeMap) as [RouteKey, RoutePath][]; - - const routeName: RouteKey | null = routeEntries.find(([, routePath]) => routePath === path)?.[0] || null; - - return routeName; -} From 2dbb5a2bd5c4f889262f799c8cbfc0e657595a2f Mon Sep 17 00:00:00 2001 From: dhb52 Date: Thu, 30 May 2024 13:12:15 +0800 Subject: [PATCH 2/7] fix(sj_1.0.0): ignore src/router/elegant/transform.ts --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 095c630..da8e129 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ yarn.lock src/typings/elegant-router.d.ts src/typings/components.d.ts +src/router/elegant/transform.ts From 15d19f84c9e189ff856c0c124ca2026c82269c14 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Thu, 30 May 2024 13:12:41 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(sj=5F1.0.0):=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/iconify/cbi.json | 14 ++++++++++++++ public/iconify/fluent.json | 12 ++++++++++++ public/iconify/oui.json | 12 ++++++++++++ public/iconify/streamline.json | 17 +++++++++++++++++ public/iconify/tabler.json | 12 ++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 public/iconify/cbi.json create mode 100644 public/iconify/fluent.json create mode 100644 public/iconify/oui.json create mode 100644 public/iconify/streamline.json create mode 100644 public/iconify/tabler.json diff --git a/public/iconify/cbi.json b/public/iconify/cbi.json new file mode 100644 index 0000000..54d4521 --- /dev/null +++ b/public/iconify/cbi.json @@ -0,0 +1,14 @@ +{ + "prefix": "cbi", + "lastModified": 1715922185, + "aliases": {}, + "width": 24, + "height": 24, + "icons": { + "scene-dynamic": { + "body": "", + "width": 32, + "height": 32 + } + } +} diff --git a/public/iconify/fluent.json b/public/iconify/fluent.json new file mode 100644 index 0000000..ac1b6e4 --- /dev/null +++ b/public/iconify/fluent.json @@ -0,0 +1,12 @@ +{ + "prefix": "fluent", + "lastModified": 1716181326, + "aliases": {}, + "width": 20, + "height": 20, + "icons": { + "people-call-20-filled": { + "body": "" + } + } +} diff --git a/public/iconify/oui.json b/public/iconify/oui.json new file mode 100644 index 0000000..f0f1e7e --- /dev/null +++ b/public/iconify/oui.json @@ -0,0 +1,12 @@ +{ + "prefix": "oui", + "lastModified": 1714628006, + "aliases": {}, + "icons": { + "app-spaces": { + "body": "", + "width": 32, + "height": 32 + } + } +} diff --git a/public/iconify/streamline.json b/public/iconify/streamline.json new file mode 100644 index 0000000..0aeb1c0 --- /dev/null +++ b/public/iconify/streamline.json @@ -0,0 +1,17 @@ +{ + "prefix": "streamline", + "lastModified": 1702314084, + "aliases": {}, + "width": 14, + "height": 14, + "icons": { + "interface-arrows-synchronize-warning-arrow-fail-notification-sync-warning-failure-synchronize-error": { + "body": "", + "hidden": true + }, + "interface-user-multiple-close-geometric-human-multiple-person-up-user": { + "body": "", + "hidden": true + } + } +} diff --git a/public/iconify/tabler.json b/public/iconify/tabler.json new file mode 100644 index 0000000..5a4f022 --- /dev/null +++ b/public/iconify/tabler.json @@ -0,0 +1,12 @@ +{ + "prefix": "tabler", + "lastModified": 1716442914, + "aliases": {}, + "width": 24, + "height": 24, + "icons": { + "logs": { + "body": "" + } + } +} From 6748d5bc244c5288253a748c5e53da87c3dbed35 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Thu, 30 May 2024 17:13:00 +0800 Subject: [PATCH 4/7] =?UTF-8?q?feat(sj=5F1.0.0):=201=E3=80=81=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96=202=E3=80=81=E5=AF=BC=E5=85=A5=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/file-upload.vue | 7 ++++++ src/typings/api.d.ts | 5 ++++ src/views/group/index.vue | 2 +- src/views/job/task/index.vue | 2 +- src/views/retry/scene/index.vue | 2 +- src/views/workflow/task/index.vue | 23 +++++++++++++------ .../workflow/task/modules/workflow-search.vue | 2 +- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/components/common/file-upload.vue b/src/components/common/file-upload.vue index 853dd63..0b40d64 100644 --- a/src/components/common/file-upload.vue +++ b/src/components/common/file-upload.vue @@ -7,6 +7,12 @@ defineOptions({ name: 'FileUpload' }); +const emit = defineEmits(); + +interface Emits { + (e: 'refresh'): void; +} + interface Props { accept?: string; action?: string; @@ -51,6 +57,7 @@ const handleImport = ({ }) .then(() => { onFinish(); + emit('refresh'); }) .catch(() => onError()); }; diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index b81cfc4..056cb72 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -894,6 +894,11 @@ declare namespace Api { Pick & CommonSearchParams >; + type ExportWorkflow = Common.CommonRecord<{ + workflowIds: String[]; + }> & + WorkflowSearchParams; + /** workflow list */ type WorkflowList = Common.PaginatingQueryRecord; } diff --git a/src/views/group/index.vue b/src/views/group/index.vue index d4c3142..b59a7dc 100644 --- a/src/views/group/index.vue +++ b/src/views/group/index.vue @@ -195,7 +195,7 @@ function handleExport() { @refresh="getData" >