123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- {template 'common/header-gw'}
- <style>
- .left-div{width:120px;overflow:hidden}
- .right-fa{width:20px;}
- .pad-left {padding-left:50px;height:30px;line-height:30px;background:url('./resource/images/bg_repno.gif') no-repeat -245px -545px;}
- .pad-bottom {padding-left:50px;height:30px;line-height:30px;background:url('./resource/images/bg_repno.gif') no-repeat -245px -595px;}
- .add{cursor:pointer;padding-top:5px;}
- .position{display:inline-block;width:100px;}
- </style>
-
- <ol class="breadcrumb">
- <li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
- <li><a href="{url 'system/welcome'}">系统</a></li>
- <li class="active">模块权限</li>
- </ol>
- <ul class="nav nav-tabs">
- <li><a href="{php echo url('extension/menu');}">菜单列表</a></li>
- <li class="active"><a href="{php echo url('extension/menu/module');}">模块菜单</a></li>
- </ul>
- {if $do == 'module'}
- <div class="clearfix">
- <h5 class="page-header">设置权限验证</h5>
- <form action="" method="post" class="form-horizontal">
- <div class="panel">
- <div class="panel-body table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th width="90">排序</th>
- <th width="300">模块名称</th>
- <th width="300">图标</th>
- <th>链接地址</th>
- <th style="text-align:center">操作</th>
- </tr>
- </thead>
- <tbody>
- {loop $modules $module}
- {if !empty($module['entry'])}
- <tr>
- <td></td>
- <td colspan="4"><span class="label label-success">{$module['title']}</span></td>
- </tr>
- {if !empty($module['entry']['menu'])}
- {loop $module['entry']['menu'] $menu}
- <tr>
- <input type="hidden" name="eid[]" value="{$menu['eid']}"/>
- <input type="hidden" name="entry[]" value="menu"/>
- <input type="hidden" name="url[]" value=""/>
- <td>
- <input type="text" name="displayorder[]" value="{$menu['displayorder']}" class="form-control" style="width:80px">
- </td>
- <td><div class="pad-left"> <span class="text-success position">业务功能菜单</span>{$menu['title']}</div></td>
- <td>
- <div class="input-group" style="width:250px">
- <input type="text" class="form-control" name="icon[]" value="{$menu['icon']}"/>
- <span class="input-group-addon"><i class="{$menu['icon']}"></i></span>
- <span class="input-group-btn">
- <button class="btn btn-default showIconDialog" type="button">图标</button>
- </span>
- </div>
- </td>
- <td></td>
- <td></td>
- </tr>
- {/loop}
- {/if}
- {if !empty($module['entry']['mine'])}
- {loop $module['entry']['mine'] $mine}
- <tr>
- <input type="hidden" name="eid[]" value="{$mine['eid']}"/>
- <input type="hidden" name="entry[]" value="mine"/>
- <td>
- <input type="text" name="displayorder[]" value="{$mine['displayorder']}" class="form-control" style="width:80px">
- </td>
- <td><div class="pad-left"> <span class="text-danger position">自定义菜单</span>{$mine['title']}</div></td>
- <td>
- <div class="input-group" style="width:250px">
- <input type="text" class="form-control" name="icon[]" value="{$mine['icon']}"/>
- <span class="input-group-addon"><i class="{$mine['icon']}"></i></span>
- <span class="input-group-btn">
- <button class="btn btn-default showIconDialog" type="button">图标</button>
- </span>
- </div>
- </td>
- <td>
- <input type="text" name="url[]" value="{$mine['url']}" class="form-control" style="width:300px">
- </td>
- <td align="center">
- <a href="javascript:;" class="btn btn-danger del-eid" data-id="{$mine['eid']}">删除</a>
- </td>
- </tr>
- {/loop}
- {/if}
- <tr>
- <td></td>
- <td colspan="4">
- <div class="pad-bottom pull-left"></div>
- <div class="pull-left add" data-module="{$module['name']}">
- <i class="fa fa-plus-circle"></i> 自定义菜单
- </div>
- </td>
- </tr>
- {/if}
- {/loop}
- </tbody>
- </table>
- </div>
- </div>
- <input type="submit" name="submit" class="btn btn-primary" value="提交"/>
- <input type="hidden" name="token" value="{$_W['token']}"/>
- </form>
- </div>
- {/if}
-
- <script>
- require(['util'], function(u){
- $('.title').hover(function(){
- $(this).tooltip('show');
- },function(){
- $(this).tooltip('hide');
- });
-
- $('.table').on('click', '.showIconDialog', function(){
- var btn = $(this);
- var spview = btn.parent().prev();
- var ipt = spview.prev();
- if(!ipt.val()){
- spview.css("display", "none");
- }
- u.iconBrowser(function(ico){
- ipt.val(ico);
- spview.show();
- spview.find("i").attr("class","");
- spview.find("i").addClass("fa").addClass(ico);
- });
- });
-
- $('.add').click(function(){
- var module = $(this).attr('data-module');
- var html =
- '<tr>' +
- '<input name="add_module[]" value="'+module+'" type="hidden">' +
- '<td><input style="width:80px;" type="text" name="add_displayorder[]" value="0" class="form-control"></td>' +
- '<td>' +
- '<div class="pad-left">' +
- '<input style="width:100px;" placeholder="菜单名称" type="text" name="add_title[]" value="" class="form-control">' +
- '</div>' +
- '</td>' +
- '<td>' +
- '<div class="input-group" style="width:300px">' +
- '<input type="text" class="form-control" name="add_icon[]" value="fa fa-puzzle-piece"/>' +
- '<span class="input-group-addon"><i class="fa fa-puzzle-piece"></i></span>' +
- '<span class="input-group-btn">' +
- '<button class="btn btn-default showIconDialog" type="button">图标</button>' +
- '</span>' +
- '</div>' +
- '</td>' +
- '<td><input style="width:300px;" placeholder="菜单链接地址" type="text" name="add_url[]" value="" class="form-control"></td>' +
- '<td><i class="fa fa-times-circle" onclick="$(this).parents(\'tr\').remove()"></i></td>' +
- '</tr>';
- $(this).parents('tr').before(html)
- });
-
- $('.del-eid').click(function(){
- if(!confirm('确认删除吗')) return false;
- var eid = $(this).attr('data-id');
- if(eid) {
- $.post("{php echo url('extension/menu/del_bind')}", {'eid':eid}, function(){
- location.reload();
- return false;
- });
- }
- });
- });
- </script>
- {template 'common/footer-gw'}
|