Zhiqim Account(前端账户管理台)是在ZhiqimManager基础上改造成用于前端注册登录的管理系统,增加组织结构和余额,开放注册组织和组织管理员,可以添加组织内的部门和角色和操作员。并增加该管理台上的一些组件,如充值支付等组件。适用于二级代理管理或该大型组织机构

森中灵 最后提交于9月前 整理为组织方式和替换新的jar
operator.zml8KB
${zhiqim_manager_breadcrumb("操作员")}
${zhiqim_manager_content()}

<script>
function doAdd()
{//增加
    var dialog = new Z.Dialog();
    dialog.title = "增加操作员";
    dialog.url = "operatorAdd.htm";
    dialog.width = 720;
    dialog.height = 183;
    dialog.fixed = true;
    dialog.execute();
}

function doResetPass(operatorCode)
{//重置密码
    var dialog = new Z.Dialog();
    dialog.title = "重置密码";
    dialog.url = "operatorPass.htm?operatorCode=" + operatorCode;
    dialog.width = 460;
    dialog.height = 263;
    dialog.fixed = true;
    dialog.execute();
}

function doUpdateStatus(operatorCode, operatorValid)
{//停启用
    Z.confirm("确定要"+(operatorValid?"停用":"启用")+"该操作员吗?", function()
    {
        var ajax = new Z.Ajax();
        ajax.setClassName("OperatorAction");
        ajax.setMethodName("doUpdateStatus");
        ajax.addParam("operatorCode", operatorCode);
        ajax.setFailureAlert();
        ajax.setSuccessReload();
        ajax.execute();
    });
}

function doSelectorDeptDialog(operatorCode)
{//设置操作员部门对话框
    var dialog = new Z.Dialog();
    dialog.title = "设置部门";
    dialog.url = "operatorDeptSelector.htm?operatorCode="+operatorCode;
    dialog.width = 392;
    dialog.height = 418;
    dialog.fixed = true;
    dialog.scroll = true;
    dialog.execute();
}

function doSelectorDeptCallback(operatorCode, deptIds)
{//设置操作员部门回调
    var ajax = new Z.Ajax();
    ajax.setClassName("ZmrDeptPresenter");
    ajax.setMethodName("doAddOperatorDepts");
    ajax.addParam("operatorCode", operatorCode);
    ajax.addParam("deptIds", deptIds);
    ajax.setFailureAlert();
    ajax.setSuccessReload();
    ajax.setLoading(document);
    ajax.execute();
}

function doDeleteOperatorDept(operatorCode, deptId)
{//删除操作员部门
    var ajax = new Z.Ajax();
    ajax.setClassName("ZmrDeptPresenter");
    ajax.setMethodName("doDeleteOperatorDept");
    ajax.addParam("operatorCode", operatorCode);
    ajax.addParam("deptId", deptId);
    ajax.setFailureAlert();
    ajax.setSuccessReload();
    ajax.execute();
}

function doSelectorRoleDialog(operatorCode)
{//设置操作员角色对话框
    var dialog = new Z.Dialog();
    dialog.title = "设置角色";
    dialog.url = "operatorRoleSelector.htm?operatorCode="+operatorCode;
    dialog.width = 392;
    dialog.height = 418;
    dialog.fixed = true;
    dialog.scroll = true;
    dialog.execute();
}

function doSelectorRoleCallback(operatorCode, roleIds)
{//设置操作员角色回调
    var ajax = new Z.Ajax();
    ajax.setClassName("ZmrRolePresenter");
    ajax.setMethodName("doAddOperatorRoles");
    ajax.addParam("operatorCode", operatorCode);
    ajax.addParam("roleIds", roleIds);
    ajax.setFailureAlert();
    ajax.setSuccessReload();
    ajax.setLoading(document);
    ajax.execute();
}

function doDeleteOperatorRole(operatorCode, roleId)
{//删除操作员角色
    var ajax = new Z.Ajax();
    ajax.setClassName("ZmrRolePresenter");
    ajax.setMethodName("doDeleteOperatorRole");
    ajax.addParam("operatorCode", operatorCode);
    ajax.addParam("roleId", roleId);
    ajax.setFailureAlert();
    ajax.setSuccessReload();
    ajax.execute();
}

function doTransferAdmin(operatorCode)
{//转让
    Z.confirm("确认转让超级管理员权限?", function()
    {
        var ajax = new Z.Ajax();
        ajax.setClassName("OperatorAction");
        ajax.setMethodName("doTransferAdmin");
        ajax.addParam("operatorCode", operatorCode);
        ajax.setFailureAlert();
        ajax.setSuccess(function()
        {
            Z.success("转让成功,请重新登录");
            Z.L.href("/logout.htm");
        });
        ajax.execute();
    }, null);
}

function doDelete(operatorCode)
{//删除
    Z.confirm("确认删除该操作员?", function()
    {
        var ajax = new Z.Ajax();
        ajax.setClassName("OperatorAction");
        ajax.setMethodName("delete");
        ajax.addParam("operatorCode", operatorCode);
        ajax.setFailureAlert();
        ajax.setSuccessReload();
        ajax.execute();
    }, null);
}
</script>

<#-- 导航 -->
<div class="z-tabnav-main z-mg-b20 ${zmr_color_class}">
<nav>
<ul class="z-mg-r10">
    <li class="z-active">操作员</li>
    ${zhiqim_manager_tabnav("部门", "/"+zhiqim_manager+"/dept.htm", true)}
    ${zhiqim_manager_tabnav("角色", "/"+zhiqim_manager+"/role.htm", true)}
</ul>
<div class="z-float-left z-mg10">
<form name="theForm" method="post">
    <select name="operatorValid" class="z-float-left z-select z-w60" data-role="z-select" data-class="zi-bd-r-none ${zmr_color_class}" data-options="maxHeight:220px;" onchange="this.form.submit();">
        <option value="">全部</option>   
        <option value="true" ${operatorValid==true?"selected":""}>正常</option>
        <option value="false" ${operatorValid==false?"selected":""}>停用</option>
    </select>
    <input name="operatorKey" class="z-float-left z-input z-w140 zi-bd-r-none" value="${operatorKey}" maxlength="64" placeholder="操作员账号" spellcheck="false">
    <button class="z-float-left z-button z-w80 zi-bd-rd0 ${zmr_color_class}"><i class="z-font z-query"></i>查询</button>
</form>
</div>
<#if ZmrAdminRule.check(request)>
<div class="z-float-right z-mg-t10 z-mg-r5">
    <button class="z-button ${zmr_color_class}" onclick="doAdd();"><i class="z-font z-add"></i>增加操作员</button>
</div>
</#if>
</nav>
</div>

<#-- 列表 -->
<table class="z-table z-bordered z-pd5 z-bg-white">
<tr class="z-h40 z-bg-gray">
    <td width="80" align="center">头像</td>
    <td width="*">操作员账号</td>
    <td width="90" align="center">操作员状态</td>
    <td width="250">所属部门</td>
    <td width="150">所属角色</td>
    <td width="460">操作</td>
</tr>
${zhiqim_manager_tr_no_record(result, "暂时没有信息")}
<#for item :result.list()>
<tr class="z-h70">
    <td align="center"><img src="${sessionUser.getAvatarUrl(item.getOperatorAvatar(), 50)}" class="freeImg z-w50 z-h50 z-bd-rd50p"></td>
    <td>${item.getOperatorCode()}</td>
    <td align="center"><#if item.isOperatorValid()>正常<#else><span class="z-text-red">停用</span></#if></td>
    <td>
        <table class="z-table z-bordered-line zi-bd-t-none z-pd5 z-lh150p">
        <#var deptIds = Arrays.toLongArray(item.getOperatorDept())/>
        <#for deptName : Arrays.toStringArray(item.getOperatorPassSalt())>
        <tr>
            <td width="*" align="left" class="zi-bd-b-none">#{deptName}</td>
            <td width="38" class="zi-bd-b-none">
            <#if ZmrAdminRule.check(request)>
                <a href="javascript:doDeleteOperatorDept('#{item.getOperatorCode()}', '#{deptIds[deptName_index]}')">取消</a>
            </#if>
            </td>
        </tr>
        </#for>
        </table>
    </td>
    <#if item.getOperatorType() == 1>
    <td class="z-text-blue" colspan="2">超级管理员</td>
    <#else>
    <td>
        <table class="z-table z-bordered-line zi-bd-t-none z-pd5 z-lh150p">
        <#var roleIds = Arrays.toLongArray(item.getOperatorRole())/>
        <#for roleName : Arrays.toStringArray(item.getOperatorPass())>
        <tr>
            <td width="*" align="left" class="zi-bd-b-none">#{roleName}</td>
            <td width="38" class="zi-bd-b-none">
            <#if ZmrAdminRule.check(request)>
                <a href="javascript:doDeleteOperatorRole('#{item.getOperatorCode()}', '#{roleIds[roleName_index]}')">取消</a>
            </#if>
            </td>
        </tr>
        </#for>
        </table>
    </td>
    <td>
    <#if ZmrAdminRule.check(request)>
        <button class="z-button z-blue" onclick="Z.L.href('operatorRule.htm?operatorCode=${item.getOperatorCode()}');">独立权限</button>
        <button class="z-button z-blue" onclick="doResetPass('${item.getOperatorCode()}')">重置密码</button>
        <button class="z-button z-purple" onclick="doSelectorDeptDialog('${item.getOperatorCode()}');">部门</button>
        <button class="z-button z-purple" onclick="doSelectorRoleDialog('${item.getOperatorCode()}');">角色</button>
        <button class="z-button z-orange" onclick="doTransferAdmin('${item.getOperatorCode()}');">转让超管</button>
        <#if item.isOperatorValid()>
            <button class="z-button z-orange z-hover" onclick="doUpdateStatus('${item.getOperatorCode()}', ${item.isOperatorValid()})">停用</button>
        <#else>
            <button class="z-button z-cyan z-hover" onclick="doUpdateStatus('${item.getOperatorCode()}', ${item.isOperatorValid()})">启用</button>
        </#if>
        <button class="z-button z-red" onclick="doDelete('${item.getOperatorCode()}');">删除</button>
    </#if>
    </td>
    </#if>
</tr>
</#for>
</table>
${zhiqim_manager_paging(result)}
${zhiqim_manager_content_end()}