refactor: 移除组件内置i18n翻译,改为调用方自行处理
Some checks failed
Release pipeline / publish (push) Has been cancelled
Release pipeline / Always run job (push) Has been cancelled

1. 调整菜单路由路径与API基础路径匹配生产配置更名
2. 优化page-table和page-dialog-form组件,移除内置的$t翻译逻辑,由调用方传入已翻译的文本
3. 为无menu_id的菜单项生成默认空路径
This commit is contained in:
sheng
2026-05-27 18:37:37 +08:00
parent 2cc8329695
commit 48cfebd008
5 changed files with 40 additions and 25 deletions

View File

@@ -6,7 +6,7 @@
适合 80% 的增删改查页面你只需要传列定义按钮定义数据和分页参数即可
依赖element-ui <el-table> <el-button> <el-pagination>
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 }}
</el-button>
<!-- 自定义工具栏内容如打印按钮列筛选器等 -->
<slot name="toolbar-extra" />
@@ -48,7 +48,7 @@
icon="el-icon-question"
@click="openHelp"
>
{{ $t(helpText) }}
{{ helpText }}
</el-button>
</div>
@@ -60,7 +60,7 @@
<div ref="tableWrapper" class="page-table__body">
<el-table
ref="table"
:data="tableData"
:data="data"
:height="tableHeight"
:border="border"
:row-key="rowKey"
@@ -91,7 +91,7 @@
:key="'idx-' + col.idx"
type="index"
:width="col.width"
:label="$t(col.label || '#')"
:label="col.label || '#'"
/>
<!-- 3. 操作列自动渲染 rowButtons编辑/删除等行内按钮 -->
<!--
@@ -314,7 +314,7 @@ export default {
helpUrl: { type: String, default: '' },
/**
* 帮助按钮的文字,支持 i18n key组件自动 $t() 翻译
* 帮助按钮的文字,由调用方负责 i18n 翻译
* 默认 '帮助'
*/
helpText: { type: String, default: '帮助' }
@@ -382,9 +382,6 @@ export default {
delete attrs.idx
delete attrs.slot
delete attrs.headerSlot
if (attrs.label) {
attrs.label = this.$t(attrs.label)
}
return attrs
},