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/report/inOut.js |   50 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/src/main/webapp/static/js/report/inOut.js b/src/main/webapp/static/js/report/inOut.js
index e7dff96..3e4b34f 100644
--- a/src/main/webapp/static/js/report/inOut.js
+++ b/src/main/webapp/static/js/report/inOut.js
@@ -7,6 +7,17 @@
     var form = layui.form;
 
 
+    // Define columns function
+    function getCols() {
+        return [[
+            {field: 'ymd', align: 'center', title: typeof I18n !== 'undefined' ? I18n.t('date') : '鏃ユ湡'}
+            ,{field: 'source_sta_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('source_station') : '绔欑偣'}
+            ,{field: 'sto_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('inbound_count') : '鍏ュ簱娆℃暟'}
+            ,{field: 'ret_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('outbound_count') : '鍑哄簱娆℃暟'}
+            ,{field: 'total_qty', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('total_count') : '鍏ュ嚭鎬绘暟'}
+        ]];
+    }
+
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#inOut',
@@ -16,14 +27,10 @@
         limit: 10,
         toolbar: '#toolbar',
         cellMinWidth: 50,
-        cols: [[
-            // {type: 'checkbox'}
-            {field: 'ymd', align: 'center', title: '鏃ユ湡'}
-            ,{field: 'source_sta_no', align: 'center',title: '绔欑偣'}
-            ,{field: 'sto_qty', align: 'center',title: '鍏ュ簱娆℃暟'}
-            ,{field: 'ret_qty', align: 'center',title: '鍑哄簱娆℃暟'}
-            ,{field: 'total_qty', align: 'center',title: '鍏ュ嚭鎬绘暟'}
-        ]],
+        text: {
+            none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+        },
+        cols: getCols(),
         request: {
             pageName: 'curr',
             pageSize: 'limit'
@@ -45,7 +52,32 @@
             }
             pageCurr=curr;
             limit();
+            if (typeof I18n !== 'undefined') {
+                I18n.updateLayuiPagination();
+                I18n.updatePage();
+                $('#btn-export').text(I18n.t('export'));
+            }
         }
+    });
+
+    // Listen for language change
+    $(document).on('i18n:languageChanged', function() {
+        tableIns.reload({
+            cols: getCols(),
+            text: {
+                none: I18n.t('no_data')
+            },
+            done: function(res, curr, count) {
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                I18n.updateLayuiPagination();
+                I18n.updatePage();
+                $('#btn-export').text(I18n.t('export'));
+            }
+        });
     });
 
     // 鐩戝惉鎺掑簭浜嬩欢
@@ -76,7 +108,7 @@
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+                layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_export') : '纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {

--
Gitblit v1.9.1