<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/header_css::header('上级菜单-菜单管理')"></head>
<body>
	<div id="dpLTE" class="container-fluid" v-cloak>
		<ul id="menuTree" class="ztree"></ul>
	</div>
	<div th:include="include/footer_js::footer"></div>
	<script type="text/javascript">
	var setting = {
		data : {
			simpleData : {
				enable : true,
				idKey : "menuId",
				pIdKey : "parentId",
				rootPId : -1
			},
			key : {
				url : "nourl"
			}
		}
	};
	var ztree;

	var vm = new Vue({
		el : '#dpLTE',
		methods : {
			getMenu : function(menuId) {
				$.get('../../sys/menu/select', function(r) {
					ztree = $.fn.zTree
							.init($("#menuTree"), setting, r.rows);
					var node = ztree.getNodeByParam("menuId", top.layerForm.vm.menu.parentId);
					ztree.selectNode(node);
					top.layerForm.vm.menu.parentName = node.name;
				})
			},
			acceptClick: function() {
				var node = ztree.getSelectedNodes();
				top.layerForm.vm.menu.parentId = node[0].menuId;
				top.layerForm.vm.menu.parentName = node[0].name;
				dialogClose();
			}
		},
		created : function() {
			this.getMenu();
		}
	})
	</script>
</body>
</html>