From 36c151bb83fd0c6fbeb5c30673088b462278eb42 Mon Sep 17 00:00:00 2001 From: XiaoHH Date: Tue, 27 Oct 2026 15:56:00 +0800 Subject: [PATCH] refactor: remove i18n and fix lint formatting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eslint.config.js | 3 + mock/index.ts | 89 +-- package.json | 1 - src/App.vue | 11 +- src/api/permission.ts | 4 +- src/components/LanguageSwitcher.vue | 25 - src/components/common-table/index.vue | 95 +-- src/components/product-card/index.vue | 8 +- src/layouts/components/Breadcrumb.vue | 11 +- src/layouts/components/Header.vue | 13 +- src/layouts/components/LayoutContent.vue | 20 +- src/layouts/components/MenuContent.vue | 19 +- src/layouts/components/Notice.vue | 24 +- src/layouts/components/Search.vue | 6 +- src/layouts/components/SideNav.vue | 3 +- src/layouts/frame/useFrameKeepAlive.ts | 7 +- src/layouts/index.vue | 10 +- src/layouts/setting.vue | 57 +- src/locales/index.ts | 70 -- src/locales/lang/en_US.json | 752 ----------------- src/locales/lang/zh_CN.json | 754 ------------------ src/locales/useLocale.ts | 36 - src/main.ts | 4 +- .../dashboard/base/components/MiddleChart.vue | 15 +- .../base/components/OutputOverview.vue | 26 +- .../dashboard/base/components/RankList.vue | 63 +- .../dashboard/base/components/TopPanel.vue | 16 +- src/pages/dashboard/base/constants.ts | 26 +- src/pages/dashboard/base/index.ts | 35 +- src/pages/dashboard/detail/constants.ts | 24 +- src/pages/dashboard/detail/index.ts | 34 +- src/pages/dashboard/detail/index.vue | 19 +- src/pages/detail/advanced/constants.ts | 68 +- src/pages/detail/advanced/index.vue | 58 +- src/pages/detail/base/index.vue | 61 +- src/pages/detail/deploy/constants.ts | 36 +- src/pages/detail/deploy/index.ts | 20 +- src/pages/detail/deploy/index.vue | 29 +- src/pages/detail/secondary/index.vue | 17 +- src/pages/form/base/constants.ts | 46 +- src/pages/form/base/index.vue | 74 +- src/pages/form/step/constants.ts | 50 +- src/pages/form/step/index.vue | 108 +-- src/pages/list/base/index.vue | 78 +- src/pages/list/card/components/DialogForm.vue | 34 +- src/pages/list/card/index.vue | 15 +- src/pages/list/tree/constants.ts | 40 +- src/pages/list/tree/index.vue | 5 +- src/pages/login/components/Header.vue | 2 - src/pages/login/components/Login.vue | 55 +- src/pages/login/components/Register.vue | 57 +- src/pages/login/index.vue | 11 +- src/pages/result/403/index.vue | 5 +- src/pages/result/404/index.vue | 5 +- src/pages/result/500/index.vue | 5 +- .../result/browser-incompatible/index.vue | 13 +- src/pages/result/fail/index.vue | 12 +- src/pages/result/maintenance/index.vue | 5 +- src/pages/result/network-error/index.vue | 7 +- src/pages/result/success/index.vue | 12 +- src/pages/user/constants.ts | 36 +- src/pages/user/index.ts | 30 +- src/pages/user/index.vue | 36 +- src/router/modules/homepage.ts | 26 +- src/router/modules/result.ts | 48 +- src/router/modules/user.ts | 16 +- src/store/modules/notification.ts | 29 +- src/store/modules/permission-fe.ts | 8 +- src/store/modules/permission.ts | 10 +- src/store/modules/tabs-router.ts | 2 +- src/store/modules/user.ts | 16 +- src/types/interface.d.ts | 10 +- src/types/router.d.ts | 6 +- src/utils/request/Axios.ts | 5 +- src/utils/request/index.ts | 5 +- 75 files changed, 756 insertions(+), 2735 deletions(-) delete mode 100644 src/components/LanguageSwitcher.vue delete mode 100644 src/locales/index.ts delete mode 100644 src/locales/lang/en_US.json delete mode 100644 src/locales/lang/zh_CN.json delete mode 100644 src/locales/useLocale.ts diff --git a/eslint.config.js b/eslint.config.js index ced473e..1ef1edc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -61,6 +61,9 @@ export default antfu( /* Disallow person rules */ 'antfu/top-level-function': 'off', 'antfu/if-newline': 'off', + // Prettier handles formatting; these rules conflict with its automatic fixes. + 'antfu/reasonable-newline': 'off', + 'antfu/consistent-chaining': 'off', 'n/prefer-global/process': 'off', /* If you need control the imports sequence, must be off diff --git a/mock/index.ts b/mock/index.ts index 54c7181..f39d1d8 100644 --- a/mock/index.ts +++ b/mock/index.ts @@ -152,8 +152,8 @@ export default [ }, }, { - /** 菜单接口,提供列表、表单、详情和 iframe 路由的嵌套样例。 */ - url: '/api/get-menu-list-i18n', + /** 中文菜单接口,提供列表、表单、详情和 iframe 路由的嵌套样例。 */ + url: '/api/get-menu-list', method: 'get', timeout: 2000, response: { @@ -167,10 +167,7 @@ export default [ component: 'LAYOUT', redirect: '/list/base', meta: { - title: { - zh_CN: '列表页', - en_US: 'List', - }, + title: '列表页', icon: 'view-list', }, children: [ @@ -179,10 +176,7 @@ export default [ name: 'ListBase', component: '/list/base/index', meta: { - title: { - zh_CN: '基础列表页', - en_US: 'Base List', - }, + title: '基础列表页', }, }, { @@ -190,10 +184,7 @@ export default [ name: 'ListCard', component: '/list/card/index', meta: { - title: { - zh_CN: '卡片列表页', - en_US: 'Card List', - }, + title: '卡片列表页', }, }, { @@ -201,10 +192,7 @@ export default [ name: 'ListFilter', component: '/list/filter/index', meta: { - title: { - zh_CN: '筛选列表页', - en_US: 'Filter List', - }, + title: '筛选列表页', }, }, { @@ -212,10 +200,7 @@ export default [ name: 'ListTree', component: '/list/tree/index', meta: { - title: { - zh_CN: '树状筛选列表页', - en_US: 'Tree List', - }, + title: '树状筛选列表页', }, }, ], @@ -226,10 +211,7 @@ export default [ component: 'LAYOUT', redirect: '/form/base', meta: { - title: { - zh_CN: '表单页', - en_US: 'Form', - }, + title: '表单页', icon: 'edit-1', }, children: [ @@ -238,10 +220,7 @@ export default [ name: 'FormBase', component: '/form/base/index', meta: { - title: { - zh_CN: '基础表单页', - en_US: 'Base Form', - }, + title: '基础表单页', }, }, { @@ -249,10 +228,7 @@ export default [ name: 'FormStep', component: '/form/step/index', meta: { - title: { - zh_CN: '分步表单页', - en_US: 'Step Form', - }, + title: '分步表单页', }, }, ], @@ -263,10 +239,7 @@ export default [ component: 'LAYOUT', redirect: '/detail/base', meta: { - title: { - zh_CN: '详情页', - en_US: 'Detail', - }, + title: '详情页', icon: 'layers', }, children: [ @@ -275,10 +248,7 @@ export default [ name: 'DetailBase', component: '/detail/base/index', meta: { - title: { - zh_CN: '基础详情页', - en_US: 'Base Detail', - }, + title: '基础详情页', }, }, { @@ -286,10 +256,7 @@ export default [ name: 'DetailAdvanced', component: '/detail/advanced/index', meta: { - title: { - zh_CN: '多卡片详情页', - en_US: 'Card Detail', - }, + title: '多卡片详情页', }, }, { @@ -297,10 +264,7 @@ export default [ name: 'DetailDeploy', component: '/detail/deploy/index', meta: { - title: { - zh_CN: '数据详情页', - en_US: 'Data Detail', - }, + title: '数据详情页', }, }, { @@ -308,10 +272,7 @@ export default [ name: 'DetailSecondary', component: '/detail/secondary/index', meta: { - title: { - zh_CN: '二级详情页', - en_US: 'Secondary Detail', - }, + title: '二级详情页', }, }, ], @@ -323,10 +284,7 @@ export default [ redirect: '/frame/doc', meta: { icon: 'internet', - title: { - zh_CN: '外部页面', - en_US: 'External', - }, + title: '外部页面', }, children: [ { @@ -335,10 +293,7 @@ export default [ component: 'IFrame', meta: { frameSrc: 'https://tdesign.tencent.com/starter/docs/vue-next/get-started', - title: { - zh_CN: '使用文档(内嵌)', - en_US: 'Documentation(IFrame)', - }, + title: '使用文档(内嵌)', }, }, { @@ -347,10 +302,7 @@ export default [ component: 'IFrame', meta: { frameSrc: 'https://tdesign.tencent.com/vue-next/getting-started', - title: { - zh_CN: 'TDesign 文档(内嵌)', - en_US: 'TDesign (IFrame)', - }, + title: 'TDesign 文档(内嵌)', }, }, { @@ -360,10 +312,7 @@ export default [ meta: { frameSrc: 'https://tdesign.tencent.com/vue-next/getting-started', frameBlank: true, - title: { - zh_CN: 'TDesign 文档(外链', - en_US: 'TDesign Doc(Link)', - }, + title: 'TDesign 文档(外链', }, }, ], diff --git a/package.json b/package.json index a20bb25..01cee26 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "tdesign-vue-next": "^1.20.10", "tvision-color": "^1.6.0", "vue": "^3.5.44", - "vue-i18n": "^11.4.16", "vue-router": "^5.4.0" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 5586d8a..261b846 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,22 +1,23 @@