|
@@ -91,7 +91,7 @@ var table = {
|
|
pagination: options.pagination, // 是否显示分页(*)
|
|
pagination: options.pagination, // 是否显示分页(*)
|
|
paginationLoop: options.paginationLoop, // 是否启用分页条无限循环的功能
|
|
paginationLoop: options.paginationLoop, // 是否启用分页条无限循环的功能
|
|
pageNumber: 1, // 初始化加载第一页,默认第一页
|
|
pageNumber: 1, // 初始化加载第一页,默认第一页
|
|
- pageSize: options.pageSize, // 每页的记录行数(*)
|
|
|
|
|
|
+ pageSize: options.pageSize, // 每页的记录行数(*)
|
|
pageList: options.pageList, // 可供选择的每页的行数(*)
|
|
pageList: options.pageList, // 可供选择的每页的行数(*)
|
|
firstLoad: options.firstLoad, // 是否首次请求加载数据,对于数据较大可以配置false
|
|
firstLoad: options.firstLoad, // 是否首次请求加载数据,对于数据较大可以配置false
|
|
escape: options.escape, // 转义HTML字符串
|
|
escape: options.escape, // 转义HTML字符串
|
|
@@ -141,7 +141,7 @@ var table = {
|
|
// 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符
|
|
// 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符
|
|
getOptionsIds: function(separator) {
|
|
getOptionsIds: function(separator) {
|
|
var _separator = $.common.isEmpty(separator) ? "," : separator;
|
|
var _separator = $.common.isEmpty(separator) ? "," : separator;
|
|
- var optionsIds = "";
|
|
|
|
|
|
+ var optionsIds = "";
|
|
$.each(table.config, function(key, value){
|
|
$.each(table.config, function(key, value){
|
|
optionsIds += "#" + key + _separator;
|
|
optionsIds += "#" + key + _separator;
|
|
});
|
|
});
|
|
@@ -158,7 +158,7 @@ var table = {
|
|
isAsc: params.order
|
|
isAsc: params.order
|
|
};
|
|
};
|
|
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
|
|
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
|
|
- return $.extend(curParams, $.common.formToJSON(currentId));
|
|
|
|
|
|
+ return $.extend(curParams, $.common.formToJSON(currentId));
|
|
},
|
|
},
|
|
// 请求获取数据后处理回调函数
|
|
// 请求获取数据后处理回调函数
|
|
responseHandler: function(res) {
|
|
responseHandler: function(res) {
|
|
@@ -794,9 +794,9 @@ var table = {
|
|
},
|
|
},
|
|
// 弹出层指定参数选项
|
|
// 弹出层指定参数选项
|
|
openOptions: function (options) {
|
|
openOptions: function (options) {
|
|
- var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url;
|
|
|
|
- var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title;
|
|
|
|
- var _width = $.common.isEmpty(options.width) ? "800" : options.width;
|
|
|
|
|
|
+ var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url;
|
|
|
|
+ var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title;
|
|
|
|
+ var _width = $.common.isEmpty(options.width) ? "800" : options.width;
|
|
var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height;
|
|
var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height;
|
|
var _btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'];
|
|
var _btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'];
|
|
if ($.common.isEmpty(options.yes)) {
|
|
if ($.common.isEmpty(options.yes)) {
|
|
@@ -946,7 +946,7 @@ var table = {
|
|
detail: function(id, width, height) {
|
|
detail: function(id, width, height) {
|
|
table.set();
|
|
table.set();
|
|
var _url = $.operate.detailUrl(id);
|
|
var _url = $.operate.detailUrl(id);
|
|
- var _width = $.common.isEmpty(width) ? "800" : width;
|
|
|
|
|
|
+ var _width = $.common.isEmpty(width) ? "800" : width;
|
|
var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height;
|
|
var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height;
|
|
//如果是移动端,就使用自适应大小弹窗
|
|
//如果是移动端,就使用自适应大小弹窗
|
|
if ($.common.isMobile()) {
|
|
if ($.common.isMobile()) {
|
|
@@ -958,7 +958,7 @@ var table = {
|
|
width: _width,
|
|
width: _width,
|
|
height: _height,
|
|
height: _height,
|
|
url: _url,
|
|
url: _url,
|
|
- skin: 'layui-layer-gray',
|
|
|
|
|
|
+ skin: 'layui-layer-gray',
|
|
btn: ['关闭'],
|
|
btn: ['关闭'],
|
|
yes: function (index, layero) {
|
|
yes: function (index, layero) {
|
|
layer.close(index);
|
|
layer.close(index);
|
|
@@ -993,7 +993,7 @@ var table = {
|
|
$.operate.submit(url, "post", "json", data);
|
|
$.operate.submit(url, "post", "json", data);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
// 批量删除信息
|
|
// 批量删除信息
|
|
removeAll: function() {
|
|
removeAll: function() {
|
|
@@ -1161,6 +1161,7 @@ var table = {
|
|
},
|
|
},
|
|
// 保存结果弹出msg刷新table表格
|
|
// 保存结果弹出msg刷新table表格
|
|
ajaxSuccess: function (result) {
|
|
ajaxSuccess: function (result) {
|
|
|
|
+
|
|
if (result.code == web_status.SUCCESS && table.options.type == table_type.bootstrapTable) {
|
|
if (result.code == web_status.SUCCESS && table.options.type == table_type.bootstrapTable) {
|
|
$.modal.msgSuccess(result.msg);
|
|
$.modal.msgSuccess(result.msg);
|
|
$.table.refresh();
|
|
$.table.refresh();
|
|
@@ -1178,6 +1179,7 @@ var table = {
|
|
},
|
|
},
|
|
// 成功结果提示msg(父窗体全局更新)
|
|
// 成功结果提示msg(父窗体全局更新)
|
|
saveSuccess: function (result) {
|
|
saveSuccess: function (result) {
|
|
|
|
+
|
|
if (result.code == web_status.SUCCESS) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
$.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
|
|
$.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS);
|
|
} else if (result.code == web_status.WARNING) {
|
|
} else if (result.code == web_status.WARNING) {
|
|
@@ -1189,6 +1191,7 @@ var table = {
|
|
},
|
|
},
|
|
// 成功回调执行事件(父窗体静默更新)
|
|
// 成功回调执行事件(父窗体静默更新)
|
|
successCallback: function(result) {
|
|
successCallback: function(result) {
|
|
|
|
+
|
|
if (result.code == web_status.SUCCESS) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
var parent = window.parent;
|
|
var parent = window.parent;
|
|
if (parent.table.options.type == table_type.bootstrapTable) {
|
|
if (parent.table.options.type == table_type.bootstrapTable) {
|
|
@@ -1604,4 +1607,4 @@ modal_status = {
|
|
SUCCESS: "success",
|
|
SUCCESS: "success",
|
|
FAIL: "error",
|
|
FAIL: "error",
|
|
WARNING: "warning"
|
|
WARNING: "warning"
|
|
-};
|
|
|
|
|
|
+};
|