|
|
@ -447,13 +447,13 @@ var table = {
|
|
|
|
// 查询表格指定列值
|
|
|
|
// 查询表格指定列值
|
|
|
|
selectColumns: function(column) {
|
|
|
|
selectColumns: function(column) {
|
|
|
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
|
|
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
|
|
|
return row[column];
|
|
|
|
return getItemField(row, column);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
|
|
|
|
if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
|
|
|
|
var selectedRows = table.rememberSelecteds[table.options.id];
|
|
|
|
var selectedRows = table.rememberSelecteds[table.options.id];
|
|
|
|
if($.common.isNotEmpty(selectedRows)) {
|
|
|
|
if($.common.isNotEmpty(selectedRows)) {
|
|
|
|
rows = $.map(table.rememberSelecteds[table.options.id], function (row) {
|
|
|
|
rows = $.map(table.rememberSelecteds[table.options.id], function (row) {
|
|
|
|
return row[column];
|
|
|
|
return getItemField(row, column);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -465,7 +465,7 @@ var table = {
|
|
|
|
var rowIds;
|
|
|
|
var rowIds;
|
|
|
|
if ($.isArray(rows)) {
|
|
|
|
if ($.isArray(rows)) {
|
|
|
|
rowIds = $.map(rows, function(row) {
|
|
|
|
rowIds = $.map(rows, function(row) {
|
|
|
|
return row[column];
|
|
|
|
return getItemField(row, column);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
rowIds = [rows[column]];
|
|
|
|
rowIds = [rows[column]];
|
|
|
@ -475,13 +475,13 @@ var table = {
|
|
|
|
// 查询表格首列值
|
|
|
|
// 查询表格首列值
|
|
|
|
selectFirstColumns: function() {
|
|
|
|
selectFirstColumns: function() {
|
|
|
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
|
|
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
|
|
|
return row[table.options.columns[1].field];
|
|
|
|
return getItemField(row, table.options.columns[1].field);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
|
|
|
|
if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
|
|
|
|
var selectedRows = table.rememberSelecteds[table.options.id];
|
|
|
|
var selectedRows = table.rememberSelecteds[table.options.id];
|
|
|
|
if($.common.isNotEmpty(selectedRows)) {
|
|
|
|
if($.common.isNotEmpty(selectedRows)) {
|
|
|
|
rows = $.map(selectedRows, function (row) {
|
|
|
|
rows = $.map(selectedRows, function (row) {
|
|
|
|
return row[table.options.columns[1].field];
|
|
|
|
return getItemField(row, table.options.columns[1].field);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -577,7 +577,7 @@ var table = {
|
|
|
|
// 查询表格树指定列值
|
|
|
|
// 查询表格树指定列值
|
|
|
|
selectColumns: function(column) {
|
|
|
|
selectColumns: function(column) {
|
|
|
|
var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) {
|
|
|
|
var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) {
|
|
|
|
return row[column];
|
|
|
|
return getItemField(row, column);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return $.common.uniqueFn(rows);
|
|
|
|
return $.common.uniqueFn(rows);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -1462,6 +1462,18 @@ var table = {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return flag ? str : '';
|
|
|
|
return flag ? str : '';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 获取节点数据,支持多层级访问
|
|
|
|
|
|
|
|
getItemField: function (item, field) {
|
|
|
|
|
|
|
|
var value = item;
|
|
|
|
|
|
|
|
if (typeof field !== 'string' || item.hasOwnProperty(field)) {
|
|
|
|
|
|
|
|
return item[field];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var props = field.split('.');
|
|
|
|
|
|
|
|
for (var p in props) {
|
|
|
|
|
|
|
|
value = value && value[props[p]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
},
|
|
|
|
// 指定随机数返回
|
|
|
|
// 指定随机数返回
|
|
|
|
random: function (min, max) {
|
|
|
|
random: function (min, max) {
|
|
|
|
return Math.floor((Math.random() * max) + min);
|
|
|
|
return Math.floor((Math.random() * max) + min);
|
|
|
|