Zhiqim Console(管理控制台)是知启蒙框架中最简洁的管理控制台组件,没有数据库,只保留一个账号,非常适用于后端程序嵌入WEB控制台模式,包括首页、登录、主界面、左侧菜单和欢迎页功能,依赖该组件实现基本的账号验证,通过覆盖原则增加自有功能。

森中灵 最后提交于2月前 替换framework依赖包
config.zml8KB
<#-------------------------------------------------------------------------->
<#-----知启蒙全局变量定义(统一使用zhiqim前缀)--------------------------------->
<#-------------------------------------------------------------------------->

<#var zhiqim.css = context.getRootPath("/service/res/zhiqim_v8.0.3.css")/>
<#var zhiqim.js = context.getRootPath("/service/res/zhiqim_v8.0.3.min.js")/>
<#var zhiqim.mobile.css= context.getRootPath("/service/res/zhiqim.mobile_v8.0.3.css")/>
<#var zhiqim.mobile.js= context.getRootPath("/service/res/zhiqim.mobile_v8.0.3.min.js")/>
<#var zhiqim_iframenav.js = context.getRootPath("/ztmpl/zhiqim_manager/zhiqim_iframenav_v8.0.3.js")/>
<#var jsencrypt.js = context.getRootPath("/ztmpl/zhiqim_manager/jsencrypt.js")/>

<#-------------------------------------------------------------------------->
<#-----知启蒙管理台变量定义(统一使用zmr前缀)---------------------------------->
<#-------------------------------------------------------------------------->

<#--分页显示默认条数-->
<#var zmr_page_size = 20/>

<#--版权标注-->
<#var zmr_copyright = "Copyright&nbsp;&nbsp;&copy;&nbsp;2015&nbsp;zhiqim.org(知启蒙)&nbsp;All&nbsp;Rights&nbsp;Reserved"/>

<#-------------------------------------------------------------------------->
<#-------知启蒙管理台函数定义(统一使用zhiqim_manager前缀)--------------------->
<#-------------------------------------------------------------------------->

<#--头部定义返回历史连接-->
<#function zhiqim_manager_console_log()>
<script>
Z.onload(function()
{
    console.log("%czhiqim.org %c知启蒙秉承“持续开发、坚持开源、拥抱开放”理念!\n\n%c如果您对开源感兴趣,欢迎加入我们:https://zhiqim.org\n ", 
                "font-family: Helvetica, Consolas, Arial;font-size:91px;color:#2a689d;", 
                "color:#333;font-size:16px;", 
                "color:#444;font-size:14px;")
});
</script>
</#function>

<#--头部定义返回历史连接-->
<#function zhiqim_manager_history(url)>
<script>
function returnHistory()
{
    window.location.href = "${url}";
}
</script>
</#function>

<#--主体内容-->
<#function zhiqim_manager_content()>
<div class="content">
</#function>

<#--主体内容结束-->
<#function zhiqim_manager_content_end()>
</div>
</#function>

<#--功能标签页-->
<#function zhiqim_manager_tabnav(name, url, check, iframenav)>
<#if !Strings.startsWith(url, "/")>
    <li onclick="Z.L.href('${url}');">${name}</li>
<#elseif iframenav == true>
    <li onclick="Zmr.iframenav(this, '${url}');">${name}</li>
<#else>
    <li onclick="Z.L.href('${context.getRootPath(url)}');">${name}</li>
</#if>
</#function>

<#--显示标题-->
<#function zhiqim_manager_title(name)>
<table class="z-table z-bordered zi-bd-b-none z-pd10">
<tr class="z-h40" style="background-color:${zmr_title_bgcolor}">
    <td class="z-bold z-px15">${name}</td>
</tr>
</table>
</#function>

<#--显示无记录信息-->
<#function zhiqim_manager_no_record(colspan, desc)>
<tr class="zi-h60 zi-text-center z-bg-white">
    <td colspan="${colspan}">${desc}</td>
</tr>
</#function>

<#--显示无记录信息-->
<#function zhiqim_manager_tr_no_record(result, desc)>
<#if result.isEmpty()>
<tr class="zi-h60 z-bg-white z-text-center">
    <td colspan="99">${desc}</td>
</tr>
</#if>
</#function>

<#--显示tr标题-->
<#function zhiqim_manager_tr_title(name)>
<tr class="zi-h40">
    <td class="z-bold z-px15 zi-pd-l5 z-text-left" colspan="99">${name}</td>
</tr>
</#function>

<#--判断列表背景分隔颜色-->
<#function zhiqim_manager_tr_bg(index)>
<#if index % 2 == 0>${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor}</#if>
</#function>

<#--列表行移入移出颜色变化-->
<#function zhiqim_manager_tr_onmouse()>
onmouseover="Z(this).css('background-color', '${zmr_tr_over_bgcolor}')" onmouseout="Z(this).css('background-color', '${zmr_tr_even_bgcolor}')"
</#function>

<#--列表行点击选中单选按钮-->
<#function zhiqim_manager_tr_click_radio()>
onclick="Z(this).find('td:first-child > zcover > i.z-radio').click();"
</#function>

