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/workIn.js |  107 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 73 insertions(+), 34 deletions(-)

diff --git a/src/main/webapp/static/js/report/workIn.js b/src/main/webapp/static/js/report/workIn.js
index ec329f9..997fed9 100644
--- a/src/main/webapp/static/js/report/workIn.js
+++ b/src/main/webapp/static/js/report/workIn.js
@@ -1,10 +1,16 @@
 var pageCurr;
+var tableIns;
+
 function getCol() {
     var cols = [
-        {field: 'ioTime$', align: 'center', title: '鍏ュ簱鏃ユ湡', width: 200}
-        ,{field: 'loc_no', align: 'center',title: '搴撲綅鍙�'}
+        {field: 'ioTime$', align: 'center', title: typeof I18n !== 'undefined' ? I18n.t('鍏ュ簱鏃堕棿') : '鍏ュ簱鏃堕棿', width: 200}
+        ,{field: 'loc_no', align: 'center',title: typeof I18n !== 'undefined' ? I18n.t('location_no') : '搴撲綅鍙�'}
     ];
-    cols.push.apply(cols, detlCols);
+    if (typeof getDetlCols === 'function') {
+        cols.push.apply(cols, getDetlCols());
+    } else {
+        cols.push.apply(cols, detlCols);
+    }
     return cols;
 }
 
@@ -17,37 +23,61 @@
 
 
     // 鏁版嵁娓叉煋
-    tableIns = table.render({
-        elem: '#workIn',
-        headers: {token: localStorage.getItem('token')},
-        url: baseUrl+'/report/viewWorkInList.action',
-        page: true,
-        limit: 16,
-        limits: [16, 30, 50, 100, 200, 500],
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
-        cols: [getCol()],
-        request: {
-            pageName: 'pageNumber',
-            limitName: 'pageSize'
-        },
-        parseData: function (res) {
-            return {
-                'code': res.code,
-                'msg': res.msg,
-                'count': res.data.total,
-                'data': res.data.records
+    function initTable() {
+        tableIns = table.render({
+            elem: '#workIn',
+            headers: {token: localStorage.getItem('token')},
+            url: baseUrl+'/report/viewWorkInList.action',
+            page: true,
+            limit: 16,
+            limits: [16, 30, 50, 100, 200, 500],
+            toolbar: '#toolbar',
+            cellMinWidth: 50,
+            cols: [getCol()],
+            request: {
+                pageName: 'pageNumber',
+                limitName: 'pageSize'
+            },
+            parseData: function (res) {
+                return {
+                    'code': res.code,
+                    'msg': res.msg,
+                    'count': res.data.total,
+                    'data': res.data.records
+                }
+            },
+            response: {
+                statusCode: 200
+            },
+            done: function(res, curr, count) {
+                if (res.code === 403) {
+                    top.location.href = baseUrl+"/";
+                }
+                pageCurr=curr;
+                limit();
+                if (typeof I18n !== 'undefined' && typeof I18n.updatePage === 'function') {
+                    I18n.updatePage();
+                }
+                if (typeof I18n !== 'undefined' && typeof I18n.updateLayuiPagination === 'function') {
+                    I18n.updateLayuiPagination();
+                }
             }
-        },
-        response: {
-            statusCode: 200
-        },
-        done: function(res, curr, count) {
-            if (res.code === 403) {
-                top.location.href = baseUrl+"/";
-            }
-            pageCurr=curr;
-            limit();
+        });
+    }
+
+    if (typeof I18n !== 'undefined' && I18n.isReady()) {
+        initTable();
+    } else {
+        $(document).on('i18n:ready', function() {
+            initTable();
+        });
+    }
+
+    $(document).on('i18n:languageChanged', function() {
+        if (tableIns) {
+            tableIns.reload({
+                cols: [getCol()]
+            });
         }
     });
 
@@ -79,7 +109,10 @@
         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') : '纭畾瀵煎嚭Excel鍚�', {
+                    shadeClose: true,
+                    title: typeof I18n !== 'undefined' ? I18n.t('prompt') : '淇℃伅'
+                }, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -157,6 +190,12 @@
                 top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
+            if (typeof I18n !== 'undefined' && typeof I18n.updatePage === 'function') {
+                I18n.updatePage();
+            }
+            if (typeof I18n !== 'undefined' && typeof I18n.updateLayuiPagination === 'function') {
+                I18n.updateLayuiPagination();
+            }
             if (res.data.length === 0 && count !== 0) {
                 tableIns.reload({
                     where: searchData,

--
Gitblit v1.9.1