From c8e8cca41014ca6178f30be6544422d8d7d27ffd Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 28 Nov 2023 21:08:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=8D=A2layout=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/layouts/BasicLayout.vue | 11 +++++++---- src/main.ts | 2 +- src/router/index.ts | 2 +- src/typings/router.d.ts | 2 +- src/views/account/profile.vue | 2 +- src/views/account/settings.vue | 2 +- src/views/configManage/backupManage/index.vue | 2 +- src/views/configManage/configParam/index.vue | 2 +- src/views/configManage/configParamForm/index.vue | 2 +- src/views/configManage/configParamTree/index.vue | 2 +- src/views/configManage/configParamTreeTable/index.vue | 2 +- src/views/configManage/license/index.vue | 2 +- src/views/configManage/neManage/index.vue | 2 +- src/views/configManage/softwareManage/index.vue | 2 +- src/views/faultManage/active-alarm/index.vue | 2 +- src/views/faultManage/fault-setting/index.vue | 2 +- src/views/faultManage/history-alarm/index.vue | 2 +- src/views/index.vue | 2 +- src/views/logManage/alarm/index.vue | 2 +- src/views/logManage/forwarding/index.vue | 2 +- src/views/logManage/logSet/index.vue | 2 +- src/views/logManage/mml/index.vue | 2 +- src/views/logManage/operation/index.vue | 2 +- src/views/logManage/security/index.vue | 2 +- src/views/mmlManage/mmlSet/index.vue | 2 +- src/views/mmlManage/neOperate/index.vue | 2 +- src/views/mmlManage/omcOperate/index.vue | 2 +- src/views/mmlManage/udmOperate/index.vue | 2 +- src/views/monitor/cache/index.vue | 2 +- src/views/monitor/cache/info.vue | 2 +- src/views/monitor/job/index.vue | 2 +- src/views/monitor/job/log.vue | 2 +- src/views/monitor/monitor/index.vue | 2 +- src/views/monitor/online/index.vue | 2 +- src/views/monitor/session/index.vue | 2 +- src/views/monitor/system/info.vue | 2 +- src/views/neUser/auth/index.vue | 2 +- src/views/neUser/base5G/index.vue | 2 +- src/views/neUser/ims/index.vue | 2 +- src/views/neUser/sub/index.vue | 2 +- src/views/neUser/ue/index.vue | 2 +- src/views/perfManage/customTarget/index.vue | 2 +- src/views/perfManage/goldTarget/index.vue | 2 +- src/views/perfManage/perfData/index.vue | 2 +- src/views/perfManage/perfReport/index.vue | 2 +- src/views/perfManage/perfSet/index.vue | 2 +- src/views/perfManage/perfThreshold/index.vue | 2 +- src/views/perfManage/taskManage/index.vue | 2 +- src/views/register.vue | 2 +- src/views/system/config/index.vue | 2 +- src/views/system/dept/index.vue | 2 +- src/views/system/dict/data.vue | 2 +- src/views/system/dict/index.vue | 2 +- src/views/system/log/login/index.vue | 2 +- src/views/system/log/operate/index.vue | 2 +- src/views/system/menu/index.vue | 2 +- src/views/system/post/index.vue | 2 +- src/views/system/role/auth-user.vue | 2 +- src/views/system/role/index.vue | 2 +- src/views/system/setting/index.vue | 2 +- src/views/system/user/index.vue | 2 +- src/views/tool/upload/index.vue | 2 +- src/views/traceManage/analysis/index.vue | 2 +- src/views/traceManage/pcap/index.vue | 2 +- src/views/traceManage/task/index.vue | 2 +- 66 files changed, 72 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index 1e13ff43..5b593b13 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "preview": "vite preview" }, "dependencies": { - "@ant-design-vue/pro-layout": "^3.2.5", + "antdv-pro-layout": "^3.2.6", "@ant-design/icons-vue": "^7.0.1", "@codemirror/lang-javascript": "^6.2.1", "@codemirror/merge": "^6.1.2", diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index 6eb53133..c7bd8ecc 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -4,7 +4,8 @@ import { WaterMark, getMenuData, clearMenuItem, -} from '@ant-design-vue/pro-layout'; + MenuDataItem, +} from 'antdv-pro-layout'; import RightContent from './components/RightContent.vue'; import Tabs from './components/Tabs.vue'; import { scriptUrl } from '@/assets/js/icon_font_8d5l8fzk5b87iudi'; @@ -85,7 +86,7 @@ const breadcrumb = computed(() => { .map(item => { return { path: item.path, - breadcrumbName: fnLocale(item.meta.title || '-'), + breadcrumbName: fnLocale(item), }; }); }); @@ -133,7 +134,9 @@ function fnClickHelpDoc(language?: string) { /** * 国际化翻译转换 */ -function fnLocale(title: string) { +function fnLocale(m: MenuDataItem) { + if (!m.meta) return; + let title = m.meta?.title ?? ''; if (title.indexOf('router.') !== -1) { title = t(title); } @@ -199,7 +202,7 @@ document.addEventListener('visibilitychange', function () { v-model:selectedKeys="layoutState.selectedKeys" v-model:openKeys="layoutState.openKeys" :menu-data="menuData" - :breadcrumb="{ routes: breadcrumb }" + :breadcrumb="{ routes: breadcrumb } as any" disable-content-margin v-bind="proConfig" :iconfont-url="scriptUrl" diff --git a/src/main.ts b/src/main.ts index de1255a8..369e950a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import App from './App.vue'; import router from './router'; import directive from './directive'; import i18n from './i18n'; -import '@ant-design-vue/pro-layout/dist/style.css'; +import 'antdv-pro-layout/dist/style.css'; import 'ant-design-vue/dist/antd.variable.min.css'; const app = createApp(App); diff --git a/src/router/index.ts b/src/router/index.ts index 1c0152e1..ead8db67 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -17,7 +17,7 @@ import useRouterStore from '@/store/modules/router'; // NProgress Configuration NProgress.configure({ showSpinner: false }); -// import { MetaRecord, MenuDataItem } from '@ant-design-vue/pro-layout'; +// import { MetaRecord, MenuDataItem } from 'antdv-pro-layout'; // mate数据类型 MetaRecord // 根据/路径构建菜单列表,列表项类型 MenuDataItem // https://github.com/vueComponent/pro-components/blob/a19279f3a28190bf11e8c36f316c92dbd3387a6d/packages/pro-layout/src/typings.ts#L16 diff --git a/src/typings/router.d.ts b/src/typings/router.d.ts index 69983d0d..d3ab65fb 100644 --- a/src/typings/router.d.ts +++ b/src/typings/router.d.ts @@ -1,5 +1,5 @@ import 'vue-router'; -import { MetaRecord, MenuDataItem } from '@ant-design-vue/pro-layout'; +import { MetaRecord, MenuDataItem } from 'antdv-pro-layout'; declare module 'vue-router' { interface RouteMeta extends MetaRecord { diff --git a/src/views/account/profile.vue b/src/views/account/profile.vue index 71c0131f..31451ead 100644 --- a/src/views/account/profile.vue +++ b/src/views/account/profile.vue @@ -1,5 +1,5 @@