<!DOCTYPE html>
<html lang="zh">
<head>
    <@meta/>
    <title>部门管理</title>
    <#include "admin/common/include_hplus.ftl">
    <#include "admin/common/include_form.ftl">
    <#include "admin/common/include_ztree.ftl">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" action="<@contextPath/>/sys/dept/saveEntity" method="post">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>上级部门：</label>
                            <div class="col-sm-8">
                                <div class="ztree-content input-ztree-2" data-url="<@contextPath/>/sys/dept/treeList">
                                    <div class="input-group">
                                        <input type="hidden" name="parentId" value="${parent.id}">
                                        <input type="text" class="form-control input-sm" autocomplete="off" name="parentName" value="${parent.name}">
                                        <div class="input-group-btn">
                                            <button class="btn btn-white btn-sm" type="button" aria-expanded="true"><span class="caret"></span></button>
                                        </div>
                                    </div>
                                    <div class="menuContent" style="display:none; position: absolute;z-index: 999;">
                                        <ul class="ztree" style="margin-top:0; "></ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>部门名称：</label>
                            <div class="col-sm-8">
                                <input class="form-control input-sm" type="text" required="" aria-required="true" name="name" value="${entity.name }">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>状态：</label>
                            <div class="col-sm-8">
                                <div class="radio i-checks">
                                    <label><input type="radio" name="state" value="1" checked="">启用</label>
                                    <label><input type="radio" name="state" value="2" <#if entity.state == '2'>checked</#if>>禁用</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-7 col-sm-offset-3" style="text-align:center;">
                                <button class="btn btn-primary" type="submit">保存</button>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="${entity.id }">
                        <input type="hidden" name="editType" value="${editForm.editType }">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){

        $.form.render();

    });
</script>
</body>
</html>