完善工具类
parent
f4bcccaac7
commit
a974344ed7
|
|
@ -66,9 +66,9 @@ layui.define("layer", function (exports) {
|
|||
* 在表格页面操作成功后弹窗提示
|
||||
* @param content
|
||||
*/
|
||||
operationSuccessMsg: function (content) {
|
||||
successMsg: function (content) {
|
||||
layer.msg(content, {icon: 1, time: 1000}, function () {
|
||||
// 刷新当前table数据
|
||||
// 刷新当前页table数据
|
||||
$(".layui-laypage-btn")[0].click();
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
laydate.render({elem: "#startTime", type: "datetime"});
|
||||
laydate.render({elem: "#endTime", type: "datetime"});
|
||||
|
||||
table.render({
|
||||
var userTable = table.render({
|
||||
elem: "#tableId",
|
||||
url: "../../data/user.json",
|
||||
limit: 10,
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
});
|
||||
|
||||
form.on("submit(search)", function (data) {
|
||||
table.reload("tableId", {
|
||||
userTable.reload({
|
||||
where: data.field,
|
||||
page: {curr: 1}
|
||||
});
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
if (idsStr) {
|
||||
okUtils.ajax("/user/batchNormal", "post", {idsStr: idsStr}).done(function (response) {
|
||||
console.log(response)
|
||||
okUtils.table.operationSuccessMsg("批量启用成功");
|
||||
okUtils.table.successMsg("批量启用成功");
|
||||
}).fail(function (error) {
|
||||
console.log(error)
|
||||
});
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
if (idsStr) {
|
||||
okUtils.ajax("/user/batchStop", "post", {idsStr: idsStr}).done(function (response) {
|
||||
console.log(response)
|
||||
okUtils.table.operationSuccessMsg("批量停用成功");
|
||||
okUtils.table.successMsg("批量停用成功");
|
||||
}).fail(function (error) {
|
||||
console.log(error)
|
||||
});
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
if (idsStr) {
|
||||
okUtils.ajax("/user/batchDel", "post", {idsStr: idsStr}).done(function (response) {
|
||||
console.log(response)
|
||||
okUtils.table.operationSuccessMsg("批量删除成功");
|
||||
okUtils.table.successMsg("批量删除成功");
|
||||
}).fail(function (error) {
|
||||
console.log(error)
|
||||
});
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
|
||||
function edit (id) {
|
||||
okLayer.open("编辑用户", "user-edit.html?id=" + id, "90%", "90%", function () {
|
||||
table.reload("tableId");
|
||||
userTable.reload();
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
okLayer.confirm("确定要删除吗?", function () {
|
||||
okUtils.ajax("/user/batchDel", "post", {idsStr: id}).done(function (response) {
|
||||
console.log(response)
|
||||
okUtils.table.operationSuccessMsg("删除成功");
|
||||
okUtils.table.successMsg("删除成功");
|
||||
}).fail(function (error) {
|
||||
console.log(error)
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue