From 35b1b26f1fe16550b4ee2881a26d599456fe59b4 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 22 一月 2026 17:01:11 +0800
Subject: [PATCH] #i18n翻译
---
src/main/webapp/static/js/basWrkIotype/basWrkIotype.js | 81 ++++++++++++++++++++++++----------------
1 files changed, 49 insertions(+), 32 deletions(-)
diff --git a/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js b/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js
index 723120b..14234d0 100644
--- a/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js
+++ b/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js
@@ -6,6 +6,45 @@
var layDate = layui.laydate;
var form = layui.form;
+ var doneCallback = function(res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ limit();
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
+ };
+
+ $(document).on('i18n:languageChanged', function() {
+ tableIns.reload({
+ cols: getCol(),
+ done: doneCallback
+ });
+ });
+
+ function getCol() {
+ return [[
+ {type: 'checkbox', fixed: 'left'}
+// ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
+ ,{field: 'ioType', align: 'center',sort:true,title: I18n.t('io_type_code')}
+ // ,{field: 'ioPri', align: 'center',title: '涓昏'}
+ ,{field: 'ioDesc', align: 'center',title: I18n.t('io_type_desc'), templet: function(d) {
+ var key = 'io_type_' + d.ioType;
+ var text = I18n.t(key);
+ return text === key ? d.ioDesc : text;
+ }}
+ ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier')}
+ ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time')}
+ // ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
+ // ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'}
+
+ ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:150}
+ ]];
+ }
+
// 鏁版嵁娓叉煋
tableIns = table.render({
elem: '#basWrkIotype',
@@ -18,19 +57,7 @@
even: true,
toolbar: '#toolbar',
cellMinWidth: 50,
- cols: [[
- {type: 'checkbox', fixed: 'left'}
-// ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
- ,{field: 'ioType', align: 'center',sort:true,title: '鍏ュ嚭绫诲瀷浠e彿'}
- // ,{field: 'ioPri', align: 'center',title: '涓昏'}
- ,{field: 'ioDesc', align: 'center',title: '鍏ュ嚭绫诲瀷鎻忚堪'}
- ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳'}
- ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'}
- // ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
- // ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'}
-
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
- ]],
+ cols: getCol(),
request: {
pageName: 'curr',
pageSize: 'limit'
@@ -46,13 +73,7 @@
response: {
statusCode: 200
},
- done: function(res, curr, count) {
- if (res.code === 403) {
- top.location.href = baseUrl+"/";
- }
- pageCurr=curr;
- limit();
- }
+ done: doneCallback
});
// 鐩戝惉鎺掑簭浜嬩欢
@@ -68,13 +89,7 @@
page: {
curr: 1
},
- done: function (res, curr, count) {
- if (res.code === 403) {
- top.location.href = baseUrl+"/";
- }
- pageCurr=curr;
- limit();
- }
+ done: doneCallback
});
});
@@ -85,7 +100,7 @@
case 'addData':
layer.open({
type: 2,
- title: '鏂板',
+ title: I18n.t('add'),
maxmin: true,
area: ['500px', top.detailHeight],
shadeClose: false,
@@ -101,16 +116,18 @@
tableIns.reload({
page: {
curr: pageCurr
- }
+ },
+ done: doneCallback
});
limit();
break;
case 'deleteData':
var data = checkStatus.data;
if (data.length === 0){
- layer.msg('璇烽�夋嫨鏁版嵁');
+ layer.msg(I18n.t('please_select_data'));
} else {
- layer.confirm('纭畾鍒犻櫎'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){
+ var msg = I18n.t('confirm_delete_prefix') + (data.length===1?I18n.t('this'):data.length) + I18n.t('confirm_delete_suffix');
+ layer.confirm(msg, function(){
$.ajax({
url: baseUrl+"/basWrkIotype/delete/auth",
headers: {'token': localStorage.getItem('token')},
@@ -132,7 +149,7 @@
}
break;
case 'exportData':
- layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+ layer.confirm(I18n.t('confirm_export'), {shadeClose: true}, function(){
var titles=[];
var fields=[];
obj.config.cols[0].map(function (col) {
--
Gitblit v1.9.1