<#--列表行点击选中多选按钮-->
<#function zhiqim_manager_tr_click_checkbox()>
onclick="Z(this).find('td:first-child > zcover > i.z-checkbox').click();"
</#function>

<#--显示记录脚注-->
<#function zhiqim_manager_list(size)>
<table class="z-table z-bordered zi-bd-t-none z-bg-white">
<tr class="z-h40">  
    <td class="zi-pd-r10 z-text-right">共&nbsp;<span class="z-color-red">${size}</span>&nbsp;条数据</td>
</tr>
</table>
</#function>

<#--显示返回上一页-->
<#function zhiqim_manager_return()>
<table class="z-table z-bordered zi-bd-t-none z-pd10 z-bg-white">
<tr class="z-h60"> 
    <td><a href="javascript:returnHistory();">返回上一页</a></td>
</tr>
</table>
</#function>

<#--显示返回上一页和提交-->
<#function zhiqim_manager_submit()>
<table class="z-table zi-bd zi-bd-t-none z-pd10 z-bg-white">
<tr class="z-h80"> 
    <td width="40%"><a href="javascript:returnHistory();">返回上一页</a></td>
    <td width="*"><button type="submit" class="z-button z-large z-w150 ${zmr_color_class}">提交</button></td>
</tr>
</table>
</#function>

<#--显示返回上一页和提交带参数-->
<#function zhiqim_manager_submit_onclick(onclick)>
<table class="z-table zi-bd zi-bd-t-none z-pd10 z-bg-white">
<tr class="z-h80">
    <td width="40%"><a href="javascript:returnHistory();">返回上一页</a></td>
    <td width="*"><button type="button" class="z-button z-large z-w150 ${zmr_color_class}" onclick="${onclick}">提交</button></td>
</tr>
</table>
</#function>

<#--显示AJAX调用结果-->
<#function zhiqim_manager_ajaxq_result()>
<div id="ajaxqResult" class="z-relative-left z-w100p" style="min-height:100px;"></div>
</#function>

<#--显示记录分页-->
<#function zhiqim_manager_paging(result, link)>
<table class="z-table z-bordered zi-bd-t-none z-bg-white">
<tr class="z-h50">  
    <td><div class="z-float-right z-mg-r10">${PagingStd.toHtmlLink(result, link)}</div></td>
</tr>
</table>
</#function>

<#--显示记录分页-->
<#function zhiqim_manager_paging_go(result, link)>
<table class="z-table z-bordered zi-bd-t-none z-bg-white">
<tr class="z-h50">  
    <td><div class="z-float-right z-mg-r10">${PagingGo.toHtmlLink(result, link)}</div></td>
</tr>
</table>
</#function>

<#--显示记录分页JS-->
<#function zhiqim_manager_paging_jsMethod(result, param, param2)>
<table class="z-table z-bordered zi-bd-t-none z-bg-white">
<tr class="z-h50">  
    <td><div class="z-float-right z-mg-r10">
    <#if param2 == null>
        ${PagingStd.toHtmlClick(result, param)}
    <#else>
        ${PagingStd.toHtmlClick(result, param, param2)}
    </#if>
    </div></td>
</tr>
</table>
</#function>

<#--显示记录分页JS-->
<#function zhiqim_manager_paging_jsMethod_go(result, param, param2)>
<table class="z-table z-bordered zi-bd-t-none z-bg-white">
<tr class="z-h50">  
    <td><div class="z-float-right z-mg-r10"><#if param2 == null>${PagingGo.toHtmlClick(result, param)}<#else>${PagingGo.toHtmlClick(result, param, param2)}</#if></div></td>
</tr>
</table>
</#function>

<#-------------------------------------------------------------------------->
<#-------知启蒙管理台预定义函数定义------------------------------------------->
<#-------------------------------------------------------------------------->

<#--topnav左边区域自定义块-->
<#function zhiqim_manager_topnav_left_defined()>

</#function>

<#--topnav右边区域自定义块-->
<#function zhiqim_manager_topnav_right_defined()>

</#function>

<#--边导航自定义块-->
<#function zhiqim_manager_sidebar_menu()>
    ${sessionUser.showSidebarMenu("系统配置设置", "z-config", "/"+zhiqim_manager+"/config.htm")}
    ${sessionUser.showSidebarMenu("如何设置菜单", "z-setting", "/example/menu.htm")}
    ${sessionUser.showSidebarMenu("列表示例展示", "z-list", "/example/online.htm")}
</#function>

<#--系统配置设置自定义块-->
<#function zhiqim_manager_tabnav_config(name)>
    <#if name == "系统配置管理"><li class="z-active">系统配置管理</li><#else>${zhiqim_manager_tabnav("系统配置管理", "/"+zhiqim_manager+"/config.htm", false)}</#if>
    <#if name == "系统参数管理"><li class="z-active">系统参数管理</li><#else>${zhiqim_manager_tabnav("系统参数管理", "/"+zhiqim_manager+"/param.htm", false)}</#if>
</#function>