mirror of https://github.com/jeecgboot/jeecg-boot
【issues/8317】菜单管理页首页国际化报错 ---
parent
69b2e97935
commit
3c0cc49f0c
|
@ -1,4 +1,5 @@
|
|||
export default {
|
||||
login: 'Login',
|
||||
errorLogList: 'Error Log',
|
||||
defaultHomePage: 'Default Home Page',
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default {
|
||||
login: '登录',
|
||||
errorLogList: '错误日志列表',
|
||||
defaultHomePage: '默认首页',
|
||||
};
|
||||
|
|
|
@ -48,18 +48,29 @@
|
|||
const { t } = useI18n();
|
||||
|
||||
// 自定义菜单名称列渲染
|
||||
columns[0].customRender = function ({text, record}) {
|
||||
const isDefIndex = checkDefIndex(record)
|
||||
if (isDefIndex) {
|
||||
text += '(默认首页)'
|
||||
}
|
||||
columns[0].customRender = function ({ text, record }) {
|
||||
// date-begin--author:liaozhiyang---date:20250716---for:【issues/8317】默认首页菜单名称适配国际化报错
|
||||
let displayText = text;
|
||||
// update-begin--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||
if (text.includes("t('") && t) {
|
||||
return new Function('t', `return ${text}`)(t);
|
||||
// 先处理国际化,避免在添加默认首页标记后影响国际化检查
|
||||
if (displayText && displayText.includes("t('") && t) {
|
||||
try {
|
||||
displayText = new Function('t', `return ${displayText}`)(t);
|
||||
} catch (error) {
|
||||
console.warn('国际化处理失败:', error);
|
||||
// 如果国际化处理失败,使用原始文本
|
||||
displayText = text;
|
||||
}
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||
return text
|
||||
}
|
||||
// 在国际化处理完成后,再添加默认首页标记
|
||||
const isDefIndex = checkDefIndex(record);
|
||||
if (isDefIndex) {
|
||||
displayText += `(${t('routes.basic.defaultHomePage')})`;
|
||||
}
|
||||
return displayText;
|
||||
// date-end--author:liaozhiyang---date:20250716---for:【issues/8317】默认首页菜单名称适配国际化报错
|
||||
};
|
||||
|
||||
// 列表页面公共参数、方法
|
||||
const { prefixCls, tableContext } = useListPage({
|
||||
|
|
Loading…
Reference in New Issue