baseCRUD() ->filterTogglable(false) ->headerToolbar([ $this->createButton(true, 'lg'), ...$this->baseHeaderToolBar(), ]) ->filter($this->baseFilter()->actions([])->body([ TextControl::make()->name('name')->label('名称')->size('md'), amisMake()->SelectControl()->name('type')->label('类型')->options(MonitorMode::typeMap())->size('md'), Components::make()->keywordsTagControl('group_tags', '分组', 'device-group')->size('md'), amis('button')->label(__('admin.reset'))->actionType('clear-and-submit'), amis('submit')->label(__('admin.search'))->level('primary'), ])) ->columns([ TableColumn::make()->name('id')->label('ID')->sortable(true), TableColumn::make()->name('name')->label('名称'), TableColumn::make()->name('type')->type('mapping')->map(MonitorMode::typeMap())->label('类型'), TableColumn::make()->name('created_at')->label(__('admin.created_at'))->type('datetime')->sortable(true), amisMake()->Operation()->label(__('admin.actions'))->buttons([ $this->rowDeleteButton() ]), ]); return $this->baseList($crud); } public function form(): Form { return $this->baseForm()->body([ TextControl::make()->name('name')->label('名称'), \amisMake()->RadiosControl()->name('type')->label('类型')->options(MonitorMode::typeMap())->required(true), Components::make()->keywordsTagControl('group_tags', '分组', 'device-group'), Components::make()->sortControl('sort', __('admin.order')), TextControl::make()->name('is_enable')->type('switch')->default(1)->label('显示'), TextControl::make()->name('is_recommend')->type('switch')->default(0)->label('推荐'), ]); } public function detail(): Form { return $this->baseDetail()->body([ TextControl::make()->static()->name('id')->label('ID'), TextControl::make()->static()->name('created_at')->label(__('admin.created_at')), TextControl::make()->static()->name('updated_at')->label(__('admin.updated_at')) ]); } }