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/basDevp/basDevp.js |  288 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 156 insertions(+), 132 deletions(-)

diff --git a/src/main/webapp/static/js/basDevp/basDevp.js b/src/main/webapp/static/js/basDevp/basDevp.js
index 9e4b732..06d23bd 100644
--- a/src/main/webapp/static/js/basDevp/basDevp.js
+++ b/src/main/webapp/static/js/basDevp/basDevp.js
@@ -7,132 +7,148 @@
     var form = layui.form;
 
     // 鏁版嵁娓叉煋
-    tableIns = table.render({
-        elem: '#basDevp',
-        headers: {token: localStorage.getItem('token')},
-        url: baseUrl+'/basDevp/list/auth',
-        page: true,
-        limit: 16,
-        limits: [16, 30, 50, 100, 200, 500],
-        even: true,
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
-        cols: [[
-            {type: 'checkbox', fixed: 'left'}
-//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
-            ,{field: 'devNo', align: 'center',sort:true,title: '缂栧彿'}
-            // ,{field: 'decDesc', align: 'center',title: '璁惧鎻忚堪'}
-            // ,{field: 'devMk', align: 'center',title: '澶囨敞'}
-            ,{field: 'inEnable', align: 'center',title: '鍙叆', templet:function(row){
-                    var html = "<input value='inEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.inEnable === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'outEnable', align: 'center',title: '鍙嚭', templet:function(row){
-                    var html = "<input value='outEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.outEnable === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'autoing', align: 'center',title: '鑷姩', templet:function(row){
-                    var html = "<input value='autoing' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.autoing === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'loading', align: 'center',title: '鏈夌墿', templet:function(row){
-                    var html = "<input value='loading' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.loading === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'canining', align: 'center',title: '鑳藉叆', templet:function(row){
-                    var html = "<input value='canining' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.canining === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'canouting', align: 'center',title: '鑳藉嚭', templet:function(row){
-                    var html = "<input value='canouting' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.canouting === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            // ,{field: 'fronting', align: 'center',title: ''}
-            // ,{field: 'rearing', align: 'center',title: ''}
-            // ,{field: 'uping', align: 'center',title: ''}
-            // ,{field: 'downing', align: 'center',title: ''}
-            ,{field: 'inreq1', align: 'center',title: '闇�姹�1', templet:function(row){
-                    var html = "<input value='inreq1' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.inreq1 === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'inreq2', align: 'center',title: '闇�姹�2', templet:function(row){
-                    var html = "<input value='inreq2' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.inreq2 === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                }}
-            ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�', edit:true,  style:'color: blue;font-weight: bold'}
-            // ,{field: 'wrkNo1', align: 'center',title: ''}
-            ,{field: 'locType1$', align: 'center',title: '楂樹綆'}
-            ,{field: 'barcode', align: 'center',title: '鏉″舰鐮�'}
-            ,{field: 'inQty', align: 'center',title: '鍏ュ簱鏆傚瓨'}
-            // ,{field: 'row1', align: 'center',title: ''}
-            // ,{field: 'ioTime$', align: 'center',title: ''}
-            // ,{field: 'area', align: 'center',title: ''}
-            // ,{field: 'inOk', align: 'center',title: ''}
-            // ,{field: 'outOk', align: 'center',title: ''}
-            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser', hide:true}
-            ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}
-            // ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
-            // ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'}
-            // ,{field: 'stdQty', align: 'center',title: ''}
-            // ,{field: 'minWt', align: 'center',title: ''}
-            // ,{field: 'maxWt', align: 'center',title: ''}
-            ,{field: 'grossWt', align: 'center',title: '閲嶉噺'}
-            // ,{field: 'cartPos', align: 'center',title: ''}
+    var initTable = function() {
+        tableIns = table.render({
+            elem: '#basDevp',
+            headers: {token: localStorage.getItem('token')},
+            url: baseUrl+'/basDevp/list/auth',
+            page: true,
+            limit: 16,
+            limits: [16, 30, 50, 100, 200, 500],
+            even: true,
+            toolbar: '#toolbar',
+            cellMinWidth: 50,
+            cols: [[
+                {type: 'checkbox', fixed: 'left'}
+    //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
+                ,{field: 'devNo', align: 'center',sort:true,title: I18n.t('id')}
+                // ,{field: 'decDesc', align: 'center',title: '璁惧鎻忚堪'}
+                // ,{field: 'devMk', align: 'center',title: '澶囨敞'}
+                ,{field: 'inEnable', align: 'center',title: I18n.t('in_enable'), templet:function(row){
+                        var html = "<input value='inEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.inEnable === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'outEnable', align: 'center',title: I18n.t('out_enable'), templet:function(row){
+                        var html = "<input value='outEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.outEnable === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'autoing', align: 'center',title: I18n.t('autoing'), templet:function(row){
+                        var html = "<input value='autoing' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.autoing === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'loading', align: 'center',title: I18n.t('loading'), templet:function(row){
+                        var html = "<input value='loading' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.loading === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'canining', align: 'center',title: I18n.t('can_in'), templet:function(row){
+                        var html = "<input value='canining' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.canining === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'canouting', align: 'center',title: I18n.t('can_out'), templet:function(row){
+                        var html = "<input value='canouting' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.canouting === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                // ,{field: 'fronting', align: 'center',title: ''}
+                // ,{field: 'rearing', align: 'center',title: ''}
+                // ,{field: 'uping', align: 'center',title: ''}
+                // ,{field: 'downing', align: 'center',title: ''}
+                ,{field: 'inreq1', align: 'center',title: I18n.t('req_1'), templet:function(row){
+                        var html = "<input value='inreq1' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.inreq1 === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'inreq2', align: 'center',title: I18n.t('req_2'), templet:function(row){
+                        var html = "<input value='inreq2' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
+                        if(row.inreq2 === 'Y'){html += " checked ";}
+                        html += ">";
+                        return html;
+                    }}
+                ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no'), edit:true,  style:'color: blue;font-weight: bold'}
+                // ,{field: 'wrkNo1', align: 'center',title: ''}
+                ,{field: 'locType1$', align: 'center',title: I18n.t('high_low_type')}
+                ,{field: 'barcode', align: 'center',title: I18n.t('barcode')}
+                ,{field: 'inQty', align: 'center',title: I18n.t('in_temp_store')}
+                // ,{field: 'row1', align: 'center',title: ''}
+                // ,{field: 'ioTime$', align: 'center',title: ''}
+                // ,{field: 'area', align: 'center',title: ''}
+                // ,{field: 'inOk', align: 'center',title: ''}
+                // ,{field: 'outOk', align: 'center',title: ''}
+                ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier'),event: 'modiUser', hide:true}
+                ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time'), hide:true}
+                // ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
+                // ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'}
+                // ,{field: 'stdQty', align: 'center',title: ''}
+                // ,{field: 'minWt', align: 'center',title: ''}
+                // ,{field: 'maxWt', align: 'center',title: ''}
+                ,{field: 'grossWt', align: 'center',title: I18n.t('weight')}
+                // ,{field: 'cartPos', align: 'center',title: ''}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
-        ]],
-        request: {
-            pageName: 'curr',
-            pageSize: 'limit'
-        },
-        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();
-            form.on('checkbox(tableCheckbox)', function (data) {
-                var _index = $(data.elem).attr('table-index')||0;
-                if(data.elem.checked){
-                    res.data[_index][data.value] = 'Y';
-                }else{
-                    res.data[_index][data.value] = 'N';
+                ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:150}
+            ]],
+            request: {
+                pageName: 'curr',
+                pageSize: 'limit'
+            },
+            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;
+                I18n.updatePage();
+                setTimeout(function() {
+                    I18n.updateLayuiPagination();
+                }, 100);
+                limit();
+                form.on('checkbox(tableCheckbox)', function (data) {
+                    var _index = $(data.elem).attr('table-index')||0;
+                    if(data.elem.checked){
+                        res.data[_index][data.value] = 'Y';
+                    }else{
+                        res.data[_index][data.value] = 'N';
+                    }
+                });
+            }
+        });
+    }
+
+    if (I18n.isReady()) {
+        initTable();
+    } else {
+        $(document).on('i18n:ready', initTable);
+    }
+
+    $(document).on('i18n:languageChanged', function() {
+        initTable();
     });
 
     // 椤甸潰淇敼
     table.on('edit(basDevp)', function (obj) {
         if (isNaN(obj.value)) {
-            layer.msg("璇疯緭鍏ユ暟瀛�");
+            layer.msg(I18n.t('please_enter_number'));
             tableReload();
             return;
         }
@@ -175,6 +191,10 @@
                     top.location.href = baseUrl+"/";
                 }
                 pageCurr=curr;
+                I18n.updatePage();
+                setTimeout(function() {
+                    I18n.updateLayuiPagination();
+                }, 100);
                 limit();
             }
         });
@@ -187,7 +207,7 @@
             case 'addData':
                 layer.open({
                     type: 2,
-                    title: '鏂板',
+                    title: I18n.t('add'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -201,12 +221,12 @@
                 });
                 break;
             case 'init':
-                layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞跺垵濮嬪寲绔欑偣', formType: 1,   shadeClose: true}, function(pass, idx){
+                layer.prompt({title: I18n.t('please_enter_password_init_station'), formType: 1,   shadeClose: true}, function(pass, idx){
                     http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) {
                         if (res.data) {
                             layer.open({
                                 type: 1,
-                                title: '鍒濆鍖栫珯鐐�',
+                                title: I18n.t('init_station'),
                                 area: ["400px"],
                                 maxmin: true,
                                 shadeClose: true,
@@ -216,7 +236,7 @@
                                 }
                             })
                         } else {
-                            layer.msg("鍙d护閿欒");
+                            layer.msg(I18n.t('password_error'));
                         }
                         layer.close(idx);
                     })
@@ -233,9 +253,9 @@
             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(){
+                    layer.confirm(I18n.t('confirm_delete_prefix')+(data.length===1?I18n.t('this'):data.length)+I18n.t('confirm_delete_suffix'), function(){
                         $.ajax({
                             url: baseUrl+"/basDevp/delete/auth",
                             headers: {'token': localStorage.getItem('token')},
@@ -257,7 +277,7 @@
                 }
                 break;
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+                layer.confirm(I18n.t('confirm_export_excel'), {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -327,7 +347,7 @@
             case 'detail':
                 layer.open({
                     type: 2,
-                    title: '璇︽儏',
+                    title: I18n.t('detail'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -347,7 +367,7 @@
             case 'edit':
                 layer.open({
                     type: 2,
-                    title: '淇敼',
+                    title: I18n.t('edit'),
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: false,
@@ -366,11 +386,11 @@
             case 'modiUser':
                 var param = top.reObject(data).modiUser;
                 if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
+                    layer.msg(I18n.t('no_data_found'));
                 } else {
                     layer.open({
                         type: 2,
-                        title: '淇敼璇︽儏',
+                        title: I18n.t('modify_detail'),
                         maxmin: true,
                         area: [top.detailWidth, top.detailHeight],
                         shadeClose: false,
@@ -403,11 +423,11 @@
             case 'appeUser':
                 var param = top.reObject(data).appeUser;
                 if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
+                    layer.msg(I18n.t('no_data_found'));
                 } else {
                     layer.open({
                         type: 2,
-                        title: '鍒涜鎯�',
+                        title: I18n.t('create_detail'),
                         maxmin: true,
                         area: [top.detailWidth, top.detailHeight],
                         shadeClose: false,
@@ -578,6 +598,10 @@
                 top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
+            I18n.updatePage();
+            setTimeout(function() {
+                I18n.updateLayuiPagination();
+            }, 100);
             if (res.data.length === 0 && count !== 0) {
                 tableIns.reload({
                     where: searchData,

--
Gitblit v1.9.1