From d907a822a940c7ec0fb7de0ca845472bda52229b Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 14:33:12 +0800
Subject: [PATCH] #pda料箱组托和换码
---
src/main/webapp/static/js/orderTable.js | 125 +++++++++++++++++++++++++----------------
1 files changed, 77 insertions(+), 48 deletions(-)
diff --git a/src/main/webapp/static/js/orderTable.js b/src/main/webapp/static/js/orderTable.js
index 8d65b03..40dfc24 100644
--- a/src/main/webapp/static/js/orderTable.js
+++ b/src/main/webapp/static/js/orderTable.js
@@ -12,55 +12,83 @@
/****************************************** 宸﹁竟琛� *************************************************/
- insTb = table.render({
- elem: '#originTable',
- url: baseUrl + '/order/nav/list/auth',
- height: 'full-120',
- headers: {token: localStorage.getItem('token')},
- request: {
- pageName: 'curr',
- pageSize: 'limit'
- },
- page: false,
- parseData: function (res) {
- return {
- 'code': res.code,
- 'msg': res.msg,
- 'data': res.data
- }
- },
- response: {
- statusCode: 200
- },
- // toolbar: ['<p>',
- // '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>娣诲姞</button> ',
- // '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon"></i>淇敼</button> ',
- // '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>鍒犻櫎</button>',
- // '</p>'].join(''),
- defaultToolbar: [],
- cols: [[
- // {type: 'numbers', title: '#'},
- {field: 'orderTime', title: '鏃ユ湡'},
- {field: 'orderNo', title: '鍗曟嵁缂栧彿', align: 'center'}
- ]],
- done: function (res, curr, count) {
- $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
-
- // 缁戝畾榧犳爣鍙抽敭
- tableX.bindCtxMenu('originTable', function (d) {
- return [
- {
- icon: 'layui-icon layui-icon-ok',
- name: '涓�閿嚭搴�',
- click: function (d) {
- autoOut(d.id);
- }
+ var initTable = function() {
+ insTb = table.render({
+ elem: '#originTable',
+ url: baseUrl + '/order/nav/list/auth',
+ height: 'full-120',
+ headers: {token: localStorage.getItem('token')},
+ request: {
+ pageName: 'curr',
+ pageSize: 'limit'
+ },
+ page: false,
+ parseData: function (res) {
+ return {
+ 'code': res.code,
+ 'msg': res.msg,
+ 'data': res.data
+ }
+ },
+ response: {
+ statusCode: 200
+ },
+ text: {none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鏁版嵁'},
+ // toolbar: ['<p>',
+ // '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>娣诲姞</button> ',
+ // '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm icon-btn"><i class="layui-icon"></i>淇敼</button> ',
+ // '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>鍒犻櫎</button>',
+ // '</p>'].join(''),
+ defaultToolbar: [],
+ cols: [[
+ // {type: 'numbers', title: '#'},
+ {field: 'orderTime', title: typeof I18n !== 'undefined' ? I18n.t('date') : '鏃ユ湡'},
+ {field: 'orderNo', title: typeof I18n !== 'undefined' ? I18n.t('order_no') : '鍗曟嵁缂栧彿', align: 'center'}
+ ]],
+ done: function (res, curr, count) {
+ if (typeof I18n !== 'undefined' && I18n.isReady()) {
+ I18n.updatePage();
+ if (count === 0) {
+ $('.layui-table-empty').text(I18n.t('no_data'));
}
- ]
+ }
+ $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
+
+ // 缁戝畾榧犳爣鍙抽敭
+ tableX.bindCtxMenu('originTable', function (d) {
+ return [
+ {
+ icon: 'layui-icon layui-icon-ok',
+ name: typeof I18n !== 'undefined' ? I18n.t('one_click_outbound') : '涓�閿嚭搴�',
+ click: function (d) {
+ autoOut(d.id);
+ }
+ }
+ ]
+
+ })
+
+ }
+ });
+ }
- })
+ if (typeof I18n !== 'undefined' && I18n.isReady()) {
+ initTable();
+ } else {
+ $(document).on('i18n:ready', function() {
+ initTable();
+ });
+ }
- }
+ // 鐩戝惉璇█鍒囨崲
+ $(document).on('i18n:languageChanged', function () {
+ insTb.reload({
+ text: {none: I18n.t('no_data')},
+ cols: [[
+ {field: 'orderTime', title: I18n.t('date')},
+ {field: 'orderNo', title: I18n.t('order_no'), align: 'center'}
+ ]]
+ });
});
/* 琛ㄦ牸鎼滅储 */
@@ -107,9 +135,10 @@
function showEdit(mData) {
admin.open({
type: 1,
- title: (mData ? '淇敼' : '娣诲姞') + '椤圭洰',
+ title: (mData ? (typeof I18n !== 'undefined' ? I18n.t('modify_project') : '淇敼椤圭洰') : (typeof I18n !== 'undefined' ? I18n.t('add_project') : '娣诲姞椤圭洰')),
content: $('#hostEditDialog').html(),
success: function (layero, dIndex) {
+ I18n.updatePage($(layero));
// 鍥炴樉琛ㄥ崟鏁版嵁
form.val('hostEditForm', mData);
// 琛ㄥ崟鎻愪氦浜嬩欢
@@ -142,7 +171,7 @@
/* 鍒犻櫎 */
function doDel(obj) {
- layer.confirm('纭畾瑕佸垹闄ゆ鍗曟嵁绫诲瀷鍚楋紵', {
+ layer.confirm(typeof I18n !== 'undefined' ? I18n.t('confirm_delete_doc_type') : '纭畾瑕佸垹闄ゆ鍗曟嵁绫诲瀷鍚楋紵', {
skin: 'layui-layer-admin',
shade: .1
}, function (i) {
--
Gitblit v1.9.1