添加选中的ids

master
夜笙歌 3 weeks ago
parent 761440b8d6
commit 13c698bc31

@ -138,6 +138,12 @@ var table = {
detailFormatter: options.detailFormatter, // 在行下面展示其他数据列表
});
},
selectRow: function() {
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
return row;
});
return rows;
},
// 获取实例ID如存在多个返回#id1,#id2 delimeter分隔符
getOptionsIds: function(separator) {
var _separator = $.common.isEmpty(separator) ? "," : separator;
@ -466,6 +472,7 @@ var table = {
// 获取当前页选中或者取消的行ID
affectedRowIds: function(rows) {
var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId;
console.log(column)
var rowIds;
if ($.isArray(rows)) {
rowIds = $.map(rows, function(row) {

@ -55,10 +55,13 @@
});
function submitHandler() {
checkItem();
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-ProcessRoute-add').serialize());
}
// checkItem();
let rows = $.table.selectRow() ||[]
let ids = rows.map(e=>e.stationID)
console.log(ids)
// if ($.validate.form()) {
// $.operate.save(prefix + "/add", $('#form-ProcessRoute-add').serialize());
// }
}
var editFlag = [[${@permission.hasPermi('nanjing:SubStation:edit')}]];
var removeFlag = [[${@permission.hasPermi('nanjing:SubStation:remove')}]];
@ -191,4 +194,4 @@
}
</script>
</body>
</html>
</html>

Loading…
Cancel
Save