【issues/8317】菜单管理页首页国际化报错 ---

pull/8387/merge
JEECG 2025-07-19 09:34:17 +08:00
parent 69b2e97935
commit 3c0cc49f0c
3 changed files with 22 additions and 9 deletions

View File

@ -1,4 +1,5 @@
export default {
login: 'Login',
errorLogList: 'Error Log',
defaultHomePage: 'Default Home Page',
};

View File

@ -1,4 +1,5 @@
export default {
login: '登录',
errorLogList: '错误日志列表',
defaultHomePage: '默认首页',
};

View File

@ -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---forissues/8317
let displayText = text;
// update-begin--author:liaozhiyang---date:20240306---forQQYUN-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---forQQYUN-8379
return text
}
//
const isDefIndex = checkDefIndex(record);
if (isDefIndex) {
displayText += `${t('routes.basic.defaultHomePage')}`;
}
return displayText;
// date-end--author:liaozhiyang---date:20250716---forissues/8317
};
//
const { prefixCls, tableContext } = useListPage({