baseCRUD() ->filterTogglable(false) ->headerToolbar([ $this->createButton(true, 'lg'), ...$this->baseHeaderToolBar(), ]) ->columns([ TableColumn::make()->name('id')->label('ID')->sortable(true), TableColumn::make()->name('title')->label('标题'), TableColumn::make()->name('created_at')->label('创建时间')->type('datetime')->sortable(true), TableColumn::make()->name('updated_at')->label('更新时间')->type('datetime')->sortable(true), $this->rowActions(true, 'lg'), ]); return $this->baseList($crud); } public function form(): Form { return $this->baseForm()->body([ TextControl::make()->name('title')->label('标题')->required(true), TextControl::make()->name('sub_title')->label('副标题'), \amisMake()->ImageControl()->name('cover')->label('封面')->autoUpload(true), Components::make()->parentControl('', 'category_id', '分类'), Components::make()->fuEditorControl(), Components::make()->sortControl(), \amisMake()->DateTimeControl()->name('published_at')->label('发布时间')->description('*不填写则默认为创建时间'), \amisMake()->SwitchControl()->name('is_enable')->label('显示'), ]); } public function detail(): Form { return $this->baseDetail()->body([ TextControl::make()->static(true)->name('id')->label('ID'), TextControl::make()->static(true)->name('title')->label('标题'), TextControl::make()->static(true)->name('created_at')->label('创建时间'), TextControl::make()->static(true)->name('updated_at')->label('更新时间') ]); } }