From 9eb7b433b4dabcd7907ffb84efb009206db88ea6 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: Fri, 2 Aug 2024 13:53:48 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/nodeConfig/index.ts | 63 ---------------------------- src/permission.ts | 1 + src/plugins/tab.ts | 4 +- src/store/modules/permission.ts | 6 +-- src/store/modules/tagsView.ts | 22 +++++----- 5 files changed, 17 insertions(+), 79 deletions(-) delete mode 100644 src/api/workflow/nodeConfig/index.ts diff --git a/src/api/workflow/nodeConfig/index.ts b/src/api/workflow/nodeConfig/index.ts deleted file mode 100644 index 3270c17..0000000 --- a/src/api/workflow/nodeConfig/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types'; - -/** - * 查询节点配置列表 - * @param query - * @returns {*} - */ - -export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise => { - return request({ - url: '/workflow/nodeConfig/list', - method: 'get', - params: query - }); -}; - -/** - * 查询节点配置详细 - * @param id - */ -export const getNodeConfig = (id: string | number): AxiosPromise => { - return request({ - url: '/workflow/nodeConfig/' + id, - method: 'get' - }); -}; - -/** - * 新增节点配置 - * @param data - */ -export const addNodeConfig = (data: NodeConfigForm) => { - return request({ - url: '/workflow/nodeConfig', - method: 'post', - data: data - }); -}; - -/** - * 修改节点配置 - * @param data - */ -export const updateNodeConfig = (data: NodeConfigForm) => { - return request({ - url: '/workflow/nodeConfig', - method: 'put', - data: data - }); -}; - -/** - * 删除节点配置 - * @param id - */ -export const delNodeConfig = (id: string | number | Array) => { - return request({ - url: '/workflow/nodeConfig/' + id, - method: 'delete' - }); -}; diff --git a/src/permission.ts b/src/permission.ts index 6771f8c..125438b 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -40,6 +40,7 @@ router.beforeEach(async (to, from, next) => { router.addRoute(route); // 动态添加可访问路由表 } }); + // @ts-ignore next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 } } else { diff --git a/src/plugins/tab.ts b/src/plugins/tab.ts index dd240cd..86421a8 100644 --- a/src/plugins/tab.ts +++ b/src/plugins/tab.ts @@ -1,5 +1,5 @@ import router from '@/router'; -import { RouteLocationMatched, RouteLocationNormalized } from 'vue-router'; +import {RouteLocationMatched, RouteLocationNormalized, RouteLocationRaw} from 'vue-router'; import useTagsViewStore from '@/store/modules/tagsView'; export default { @@ -41,7 +41,7 @@ export default { }); }, // 关闭当前tab页签,打开新页签 - closeOpenPage(obj: RouteLocationNormalized): void { + closeOpenPage(obj: RouteLocationRaw): void { useTagsViewStore().delView(router.currentRoute.value); if (obj !== undefined) { router.push(obj); diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 2e719ba..e90df4c 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -21,13 +21,13 @@ export const usePermissionStore = defineStore('permission', () => { const sidebarRouters = ref([]); const getRoutes = (): RouteRecordRaw[] => { - return routes.value; + return routes.value as RouteRecordRaw[]; }; const getSidebarRoutes = (): RouteRecordRaw[] => { - return sidebarRouters.value; + return sidebarRouters.value as RouteRecordRaw[]; }; const getTopbarRoutes = (): RouteRecordRaw[] => { - return topbarRouters.value; + return topbarRouters.value as RouteRecordRaw[]; }; const setRoutes = (newRoutes: RouteRecordRaw[]): void => { diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index b9502eb..9756ac2 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -6,10 +6,10 @@ export const useTagsViewStore = defineStore('tagsView', () => { const iframeViews = ref([]); const getVisitedViews = (): RouteLocationNormalized[] => { - return visitedViews.value; + return visitedViews.value as RouteLocationNormalized[]; }; const getIframeViews = (): RouteLocationNormalized[] => { - return iframeViews.value; + return iframeViews.value as RouteLocationNormalized[]; }; const getCachedViews = (): string[] => { return cachedViews.value; @@ -31,7 +31,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { const delIframeView = (view: RouteLocationNormalized): Promise => { return new Promise((resolve) => { iframeViews.value = iframeViews.value.filter((item: RouteLocationNormalized) => item.path !== view.path); - resolve([...iframeViews.value]); + resolve([...iframeViews.value as RouteLocationNormalized[]]); }); }; const addVisitedView = (view: RouteLocationNormalized): void => { @@ -54,7 +54,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delCachedView(view); } resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -68,7 +68,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { break; } } - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delCachedView = (view?: RouteLocationNormalized): Promise => { @@ -92,7 +92,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delOthersVisitedViews(view); delOthersCachedViews(view); resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -103,7 +103,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { visitedViews.value = visitedViews.value.filter((v: RouteLocationNormalized) => { return v.meta?.affix || v.path === view.path; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delOthersCachedViews = (view: RouteLocationNormalized): Promise => { @@ -124,7 +124,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delAllVisitedViews(); delAllCachedViews(); resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -132,7 +132,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { const delAllVisitedViews = (): Promise => { return new Promise((resolve) => { visitedViews.value = visitedViews.value.filter((tag: RouteLocationNormalized) => tag.meta?.affix); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; @@ -167,7 +167,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { } return false; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delLeftTags = (view: RouteLocationNormalized): Promise => { @@ -186,7 +186,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { } return false; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); };