cf39a251 by yangjianbin

init

1 parent a69b7d92
......@@ -76,7 +76,37 @@
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.selectNode(treeNode);
return confirm("确认删除 节点 -- " + treeNode.name + " 吗? 一旦删除信息无法恢复");
var bool = confirm("确认删除 节点 -- " + treeNode.name + " 吗? 一旦删除信息无法恢复");
if(bool) {
var targetUrl = 'department/delete/' + treeNode.id;
$.ajax({
type: 'delete',
url: apiBaseUrl + targetUrl,
cache: false,
dataType: 'json',
data: JSON.stringify(data),
contentType: "application/json; charset=UTF-8",
success: function (data) {
if (data.msg) {
layer.alert(data.msg);
} else if (data.code != 0) {
layer.alert('操作失败');
} else {
layer.msg('操作成功');
}
setTimeout(function () {
if(!data.code) {
layer_close();
}
},500);
},
error: function () {
layer.alert("操作失败")
}
})
}
return bool;
}
function beforeRename(treeId, treeNode, newName, isCancel) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!