<%@ page import="com.lightinit.hsdataplatformresdir.dictionary.DicUserAccountLockType" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<jsp:include page="../../../common/admin/modal_content_pre.jsp">
    <jsp:param name="modal_title" value="编辑用户"/>
</jsp:include>
<form id="formAdd"  action="<%=basePath%>/admin/user/edit.action" method="post" class="form-horizontal">
    <div class="form-group">
        <div class="form-group">
            <label for="username" class="col-sm-3 control-label"><span style="color: red;">*</span>用户账号</label>
            <div class="col-sm-8">
                <input type="hidden" id="id" name="id" value="${admin.id}">
                <input type="text" id="username" name="username" class="form-control" value="${admin.username}" readonly/>
            </div>
        </div>
        <div class="form-group">
            <label for="showname" class="col-sm-3 control-label"><span style="color: red;">*</span>用户全称</label>
            <div class="col-sm-8">
                <input type="text" id="showname" name="showname" class="form-control" value="${admin.showname}"/>
                <span class="field-validation-valid help-block"></span>
            </div>
        </div>
        <div class="form-group">
            <label for="orgId" class="col-sm-3 control-label">部门</label>
            <div class="col-md-7 col-sm-7">
                <input type="hidden" id="orgId" name="orgId" readonly/>
                <button type="button" class="btn btn-default dropdown-toggle" style="min-width: 120px; text-align: right;">
                    <span class="caret" style="margin-left: 10px;"></span>
                </button>
                <div id="divAddSectorTree"></div>
                <span class="field-validation-valid help-block"></span>
            </div>
        </div>
        <div class="form-group">
            <label for="salt" class="col-sm-3 control-label">密码盐</label>
            <div class="col-sm-8">
                <input type="text" id="salt" name="salt" class="form-control"
                value="${admin.salt}" readonly/>
            </div>
        </div>
        <div class="form-group">
            <label for="accountlock" class="col-sm-3 control-label">用户状态</label>
            <div class="col-sm-8">
                <select id="accountlock" name="accountlock" class="form-control">
                    <option value="0" <c:if test="${admin.accountlock==0}">selected="selected"</c:if>><%=DicUserAccountLockType.NORMAL%></option>
                    <option value="1" <c:if test="${admin.accountlock==1}">selected="selected"</c:if>><%=DicUserAccountLockType.LOCKING%></option>
                </select>
            </div>
        </div>

    </div>
</form>
<jsp:include page="../../../common/admin/modal_content_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/modal_footer_pre.jsp"></jsp:include>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>取消</button>
<button type="button" id="btnSave" class="btn btn-primary"><i class="fa fa-check"></i>保存</button>
<jsp:include page="../../../common/admin/modal_footer_post.jsp"></jsp:include>
<script type="text/javascript">
    $("#btnSave").click(function() {
        $('#formAdd').ajaxSubmitCloseRefresh();
    });
    $("#divAddSectorTree").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action${admin.orgId == null ? "" : "?selectedId="}${admin.orgId}"});
</script>