From 48cfebd008975ccb966d9611bdde3277745e6ada Mon Sep 17 00:00:00 2001 From: sheng <905537351@qq.com> Date: Wed, 27 May 2026 18:37:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E7=BD=AEi18n=E7=BF=BB=E8=AF=91=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=B0=83=E7=94=A8=E6=96=B9=E8=87=AA=E8=A1=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整菜单路由路径与API基础路径匹配生产配置更名 2. 优化page-table和page-dialog-form组件,移除内置的$t翻译逻辑,由调用方传入已翻译的文本 3. 为无menu_id的菜单项生成默认空路径 --- .../production-master-data/factory-area.js | 2 +- src/components/page-dialog-form/index.vue | 28 +++++++++---------- src/components/page-table/index.vue | 15 ++++------ src/menu/index.js | 2 +- src/router/modules/production-master-data.js | 18 ++++++++++++ 5 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 src/router/modules/production-master-data.js diff --git a/src/api/production-master-data/factory-area.js b/src/api/production-master-data/factory-area.js index f13e1a1d..32de05a9 100644 --- a/src/api/production-master-data/factory-area.js +++ b/src/api/production-master-data/factory-area.js @@ -1,6 +1,6 @@ import { request } from '@/api/_service' -const BASE = 'production_master_data/factory_model/factory_area/' +const BASE = 'production_configuration/factory_model/factory_area/' function apiParams (method, data = {}) { return { diff --git a/src/components/page-dialog-form/index.vue b/src/components/page-dialog-form/index.vue index d1696fb1..1da427f1 100644 --- a/src/components/page-dialog-form/index.vue +++ b/src/components/page-dialog-form/index.vue @@ -8,7 +8,7 @@ 不支持复杂表单联动——如有需要,通过默认插槽自定义内容。 依赖:element-ui 的 - i18n:title / label / placeholder / confirm/cancel 按钮 全部自动 $t() 翻译 + i18n:由调用方负责翻译,组件直接渲染传入的文本 @author 前端团队 @since 2026-05 @@ -22,7 +22,7 @@ --> (支持 textarea、密码等) - type='select' → + - label / placeholder 会自动调用 $t() 翻译,传 i18n key 即可 + 由调用方负责翻译,传已翻译的文本即可 --> @@ -64,7 +64,7 @@ @@ -104,11 +104,11 @@ @@ -175,7 +175,7 @@ export default { visible: { type: Boolean, default: false }, /** - * 弹框标题,支持 i18n key(组件自动 $t() 翻译) + * 弹框标题,由调用方负责翻译 */ title: { type: String, default: '' }, @@ -217,12 +217,12 @@ export default { submitting: { type: Boolean, default: false }, /** - * 确定按钮文字,默认 '确定',支持 i18n key + * 确定按钮文字,默认 '确定',由调用方负责 i18n 翻译 */ confirmText: { type: String, default: '确定' }, /** - * 取消按钮文字,默认 '取消',支持 i18n key + * 取消按钮文字,默认 '取消',由调用方负责 i18n 翻译 */ cancelText: { type: String, default: '取消' } }, @@ -262,7 +262,7 @@ export default { const firstKey = Object.keys(invalidFields)[0] if (firstKey && invalidFields[firstKey].length) { const msg = invalidFields[firstKey][0].message - this.$message.warning(this.$t(msg) || msg) + this.$message.warning(msg) } return } diff --git a/src/components/page-table/index.vue b/src/components/page-table/index.vue index b1db3e9c..3e9c6031 100644 --- a/src/components/page-table/index.vue +++ b/src/components/page-table/index.vue @@ -6,7 +6,7 @@ 适合 80% 的增删改查页面,你只需要传列定义、按钮定义、数据和分页参数即可。 依赖:element-ui 的 - i18n:所有 label / 按钮文字 / 列标题 自动调用 $t() 翻译,传 i18n key 即可 + i18n:由调用方负责翻译,组件直接渲染传入的文本 @author 前端团队 @since 2026-05 @@ -35,7 +35,7 @@ :disabled="btn.needSelection && !selectedCount" @click="btn.onClick" > - {{ $t(btn.label) }} + {{ btn.label }} @@ -48,7 +48,7 @@ icon="el-icon-question" @click="openHelp" > - {{ $t(helpText) }} + {{ helpText }} @@ -60,7 +60,7 @@