From 8e943b7104561c3b14cf223016698709c5ade4b5 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 15:37:26 +0800
Subject: [PATCH] #pda料箱组托和换码

---
 src/main/webapp/static/js/basWrkIotype/basWrkIotype.js |  106 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 62 insertions(+), 44 deletions(-)

diff --git a/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js b/src/main/webapp/static/js/basWrkIotype/basWrkIotype.js
index 47f1fee..c68e01b 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',
@@ -13,23 +52,12 @@
         url: baseUrl+'/basWrkIotype/list/auth',
         page: true,
         limit: 16,
-        skin: 'line',
+        limits: [16, 30, 50, 100, 200, 500],
+        // skin: 'line',
         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'
@@ -45,13 +73,7 @@
         response: {
             statusCode: 200
         },
-        done: function(res, curr, count) {
-            if (res.code === 403) {
-                top.location.href = "/";
-            }
-            pageCurr=curr;
-            limit();
-        }
+        done: doneCallback
     });
 
     // 鐩戝惉鎺掑簭浜嬩欢
@@ -67,13 +89,7 @@
             page: {
                 curr: 1
             },
-            done: function (res, curr, count) {
-                if (res.code === 403) {
-                    top.location.href = "/";
-                }
-                pageCurr=curr;
-                limit();
-            }
+            done: doneCallback
         });
     });
 
@@ -84,9 +100,9 @@
             case 'addData':
                 layer.open({
                     type: 2,
-                    title: '鏂板',
+                    title: I18n.t('add'),
                     maxmin: true,
-                    area: [top.detailWidth, top.detailHeight],
+                    area: ['500px', top.detailHeight],
                     shadeClose: false,
                     content: 'basWrkIotype_detail.html',
                     success: function(layero, index){
@@ -100,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')},
@@ -121,9 +139,9 @@
                                     layer.closeAll();
                                     tableReload(false);
                                 } else if (res.code === 403){
-                                    top.location.href = "/";
+                                    top.location.href = baseUrl+"/";
                                 } else {
-                                    layer.msg(res.msg)
+                                    layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                 }
                             }
                         })
@@ -131,7 +149,7 @@
                 }
                 break;
             case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', function(){
+                layer.confirm(I18n.t('confirm_export'), {shadeClose: true}, function(){
                     var titles=[];
                     var fields=[];
                     obj.config.cols[0].map(function (col) {
@@ -160,9 +178,9 @@
                             if (res.code === 200) {
                                 table.exportFile(titles,res.data,'xls');
                             } else if (res.code === 403) {
-                                top.location.href = "/";
+                                top.location.href = baseUrl+"/";
                             } else {
-                                layer.msg(res.msg)
+                                layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                             }
                         }
                     });
@@ -200,7 +218,7 @@
                     type: 2,
                     title: '淇敼',
                     maxmin: true,
-                    area: [top.detailWidth, top.detailHeight],
+                    area: ['500px', top.detailHeight],
                     shadeClose: false,
                     content: 'basWrkIotype_detail.html',
                     success: function(layero, index){
@@ -241,7 +259,7 @@
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
-                                       layer.msg(res.msg)
+                                       layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                    }
                                }
                            })
@@ -276,7 +294,7 @@
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
-                                       layer.msg(res.msg)
+                                       layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                                    }
                                }
                            })
@@ -330,9 +348,9 @@
                         $(this).val("");
                     });
                 } else if (res.code === 403){
-                    top.location.href = "/";
+                    top.location.href = baseUrl+"/";
                 }else {
-                    layer.msg(res.msg)
+                    layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
                 }
                 layer.close(index);
             }
@@ -382,7 +400,7 @@
         },
         done: function (res, curr, count) {
             if (res.code === 403) {
-                top.location.href = "/";
+                top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             if (res.data.length === 0 && count !== 0) {

--
Gitblit v1.9.1