4.0日常更新
This commit is contained in:
+75
-111
@@ -1,118 +1,82 @@
|
||||
{extend name="admin/base"/}
|
||||
{block name="body"}
|
||||
<div class="box box-primary">
|
||||
<header class="box-header with-border">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title|default="新功能"}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{:url('Config/group')}" class="btn btn-danger">
|
||||
<i class="fa fa-list"></i>
|
||||
配置管理
|
||||
</a>
|
||||
<a href="{:url('Config/add')}" class="btn btn-danger">
|
||||
<i class="fa fa-plus"></i>
|
||||
添加配置
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="box-body">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {if condition="!$group_id"}class="active"{/if}><a href="{:url('/admin/config/index')}">全部</a></li>
|
||||
{volist name="config['config_group_list']" id="item"}
|
||||
<li {if condition="$group_id eq $key"}class="active"{/if}>
|
||||
<a href="{:url('/admin/config/index?group='.$key)}">{$item}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active">
|
||||
<div class="table-responsive clearfix">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="row-selected">
|
||||
<input class="checkbox check-all" type="checkbox">
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>标题</th>
|
||||
<th>分组</th>
|
||||
<th>类型</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{notempty name="list"}
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item.id}"></td>
|
||||
<td>{$item.id}</td>
|
||||
<td><a href="{:url('edit?id='.$item['id'])}">{$item.name}</a></td>
|
||||
<td>{$item.title}</td>
|
||||
<td>{$config['config_group_list'][$item['group']]|default=''}</td>
|
||||
<td>{$item['type_text']}</td>
|
||||
<td>
|
||||
<a title="编辑" href="{:url('/admin/config/edit?id='.$item['id'])}">编辑</a>
|
||||
<a class="confirm ajax-get" title="删除" href="{:url('/admin/config/del?id='.$item['id'])}">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{else/}
|
||||
<td colspan="7" class="text-center"> aOh! 暂时还没有内容!</td>
|
||||
{/notempty}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{$page|raw}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {if condition="!$group_id"}class="active"{/if}><a href="{:url('/admin/config/index')}">全部</a></li>
|
||||
{volist name="config['config_group_list']" id="item"}
|
||||
<li {if condition="$group_id eq $key"}class="active"{/if}><a href="{:url('/admin/config/index', array('group'=>$key))}">{$item}</a></li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.openTab('配置管理', '/admin/config/group')"><i class="fa fa-plus"></i> 配置管理</a>
|
||||
<a class="btn btn-success" onclick="$.operate.add()"><i class="fa fa-plus"></i> 新增</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"><i class="fa fa-edit"></i> 修改</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"><i class="fa fa-remove"></i> 删除</a>
|
||||
</div>
|
||||
<div class="table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
//搜索功能
|
||||
$("#search").click(function () {
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.search-form').find('input').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
|
||||
query = query.replace(/^&/g, '');
|
||||
if (url.indexOf('?') > 0) {
|
||||
url += '&' + query;
|
||||
} else {
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
//回车搜索
|
||||
$(".search-input").keyup(function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
$("#search").click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//点击排序
|
||||
$('.list_sort').click(function () {
|
||||
var url = $(this).attr('url');
|
||||
var ids = $('.ids:checked');
|
||||
var param = '';
|
||||
if (ids.length > 0) {
|
||||
var str = new Array();
|
||||
ids.each(function () {
|
||||
str.push($(this).val());
|
||||
});
|
||||
param = str.join(',');
|
||||
}
|
||||
<!-- bootstrap-table 表格插件 -->
|
||||
<script src="__static__/plugins/bootstrap-table/bootstrap-table.min.js"></script>
|
||||
<script src="__static__/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
|
||||
<script src="__static__/plugins/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js"></script>
|
||||
<script src="__static__/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
|
||||
<script src="__static__/plugins/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js"></script>
|
||||
|
||||
if (url != undefined && url != '') {
|
||||
window.location.href = url + '/ids/' + param;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var group = "{$group_id|default=0}";
|
||||
var editFlag = "";
|
||||
var removeFlag = "";
|
||||
var resetPwdFlag = "";
|
||||
|
||||
$.table.init({
|
||||
url: "/admin/config/index?group="+group,
|
||||
createUrl: "/admin/config/add",
|
||||
updateUrl: "/admin/config/edit/id/{id}",
|
||||
removeUrl: "/admin/config/del",
|
||||
uniqueId: "id",
|
||||
sortName: "id",
|
||||
sortOrder: "desc",
|
||||
modalName: "配置",
|
||||
columns: [
|
||||
{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '配置标题'
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '配置名称'
|
||||
},
|
||||
{
|
||||
field: 'group_text',
|
||||
title: '分组'
|
||||
},
|
||||
{
|
||||
field: 'type_text',
|
||||
title: '类型'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
return actions.join('');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user