翻译
This commit is contained in:
@@ -70,22 +70,28 @@
|
||||
|
||||
console.log('Layui initialized');
|
||||
|
||||
// 更新标签页标题
|
||||
try {
|
||||
if (window.parent && window.parent.layui) {
|
||||
window.parent.layui.use(['tab'], function() {
|
||||
let tab = window.parent.layui.tab;
|
||||
if (tab && typeof tab.changeTitle === 'function') {
|
||||
let currentTab = window.parent.document.querySelector('.layui-tab-title .layui-this');
|
||||
if (currentTab) {
|
||||
tab.changeTitle(currentTab.getAttribute('lay-id'), translations.title);
|
||||
}
|
||||
// 监听语言更新消息
|
||||
window.addEventListener('message', function(event) {
|
||||
if (event.data && event.data.type === 'language_changed') {
|
||||
// 重新获取翻译
|
||||
$.get('/app/admin/vehicle/getTranslations', function(translations) {
|
||||
// 更新标签页标题
|
||||
if (window.parent && window.parent.layui) {
|
||||
window.parent.layui.use(['tab'], function() {
|
||||
let tab = window.parent.layui.tab;
|
||||
if (tab && typeof tab.changeTitle === 'function') {
|
||||
let currentTab = window.parent.document.querySelector('.layui-tab-title .layui-this');
|
||||
if (currentTab) {
|
||||
tab.changeTitle(currentTab.getAttribute('lay-id'), translations.title);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重新加载表格
|
||||
table.reload('data-table');
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to update tab title:', e);
|
||||
}
|
||||
});
|
||||
|
||||
// 表头参数
|
||||
let cols = [[
|
||||
@@ -93,7 +99,7 @@
|
||||
{title: translations.id, align: "center", field: "id"},
|
||||
{title: translations.vin, align: "center", field: "vin"},
|
||||
{title: translations.status, align: "center", field: "status"},
|
||||
{title: translations.location, align: "center", field: "location_name"},
|
||||
{title: translations.current_location, align: "center", field: "location_name"},
|
||||
{title: translations.final_location, align: "center", field: "final_location_name"},
|
||||
{title: translations.fbo_location, align: "center", field: "fbo_location_name"},
|
||||
{title: translations.created_at, align: "center", field: "created_at"},
|
||||
|
||||
Reference in New Issue
Block a user