新增删除功能
This commit is contained in:
@@ -279,7 +279,7 @@ export default {
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button class="btn btn-sm btn-success opt-edit" data-index="' + index + '">编辑</button>';
|
||||
return '<button class="btn btn-sm btn-success opt-edit" data-index="' + index + '">编辑</button>' + '<button class="btn btn-sm btn-default opt-del" data-index="' + index + '">删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -365,6 +365,29 @@ export default {
|
||||
});
|
||||
$("#deployedModal").modal('show');
|
||||
});
|
||||
|
||||
$('#table').on('click', '.opt-del', function () {
|
||||
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
||||
var id = currentData.id;
|
||||
const msg = '确定要删除吗?';
|
||||
if (confirm(msg)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/seize-treasure/pool/item/del?id=" + id,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true' || json.code == 200) {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
optEdit() {
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
|
Reference in New Issue
Block a user