4.0日常更新
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@
|
|||||||
/vendor
|
/vendor
|
||||||
/bak
|
/bak
|
||||||
*.log
|
*.log
|
||||||
.env
|
.env
|
||||||
|
composer.lock
|
||||||
@@ -19,9 +19,8 @@ class Ad extends Admin{
|
|||||||
*/
|
*/
|
||||||
public function index(AdPlace $adp){
|
public function index(AdPlace $adp){
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$res = $adp->paginate(25, false, array(
|
$param = $this->request->param();
|
||||||
'query' => $this->request->param()
|
$res = $adp->paginate($this->request->pageConfig);
|
||||||
));
|
|
||||||
|
|
||||||
$data = $res->append(['show_type_text', 'status_text'])->toArray();
|
$data = $res->append(['show_type_text', 'status_text'])->toArray();
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
@@ -104,9 +103,7 @@ class Ad extends Admin{
|
|||||||
*/
|
*/
|
||||||
public function lists(AdModel $ad){
|
public function lists(AdModel $ad){
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$res = $ad->paginate(25, false, array(
|
$res = $ad->paginate($this->request->pageConfig);
|
||||||
'query' => $this->request->param()
|
|
||||||
));
|
|
||||||
$data = $res->append(['cover','status_text'])->toArray();
|
$data = $res->append(['cover','status_text'])->toArray();
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ class Channel extends Admin{
|
|||||||
public function index(ChannelModel $channel){
|
public function index(ChannelModel $channel){
|
||||||
if($this->request->isAjax()){
|
if($this->request->isAjax()){
|
||||||
$tree = $this->request->param('tree', 0);
|
$tree = $this->request->param('tree', 0);
|
||||||
|
$type = $this->request->param('type', 0);
|
||||||
$map = array();
|
$map = array();
|
||||||
|
|
||||||
|
if($type){
|
||||||
|
$map['type'] = $type;
|
||||||
|
}
|
||||||
|
|
||||||
$res = $channel->where($map)->order('sort asc, id asc')->select();
|
$res = $channel->where($map)->order('sort asc, id asc')->select();
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ class Client extends Admin{
|
|||||||
*/
|
*/
|
||||||
public function index(ClientModel $client){
|
public function index(ClientModel $client){
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$res = $client->paginate(25, false, array(
|
$param = $this->request->param();
|
||||||
'query' => $this->request->param()
|
$res = $client->paginate($this->request->pageConfig);
|
||||||
));
|
|
||||||
$data = $res->toArray();
|
$data = $res->toArray();
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
|||||||
@@ -18,33 +18,34 @@ class Config extends Admin {
|
|||||||
* @title 系统首页
|
* @title 系统首页
|
||||||
*/
|
*/
|
||||||
public function index(ConfigModel $config) {
|
public function index(ConfigModel $config) {
|
||||||
$group = input('group', 0, 'trim');
|
if($this->request->isAjax()){
|
||||||
$name = input('name', '', 'trim');
|
$param = $this->request->param();
|
||||||
$system_config = Cache::get('system_config');
|
$group = input('group', 0, 'trim');
|
||||||
|
$name = input('name', '', 'trim');
|
||||||
|
$system_config = Cache::get('system_config');
|
||||||
|
|
||||||
/* 查询条件初始化 */
|
/* 查询条件初始化 */
|
||||||
$map = array('status' => 1);
|
$map = array('status' => 1);
|
||||||
if ($group) {
|
if ($group) {
|
||||||
$map['group'] = $group;
|
$map['group'] = $group;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name) {
|
||||||
|
$map['name'] = array('like', '%' . $name . '%');
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = $config->where($map)->order('id desc')->paginate($this->request->pageConfig);
|
||||||
|
|
||||||
|
$data = $res->append(['type_text','group_text'])->toArray();
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
return $this->data;
|
||||||
|
}else{
|
||||||
|
$data = array(
|
||||||
|
'group_id' => $this->request->get('group', 0),
|
||||||
|
);
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($name) {
|
|
||||||
$map['name'] = array('like', '%' . $name . '%');
|
|
||||||
}
|
|
||||||
|
|
||||||
$list = $config->where($map)->order('id desc')->paginate(25, false, array(
|
|
||||||
'query' => $this->request->param(),
|
|
||||||
));
|
|
||||||
// 记录当前列表页的cookie
|
|
||||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
|
||||||
|
|
||||||
$data = array(
|
|
||||||
'page' => $list->render(),
|
|
||||||
'group_id' => $group,
|
|
||||||
'list' => $list,
|
|
||||||
);
|
|
||||||
$this->data['data'] = $data;
|
|
||||||
return $this->data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ class Form extends Admin{
|
|||||||
*/
|
*/
|
||||||
public function index(FormModel $form){
|
public function index(FormModel $form){
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$res = $form->paginate(25, false, array(
|
$res = $form->paginate($this->request->pageConfig);
|
||||||
'query' => $this->request->param()
|
|
||||||
));
|
|
||||||
$data = $res->toArray();
|
$data = $res->toArray();
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ class Link extends Admin{
|
|||||||
*/
|
*/
|
||||||
public function index(LinkModel $link){
|
public function index(LinkModel $link){
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$res = $link->paginate(25, false, array(
|
$res = $link->paginate($this->request->pageConfig);
|
||||||
'query' => $this->request->param()
|
|
||||||
));
|
|
||||||
$data = $res->toArray();
|
$data = $res->toArray();
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
|||||||
@@ -18,19 +18,16 @@ class Seo extends Admin{
|
|||||||
* @title 系统首页
|
* @title 系统首页
|
||||||
*/
|
*/
|
||||||
public function index(SeoRule $seo){
|
public function index(SeoRule $seo){
|
||||||
//读取规则列表
|
if($this->request->isAjax()){
|
||||||
$map = array('status' => array('=', 0));
|
//读取规则列表
|
||||||
|
$map = array('status' => array('=', 0));
|
||||||
|
|
||||||
$list = $seo->where($map)->order('sort asc')->paginate(10, false, array(
|
$res = $seo->where($map)->order('sort asc')->paginate($this->request->pageConfig);
|
||||||
'query' => $this->request->param()
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->data['data'] = array(
|
$this->data['data'] = $res->toArray();
|
||||||
'list' => $list,
|
|
||||||
'page' => $list->render()
|
return $this->data;
|
||||||
);
|
}
|
||||||
|
|
||||||
return $this->data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ class Admin {
|
|||||||
protected $data = [];
|
protected $data = [];
|
||||||
|
|
||||||
public function handle($request, \Closure $next) {
|
public function handle($request, \Closure $next) {
|
||||||
|
$request->pageConfig = array(
|
||||||
|
'list_rows' => $request->param('limit', 20),
|
||||||
|
'page' => $request->param('page', 1)
|
||||||
|
);
|
||||||
$response = $next($request);
|
$response = $next($request);
|
||||||
|
|
||||||
if (is_array($response->getData())) {
|
if (is_array($response->getData())) {
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ class Config extends Model {
|
|||||||
return $type_text[0];
|
return $type_text[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getGroupTextAttr($value, $data) {
|
||||||
|
$config = Cache::get('system_config');
|
||||||
|
$group = $config['config_group_list'];
|
||||||
|
return isset($group[$data['group']]) ? $group[$data['group']] : '未分组';
|
||||||
|
}
|
||||||
|
|
||||||
public function lists() {
|
public function lists() {
|
||||||
$map = array('status' => 1);
|
$map = array('status' => 1);
|
||||||
$res = $this->where($map)->field('type,name,value')->select();
|
$res = $this->where($map)->field('type,name,value')->select();
|
||||||
|
|||||||
@@ -979,6 +979,8 @@ label {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-outline{border: 1px solid #dedede; color: #333333;}
|
||||||
|
|
||||||
.data-skin-box{position: fixed; z-index: 1000000; top: 50px; right: -280px;}
|
.data-skin-box{position: fixed; z-index: 1000000; top: 50px; right: -280px;}
|
||||||
.data-skin-box .content{width: 280px; height: 240px; padding: 10px; background: #181f23; color: #ffffff;}
|
.data-skin-box .content{width: 280px; height: 240px; padding: 10px; background: #181f23; color: #ffffff;}
|
||||||
.data-skin-box .tool-bar{height: 50px; width: 50px; line-height: 50px; text-align: center; font-size: 24px; display: inline-block; background: #181f23; color: #ffffff; position: absolute; right: 0; cursor: pointer;}
|
.data-skin-box .tool-bar{height: 50px; width: 50px; line-height: 50px; text-align: center; font-size: 24px; display: inline-block; background: #181f23; color: #ffffff; position: absolute; right: 0; cursor: pointer;}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
sortName: "",
|
sortName: "",
|
||||||
sortOrder: "asc",
|
sortOrder: "asc",
|
||||||
pagination: true,
|
pagination: true,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
pageList: [10, 25, 50],
|
pageList: [20, 30, 50, 100],
|
||||||
toolbar: "toolbar",
|
toolbar: "toolbar",
|
||||||
striped: false,
|
striped: false,
|
||||||
escape: false,
|
escape: false,
|
||||||
@@ -98,11 +98,11 @@
|
|||||||
queryParams: function(params) {
|
queryParams: function(params) {
|
||||||
var curParams = {
|
var curParams = {
|
||||||
// 传递参数查询参数
|
// 传递参数查询参数
|
||||||
pageSize: params.limit,
|
limit: params.limit,
|
||||||
pageNum: params.offset / params.limit + 1,
|
page: params.offset / params.limit + 1,
|
||||||
searchValue: params.search,
|
searchValue: params.search,
|
||||||
orderByColumn: params.sort,
|
sort: params.sort,
|
||||||
isAsc: params.order
|
sortorder: params.order
|
||||||
};
|
};
|
||||||
var currentId = $.common.isEmpty($.table._option.formId) ? $('form').attr('id') : $.table._option.formId;
|
var currentId = $.common.isEmpty($.table._option.formId) ? $('form').attr('id') : $.table._option.formId;
|
||||||
return $.extend(curParams, $.common.formToJSON(currentId));
|
return $.extend(curParams, $.common.formToJSON(currentId));
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
var type = "{$type}";
|
||||||
var addFlag = "";
|
var addFlag = "";
|
||||||
var editFlag = "";
|
var editFlag = "";
|
||||||
var removeFlag = "";
|
var removeFlag = "";
|
||||||
@@ -48,12 +49,11 @@ $(function(){
|
|||||||
uniqueId: "id",
|
uniqueId: "id",
|
||||||
expandAll: false,
|
expandAll: false,
|
||||||
expandFirst: false,
|
expandFirst: false,
|
||||||
url: "/admin/channel/index",
|
url: "/admin/channel/index?type="+type,
|
||||||
createUrl: "/admin/channel/add?id={id}",
|
createUrl: "/admin/channel/add?id={id}",
|
||||||
updateUrl: "/admin/channel/edit?id={id}",
|
updateUrl: "/admin/channel/edit?id={id}",
|
||||||
removeUrl: "/admin/channel/del?id={id}",
|
removeUrl: "/admin/channel/del?id={id}",
|
||||||
modalName: "频道",
|
modalName: "频道",
|
||||||
queryParams:{type:0},
|
|
||||||
columns:[
|
columns:[
|
||||||
{field: 'selectItem', radio: true},
|
{field: 'selectItem', radio: true},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,30 +7,31 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form method="post" class="form form-horizontal" role="ajax">
|
<form method="post" class="form form-horizontal" role="ajax">
|
||||||
|
<input type="hidden" name="id" value="{$info.id|default=''}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置标识</label>
|
<label class="col-sm-2 control-label">配置标识</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" style="width: 400px" name="name" value="{$info.name|default=''}">
|
<input type="text" class="form-control" style="width: 400px" name="name" value="{$info.name|default=''}">
|
||||||
<span class="help-block">(用于config函数调用,只能使用英文且不能重复)</span>
|
<span class="help-block">(用于config函数调用,只能使用英文且不能重复)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置标题</label>
|
<label class="col-sm-2 control-label">配置标题</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" style="width:400px;" name="title" value="{$info.title|default=''}">
|
<input type="text" class="form-control" style="width:400px;" name="title" value="{$info.title|default=''}">
|
||||||
<span class="help-block">(用于后台显示的配置标题)</span>
|
<span class="help-block">(用于后台显示的配置标题)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">排序</label>
|
<label class="col-sm-2 control-label">排序</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" style="width: 400px" name="sort" value="{$info.sort|default=0}">
|
<input type="text" class="form-control" style="width: 400px" name="sort" value="{$info.sort|default=0}">
|
||||||
<span class="help-block">(用于分组显示的顺序)</span>
|
<span class="help-block">(用于分组显示的顺序)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置类型</label>
|
<label class="col-sm-2 control-label">配置类型</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<select name="type" class="form-control" style="width:auto;">
|
<select name="type" class="form-control" style="width:auto;">
|
||||||
{volist name="config['config_type_list']" id="type"}
|
{volist name="config['config_type_list']" id="type"}
|
||||||
<option value="{$key}" {if isset($info['type']) && $info['type'] == $key}selected{/if}>{$type}</option>
|
<option value="{$key}" {if isset($info['type']) && $info['type'] == $key}selected{/if}>{$type}</option>
|
||||||
@@ -40,8 +41,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置分组</label>
|
<label class="col-sm-2 control-label">配置分组</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<select name="group" class="form-control" style="width: auto">
|
<select name="group" class="form-control" style="width: auto">
|
||||||
<option value="0">不分组</option>
|
<option value="0">不分组</option>
|
||||||
{volist name="config['config_group_list']" id="group"}
|
{volist name="config['config_group_list']" id="group"}
|
||||||
@@ -52,29 +53,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置值</label>
|
<label class="col-sm-2 control-label">配置值</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<textarea name="value" class="form-control" style="width: 80%;height: 120px">{$info.value|default=''}</textarea>
|
<textarea name="value" class="form-control" style="width: 80%;height: 120px">{$info.value|default=''}</textarea>
|
||||||
<span class="help-block">(配置值)</span>
|
<span class="help-block">(配置值)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">配置项</label>
|
<label class="col-sm-2 control-label">配置项</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<textarea name="extra" class="form-control" style="width: 80%;height: 120px">{$info.extra|default=''}</textarea>
|
<textarea name="extra" class="form-control" style="width: 80%;height: 120px">{$info.extra|default=''}</textarea>
|
||||||
<span class="help-block">(如果是枚举型 需要配置该项)</span>
|
<span class="help-block">(如果是枚举型 需要配置该项)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-2 control-label">说明</label>
|
<label class="col-sm-2 control-label">说明</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
<textarea name="remark" class="form-control" style="width: 80%;height: 120px">{$info.remark|default=''}</textarea>
|
<textarea name="remark" class="form-control" style="width: 80%;height: 120px">{$info.remark|default=''}</textarea>
|
||||||
<span class="help-block">(配置详细说明)</span>
|
<span class="help-block">(配置详细说明)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" style="display: none;">
|
||||||
<div class="col-lg-offset-2 col-lg-10">
|
<div class="col-sm-offset-2 col-sm-10">
|
||||||
<input type="hidden" name="id" value="{$info.id|default=''}">
|
|
||||||
<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
|
<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
|
||||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,29 +1,23 @@
|
|||||||
{extend name="admin/base"/}
|
{extend name="admin/base"/}
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
|
<div class="nav-tabs-custom">
|
||||||
<!-- Default box -->
|
<ul class="nav nav-tabs">
|
||||||
<div class="box box-primary">
|
{volist name="config['config_group_list']" id="item"}
|
||||||
<div class="box-header with-border">
|
<li {if $key == $id}class="active"{/if}><a href="/admin/config/group.html?id={$key}">{$item}</a></li>
|
||||||
<h3 class="box-title">{$mate_title|default="新功能"}</h3>
|
{/volist}
|
||||||
<div class="box-tools pull-right">
|
</ul>
|
||||||
<ul class="nav nav-tabs">
|
<div class="tab-content">
|
||||||
{volist name="config['config_group_list']" id="item"}
|
<!-- Font Awesome Icons -->
|
||||||
<li {if $key == $id}class="active"{/if}><a href="/admin/config/group.html?id={$key}">{$item}</a></li>
|
<div class="tab-pane active">
|
||||||
{/volist}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="tabs-wrapper">
|
|
||||||
<div class="btn-group-sm" style="text-align: right; padding-bottom: 10px;">
|
<div class="btn-group-sm" style="text-align: right; padding-bottom: 10px;">
|
||||||
<a href="{:url('/admin/config/index')}" class="btn btn-primary"><i class="fa fa-list"></i> 配置列表</a>
|
<a onclick="$.operate.openTab('配置列表', '/admin/config/index')" class="btn btn-primary"><i class="fa fa-list"></i> 配置列表</a>
|
||||||
<a href="{:url('/admin/config/add')}" class="btn btn-danger"><i class="fa fa-list"></i> 添加配置</a>
|
<a href="{:url('/admin/config/add')}" class="btn btn-danger"><i class="fa fa-list"></i> 添加配置</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" class="form form-horizontal" role="ajax">
|
<form method="post" class="form form-horizontal" role="ajax">
|
||||||
{volist name="list" id="item"}
|
{volist name="list" id="item"}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputEmail1" class="col-lg-2 control-label">{$item['title']}</label>
|
<label for="inputEmail1" class="col-sm-2 control-label">{$item['title']}</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-sm-10">
|
||||||
{switch name="item['type']"}
|
{switch name="item['type']"}
|
||||||
{case value="text"}
|
{case value="text"}
|
||||||
<input type="text" class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" value="{$item['value']}" placeholder="{$item['title']}" style="width:50%;">
|
<input type="text" class="form-control" name="config[{$item['name']}]" id="config[{$item['name']}]" value="{$item['value']}" placeholder="{$item['title']}" style="width:50%;">
|
||||||
@@ -62,13 +56,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{/volist}
|
{/volist}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-lg-offset-2 col-lg-10">
|
<div class="col-sm-offset-2 col-sm-10">
|
||||||
<button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form">确认提交</button>
|
<button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form">确认提交</button>
|
||||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.box-body -->
|
</div>
|
||||||
</div><!-- /.box -->
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
@@ -1,118 +1,82 @@
|
|||||||
{extend name="admin/base"/}
|
{extend name="admin/base"/}
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="box box-primary">
|
<div class="nav-tabs-custom">
|
||||||
<header class="box-header with-border">
|
<ul class="nav nav-tabs">
|
||||||
<div class="pull-left">
|
<li {if condition="!$group_id"}class="active"{/if}><a href="{:url('/admin/config/index')}">全部</a></li>
|
||||||
<h2>{$meta_title|default="新功能"}</h2>
|
{volist name="config['config_group_list']" id="item"}
|
||||||
</div>
|
<li {if condition="$group_id eq $key"}class="active"{/if}><a href="{:url('/admin/config/index', array('group'=>$key))}">{$item}</a></li>
|
||||||
<div class="pull-right">
|
{/volist}
|
||||||
<a href="{:url('Config/group')}" class="btn btn-danger">
|
</ul>
|
||||||
<i class="fa fa-list"></i>
|
<div class="tab-content">
|
||||||
配置管理
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
</a>
|
<a class="btn btn-success" onclick="$.operate.openTab('配置管理', '/admin/config/group')"><i class="fa fa-plus"></i> 配置管理</a>
|
||||||
<a href="{:url('Config/add')}" class="btn btn-danger">
|
<a class="btn btn-success" onclick="$.operate.add()"><i class="fa fa-plus"></i> 新增</a>
|
||||||
<i class="fa fa-plus"></i>
|
<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>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
<div class="table-striped">
|
||||||
</header>
|
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||||
<div class="box-body">
|
</div>
|
||||||
<div class="tabs-wrapper">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script type="text/javascript">
|
<!-- bootstrap-table 表格插件 -->
|
||||||
$(function () {
|
<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>
|
||||||
$("#search").click(function () {
|
<script src="__static__/plugins/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js"></script>
|
||||||
var url = $(this).attr('url');
|
<script src="__static__/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
|
||||||
var query = $('.search-form').find('input').serialize();
|
<script src="__static__/plugins/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js"></script>
|
||||||
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(',');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url != undefined && url != '') {
|
<script type="text/javascript">
|
||||||
window.location.href = url + '/ids/' + param;
|
$(function(){
|
||||||
}
|
var group = "{$group_id|default=0}";
|
||||||
});
|
var editFlag = "";
|
||||||
});
|
var removeFlag = "";
|
||||||
</script>
|
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}
|
{/block}
|
||||||
Reference in New Issue
Block a user