<!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="orgTree" class="ztree"></ul>
	</div>
	<div th:include="include/footer_js::footer"></div>
	<script type="text/javascript">
	var setting = {
		data : {
			simpleData : {
				enable : true,
				idKey : "orgId",
				pIdKey : "parentId",
				rootPId : 0
			},
			key : {
				url : "nourl"
			}
		}
	};
	var ztree;

	var vm = new Vue({
		el : '#dpLTE',
		methods : {
			getOrg : function(menuId) {
				$.get('../../sys/org/list', function(r) {
					ztree = $.fn.zTree.init($("#orgTree"), setting, r);
					if(top.layerForm.vm.role.orgId != 0) {
						var node = ztree.getNodeByParam("orgId", top.layerForm.vm.role.orgId);
						ztree.selectNode(node);
						top.layerForm.vm.role.parentName = node.name;
					}
				})
			},
			acceptClick: function() {
				var node = ztree.getSelectedNodes();
				top.layerForm.vm.role.orgId = node[0].orgId;
				top.layerForm.vm.role.orgName = node[0].name;
				dialogClose();
			}
		},
		created : function() {
			this.getOrg();
		}
	})
	</script>
</body>
</html>