<!--弹出添加帐号-->
<div class="modal fade" id="add-user" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">添加账号</h5>
            </div>
            <form method="post" action="/setting/user/add?_csrf=<%= ctx.csrf %>" onsubmit="return checkUserForm('add');">
            <div class="modal-body">
                <div class="form-group">
                    <label><b class="text-danger">*</b>账号组</label>
                    <select class="form-control" name="account_group">
                        <option value="0">请选择</option>
                        <% for (const dw in accountGroup) { %>
                        <option value="<%= dw %>"><%= accountGroup[dw] %></option>
                        <% } %>
                    </select>
                </div>
                <div class="form-group">
                    <label>登录账号<b class="text-danger">*</b></label>
                    <input class="form-control" name="account" placeholder="支持英文数字组合" type="text">
                    <input value="" class="account-check" type="hidden">
                    <div class="invalid-feedback">
                        该账号已存在。
                    </div>
                </div>
                <div class="form-group">
                    <label>登录密码<b class="text-danger">*</b></label>
                    <div class="input-group">
                        <input type="text" name="password" class="form-control" placeholder="密码支持英文数字及符号">
                        <div class="input-group-append">
                            <button id="rand-password" class="btn btn-outline-secondary" type="button">随机密码</button>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>姓名<b class="text-danger">*</b></label>
                    <input class="form-control" name="name" value="" type="text">
                </div>
                <div class="form-group">
                    <label>单位名称<b class="text-danger">*</b></label>
                    <input class="form-control" name="company" value="" type="text">
                </div>
                <div class="form-group">
                    <label>角色/职位<b class="text-danger">*</b></label>
                    <input class="form-control" name="role" value="" type="text">
                </div>
                <div class="form-group">
                    <label>手机<b class="text-danger">*</b></label>
                    <input class="form-control" name="mobile" value="" type="number">
                </div>
                <div class="form-group">
                    <label>电话</label>
                    <input class="form-control" name="telephone" placeholder="格式000-0000000" type="text">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">确定添加</button>
            </div>
            </form>
        </div>
    </div>
</div>
<!--弹出编辑帐号-->
<div class="modal fade" id="edit-user" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">编辑账号</h5>
            </div>
            <form method="post" action="/setting/user/update?_csrf=<%= ctx.csrf %>" onsubmit="return checkUserForm('update');">
            <div class="modal-body">
                <div class="form-group">
                    <label>账号组<b class="text-danger">*</b></label>
                    <select class="form-control" name="account_group">
                        <option value="0">请选择</option>
                        <% for (const dw in accountGroup) { %>
                            <option value="<%= dw %>"><%= accountGroup[dw] %></option>
                        <% } %>
                    </select>
                </div>
                <div class="form-group">
                    <label>登录账号<b class="text-danger">*</b></label>
                    <input class="form-control" value="" name="account" placeholder="支持英文数字组合" type="text">
                    <input value="" class="account-check" type="hidden">
                    <div class="invalid-feedback">
                        该账号已存在。
                    </div>
                </div>
                <div class="form-group">
                    <label>登录密码</label>
                    <div class="input-group">
                        <input type="text" id="reset-password" class="form-control" placeholder="密码支持英文数字及符号">
                        <div class="input-group-append">
                            <button id="reset-password-btn" class="btn btn-outline-secondary" type="button">修改密码</button>
                        </div>
                    </div>
                    <span class="form-text text-success">如果账号已有认证手机，密码也将发送至该手机。</span>
                </div>
                <div class="form-group">
                    <label>姓名<b class="text-danger">*</b></label>
                    <input class="form-control" value="" name="name" type="text">
                    <small class="form-text text-muted">修改姓名，将影响所有该账号参与数据</small>
                </div>
                <div class="form-group">
                    <label>单位名称<b class="text-danger">*</b></label>
                    <input class="form-control" value="" name="company" type="text">
                </div>
                <div class="form-group">
                    <label>角色/职位<b class="text-danger">*</b></label>
                    <input class="form-control" value="" name="role" type="text">
                </div>
                <div class="form-group">
                    <label>手机<b class="text-danger">*</b></label>
                    <input class="form-control" value="" name="mobile" type="number">
                </div>
                <div class="form-group">
                    <label>电话</label>
                    <input class="form-control" value="" name="telephone" placeholder="格式000-0000000" type="text">
                </div>
            </div>
            <div class="modal-footer">
                <input type="hidden" name="id" id="user-id" value="">
                <!--<button type="button" class="btn btn-outline-danger" data-dismiss="modal">删除账号</button>-->
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交修改</button>
            </div>
            </form>
        </div>
    </div>
</div>
<!--弹出账号受限-->
<div class="modal" tabindex="-1" role="dialog" id="add-unpass">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">无法添加账号</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <p>账号已超过最大账号数，无法添加新账号。</p>
                <p>当前限制账号总数：<b><%= projectData.max_user %></b></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
