cms update

This commit is contained in:
JaguarJack
2021-05-23 20:35:21 +08:00
parent 5abc675e5d
commit 034705bb3d
8 changed files with 263 additions and 65 deletions

View File

@@ -2,31 +2,36 @@
namespace catchAdmin\cms\tables\forms;
use catchAdmin\cms\model\Tags;
use catcher\library\form\Form;
use catchAdmin\cms\model\Articles as Article;
use catchAdmin\cms\model\Category;
class Articles extends Form
class Articles extends BaseForm
{
protected $table = 'cms_articles';
public function fields(): array
{
$categories = Category::field(['id', 'name', 'parent_id'])->select()->toTree();
// TODO: Implement fields() method.
return [
self::input('title', '标题')->required()->maxlength(100)->col(12),
self::cascader('category_id', '选择分类')
->options(
Category::field(['id', 'name', 'parent_id'])->select()->toTree()
)
->col(12)
->props(self::props('name', 'id', [
'checkStrictly' => true
]))
->filterable(true)
self::cascader('category_id', '选择分类', [])
->options($categories)
->clearable(true)
->style(['width' => '100%'])
->filterable(true)
->showAllLevels(false)
->props([
'props' => [
'value' => 'id',
'label' => 'name',
'checkStrictly' => true
],
])->style(['width' => '100%'])
->required()->col(8),
self::input('keywords', '关键字')->col(12),
self::image('封面', 'cover')->col(12),