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/wrkMastLog/wrkMastLog.js | 586 +++++++++++++++++-----------------------------------------
1 files changed, 172 insertions(+), 414 deletions(-)
diff --git a/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js b/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
index 0e7a591..f452db8 100644
--- a/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
+++ b/src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
@@ -1,4 +1,6 @@
var pageCurr;
+var wrkNo;
+var ioTime;
layui.use(['table','laydate', 'form'], function(){
var table = layui.table;
var $ = layui.jquery;
@@ -7,30 +9,102 @@
var form = layui.form;
// 鏁版嵁娓叉煋
- tableIns = table.render({
- elem: '#wrkMastLog',
- headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/wrkMastLog/list/auth',
- page: true,
- limit: 16,
- limits: [16, 30, 50, 100, 200, 500],
- even: true,
- toolbar: '#toolbar',
- cellMinWidth: 50,
- cols: [[
- {type: 'checkbox'}
+ function initTable() {
+ tableIns = table.render({
+ elem: '#wrkMastLog',
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/wrkMastLog/list/auth',
+ page: true,
+ limit: 16,
+ limits: [16, 30, 50, 100, 200, 500],
+ even: true,
+ toolbar: '#toolbar',
+ cellMinWidth: 50,
+ cols: getCol(),
+ text: {
+ none: typeof I18n !== 'undefined' ? I18n.t('no_data') : '鏆傛棤鐩稿叧鏁版嵁'
+ },
+ 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: doneCallback
+ });
+ }
+
+ if (I18n.isReady()) {
+ initTable();
+ } else {
+ $(document).on('i18n:ready', initTable);
+ }
+
+ var doneCallback = 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';
+ }
+ });
+ setTimeout(function() {
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
+ }, 50);
+ };
+
+ $(document).on('i18n:languageChanged', function() {
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('#search-box'));
+ }
+ layDateRender();
+ tableIns.reload({
+ cols: getCol(),
+ done: doneCallback
+ });
+ });
+
+ function getCol() {
+ return [[
+ // {type: 'checkbox'}
// ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
// ,{field: 'id', align: 'center',title: '缂栧彿'}
- ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�',event: 'wrkNo', sort: true}
- ,{field: 'ioTime$', align: 'center',title: '宸ヤ綔鏃堕棿', width:160, sort: true}
- ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��', width:160}
- ,{field: 'ioType$', align: 'center',title: '鍏ュ嚭搴撶被鍨�', width:160}
- ,{field: 'ioPri', align: 'center',title: '浼樺厛绾�'}
- ,{field: 'crnNo$', align: 'center',title: '鍫嗗灈鏈哄彿'}
- ,{field: 'sourceStaNo$', align: 'center',title: '婧愮珯',event: 'sourceStaNo', style: 'cursor:pointer'}
- ,{field: 'staNo$', align: 'center',title: '鐩爣绔�',event: 'staNo', style: 'cursor:pointer'}
- ,{field: 'sourceLocNo$', align: 'center',title: '婧愬簱浣�',event: 'sourceLocNo', style: 'cursor:pointer'}
- ,{field: 'locNo$', align: 'center',title: '鐩爣搴撲綅',event: 'locNo', style: 'cursor:pointer'}
+ {field: 'wrkNo', align: 'center',title: I18n.t('work_no'),event: 'wrkNo', sort: true}
+ ,{field: 'ioTime$', align: 'center',title: I18n.t('work_time'), width:160, sort: true}
+ ,{field: 'wrkSts', align: 'center',title: I18n.t('work_status'), width:160, templet: function(d) {
+ var key = 'wrk_status_' + d.wrkSts;
+ var text = I18n.t(key);
+ return text === key ? d.wrkSts$ : text;
+ }}
+ ,{field: 'ioType', align: 'center',title: I18n.t('transaction_type'), width:160, templet: function(d) {
+ var key = 'io_type_' + d.ioType;
+ var text = I18n.t(key);
+ return text === key ? d.ioType$ : text;
+ }}
+ ,{field: 'ioPri', align: 'center',title: I18n.t('priority')}
+ ,{field: 'crnNo$', align: 'center',title: I18n.t('crane_no')}
+ ,{field: 'sourceStaNo$', align: 'center',title: I18n.t('source_station')}
+ ,{field: 'staNo$', align: 'center',title: I18n.t('target_station')}
+ ,{field: 'sourceLocNo$', align: 'center',title: I18n.t('source_location')}
+ ,{field: 'locNo$', align: 'center',title: I18n.t('target_location')}
// ,{field: 'picking', align: 'center',title: '鎷f枡', templet:function(row){
// var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
// if(row.picking === 'Y'){html += " checked ";}
@@ -53,11 +127,11 @@
// ,{field: 'crnStrTime$', align: 'center',title: '鍫嗗灈鏈哄惎鍔ㄦ椂闂�'}
// ,{field: 'crnEndTime$', align: 'center',title: '鍫嗗灈鏈哄仠姝㈡椂闂�'}
// ,{field: 'plcStrTime$', align: 'center',title: '鎷f枡鏃堕棿'}
- ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true}
- ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}
+ ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier'), hide:true}
+ ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time'), hide:true}
// ,{field: 'appeUser$', align: 'center',title: '鍒涘缓鑰�',event: 'appeUser', style: 'cursor:pointer'}
// ,{field: 'appeTime$', align: 'center',title: '娣诲姞鏃堕棿'}
- ,{field: 'barcode', align: 'center',title: '鏉$爜'}
+ ,{field: 'barcode', align: 'center',title: I18n.t('barcode')}
// ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){
// var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
// if(row.fullPlt === 'Y'){html += " checked ";}
@@ -65,39 +139,11 @@
// return html;
// }}
- // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:130}
- ]],
- 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', width: 80, templet: function(d) {
+ return '<a class="layui-btn layui-btn-xs btn-detlShow" lay-event="detlShow" data-i18n="detail">' + I18n.t('detail') + '</a>';
+ }}
+ ]];
+ }
// 鐩戝惉鎺掑簭浜嬩欢
table.on('sort(wrkMastLog)', function (obj) {
@@ -118,6 +164,10 @@
}
pageCurr=curr;
limit();
+ if (typeof I18n !== 'undefined') {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
}
});
});
@@ -129,7 +179,7 @@
case 'addData':
layer.open({
type: 2,
- title: '鏂板',
+ title: I18n.t('add'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -152,9 +202,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+"/wrkMastLog/delete/auth",
headers: {'token': localStorage.getItem('token')},
@@ -168,7 +218,7 @@
} else if (res.code === 403){
top.location.href = baseUrl+"/";
} else {
- layer.msg(res.msg)
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
}
}
})
@@ -176,7 +226,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) {
@@ -207,7 +257,7 @@
} else if (res.code === 403) {
top.location.href = baseUrl+"/";
} else {
- layer.msg(res.msg)
+ layer.msg(typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg, {icon: 2})
}
}
});
@@ -220,11 +270,29 @@
table.on('tool(wrkMastLog)', function(obj){
var data = obj.data;
switch (obj.event) {
+ // 鏄庣粏灞曠ず
+ case 'detlShow':
+ wrkNo = data.wrkNo;
+ ioTime = data.ioTime;
+ // 琛ㄦ牸涓嬫柟鏄剧ず
+ // locDetl(data.wrkNo);
+ // 寮瑰眰鏄剧ず
+ layer.open({
+ type: 2,
+ title: I18n.t('work_order_detail_history'),
+ maxmin: true,
+ area: [top.detailWidth, top.detailHeight],
+ shadeClose: true,
+ content: 'wrkDetlLog.html',
+ success: function(layero, index){
+ }
+ });
+ break;
// 璇︽儏
case 'detail':
layer.open({
type: 2,
- title: '璇︽儏',
+ title: I18n.t('detail'),
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
@@ -241,353 +309,6 @@
}
});
break;
- // 缂栬緫
- case 'edit':
- layer.open({
- type: 2,
- title: '淇敼',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: 'wrkMastLog_detail.html',
- success: function(layero, index){
- layer.getChildFrame('#data-detail-submit-save', index).hide();
- setFormVal(layer.getChildFrame('#detail', index), data, false);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
- top.convertDisabled(layer.getChildFrame('#id', index), true);
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- layer.getChildFrame('##dealDownLine', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
-
- }
- });
- break;
- case 'wrkSts':
- var param = top.reObject(data).wrkSts;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '宸ヤ綔鐘舵�佽鎯�',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../basWrkStatus/basWrkStatus_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/basWrkStatus/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'ioType':
- var param = top.reObject(data).ioType;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '鍏ュ嚭搴撶被鍨嬭鎯�',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../basWrkIotype/basWrkIotype_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/basWrkIotype/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'crnNo':
- var param = top.reObject(data).crnNo;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '鍫嗗灈鏈哄彿璇︽儏',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../basCrnp/basCrnp_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/basCrnp/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'locNo':
- var param = top.reObject(data).locNo;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '鐩爣搴撲綅璇︽儏',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../locMast/locMast_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/locMast/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'staNo':
- var param = top.reObject(data).staNo;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '鐩爣绔欒鎯�',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../basDevp/basDevp_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/basDevp/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'sourceStaNo':
- var param = top.reObject(data).sourceStaNo;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '婧愮珯璇︽儏',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../basDevp/basDevp_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/basDevp/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'sourceLocNo':
- var param = top.reObject(data).sourceLocNo;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '婧愬簱浣嶈鎯�',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../locMast/locMast_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/locMast/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'modiUser':
- var param = top.reObject(data).modiUser;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '淇敼浜哄憳璇︽儏',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../user/user_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/user/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
- case 'appeUser':
- var param = top.reObject(data).appeUser;
- if (param === undefined) {
- layer.msg("鏃犳暟鎹�");
- } else {
- layer.open({
- type: 2,
- title: '鍒涘缓鑰呰鎯�',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../user/user_detail.html',
- success: function(layero, index){
- $.ajax({
- url: baseUrl+"/user/"+ param +"/auth",
- headers: {'token': localStorage.getItem('token')},
- method: 'GET',
- success: function (res) {
- if (res.code === 200){
- setFormVal(layer.getChildFrame('#detail', index), res.data, true);
- top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
- layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
- layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- layero.find('iframe')[0].contentWindow.layui.form.render('select');
- layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
- } else if (res.code === 403){
- parent.location.href = "/";
- }else {
- layer.msg(res.msg)
- }
- }
- })
- }
- });
- }
- break;
-
}
});
@@ -684,7 +405,7 @@
} else if (res.code === 403){
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);
}
@@ -763,7 +484,30 @@
elem: '#logErrTime\\$',
type: 'datetime'
});
-
+ function layDateRender() {
+ var lang = (typeof I18n !== 'undefined' && I18n.getLanguage().indexOf('en') > -1) ? 'en' : 'cn';
+ setTimeout(function () {
+ $('.layui-laydate-range').each(function() {
+ var $this = $(this);
+ var val = $this.val();
+
+ // Clone the element to remove old event listeners and lay-key
+ var $newElem = $this.clone();
+ $newElem.removeAttr('lay-key');
+ $newElem.val(val);
+
+ $this.replaceWith($newElem);
+
+ layDate.render({
+ elem: $newElem[0]
+ ,type: 'datetime'
+ ,range: true
+ ,lang: lang
+ });
+ });
+ }, 300);
+ }
+ layDateRender();
});
@@ -797,6 +541,20 @@
pageCurr -= 1;
}
limit(child);
+ setTimeout(function() {
+ if (typeof I18n !== 'undefined') {
+ if (child) {
+ // If reloading parent table from iframe
+ if (typeof parent.I18n !== 'undefined') {
+ parent.I18n.updatePage(parent.layui.jquery('.layui-table-view'));
+ parent.I18n.updateLayuiPagination();
+ }
+ } else {
+ I18n.updatePage($('.layui-table-view'));
+ I18n.updateLayuiPagination();
+ }
+ }
+ }, 50);
}
});
}
--
Gitblit v1.9.1