From 539a56279625242c497b4b4093f2defbb9d80334 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 29 一月 2026 14:05:44 +0800
Subject: [PATCH] #i18n翻译
---
src/main/webapp/static/js/pakStore/pakStore.js | 73 ++++++++++++++++++++++++------------
1 files changed, 49 insertions(+), 24 deletions(-)
diff --git a/src/main/webapp/static/js/pakStore/pakStore.js b/src/main/webapp/static/js/pakStore/pakStore.js
index 863b89f..4c4de8a 100644
--- a/src/main/webapp/static/js/pakStore/pakStore.js
+++ b/src/main/webapp/static/js/pakStore/pakStore.js
@@ -3,11 +3,11 @@
var matCodeData = [];
function getCol() {
var cols = [
- {fixed: 'left', field: 'anfme', title: '鏁伴噺锛堝繀濉級', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'},
- {field: 'batch', title: '鎵瑰彿锛堥�夊~锛�', align: 'center', edit:'text', width: 200, style:'color: block;font-weight: bold'}
+ {fixed: 'left', field: 'anfme', title: typeof I18n !== 'undefined' ? I18n.t('quantity_required') : '鏁伴噺锛堝繀濉級', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'},
+ {field: 'batch', title: typeof I18n !== 'undefined' ? I18n.t('batch_optional') : '鎵瑰彿锛堥�夊~锛�', align: 'center', edit:'text', width: 200, style:'color: block;font-weight: bold'}
];
- cols.push.apply(cols, matCols);
- cols.push({fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 80})
+ cols.push.apply(cols, getMatCols());
+ cols.push({fixed: 'right', title: typeof I18n !== 'undefined' ? I18n.t('operation') : '鎿嶄綔', align: 'center', toolbar: '#operate', width: 80})
return cols;
}
@@ -20,17 +20,36 @@
var form = layui.form;
var admin = layui.admin;
- tableIns = table.render({
- elem: '#chooseData',
- data: [],
- even: true,
- limit: 500,
- cellMinWidth: 50,
- toolbar: '#toolbar',
- cols: [getCol()],
- done: function (res, curr, count) {
- limit();
- getInBound();
+ function initTable() {
+ tableIns = table.render({
+ elem: '#chooseData',
+ data: [],
+ even: true,
+ limit: 500,
+ cellMinWidth: 50,
+ toolbar: '#toolbar',
+ cols: [getCol()],
+ done: function (res, curr, count) {
+ limit();
+ getInBound();
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ }
+ }
+ });
+ }
+
+ if (typeof I18n !== 'undefined' && I18n.isReady()) {
+ initTable();
+ } else {
+ $(document).on('i18n:ready', initTable);
+ }
+
+ $(document).on('i18n:languageChanged', function() {
+ if (tableIns) {
+ tableIns.reload({
+ cols: [getCol()]
+ });
}
});
@@ -42,11 +61,11 @@
if (obj.field === 'anfme'){
let vle = Number(obj.value);
if (isNaN(vle)) {
- layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_enter_number') : "璇疯緭鍏ユ暟瀛�", {icon: 2});
modify = false;
} else {
if (vle <= 0) {
- layer.msg("鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('quantity_must_be_greater_than_zero') : "鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
modify = false;
}
}
@@ -65,23 +84,23 @@
case 'comb':
// 鍒ゆ柇鏄惁瀛樺湪鐗╂枡
if (matCodeData.length === 0) {
- layer.msg("璇峰厛鎻愬彇鍟嗗搧", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_extract_item_first') : "璇峰厛鎻愬彇鍟嗗搧", {icon: 2});
return;
}
// 鍒ゆ柇鐗╂枡鏁伴噺鏄惁瀛樺湪寮傚父
for (var i=0;i<matCodeData.length;i++){
if (isNaN(matCodeData[i].anfme)) {
- layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_enter_number') : "璇疯緭鍏ユ暟瀛�", {icon: 2});
return;
}
if (matCodeData[i].anfme <= 0){
- layer.msg("鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('quantity_must_be_greater_than_zero') : "鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
return;
}
}
let devpNo = $('#putSiteSelect').val();
if (isEmpty(devpNo)) {
- layer.msg("璇烽�夋嫨鍏ュ簱绔�", {icon: 2});
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_select_inbound_station') : "璇烽�夋嫨鍏ュ簱绔�", {icon: 2});
return;
}
console.log(matCodeData)
@@ -97,10 +116,16 @@
async: false,
success: function (res) {
if (res.code === 200){
- layer.msg("鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data, {icon: 1});
+ layer.msg((typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg) + "锛�" + res.data, {icon: 1});
matCodeData = [];
$('#focusMatByMat').val("");
- tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}});
+ tableIns.reload({data: matCodeData,done:function (res) {
+ limit();
+ getInBound();
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ }
+ }});
} else if (res.code === 403){
top.location.href = baseUrl+"/";
}else {
@@ -149,7 +174,7 @@
// 鎻愬彇鐗╂枡
$(document).on('click','#mat-query', function () {
- let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+ let loadIndex = layer.msg(typeof I18n !== 'undefined' ? I18n.t('requesting') : '璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
matCodeLayerIdx = admin.open({
type: 2,
title: false,
--
Gitblit v1.9.1