数据字典完成一半管理功能

This commit is contained in:
2020-08-06 01:16:39 +08:00
parent 0c1fb6b097
commit 3d015baa56
5 changed files with 345 additions and 64 deletions
+3 -3
View File
@@ -3,9 +3,9 @@ function showDialog(id, title, url, width, height) {
top.showDialog(id, title, url, width, height)
}
//删除数据
function doDel(url, id) {
top.doDel(url, id);
}
//function doDel(url, id) {
// top.doDel(url, id);
//}
//刷新网页
function refresh() {
+22 -21
View File
@@ -114,12 +114,13 @@ function DoPost(formId, rules, messages) {
}
//后台异步删除
function doDel(url, id) {
layer.confirm('确认要删除当前记录?此操作不可恢复!', {
//console.log('找到记录:' + $("#tb_departments").length, window.location.href);
top.layer.confirm('确认要删除当前记录?此操作不可恢复!', {
icon: 3,
title: '系统提示',
btn: ['确定', '取消 '] //按钮
}, function () {
var loading = layer.load(0, {
var loading = top.layer.load(0, {
shade: [0.2, '#000'] //0.1透明度的背景
});
$.ajax({
@@ -129,36 +130,36 @@ function doDel(url, id) {
dataType: "JSON",
success: function (data) {
if (data.status == "success") {
layer.close(loading);
layer.msg(data.message, {
top.layer.close(loading);
top.layer.msg(data.message, {
time: 1000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
if ($("#row_" + id).length > 0) {
$("#row_" + id).fadeOut(300).remove();
if ($("#tb_departments").length > 0) {
$("#tb_departments").bootstrapTable('refresh');
} else {
//window.location.href = window.location.href;
var dindex = parent.layer.getFrameIndex(window.name);
if (dindex) {
layer.close(dindex);
return;
}
if (top.toplayerindex) {
//window.location.href = window.location.href;
} else {
top.refreshCurrentTab();//刷新本tab
}
window.location.href = window.location.href;
//var dindex = parent.layer.getFrameIndex(window.name);
//if (dindex) {
// layer.close(dindex);
// return;
//}
//if (top.toplayerindex) {
// //window.location.href = window.location.href;
//} else {
// top.refreshCurrentTab();//刷新本tab
//}
}
});
} else {
layer.close(loading);
layer.alert(data.message, { icon: 2 });
top.layer.close(loading);
top.layer.alert(data.message, { icon: 2 });
}
},
error: function () {
layer.close(loading);
layer.alert('执行错误,请联系管理员!', { icon: 2 });
top.layer.close(loading);
top.layer.alert('执行错误,请联系管理员!', { icon: 2 });
}
});
}, function () {