You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.1 KiB
92 lines
2.1 KiB
<?php |
|
/** |
|
* Banner.php |
|
* Date: 2021-01-11 17:40:20 |
|
* User: chenlong <vip_chenlong@163.com> |
|
*/ |
|
|
|
namespace app\admin\page; |
|
|
|
use app\common\BasePage; |
|
use sdModule\layui\TablePage; |
|
use sdModule\layui\tablePage\TableAux; |
|
use sdModule\layuiSearch\Form; |
|
use sdModule\layui\defaultForm\FormData; |
|
use sdModule\layuiSearch\SearchForm; |
|
use sdModule\layuiSearch\generate\TimeRange; |
|
|
|
|
|
/** |
|
* Class Banner |
|
* @package app\admin\page |
|
*/ |
|
class Banner extends BasePage |
|
{ |
|
/** |
|
* 获取创建列表table的数据 |
|
* @return TablePage |
|
*/ |
|
public function getTablePageData(): TablePage |
|
{ |
|
$table = TablePage::create([ |
|
TablePage::column(['type' => 'checkbox']), |
|
TableAux::column('sort', '排序'), |
|
TableAux::column('title', '标题'), |
|
TableAux::column('cover', '封面图', '@image'), |
|
TableAux::column('cover_url', '封面图路径'), |
|
TableAux::column('create_time', '创建时间'), |
|
]); |
|
|
|
$table->setHandleWidth(150); |
|
return $table; |
|
} |
|
|
|
/** |
|
* 生成表单的数据 |
|
* @return array |
|
*/ |
|
public function formData(): array |
|
{ |
|
return [ |
|
FormData::hidden('id'), |
|
FormData::text('sort', '排序'), |
|
FormData::text('title', '标题'), |
|
FormData::image('cover', '封面图'), |
|
FormData::text('cover_url', '封面图路径'), |
|
]; |
|
} |
|
|
|
/** |
|
* 列表页面的名字 |
|
* @return string |
|
*/ |
|
public function listPageName(): string |
|
{ |
|
return "banner列表"; |
|
} |
|
|
|
/** |
|
* 创建搜索表单的数据 |
|
* @return string |
|
*/ |
|
public function searchFormData():string |
|
{ |
|
$form_data = [ |
|
|
|
SearchForm::Text('i.title%%', "标题")->label(true)->html(), |
|
SearchForm::TimeRange("i.create_time_~", "创建时间")->label(true)->html(TimeRange::TYPE_DATETIME), |
|
]; |
|
return Form::CreateHTML($form_data); |
|
} |
|
|
|
/** |
|
* @return array 设置快捷搜索 |
|
*/ |
|
public function setQuickSearchField():array |
|
{ |
|
return [ |
|
|
|
]; |
|
} |
|
|
|
}
|
|
|