服务青年九宫格图片跳转接口
团务百科需要增加分类 Signed-off-by: qinzexin <“731344816@qq.com”>
This commit is contained in:
		
							parent
							
								
									3a3696ede0
								
							
						
					
					
						commit
						acf45ddd0c
					
				@ -37,4 +37,44 @@ class Encyclopedia extends Backend
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 查看
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function index()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        //当前是否为关联查询
 | 
				
			||||||
 | 
					        $this->relationSearch = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $this->searchFields = ["id","title","subtitle","source","cate.name","cate.flag"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //设置过滤方法
 | 
				
			||||||
 | 
					        $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(['cate'])
 | 
				
			||||||
 | 
					                ->where($where)
 | 
				
			||||||
 | 
					                ->order($sort, $order)
 | 
				
			||||||
 | 
					                ->paginate($limit);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            foreach ($list as $row) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                $row->getRelation('cate')->visible(['name']);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $result = array("total" => $list->total(), "rows" => $list->items());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return json($result);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return $this->view->fetch();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										37
									
								
								application/admin/controller/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								application/admin/controller/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace app\admin\controller\home;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use app\common\controller\Backend;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 团务百科类目
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @icon fa fa-circle-o
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					class EncyclopediaCate extends Backend
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * EncyclopediaCate模型对象
 | 
				
			||||||
 | 
					     * @var \app\admin\model\home\EncyclopediaCate
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $model = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function _initialize()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        parent::_initialize();
 | 
				
			||||||
 | 
					        $this->model = new \app\admin\model\home\EncyclopediaCate;
 | 
				
			||||||
 | 
					        $this->view->assign("statusList", $this->model->getStatusList());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
 | 
				
			||||||
 | 
					     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
 | 
				
			||||||
 | 
					     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -24,6 +24,7 @@ class Images extends Backend
 | 
				
			|||||||
        $this->model = new \app\admin\model\home\Images;
 | 
					        $this->model = new \app\admin\model\home\Images;
 | 
				
			||||||
        $this->view->assign("typeList", $this->model->getTypeList());
 | 
					        $this->view->assign("typeList", $this->model->getTypeList());
 | 
				
			||||||
        $this->view->assign("showtypeList", $this->model->getShowtypeList());
 | 
					        $this->view->assign("showtypeList", $this->model->getShowtypeList());
 | 
				
			||||||
 | 
					        $this->view->assign("statusList", $this->model->getStatusList());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										16
									
								
								application/admin/lang/zh-cn/home/encyclopedia_cate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								application/admin/lang/zh-cn/home/encyclopedia_cate.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return [
 | 
				
			||||||
 | 
					    'Image'      => 'icon',
 | 
				
			||||||
 | 
					    'Name'       => '类目名',
 | 
				
			||||||
 | 
					    'Flag'       => '分类标识',
 | 
				
			||||||
 | 
					    'Status'     => '状态',
 | 
				
			||||||
 | 
					    'Status 1'   => '上架',
 | 
				
			||||||
 | 
					    'Set status to 1'=> '设为上架',
 | 
				
			||||||
 | 
					    'Status 2'   => '下架',
 | 
				
			||||||
 | 
					    'Set status to 2'=> '设为下架',
 | 
				
			||||||
 | 
					    'Weigh'      => '权重',
 | 
				
			||||||
 | 
					    'Createtime' => '创建时间',
 | 
				
			||||||
 | 
					    'Updatetime' => '修改时间',
 | 
				
			||||||
 | 
					    'Deletetime' => '删除时间'
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
@ -12,5 +12,10 @@ return [
 | 
				
			|||||||
    'Showtype'       => '展示类型',
 | 
					    'Showtype'       => '展示类型',
 | 
				
			||||||
    'Showtype image' => '图片',
 | 
					    'Showtype image' => '图片',
 | 
				
			||||||
    'Showtype video' => '视频',
 | 
					    'Showtype video' => '视频',
 | 
				
			||||||
    'Title'          => '轮播图标题'
 | 
					    'Title'          => '轮播图标题',
 | 
				
			||||||
 | 
					    'Status'     => '状态',
 | 
				
			||||||
 | 
					    'Status 1'   => '顶部',
 | 
				
			||||||
 | 
					    'Set status to 1'=> '设为顶部',
 | 
				
			||||||
 | 
					    'Status 2'   => '服务青年专栏',
 | 
				
			||||||
 | 
					    'Set status to 2'=> '设为服务青年专栏',
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
				
			|||||||
@ -81,4 +81,11 @@ class Encyclopedia extends Model
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function cate()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return $this->belongsTo(EncyclopediaCate::class, 'cate_id', 'id', [], 'LEFT')->setEagerlyType(0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										59
									
								
								application/admin/model/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								application/admin/model/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,59 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace app\admin\model\home;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use think\Model;
 | 
				
			||||||
 | 
					use traits\model\SoftDelete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class EncyclopediaCate extends Model
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    use SoftDelete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 表名
 | 
				
			||||||
 | 
					    protected $name = 'encyclopedia_cate';
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    // 自动写入时间戳字段
 | 
				
			||||||
 | 
					    protected $autoWriteTimestamp = 'integer';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 定义时间戳字段名
 | 
				
			||||||
 | 
					    protected $createTime = 'createtime';
 | 
				
			||||||
 | 
					    protected $updateTime = 'updatetime';
 | 
				
			||||||
 | 
					    protected $deleteTime = 'deletetime';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 追加属性
 | 
				
			||||||
 | 
					    protected $append = [
 | 
				
			||||||
 | 
					        'status_text'
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected static function init()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        self::afterInsert(function ($row) {
 | 
				
			||||||
 | 
					            if (!$row['weigh']) {
 | 
				
			||||||
 | 
					                $pk = $row->getPk();
 | 
				
			||||||
 | 
					                $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    public function getStatusList()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return ['1' => __('Status 1'), '2' => __('Status 2')];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getStatusTextAttr($value, $data)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $value = $value ?: ($data['status'] ?? '');
 | 
				
			||||||
 | 
					        $list = $this->getStatusList();
 | 
				
			||||||
 | 
					        return $list[$value] ?? '';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -26,7 +26,8 @@ class Images extends Model
 | 
				
			|||||||
    // 追加属性
 | 
					    // 追加属性
 | 
				
			||||||
    protected $append = [
 | 
					    protected $append = [
 | 
				
			||||||
        'type_text',
 | 
					        'type_text',
 | 
				
			||||||
        'showtype_text'
 | 
					        'showtype_text',
 | 
				
			||||||
 | 
					        'status_text'
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -41,6 +42,22 @@ class Images extends Model
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getStatusList()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return ['1' => __('Status 1'), '2' => __('Status 2')];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getStatusTextAttr($value, $data)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $value = $value ?: ($data['status'] ?? '');
 | 
				
			||||||
 | 
					        $list = $this->getStatusList();
 | 
				
			||||||
 | 
					        return $list[$value] ?? '';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function getTypeList()
 | 
					    public function getTypeList()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return ['in' => __('Type in'), 'out' => __('Type out')];
 | 
					        return ['in' => __('Type in'), 'out' => __('Type out')];
 | 
				
			||||||
 | 
				
			|||||||
@ -44,6 +44,9 @@ class News extends Model
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function getTypeList()
 | 
					    public function getTypeList()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return ['1' => __('Type 1'), '2' => __('Type 2')];
 | 
					        return ['1' => __('Type 1'), '2' => __('Type 2')];
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										27
									
								
								application/admin/validate/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								application/admin/validate/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace app\admin\validate\home;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use think\Validate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class EncyclopediaCate extends Validate
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 验证规则
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $rule = [
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 提示消息
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $message = [
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 验证场景
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $scene = [
 | 
				
			||||||
 | 
					        'add'  => [],
 | 
				
			||||||
 | 
					        'edit' => [],
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,5 +1,13 @@
 | 
				
			|||||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
 | 
					<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">{:__('Cate_id')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-cate_id" data-rule="required"  data-source="home/encyclopedia_cate/index"  class="form-control selectpage" name="row[cate_id]" type="text" value="">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,12 @@
 | 
				
			|||||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
 | 
					<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">{:__('Cate_id')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-cate_id" data-rule="required"  data-source="home/encyclopedia_cate/index"  class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										53
									
								
								application/admin/view/home/encyclopedia_cate/add.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								application/admin/view/home/encyclopedia_cate/add.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					<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">{:__('Image')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <div class="input-group">
 | 
				
			||||||
 | 
					                <input id="c-image" class="form-control" size="50" name="row[image]" type="text">
 | 
				
			||||||
 | 
					                <div class="input-group-addon no-border no-padding">
 | 
				
			||||||
 | 
					                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
 | 
				
			||||||
 | 
					                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <span class="msg-box n-right" for="c-image"></span>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-flag" class="form-control" name="row[flag]" type="text">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            <div class="radio">
 | 
				
			||||||
 | 
					            {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
 | 
				
			||||||
 | 
					            {/foreach}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
 | 
				
			||||||
 | 
					        </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>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</form>
 | 
				
			||||||
							
								
								
									
										53
									
								
								application/admin/view/home/encyclopedia_cate/edit.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								application/admin/view/home/encyclopedia_cate/edit.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					<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">{:__('Image')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <div class="input-group">
 | 
				
			||||||
 | 
					                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
 | 
				
			||||||
 | 
					                <div class="input-group-addon no-border no-padding">
 | 
				
			||||||
 | 
					                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
 | 
				
			||||||
 | 
					                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <span class="msg-box n-right" for="c-image"></span>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-flag" class="form-control" name="row[flag]" type="text" value="{$row.flag|htmlentities}">
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            <div class="radio">
 | 
				
			||||||
 | 
					            {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
 | 
				
			||||||
 | 
					            {/foreach}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|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>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</form>
 | 
				
			||||||
							
								
								
									
										46
									
								
								application/admin/view/home/encyclopedia_cate/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								application/admin/view/home/encyclopedia_cate/index.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					<div class="panel panel-default panel-intro">
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    <div class="panel-heading">
 | 
				
			||||||
 | 
					        {:build_heading(null,FALSE)}
 | 
				
			||||||
 | 
					        <ul class="nav nav-tabs" data-field="status">
 | 
				
			||||||
 | 
					            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
 | 
				
			||||||
 | 
					            {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
 | 
				
			||||||
 | 
					            {/foreach}
 | 
				
			||||||
 | 
					        </ul>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <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('home/encyclopedia_cate/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('home/encyclopedia_cate/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('home/encyclopedia_cate/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
 | 
				
			||||||
 | 
					                        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        <div class="dropdown btn-group {:$auth->check('home/encyclopedia_cate/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">
 | 
				
			||||||
 | 
					                                {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
 | 
				
			||||||
 | 
					                                {/foreach}
 | 
				
			||||||
 | 
					                            </ul>
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('home/encyclopedia_cate/recyclebin')?'':'hide'}" href="home/encyclopedia_cate/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
 | 
				
			||||||
 | 
					                           data-operate-edit="{:$auth->check('home/encyclopedia_cate/edit')}"
 | 
				
			||||||
 | 
					                           data-operate-del="{:$auth->check('home/encyclopedia_cate/del')}"
 | 
				
			||||||
 | 
					                           width="100%">
 | 
				
			||||||
 | 
					                    </table>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					<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">
 | 
				
			||||||
 | 
					                        {:build_toolbar('refresh')}
 | 
				
			||||||
 | 
					                        <a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('home/encyclopedia_cate/restore')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia_cate/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
 | 
				
			||||||
 | 
					                        <a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('home/encyclopedia_cate/destroy')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia_cate/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
 | 
				
			||||||
 | 
					                        <a class="btn btn-success btn-restoreall {:$auth->check('home/encyclopedia_cate/restore')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia_cate/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
 | 
				
			||||||
 | 
					                        <a class="btn btn-danger btn-destroyall {:$auth->check('home/encyclopedia_cate/destroy')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia_cate/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                    <table id="table" class="table table-striped table-bordered table-hover"
 | 
				
			||||||
 | 
					                           data-operate-restore="{:$auth->check('home/encyclopedia_cate/restore')}"
 | 
				
			||||||
 | 
					                           data-operate-destroy="{:$auth->check('home/encyclopedia_cate/destroy')}"
 | 
				
			||||||
 | 
					                           width="100%">
 | 
				
			||||||
 | 
					                    </table>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
@ -14,6 +14,20 @@
 | 
				
			|||||||
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
					            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div class="radio">
 | 
				
			||||||
 | 
					                {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
 | 
				
			||||||
 | 
					                {/foreach}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
				
			|||||||
@ -14,6 +14,20 @@
 | 
				
			|||||||
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
					            <ul class="row list-inline faupload-preview" id="p-image"></ul>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
 | 
				
			||||||
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div class="radio">
 | 
				
			||||||
 | 
					                {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
 | 
				
			||||||
 | 
					                {/foreach}
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,13 @@
 | 
				
			|||||||
<div class="panel panel-default panel-intro">
 | 
					<div class="panel panel-default panel-intro">
 | 
				
			||||||
    {:build_heading()}
 | 
					    <div class="panel-heading">
 | 
				
			||||||
 | 
					        {:build_heading(null,FALSE)}
 | 
				
			||||||
 | 
					        <ul class="nav nav-tabs" data-field="status">
 | 
				
			||||||
 | 
					            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
 | 
				
			||||||
 | 
					            {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
 | 
				
			||||||
 | 
					            {/foreach}
 | 
				
			||||||
 | 
					        </ul>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <div class="panel-body">
 | 
					    <div class="panel-body">
 | 
				
			||||||
        <div id="myTabContent" class="tab-content">
 | 
					        <div id="myTabContent" class="tab-content">
 | 
				
			||||||
@ -12,7 +20,14 @@
 | 
				
			|||||||
                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('home/images/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
 | 
					                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('home/images/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        
 | 
					                        <div class="dropdown btn-group {:$auth->check('home/images/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">
 | 
				
			||||||
 | 
					                                {foreach name="statusList" item="vo"}
 | 
				
			||||||
 | 
					                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
 | 
				
			||||||
 | 
					                                {/foreach}
 | 
				
			||||||
 | 
					                            </ul>
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('home/images/recyclebin')?'':'hide'}" href="home/images/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
 | 
					                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('home/images/recyclebin')?'':'hide'}" href="home/images/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,7 @@
 | 
				
			|||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
            <input id="c-cate_id" data-rule="required" data-source="home/media_matrix/index" class="form-control selectpage" name="row[cate_id]" type="text" value="">
 | 
					            <input id="c-cate_id" data-rule="required" data-source="home/media_matrix_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="">
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,7 @@
 | 
				
			|||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
 | 
					        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
 | 
				
			||||||
        <div class="col-xs-12 col-sm-8">
 | 
					        <div class="col-xs-12 col-sm-8">
 | 
				
			||||||
            <input id="c-cate_id" data-rule="required" data-source="home/media_matrix/index" class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
 | 
					            <input id="c-cate_id" data-rule="required" data-source="home/media_matrix_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="form-group">
 | 
					    <div class="form-group">
 | 
				
			||||||
 | 
				
			|||||||
@ -22,6 +22,7 @@ class Index extends Base
 | 
				
			|||||||
     * @ApiMethod(GET)
 | 
					     * @ApiMethod(GET)
 | 
				
			||||||
     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
					     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
				
			||||||
     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
					     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
				
			||||||
 | 
					     * @ApiParams(name = "status", type = "string",required=true,description = "放置类型:1=顶部,2=服务青年专栏")
 | 
				
			||||||
     * @ApiReturn({
 | 
					     * @ApiReturn({
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *})
 | 
					     *})
 | 
				
			||||||
@ -31,14 +32,15 @@ class Index extends Base
 | 
				
			|||||||
        $user_id = 0;
 | 
					        $user_id = 0;
 | 
				
			||||||
        $user = $this->auth->getUser();//登录用户
 | 
					        $user = $this->auth->getUser();//登录用户
 | 
				
			||||||
        if($user)$user_id = $user['id'];
 | 
					        if($user)$user_id = $user['id'];
 | 
				
			||||||
 | 
					        $params=[];
 | 
				
			||||||
        $page              =  $this->request->get('page/d', 0); //页数
 | 
					        $page              =  $this->request->get('page/d', 0); //页数
 | 
				
			||||||
        $limit             =  $this->request->get('limit/d', 0); //条数
 | 
					        $limit             =  $this->request->get('limit/d', 0); //条数
 | 
				
			||||||
 | 
					        $params["status"]  =  $this->request->get('status/s', ""); //条数
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try{
 | 
					        try{
 | 
				
			||||||
            //当前申请状态
 | 
					            //当前申请状态
 | 
				
			||||||
            $res =  Images::allList($page, $limit);
 | 
					            $res =  Images::allList($page, $limit,$params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }catch (\Exception $e){
 | 
					        }catch (\Exception $e){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@ namespace app\api\controller\home;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use app\common\model\home\Encyclopedia as EncyclopediaModel;
 | 
					use app\common\model\home\Encyclopedia as EncyclopediaModel;
 | 
				
			||||||
use app\common\model\home\News as NewsModel;
 | 
					use app\common\model\home\News as NewsModel;
 | 
				
			||||||
use app\common\model\home\NewsCate;
 | 
					use app\common\model\home\EncyclopediaCate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 团务百科接口
 | 
					 * 团务百科接口
 | 
				
			||||||
@ -30,6 +30,44 @@ class Encyclopedia extends Base
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @ApiTitle( 团务百科分类)
 | 
				
			||||||
 | 
					     * @ApiSummary(团务百科分类)
 | 
				
			||||||
 | 
					     * @ApiMethod(GET)
 | 
				
			||||||
 | 
					     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
				
			||||||
 | 
					     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
				
			||||||
 | 
					     * @ApiParams(name = "flag", type = "string",required=false,description = "分类标识")
 | 
				
			||||||
 | 
					     * @ApiReturn({
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     *})
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function cate()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $user_id = 0;
 | 
				
			||||||
 | 
					        $user = $this->auth->getUser();//登录用户
 | 
				
			||||||
 | 
					        if($user)$user_id = $user['id'];
 | 
				
			||||||
 | 
					        $params=[];
 | 
				
			||||||
 | 
					        $page      =  $this->request->param('page/d', 0); //页数
 | 
				
			||||||
 | 
					        $limit   =  $this->request->param('limit/d', 0); //条数
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $params["flag"]  =  $this->request->param('flag/s', ''); //搜索关键字
 | 
				
			||||||
 | 
					//        $params["hot"]  =  $this->request->param('hot/s', ''); //搜索关键字
 | 
				
			||||||
 | 
					//        $params["home"]  =  $this->request->param('home/s', ''); //搜索关键字
 | 
				
			||||||
 | 
					//        $params["isnews"]  =  $this->request->param('isnews/s', ''); //搜索关键字
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try{
 | 
				
			||||||
 | 
					            //当前申请状态
 | 
				
			||||||
 | 
					            $res =  EncyclopediaCate::allList($page, $limit,$params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }catch (\Exception $e){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $this->error($e->getMessage());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        $this->success('查询成功', $res);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @ApiTitle( 团务百科文章列表)
 | 
					     * @ApiTitle( 团务百科文章列表)
 | 
				
			||||||
     * @ApiSummary(团务百科文章列表)
 | 
					     * @ApiSummary(团务百科文章列表)
 | 
				
			||||||
@ -38,6 +76,7 @@ class Encyclopedia extends Base
 | 
				
			|||||||
     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
					     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
				
			||||||
     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
					     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
				
			||||||
     * @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
 | 
					     * @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
 | 
				
			||||||
 | 
					     * @ApiParams(name = "cate_id", type = "int",required=false,description = "团务百科类目id")
 | 
				
			||||||
     * @ApiReturn({
 | 
					     * @ApiReturn({
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *})
 | 
					     *})
 | 
				
			||||||
 | 
				
			|||||||
@ -72,6 +72,7 @@ class MediaMatrix extends Base
 | 
				
			|||||||
     * @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
 | 
					     * @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
 | 
				
			||||||
     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
					     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
				
			||||||
     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
					     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
				
			||||||
 | 
					     * @ApiParams(name = "cate_id", type = "string",required=true,description = "分类id")
 | 
				
			||||||
     * @ApiReturn({
 | 
					     * @ApiReturn({
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *})
 | 
					     *})
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										151
									
								
								application/common/model/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								application/common/model/home/EncyclopediaCate.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,151 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace app\common\model\home;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use app\common\model\BaseModel;
 | 
				
			||||||
 | 
					use think\Model;
 | 
				
			||||||
 | 
					use traits\model\SoftDelete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class EncyclopediaCate extends BaseModel
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    use SoftDelete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 表名
 | 
				
			||||||
 | 
					    protected $name = 'encyclopedia_cate';
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    // 自动写入时间戳字段
 | 
				
			||||||
 | 
					    protected $autoWriteTimestamp = 'integer';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 定义时间戳字段名
 | 
				
			||||||
 | 
					    protected $createTime = 'createtime';
 | 
				
			||||||
 | 
					    protected $updateTime = 'updatetime';
 | 
				
			||||||
 | 
					    protected $deleteTime = 'deletetime';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 追加属性
 | 
				
			||||||
 | 
					    protected $append = [
 | 
				
			||||||
 | 
					        'status_text'
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected static function init()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        self::afterInsert(function ($row) {
 | 
				
			||||||
 | 
					            if (!$row['weigh']) {
 | 
				
			||||||
 | 
					                $pk = $row->getPk();
 | 
				
			||||||
 | 
					                $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    public function getStatusList()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return ['1' => __('Status 1'), '2' => __('Status 2')];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getStatusTextAttr($value, $data)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $value = $value ?: ($data['status'] ?? '');
 | 
				
			||||||
 | 
					        $list = $this->getStatusList();
 | 
				
			||||||
 | 
					        return $list[$value] ?? '';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getImageAttr($value, $data)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (!empty($value)) return cdnurl($value, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**得到基础条件
 | 
				
			||||||
 | 
					     * @param $status
 | 
				
			||||||
 | 
					     * @param null $model
 | 
				
			||||||
 | 
					     * @param string $alisa
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!$model) {
 | 
				
			||||||
 | 
					            $model = new static;
 | 
				
			||||||
 | 
					            if ($alisa&&!$with) $model = $model->alias($alisa);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if ($alisa) $alisa = $alisa . '.';
 | 
				
			||||||
 | 
					        $tableFields = (new static)->getTableFields();
 | 
				
			||||||
 | 
					        foreach ($tableFields as $fields)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					//            if(in_array($fields, ["hot","home"]))continue;
 | 
				
			||||||
 | 
					//            if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (isset($whereData[$fields]) && $whereData[$fields]){
 | 
				
			||||||
 | 
					                if(is_array($whereData[$fields])){
 | 
				
			||||||
 | 
					                    $model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
 | 
				
			||||||
 | 
					                }else{
 | 
				
			||||||
 | 
					                    $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//        if (isset($whereData['hot']) && $whereData['hot']!=="" && $whereData['hot']!==null){
 | 
				
			||||||
 | 
					//            $model = $model->where("{$alisa}hot", 'in', $whereData['hot'] );
 | 
				
			||||||
 | 
					//        }
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//        if (isset($whereData['home']) && $whereData['home']!=="" && $whereData['home']!==null){
 | 
				
			||||||
 | 
					//            $model = $model->where("{$alisa}home", 'in', $whereData['home'] );
 | 
				
			||||||
 | 
					//        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (isset($whereData['keywords'])&&$whereData['keywords']){
 | 
				
			||||||
 | 
					            $model = $model->where("{$alisa}name|{$alisa}flag", 'LIKE', "%{$whereData['keywords']}%" );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (isset($whereData['time'])&&$whereData['time']){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $model = $model->time(["{$alisa}createtime",$whereData['time']]);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//        if (isset($whereData['has_evaluate'])&&$whereData['has_evaluate']){
 | 
				
			||||||
 | 
					//            //1查已评价 2查未评价
 | 
				
			||||||
 | 
					//            if($whereData['has_evaluate'] == 1){
 | 
				
			||||||
 | 
					//                //1查已评价
 | 
				
			||||||
 | 
					//                $model = $model->where("{$alisa}classes_evaluate_id", '<>', 0);
 | 
				
			||||||
 | 
					//            }else{
 | 
				
			||||||
 | 
					//                //2查未评价
 | 
				
			||||||
 | 
					//                $model = $model->whereExists(function ($query) use ($alisa) {
 | 
				
			||||||
 | 
					//                    $order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
 | 
				
			||||||
 | 
					//                    $query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $alisa . 'id')->where('status', '=', '3');
 | 
				
			||||||
 | 
					//                })->where("{$alisa}classes_evaluate_id", '=', 0);
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//            }
 | 
				
			||||||
 | 
					//        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return $model;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static function allList($page, $limit,$params=[]){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $sort = "weigh desc,id desc";
 | 
				
			||||||
 | 
					//        if(!empty($params['status'])){
 | 
				
			||||||
 | 
					//            $params['status'] = '1';
 | 
				
			||||||
 | 
					//        }
 | 
				
			||||||
 | 
					        return (new self)->getBaseList($params, $page, $limit,$sort);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -28,6 +28,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 | 
				
			|||||||
                    [
 | 
					                    [
 | 
				
			||||||
                        {checkbox: true},
 | 
					                        {checkbox: true},
 | 
				
			||||||
                        {field: 'id', title: __('Id')},
 | 
					                        {field: 'id', title: __('Id')},
 | 
				
			||||||
 | 
					                        {field: 'cate_id', title: __('Cate_id')},
 | 
				
			||||||
 | 
					                        {field: 'cate.name', title: __('Cate.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
					                        {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
				
			||||||
                        {field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
					                        {field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										118
									
								
								public/assets/js/backend/home/encyclopedia_cate.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								public/assets/js/backend/home/encyclopedia_cate.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,118 @@
 | 
				
			|||||||
 | 
					define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    var Controller = {
 | 
				
			||||||
 | 
					        index: function () {
 | 
				
			||||||
 | 
					            // 初始化表格参数配置
 | 
				
			||||||
 | 
					            Table.api.init({
 | 
				
			||||||
 | 
					                extend: {
 | 
				
			||||||
 | 
					                    index_url: 'home/encyclopedia_cate/index' + location.search,
 | 
				
			||||||
 | 
					                    add_url: 'home/encyclopedia_cate/add',
 | 
				
			||||||
 | 
					                    edit_url: 'home/encyclopedia_cate/edit',
 | 
				
			||||||
 | 
					                    del_url: 'home/encyclopedia_cate/del',
 | 
				
			||||||
 | 
					                    multi_url: 'home/encyclopedia_cate/multi',
 | 
				
			||||||
 | 
					                    import_url: 'home/encyclopedia_cate/import',
 | 
				
			||||||
 | 
					                    table: 'encyclopedia_cate',
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var table = $("#table");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 初始化表格
 | 
				
			||||||
 | 
					            table.bootstrapTable({
 | 
				
			||||||
 | 
					                url: $.fn.bootstrapTable.defaults.extend.index_url,
 | 
				
			||||||
 | 
					                pk: 'id',
 | 
				
			||||||
 | 
					                sortName: 'weigh',
 | 
				
			||||||
 | 
					                columns: [
 | 
				
			||||||
 | 
					                    [
 | 
				
			||||||
 | 
					                        {checkbox: true},
 | 
				
			||||||
 | 
					                        {field: 'id', title: __('Id')},
 | 
				
			||||||
 | 
					                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
 | 
				
			||||||
 | 
					                        {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
 | 
				
			||||||
 | 
					                        {field: 'flag', title: __('Flag'), operate: 'LIKE', formatter: Table.api.formatter.flag},
 | 
				
			||||||
 | 
					                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
 | 
				
			||||||
 | 
					                        {field: 'weigh', title: __('Weigh'), operate: false},
 | 
				
			||||||
 | 
					                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 | 
				
			||||||
 | 
					                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 | 
				
			||||||
 | 
					                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
 | 
				
			||||||
 | 
					                    ]
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 为表格绑定事件
 | 
				
			||||||
 | 
					            Table.api.bindevent(table);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        recyclebin: function () {
 | 
				
			||||||
 | 
					            // 初始化表格参数配置
 | 
				
			||||||
 | 
					            Table.api.init({
 | 
				
			||||||
 | 
					                extend: {
 | 
				
			||||||
 | 
					                    'dragsort_url': ''
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var table = $("#table");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 初始化表格
 | 
				
			||||||
 | 
					            table.bootstrapTable({
 | 
				
			||||||
 | 
					                url: 'home/encyclopedia_cate/recyclebin' + location.search,
 | 
				
			||||||
 | 
					                pk: 'id',
 | 
				
			||||||
 | 
					                sortName: 'id',
 | 
				
			||||||
 | 
					                columns: [
 | 
				
			||||||
 | 
					                    [
 | 
				
			||||||
 | 
					                        {checkbox: true},
 | 
				
			||||||
 | 
					                        {field: 'id', title: __('Id')},
 | 
				
			||||||
 | 
					                        {field: 'name', title: __('Name'), align: 'left'},
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            field: 'deletetime',
 | 
				
			||||||
 | 
					                            title: __('Deletetime'),
 | 
				
			||||||
 | 
					                            operate: 'RANGE',
 | 
				
			||||||
 | 
					                            addclass: 'datetimerange',
 | 
				
			||||||
 | 
					                            formatter: Table.api.formatter.datetime
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            field: 'operate',
 | 
				
			||||||
 | 
					                            width: '140px',
 | 
				
			||||||
 | 
					                            title: __('Operate'),
 | 
				
			||||||
 | 
					                            table: table,
 | 
				
			||||||
 | 
					                            events: Table.api.events.operate,
 | 
				
			||||||
 | 
					                            buttons: [
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    name: 'Restore',
 | 
				
			||||||
 | 
					                                    text: __('Restore'),
 | 
				
			||||||
 | 
					                                    classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
 | 
				
			||||||
 | 
					                                    icon: 'fa fa-rotate-left',
 | 
				
			||||||
 | 
					                                    url: 'home/encyclopedia_cate/restore',
 | 
				
			||||||
 | 
					                                    refresh: true
 | 
				
			||||||
 | 
					                                },
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    name: 'Destroy',
 | 
				
			||||||
 | 
					                                    text: __('Destroy'),
 | 
				
			||||||
 | 
					                                    classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
 | 
				
			||||||
 | 
					                                    icon: 'fa fa-times',
 | 
				
			||||||
 | 
					                                    url: 'home/encyclopedia_cate/destroy',
 | 
				
			||||||
 | 
					                                    refresh: true
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            ],
 | 
				
			||||||
 | 
					                            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;
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
@ -63,7 +63,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 | 
				
			|||||||
                                }
 | 
					                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            }},
 | 
					                            }},
 | 
				
			||||||
 | 
					                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
 | 
				
			||||||
                        {field: 'type', title: __('Type'), searchList: {"in":__('Type in'),"out":__('Type out')}, formatter: Table.api.formatter.normal},
 | 
					                        {field: 'type', title: __('Type'), searchList: {"in":__('Type in'),"out":__('Type out')}, formatter: Table.api.formatter.normal},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        {field: 'url', title: __('Url'), operate: 'LIKE', formatter: Table.api.formatter.url},
 | 
					                        {field: 'url', title: __('Url'), operate: 'LIKE', formatter: Table.api.formatter.url},
 | 
				
			||||||
                        {field: 'weigh', title: __('Weigh'), operate: false},
 | 
					                        {field: 'weigh', title: __('Weigh'), operate: false},
 | 
				
			||||||
                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 | 
					                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user