mirror of https://gitee.com/y_project/RuoYi.git
查询表格指定列值增加deDuplication是否去重属性
parent
9d83ffab2a
commit
c7e0292da3
|
@ -477,8 +477,9 @@ var table = {
|
||||||
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||||
$("#" + currentId).bootstrapTable('refreshOptions', options);
|
$("#" + currentId).bootstrapTable('refreshOptions', options);
|
||||||
},
|
},
|
||||||
// 查询表格指定列值
|
// 查询表格指定列值 deDuplication( true去重、false不去重)
|
||||||
selectColumns: function(column) {
|
selectColumns: function(column, deDuplication) {
|
||||||
|
var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication;
|
||||||
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
||||||
return $.common.getItemField(row, column);
|
return $.common.getItemField(row, column);
|
||||||
});
|
});
|
||||||
|
@ -490,7 +491,7 @@ var table = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $.common.uniqueFn(rows);
|
return distinct ? $.common.uniqueFn(rows) : rows;
|
||||||
},
|
},
|
||||||
// 获取当前页选中或者取消的行ID
|
// 获取当前页选中或者取消的行ID
|
||||||
affectedRowIds: function(rows) {
|
affectedRowIds: function(rows) {
|
||||||
|
@ -505,8 +506,9 @@ var table = {
|
||||||
}
|
}
|
||||||
return rowIds;
|
return rowIds;
|
||||||
},
|
},
|
||||||
// 查询表格首列值
|
// 查询表格首列值deDuplication( true去重、false不去重)
|
||||||
selectFirstColumns: function() {
|
selectFirstColumns: function(deDuplication) {
|
||||||
|
var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication;
|
||||||
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
||||||
return $.common.getItemField(row, table.options.columns[1].field);
|
return $.common.getItemField(row, table.options.columns[1].field);
|
||||||
});
|
});
|
||||||
|
@ -518,7 +520,7 @@ var table = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $.common.uniqueFn(rows);
|
return distinct ? $.common.uniqueFn(rows) : rows;
|
||||||
},
|
},
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
selectDictLabel: function(datas, value) {
|
selectDictLabel: function(datas, value) {
|
||||||
|
@ -630,12 +632,13 @@ var table = {
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
$.bttTable.bootstrapTreeTable('refresh');
|
$.bttTable.bootstrapTreeTable('refresh');
|
||||||
},
|
},
|
||||||
// 查询表格树指定列值
|
// 查询表格树指定列值deDuplication( true去重、false不去重)
|
||||||
selectColumns: function(column) {
|
selectColumns: function(column, deDuplication) {
|
||||||
|
var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication;
|
||||||
var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) {
|
var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) {
|
||||||
return $.common.getItemField(row, column);
|
return $.common.getItemField(row, column);
|
||||||
});
|
});
|
||||||
return $.common.uniqueFn(rows);
|
return distinct ? $.common.uniqueFn(rows) : rows;
|
||||||
},
|
},
|
||||||
// 请求获取数据后处理回调函数,校验异常状态提醒
|
// 请求获取数据后处理回调函数,校验异常状态提醒
|
||||||
responseHandler: function(res) {
|
responseHandler: function(res) {
|
||||||
|
|
Loading…
Reference in New Issue