ConfigEditAction.php 759 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Module\System\Admin\Actions;
  3. use Dcat\Admin\Widgets\Modal;
  4. trait ConfigEditAction
  5. {
  6. protected $ConfigEditForm;
  7. public function render2()
  8. {
  9. $this->ConfigEditForm =$this->configEditForm();
  10. // 实例化表单类并传递自定义参数
  11. $form = $this->ConfigEditForm::make();
  12. $form->payload([
  13. 'id' => $this->getKey(),
  14. 'value' => $this->getRow()->value1
  15. ]);
  16. return Modal::make()
  17. ->lg()
  18. ->title($this->title())
  19. ->body($form)
  20. ->button($this->title());
  21. }
  22. public function configEditForm():string
  23. {
  24. return $this->ConfigEditForm;
  25. }
  26. }