121f0132 by yangjianbin

Merge branch 'develop' of http://g.28ms.com:8000/yangjianbin/page into develop

2 parents 2d675fd7 74be6b98
......@@ -118,8 +118,11 @@
return false;
}
var targetUrl = 'department/update/' + treeNode.id;
console.log(treeNode);
var data = {
name:newName
name:newName,
parentId:treeNode.id
}
$.ajax({
type: 'put',
......@@ -160,6 +163,38 @@
if (btn) btn.bind("click", function(){
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.addNodes(treeNode, {id:(100 + newCount), pId:treeNode.id, name:"new node" + (newCount++)});
var data = {
name:'new node',
parentId:treeNode.id
}
var targetUrl1 = 'department/add';
$.ajax({
type: 'post',
url: apiBaseUrl + targetUrl1,
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 false;
});
};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!