作者 开飞机的舒克

后台修改

<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 项目管理
*
* @icon fa fa-circle-o
*/
class Item extends Backend
{
/**
* Item模型对象
* @var \app\admin\model\Item
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Item;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['radar','user'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','title','radar_id','user_id','score','createtime']);
$row->visible(['radar']);
$row->getRelation('radar')->visible(['title']);
$row->visible(['user']);
$row->getRelation('user')->visible(['username']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ... @@ -7,6 +7,6 @@ return [
'Score' => '积分',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Radar.title' => '维度名称',
'User.username' => '用户名'
'User.username' => '用户名',
'Radar.title' => '维度名称'
];
... ...
... ... @@ -7,7 +7,6 @@ return [
'Is_sift' => '是否为精选',
'Is_sift 0' => '否',
'Is_sift 1' => '是',
'Score' => '积分',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Item.title' => '名称'
... ...
<?php
namespace app\admin\model;
use think\Model;
class Item extends Model
{
// 表名
protected $name = 'item';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function radar()
{
return $this->belongsTo('Radar', 'radar_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
<style type="text/css">
.sm-st {
background: #fff;
padding: 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin-bottom: 20px;
}
.sm-st-icon {
width: 60px;
height: 60px;
display: inline-block;
line-height: 60px;
text-align: center;
font-size: 30px;
background: #eee;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
float: left;
margin-right: 10px;
color: #fff;
}
.sm-st-info {
padding-top: 2px;
}
.sm-st-info span {
display: block;
font-size: 24px;
font-weight: 600;
}
.orange {
background: #fa8564 !important;
}
.tar {
background: #45cf95 !important;
}
.sm-st .green {
background: #86ba41 !important;
}
.pink {
background: #AC75F0 !important;
}
.yellow-b {
background: #fdd752 !important;
}
.stat-elem {
background-color: #fff;
padding: 18px;
border-radius: 40px;
}
.stat-info {
text-align: center;
background-color: #fff;
border-radius: 5px;
margin-top: -5px;
padding: 8px;
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
font-style: italic;
}
.stat-icon {
text-align: center;
margin-bottom: 5px;
}
.st-red {
background-color: #F05050;
}
.st-green {
background-color: #27C24C;
}
.st-violet {
background-color: #7266ba;
}
.st-blue {
background-color: #23b7e5;
}
.stats .stat-icon {
color: #28bb9c;
display: inline-block;
font-size: 26px;
text-align: center;
vertical-align: middle;
width: 50px;
float: left;
}
.stat {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
.stat .value {
font-size: 20px;
line-height: 24px;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
}
.stat .name {
overflow: hidden;
text-overflow: ellipsis;
margin: 5px 0;
}
.stat.lg .value {
font-size: 26px;
line-height: 28px;
}
.stat-col {
margin:0 0 10px 0;
}
.stat.lg .name {
font-size: 16px;
}
.stat-col .progress {
height: 2px;
}
.stat-col .progress-bar {
line-height: 2px;
height: 2px;
}
.item {
padding: 30px 0;
}
#statistics .panel {
min-height: 150px;
}
#statistics .panel h5 {
font-size: 14px;
}
</style>
{/*<style type="text/css">*/}
{/* .sm-st {*/}
{/* background: #fff;*/}
{/* padding: 20px;*/}
{/* -webkit-border-radius: 3px;*/}
{/* -moz-border-radius: 3px;*/}
{/* border-radius: 3px;*/}
{/* margin-bottom: 20px;*/}
{/* &cc;*/}
{/* .sm-st-icon {*/}
{/* width: 60px;*/}
{/* height: 60px;*/}
{/* display: inline-block;*/}
{/* line-height: 60px;*/}
{/* text-align: center;*/}
{/* font-size: 30px;*/}
{/* background: #eee;*/}
{/* -webkit-border-radius: 5px;*/}
{/* -moz-border-radius: 5px;*/}
{/* border-radius: 5px;*/}
{/* float: left;*/}
{/* margin-right: 10px;*/}
{/* color: #fff;*/}
{/* &cc;*/}
{/* .sm-st-info {*/}
{/* padding-top: 2px;*/}
{/* &cc;*/}
{/* .sm-st-info span {*/}
{/* display: block;*/}
{/* font-size: 24px;*/}
{/* font-weight: 600;*/}
{/* &cc;*/}
{/* .orange {*/}
{/* background: #fa8564 !important;*/}
{/* &cc;*/}
{/* .tar {*/}
{/* background: #45cf95 !important;*/}
{/* &cc;*/}
{/* .sm-st .green {*/}
{/* background: #86ba41 !important;*/}
{/* &cc;*/}
{/* .pink {*/}
{/* background: #AC75F0 !important;*/}
{/* &cc;*/}
{/* .yellow-b {*/}
{/* background: #fdd752 !important;*/}
{/* &cc;*/}
{/* .stat-elem {*/}
{/* background-color: #fff;*/}
{/* padding: 18px;*/}
{/* border-radius: 40px;*/}
{/* &cc;*/}
{/* .stat-info {*/}
{/* text-align: center;*/}
{/* background-color: #fff;*/}
{/* border-radius: 5px;*/}
{/* margin-top: -5px;*/}
{/* padding: 8px;*/}
{/* -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);*/}
{/* box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);*/}
{/* font-style: italic;*/}
{/* &cc;*/}
{/* .stat-icon {*/}
{/* text-align: center;*/}
{/* margin-bottom: 5px;*/}
{/* &cc;*/}
{/* .st-red {*/}
{/* background-color: #F05050;*/}
{/* &cc;*/}
{/* .st-green {*/}
{/* background-color: #27C24C;*/}
{/* &cc;*/}
{/* .st-violet {*/}
{/* background-color: #7266ba;*/}
{/* &cc;*/}
{/* .st-blue {*/}
{/* background-color: #23b7e5;*/}
{/* &cc;*/}
{/* .stats .stat-icon {*/}
{/* color: #28bb9c;*/}
{/* display: inline-block;*/}
{/* font-size: 26px;*/}
{/* text-align: center;*/}
{/* vertical-align: middle;*/}
{/* width: 50px;*/}
{/* float: left;*/}
{/* &cc;*/}
{/* .stat {*/}
{/* white-space: nowrap;*/}
{/* overflow: hidden;*/}
{/* text-overflow: ellipsis;*/}
{/* display: inline-block;*/}
{/* &cc;*/}
{/* .stat .value {*/}
{/* font-size: 20px;*/}
{/* line-height: 24px;*/}
{/* overflow: hidden;*/}
{/* text-overflow: ellipsis;*/}
{/* font-weight: 500;*/}
{/* &cc;*/}
{/* .stat .name {*/}
{/* overflow: hidden;*/}
{/* text-overflow: ellipsis;*/}
{/* margin: 5px 0;*/}
{/* &cc;*/}
{/* .stat.lg .value {*/}
{/* font-size: 26px;*/}
{/* line-height: 28px;*/}
{/* &cc;*/}
{/* .stat-col {*/}
{/* margin:0 0 10px 0;*/}
{/* &cc;*/}
{/* .stat.lg .name {*/}
{/* font-size: 16px;*/}
{/* &cc;*/}
{/* .stat-col .progress {*/}
{/* height: 2px;*/}
{/* &cc;*/}
{/* .stat-col .progress-bar {*/}
{/* line-height: 2px;*/}
{/* height: 2px;*/}
{/* &cc;*/}
{/* .item {*/}
{/* padding: 30px 0;*/}
{/* &cc;*/}
{/* #statistics .panel {*/}
{/* min-height: 150px;*/}
{/* &cc;*/}
{/* #statistics .panel h5 {*/}
{/* font-size: 14px;*/}
{/* &cc;*/}
{/*</style>*/}
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null, false)}
<ul class="nav nav-tabs">
<li class="active"><a href="#one" data-toggle="tab">{:__('Dashboard')}</a></li>
<li><a href="#two" data-toggle="tab">{:__('Custom')}</a></li>
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="row">
<div class="col-sm-3 col-xs-6">
<div class="sm-st clearfix">
<span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>
<div class="sm-st-info">
<span>{$totaluser}</span>
{:__('Total user')}
</div>
</div>
</div>
<div class="col-sm-3 col-xs-6">
<div class="sm-st clearfix">
<span class="sm-st-icon st-violet"><i class="fa fa-magic"></i></span>
<div class="sm-st-info">
<span>{$totaladdon}</span>
{:__('Total addon')}
</div>
</div>
</div>
<div class="col-sm-3 col-xs-6">
<div class="sm-st clearfix">
<span class="sm-st-icon st-blue"><i class="fa fa-leaf"></i></span>
<div class="sm-st-info">
<span>{$attachmentnums}</span>
{:__('Total attachment')}
</div>
</div>
</div>
<div class="col-sm-3 col-xs-6">
<div class="sm-st clearfix">
<span class="sm-st-icon st-green"><i class="fa fa-user"></i></span>
<div class="sm-st-info">
<span>{$totaladmin}</span>
{:__('Total admin')}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8">
<div id="echart" class="btn-refresh" style="height:300px;width:100%;"></div>
</div>
<div class="col-lg-4">
<div class="card sameheight-item stats">
<div class="card-block">
<div class="row row-sm stats-container">
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-rocket"></i></div>
<div class="stat">
<div class="value"> {$todayusersignup}</div>
<div class="name"> {:__('Today user signup')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-vcard"></i></div>
<div class="stat">
<div class="value"> {$todayuserlogin}</div>
<div class="name"> {:__('Today user login')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-calendar"></i></div>
<div class="stat">
<div class="value"> {$threednu}</div>
<div class="name"> {:__('Three dnu')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-calendar-plus-o"></i></div>
<div class="stat">
<div class="value"> {$sevendnu}</div>
<div class="name"> {:__('Seven dnu')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-user-circle"></i></div>
<div class="stat">
<div class="value"> {$sevendau}</div>
<div class="name"> {:__('Seven dau')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-user-circle-o"></i></div>
<div class="stat">
<div class="value"> {$thirtydau}</div>
<div class="name"> {:__('Thirty dau')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top:15px;" id="statistics">
<div class="col-lg-12">
</div>
<div class="col-xs-6 col-md-3">
<div class="panel bg-blue-gradient no-border">
<div class="panel-body">
<div class="panel-title">
<span class="label label-primary pull-right">{:__('Real time')}</span>
<h5>{:__('Working addon count')}</h5>
</div>
<div class="panel-content">
<div class="row">
<div class="col-md-12">
<h1 class="no-margins">{$totalworkingaddon}</h1>
<div class="font-bold"><i class="fa fa-magic"></i>
<small>{:__('Working addon count tips')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-3">
<div class="panel bg-teal-gradient no-border">
<div class="panel-body">
<div class="ibox-title">
<span class="label label-primary pull-right">{:__('Real time')}</span>
<h5>{:__('Database count')}</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h1 class="no-margins">{$dbtablenums}</h1>
<div class="font-bold"><i class="fa fa-database"></i>
<small>{:__('Database table nums')}</small>
</div>
</div>
<div class="col-md-6">
<h1 class="no-margins">{$dbsize|format_bytes=###,'',0}</h1>
<div class="font-bold"><i class="fa fa-filter"></i>
<small>{:__('Database size')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-3">
<div class="panel bg-purple-gradient no-border">
<div class="panel-body">
<div class="ibox-title">
<span class="label label-primary pull-right">{:__('Real time')}</span>
<h5>{:__('Attachment count')}</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h1 class="no-margins">{$attachmentnums}</h1>
<div class="font-bold"><i class="fa fa-files-o"></i>
<small>{:__('Attachment nums')}</small>
</div>
</div>
<div class="col-md-6">
<h1 class="no-margins">{$attachmentsize|format_bytes=###,'',0}</h1>
<div class="font-bold"><i class="fa fa-filter"></i>
<small>{:__('Attachment size')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-3">
<div class="panel bg-green-gradient no-border">
<div class="panel-body">
<div class="ibox-title">
<span class="label label-primary pull-right">{:__('Real time')}</span>
<h5>{:__('Picture count')}</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h1 class="no-margins">{$picturenums}</h1>
<div class="font-bold"><i class="fa fa-picture-o"></i>
<small>{:__('Picture nums')}</small>
</div>
</div>
<div class="col-md-6">
<h1 class="no-margins">{$picturesize|format_bytes=###,'',0}</h1>
<div class="font-bold"><i class="fa fa-filter"></i>
<small>{:__('Picture size')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="two">
<div class="row">
<div class="col-xs-12">
{:__('Custom zone')}
</div>
</div>
</div>
</div>
<p>校园活动小程序</p>
{/* {:build_heading(null, false)&cc;*/}
{/* <ul class="nav nav-tabs">*/}
{/* <li class="active"><a href="#one" data-toggle="tab">{:__('Dashboard')&cc;</a></li>*/}
{/* <li><a href="#two" data-toggle="tab">{:__('Custom')&cc;</a></li>*/}
{/* </ul>*/}
</div>
{/* <div class="panel-body">*/}
{/* <div id="myTabContent" class="tab-content">*/}
{/* <div class="tab-pane fade active in" id="one">*/}
{/* <div class="row">*/}
{/* <div class="col-sm-3 col-xs-6">*/}
{/* <div class="sm-st clearfix">*/}
{/* <span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>*/}
{/* <div class="sm-st-info">*/}
{/* <span>{$totaluser&cc;</span>*/}
{/* {:__('Total user')&cc;*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-sm-3 col-xs-6">*/}
{/* <div class="sm-st clearfix">*/}
{/* <span class="sm-st-icon st-violet"><i class="fa fa-magic"></i></span>*/}
{/* <div class="sm-st-info">*/}
{/* <span>{$totaladdon&cc;</span>*/}
{/* {:__('Total addon')&cc;*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-sm-3 col-xs-6">*/}
{/* <div class="sm-st clearfix">*/}
{/* <span class="sm-st-icon st-blue"><i class="fa fa-leaf"></i></span>*/}
{/* <div class="sm-st-info">*/}
{/* <span>{$attachmentnums&cc;</span>*/}
{/* {:__('Total attachment')&cc;*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-sm-3 col-xs-6">*/}
{/* <div class="sm-st clearfix">*/}
{/* <span class="sm-st-icon st-green"><i class="fa fa-user"></i></span>*/}
{/* <div class="sm-st-info">*/}
{/* <span>{$totaladmin&cc;</span>*/}
{/* {:__('Total admin')&cc;*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="row">*/}
{/* <div class="col-lg-8">*/}
{/* <div id="echart" class="btn-refresh" style="height:300px;width:100%;"></div>*/}
{/* </div>*/}
{/* <div class="col-lg-4">*/}
{/* <div class="card sameheight-item stats">*/}
{/* <div class="card-block">*/}
{/* <div class="row row-sm stats-container">*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-rocket"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$todayusersignup&cc;</div>*/}
{/* <div class="name"> {:__('Today user signup')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-vcard"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$todayuserlogin&cc;</div>*/}
{/* <div class="name"> {:__('Today user login')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-calendar"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$threednu&cc;</div>*/}
{/* <div class="name"> {:__('Three dnu')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-calendar-plus-o"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$sevendnu&cc;</div>*/}
{/* <div class="name"> {:__('Seven dnu')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-user-circle"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$sevendau&cc;</div>*/}
{/* <div class="name"> {:__('Seven dau')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 stat-col">*/}
{/* <div class="stat-icon"><i class="fa fa-user-circle-o"></i></div>*/}
{/* <div class="stat">*/}
{/* <div class="value"> {$thirtydau&cc;</div>*/}
{/* <div class="name"> {:__('Thirty dau')&cc;</div>*/}
{/* </div>*/}
{/* <div class="progress">*/}
{/* <div class="progress-bar progress-bar-success" style="width: 20%"></div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="row" style="margin-top:15px;" id="statistics">*/}
{/* <div class="col-lg-12">*/}
{/* </div>*/}
{/* <div class="col-xs-6 col-md-3">*/}
{/* <div class="panel bg-blue-gradient no-border">*/}
{/* <div class="panel-body">*/}
{/* <div class="panel-title">*/}
{/* <span class="label label-primary pull-right">{:__('Real time')&cc;</span>*/}
{/* <h5>{:__('Working addon count')&cc;</h5>*/}
{/* </div>*/}
{/* <div class="panel-content">*/}
{/* <div class="row">*/}
{/* <div class="col-md-12">*/}
{/* <h1 class="no-margins">{$totalworkingaddon&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-magic"></i>*/}
{/* <small>{:__('Working addon count tips')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 col-md-3">*/}
{/* <div class="panel bg-teal-gradient no-border">*/}
{/* <div class="panel-body">*/}
{/* <div class="ibox-title">*/}
{/* <span class="label label-primary pull-right">{:__('Real time')&cc;</span>*/}
{/* <h5>{:__('Database count')&cc;</h5>*/}
{/* </div>*/}
{/* <div class="ibox-content">*/}
{/* <div class="row">*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$dbtablenums&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-database"></i>*/}
{/* <small>{:__('Database table nums')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$dbsize|format_bytes=###,'',0&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-filter"></i>*/}
{/* <small>{:__('Database size')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 col-md-3">*/}
{/* <div class="panel bg-purple-gradient no-border">*/}
{/* <div class="panel-body">*/}
{/* <div class="ibox-title">*/}
{/* <span class="label label-primary pull-right">{:__('Real time')&cc;</span>*/}
{/* <h5>{:__('Attachment count')&cc;</h5>*/}
{/* </div>*/}
{/* <div class="ibox-content">*/}
{/* <div class="row">*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$attachmentnums&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-files-o"></i>*/}
{/* <small>{:__('Attachment nums')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$attachmentsize|format_bytes=###,'',0&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-filter"></i>*/}
{/* <small>{:__('Attachment size')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-xs-6 col-md-3">*/}
{/* <div class="panel bg-green-gradient no-border">*/}
{/* <div class="panel-body">*/}
{/* <div class="ibox-title">*/}
{/* <span class="label label-primary pull-right">{:__('Real time')&cc;</span>*/}
{/* <h5>{:__('Picture count')&cc;</h5>*/}
{/* </div>*/}
{/* <div class="ibox-content">*/}
{/* <div class="row">*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$picturenums&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-picture-o"></i>*/}
{/* <small>{:__('Picture nums')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="col-md-6">*/}
{/* <h1 class="no-margins">{$picturesize|format_bytes=###,'',0&cc;</h1>*/}
{/* <div class="font-bold"><i class="fa fa-filter"></i>*/}
{/* <small>{:__('Picture size')&cc;</small>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div class="tab-pane fade" id="two">*/}
{/* <div class="row">*/}
{/* <div class="col-xs-12">*/}
{/* {:__('Custom zone')&cc;*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
</div>
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" class="form-control" name="row[title]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Radar_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-radar_id" data-rule="required" data-source="radar/index" class="form-control selectpage" name="row[radar_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-score" class="form-control" step="0.01" name="row[score]" type="number">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Radar_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-radar_id" data-rule="required" data-source="radar/index" class="form-control selectpage" name="row[radar_id]" type="text" value="{$row.radar_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-score" class="form-control" step="0.01" name="row[score]" type="number" value="{$row.score|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('item/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('item/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('item/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('item/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('item/edit')}"
data-operate-del="{:$auth->check('item/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'item/index' + location.search,
add_url: 'item/add',
edit_url: 'item/edit',
del_url: 'item/del',
multi_url: 'item/multi',
import_url: 'item/import',
table: 'item',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'title', title: __('Title'), operate: 'LIKE'},
{field: 'radar_id', title: __('Radar_id')},
{field: 'user_id', title: __('User_id')},
{field: 'score', title: __('Score'), operate:'BETWEEN'},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'radar.title', title: __('Radar.title'), operate: 'LIKE'},
{field: 'user.username', title: __('User.username'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});