|
@@ -250,7 +250,7 @@ var table = {
|
|
if($.common.equals("self", target)) {
|
|
if($.common.equals("self", target)) {
|
|
var height = $(this).data('height');
|
|
var height = $(this).data('height');
|
|
var width = $(this).data('width');
|
|
var width = $(this).data('width');
|
|
- layer.open({
|
|
|
|
|
|
+ top.layer.open({
|
|
title: false,
|
|
title: false,
|
|
type: 1,
|
|
type: 1,
|
|
closeBtn: true,
|
|
closeBtn: true,
|
|
@@ -270,7 +270,7 @@ var table = {
|
|
input.select();
|
|
input.select();
|
|
document.execCommand("copy");
|
|
document.execCommand("copy");
|
|
} else if ($.common.equals("open", target)) {
|
|
} else if ($.common.equals("open", target)) {
|
|
- parent.layer.alert(input.val(), {
|
|
|
|
|
|
+ top.layer.alert(input.val(), {
|
|
title: "信息内容",
|
|
title: "信息内容",
|
|
shadeClose: true,
|
|
shadeClose: true,
|
|
btn: ['确认'],
|
|
btn: ['确认'],
|
|
@@ -405,7 +405,7 @@ var table = {
|
|
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId;
|
|
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId;
|
|
var _width = $.common.isEmpty(width) ? "400" : width;
|
|
var _width = $.common.isEmpty(width) ? "400" : width;
|
|
var _height = $.common.isEmpty(height) ? "230" : height;
|
|
var _height = $.common.isEmpty(height) ? "230" : height;
|
|
- layer.open({
|
|
|
|
|
|
+ top.layer.open({
|
|
type: 1,
|
|
type: 1,
|
|
area: [_width + 'px', _height + 'px'],
|
|
area: [_width + 'px', _height + 'px'],
|
|
fix: false,
|
|
fix: false,
|
|
@@ -423,7 +423,7 @@ var table = {
|
|
$.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
|
|
$.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- var index = layer.load(2, {shade: false});
|
|
|
|
|
|
+ var index = top.layer.load(2, {shade: false});
|
|
$.modal.disable();
|
|
$.modal.disable();
|
|
var formData = new FormData(layero.find('form')[0]);
|
|
var formData = new FormData(layero.find('form')[0]);
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -435,15 +435,16 @@ var table = {
|
|
type: 'POST',
|
|
type: 'POST',
|
|
success: function (result) {
|
|
success: function (result) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
|
|
+ $.modal.close(index);
|
|
$.modal.closeAll();
|
|
$.modal.closeAll();
|
|
$.modal.alertSuccess(result.msg);
|
|
$.modal.alertSuccess(result.msg);
|
|
$.table.refresh();
|
|
$.table.refresh();
|
|
} else if (result.code == web_status.WARNING) {
|
|
} else if (result.code == web_status.WARNING) {
|
|
- layer.close(index);
|
|
|
|
|
|
+ $.modal.close(index);
|
|
$.modal.enable();
|
|
$.modal.enable();
|
|
$.modal.alertWarning(result.msg)
|
|
$.modal.alertWarning(result.msg)
|
|
} else {
|
|
} else {
|
|
- layer.close(index);
|
|
|
|
|
|
+ $.modal.close(index);
|
|
$.modal.enable();
|
|
$.modal.enable();
|
|
$.modal.alertError(result.msg);
|
|
$.modal.alertError(result.msg);
|
|
}
|
|
}
|
|
@@ -733,9 +734,9 @@ var table = {
|
|
// 消息提示
|
|
// 消息提示
|
|
msg: function(content, type) {
|
|
msg: function(content, type) {
|
|
if (type != undefined) {
|
|
if (type != undefined) {
|
|
- layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 });
|
|
|
|
|
|
+ top.layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 });
|
|
} else {
|
|
} else {
|
|
- layer.msg(content);
|
|
|
|
|
|
+ top.layer.msg(content);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 错误消息
|
|
// 错误消息
|
|
@@ -752,24 +753,13 @@ var table = {
|
|
},
|
|
},
|
|
// 弹出提示
|
|
// 弹出提示
|
|
alert: function(content, type) {
|
|
alert: function(content, type) {
|
|
- layer.alert(content, {
|
|
|
|
|
|
+ top.layer.alert(content, {
|
|
icon: $.modal.icon(type),
|
|
icon: $.modal.icon(type),
|
|
title: "系统提示",
|
|
title: "系统提示",
|
|
btn: ['确认'],
|
|
btn: ['确认'],
|
|
btnclass: ['btn btn-primary'],
|
|
btnclass: ['btn btn-primary'],
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // 消息提示并刷新父窗体
|
|
|
|
- msgReload: function(msg, type) {
|
|
|
|
- layer.msg(msg, {
|
|
|
|
- icon: $.modal.icon(type),
|
|
|
|
- time: 500,
|
|
|
|
- shade: [0.1, '#8F8F8F']
|
|
|
|
- },
|
|
|
|
- function() {
|
|
|
|
- $.modal.reload();
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
// 错误提示
|
|
// 错误提示
|
|
alertError: function(content) {
|
|
alertError: function(content) {
|
|
$.modal.alert(content, modal_status.FAIL);
|
|
$.modal.alert(content, modal_status.FAIL);
|
|
@@ -782,27 +772,51 @@ var table = {
|
|
alertWarning: function(content) {
|
|
alertWarning: function(content) {
|
|
$.modal.alert(content, modal_status.WARNING);
|
|
$.modal.alert(content, modal_status.WARNING);
|
|
},
|
|
},
|
|
|
|
+ // 消息提示,重新加载页面
|
|
|
|
+ msgReload: function(msg, type) {
|
|
|
|
+ top.layer.msg(msg, {
|
|
|
|
+ icon: $.modal.icon(type),
|
|
|
|
+ time: 500,
|
|
|
|
+ shade: [0.1, '#8F8F8F']
|
|
|
|
+ },
|
|
|
|
+ function() {
|
|
|
|
+ $.modal.reload();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 消息提示成功并刷新父窗体
|
|
|
|
+ msgSuccessReload: function(msg) {
|
|
|
|
+ $.modal.msgReload(msg, modal_status.SUCCESS);
|
|
|
|
+ },
|
|
|
|
+ // 获取iframe页的DOM
|
|
|
|
+ getChildFrame: function (index) {
|
|
|
|
+ if($.common.isEmpty(index)){
|
|
|
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
|
+ return parent.layer.getChildFrame('body', index);
|
|
|
|
+ } else {
|
|
|
|
+ return top.layer.getChildFrame('body', index);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 关闭窗体
|
|
// 关闭窗体
|
|
close: function (index) {
|
|
close: function (index) {
|
|
if($.common.isEmpty(index)){
|
|
if($.common.isEmpty(index)){
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
parent.layer.close(index);
|
|
parent.layer.close(index);
|
|
} else {
|
|
} else {
|
|
- layer.close(index);
|
|
|
|
|
|
+ top.layer.close(index);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 关闭全部窗体
|
|
// 关闭全部窗体
|
|
closeAll: function () {
|
|
closeAll: function () {
|
|
- layer.closeAll();
|
|
|
|
|
|
+ top.layer.closeAll();
|
|
},
|
|
},
|
|
// 确认窗体
|
|
// 确认窗体
|
|
confirm: function (content, callBack) {
|
|
confirm: function (content, callBack) {
|
|
- layer.confirm(content, {
|
|
|
|
|
|
+ top.layer.confirm(content, {
|
|
icon: 3,
|
|
icon: 3,
|
|
title: "系统提示",
|
|
title: "系统提示",
|
|
btn: ['确认', '取消']
|
|
btn: ['确认', '取消']
|
|
}, function (index) {
|
|
}, function (index) {
|
|
- layer.close(index);
|
|
|
|
|
|
+ $.modal.close(index);
|
|
callBack(true);
|
|
callBack(true);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -831,7 +845,7 @@ var table = {
|
|
iframeWin.contentWindow.submitHandler(index, layero);
|
|
iframeWin.contentWindow.submitHandler(index, layero);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- layer.open({
|
|
|
|
|
|
+ top.layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
area: [width + 'px', height + 'px'],
|
|
area: [width + 'px', height + 'px'],
|
|
fix: false,
|
|
fix: false,
|
|
@@ -875,7 +889,7 @@ var table = {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var index = layer.open($.extend({
|
|
|
|
|
|
+ var index = top.layer.open($.extend({
|
|
type: 2,
|
|
type: 2,
|
|
maxmin: $.common.isEmpty(options.maxmin) ? true : options.maxmin,
|
|
maxmin: $.common.isEmpty(options.maxmin) ? true : options.maxmin,
|
|
shade: 0.3,
|
|
shade: 0.3,
|
|
@@ -915,7 +929,7 @@ var table = {
|
|
if ($.common.isEmpty(height)) {
|
|
if ($.common.isEmpty(height)) {
|
|
height = ($(window).height() - 50);
|
|
height = ($(window).height() - 50);
|
|
}
|
|
}
|
|
- var index = layer.open({
|
|
|
|
|
|
+ var index = top.layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
area: [width + 'px', height + 'px'],
|
|
area: [width + 'px', height + 'px'],
|
|
fix: false,
|
|
fix: false,
|
|
@@ -935,7 +949,7 @@ var table = {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- layer.full(index);
|
|
|
|
|
|
+ top.layer.full(index);
|
|
},
|
|
},
|
|
// 选卡页方式打开
|
|
// 选卡页方式打开
|
|
openTab: function (title, url, isRefresh) {
|
|
openTab: function (title, url, isRefresh) {
|
|
@@ -1017,7 +1031,7 @@ var table = {
|
|
skin: 'layui-layer-gray',
|
|
skin: 'layui-layer-gray',
|
|
btn: ['关闭'],
|
|
btn: ['关闭'],
|
|
yes: function (index, layero) {
|
|
yes: function (index, layero) {
|
|
- layer.close(index);
|
|
|
|
|
|
+ $.modal.close(index);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
$.modal.openOptions(options);
|
|
$.modal.openOptions(options);
|
|
@@ -1173,7 +1187,7 @@ var table = {
|
|
};
|
|
};
|
|
$.ajax(config)
|
|
$.ajax(config)
|
|
},
|
|
},
|
|
- // 保存信息 弹出提示框
|
|
|
|
|
|
+ // 保存信息 弹出结果提示框
|
|
saveModal: function(url, data, callback) {
|
|
saveModal: function(url, data, callback) {
|
|
var config = {
|
|
var config = {
|
|
url: url,
|
|
url: url,
|
|
@@ -1235,10 +1249,10 @@ var table = {
|
|
}
|
|
}
|
|
$.modal.closeLoading();
|
|
$.modal.closeLoading();
|
|
},
|
|
},
|
|
- // 成功结果提示msg(父窗体全局更新)
|
|
|
|
- saveSuccess: function (result) {
|
|
|
|
|
|
+ // 保存结果重新加载页面
|
|
|
|
+ saveReload: function (result) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
- $.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
|
|
|
|
|
|
+ $.modal.msgSuccessReload(result.msg);
|
|
} else if (result.code == web_status.WARNING) {
|
|
} else if (result.code == web_status.WARNING) {
|
|
$.modal.alertWarning(result.msg)
|
|
$.modal.alertWarning(result.msg)
|
|
} else {
|
|
} else {
|
|
@@ -1249,8 +1263,10 @@ var table = {
|
|
// 成功回调执行事件(父窗体静默更新)
|
|
// 成功回调执行事件(父窗体静默更新)
|
|
successCallback: function(result) {
|
|
successCallback: function(result) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
- var parent = window.parent;
|
|
|
|
- if (parent.table.options.type == table_type.bootstrapTable) {
|
|
|
|
|
|
+ var parent = activeWindow();
|
|
|
|
+ if($.common.isEmpty(parent.table)) {
|
|
|
|
+ $.modal.msgSuccessReload(result.msg);
|
|
|
|
+ } else if (parent.table.options.type == table_type.bootstrapTable) {
|
|
$.modal.close();
|
|
$.modal.close();
|
|
parent.$.modal.msgSuccess(result.msg);
|
|
parent.$.modal.msgSuccess(result.msg);
|
|
parent.$.table.refresh();
|
|
parent.$.table.refresh();
|
|
@@ -1258,8 +1274,6 @@ var table = {
|
|
$.modal.close();
|
|
$.modal.close();
|
|
parent.$.modal.msgSuccess(result.msg);
|
|
parent.$.modal.msgSuccess(result.msg);
|
|
parent.$.treeTable.refresh();
|
|
parent.$.treeTable.refresh();
|
|
- } else {
|
|
|
|
- $.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
|
|
|
|
}
|
|
}
|
|
} else if (result.code == web_status.WARNING) {
|
|
} else if (result.code == web_status.WARNING) {
|
|
$.modal.alertWarning(result.msg)
|
|
$.modal.alertWarning(result.msg)
|