| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Module\System\Admin\Actions;
- use App\Module\System\Models\SysConfig;
- use Dcat\Admin\Contracts\LazyRenderable;
- use Dcat\Admin\Traits\LazyWidget;
- use UCore\DcatAdmin\Widgets\Form;
- /**
- * Bool 开关 配置修改表单
- *
- */
- class ConfigSwitchEditForm extends Form implements LazyRenderable
- {
- use LazyWidget;
- use ConfigEditForm;
- public function form()
- {
- $id = $this->payload['id'] ?? null;
- $model = SysConfig::query()->find($id);
- if(!$model){
- return $this->error('错误的')->refresh();
- }
- $this->display('k','Key')->value($model->keyname);
- $this->display('k','标题')->value($model->title);
- $this->display('k','描述')->value($model->desc);
- $this->switch('value','开关')->default($model->value);
- }
- }
|