From 51c170acf848af84d0505ecc215b3258f3ba9d60 Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Fri, 18 Oct 2024 13:05:48 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=A4=84=E7=90=86=E5=8A=A8=E6=80=81=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/src/basic/menu/use-navigation.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/effects/layouts/src/basic/menu/use-navigation.ts b/packages/effects/layouts/src/basic/menu/use-navigation.ts index 5efb3969..95a4ef6e 100644 --- a/packages/effects/layouts/src/basic/menu/use-navigation.ts +++ b/packages/effects/layouts/src/basic/menu/use-navigation.ts @@ -5,11 +5,22 @@ import { isHttpUrl, openWindow } from '@vben/utils'; function useNavigation() { const router = useRouter(); + // Helper function to clean up optional parameters + const cleanPath = (path: string) => { + // 正则匹配类似 :param? 的可选参数 + return path.replace(/\/:\w+\?/g, ''); + }; + const navigation = async (path: string) => { + // 如果是HTTP URL,则在新窗口打开 if (isHttpUrl(path)) { openWindow(path, { target: '_blank' }); } else { - await router.push(path); + // 去除未赋值的可选参数 + const cleanedPath = cleanPath(path); + + // 路由跳转 + await router.push(cleanedPath); } }; From 22fc4c413f8e1656c3f3ffba0528737da8179b71 Mon Sep 17 00:00:00 2001 From: z9130 <984661593@qq.com> Date: Fri, 18 Oct 2024 15:45:42 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-contract/src/layouts/basic.vue | 44 ++-- apps/web-contract/src/utils/dict/shared.ts | 2 +- .../src/utils/dict/static.data.js | 8 + .../views/contract/approval/edit/index.vue | 25 ++- .../business/edit/basic-info-card.vue | 85 +++++--- .../contract/business/edit/business-card.vue | 135 ++++++------ .../views/contract/business/edit/index.vue | 45 +++- .../views/contract/business/list/index.vue | 61 +++--- .../contract/business/result-list/index.vue | 55 ++--- .../business/result/fill-result-card.vue | 108 ++++++---- .../views/contract/business/result/index.vue | 114 ++++++---- .../company/list/choose-company-modal.vue | 31 ++- .../info-business/business-card.vue | 199 +++++++++++++++--- .../dashboard/components/workbench-todo.vue | 27 ++- .../src/views/dashboard/home/index.vue | 9 +- apps/web-office/src/layouts/basic.vue | 4 +- 16 files changed, 641 insertions(+), 311 deletions(-) diff --git a/apps/web-contract/src/layouts/basic.vue b/apps/web-contract/src/layouts/basic.vue index 1ae91be4..8a5c0dde 100644 --- a/apps/web-contract/src/layouts/basic.vue +++ b/apps/web-contract/src/layouts/basic.vue @@ -121,27 +121,27 @@ function handleMenuClick(e) { } onMounted(async () => { - const data = await Apis.home.get_todo({ - params: { pageNum: 1, pageSize: 20 }, - }); + // const data = await Apis.home.get_todo({ + // params: { pageNum: 1, pageSize: 20 }, + // }); - notifications.value = data.rows.map((item) => { - let module = - getDictObj(DICT_TYPE.contract_todo_type, item.module)?.label || ''; - module = module.slice(-4); - let moduleTextArr = [...module]; - moduleTextArr = - moduleTextArr.length <= 3 ? moduleTextArr : moduleTextArr.slice(-4); - return { - moduleTextArr, - avatar: '', - date: item.createTime, - isRead: true, - message: item.contractName, - title: item.taskName, - }; - }); - console.log(notifications); + // notifications.value = data.rows.map((item) => { + // let module = + // getDictObj(DICT_TYPE.contract_todo_type, item.module)?.label || ''; + // module = module.slice(-4); + // let moduleTextArr = [...module]; + // moduleTextArr = + // moduleTextArr.length <= 3 ? moduleTextArr : moduleTextArr.slice(-4); + // return { + // moduleTextArr, + // avatar: '', + // date: item.createTime, + // isRead: true, + // message: item.contractName, + // title: item.taskName, + // }; + // }); + // console.log(notifications); // resetAllStores(); }); @@ -172,13 +172,13 @@ onMounted(async () => { {{ value ? `代理${value}` : '代理切换' }} - + /> -->