ProductAudit.php 758 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Admin\Actions\Grid;
  3. use App\Admin\Forms\ProductAudit as ProductAuditForm;
  4. use Dcat\Admin\Grid\BatchAction;
  5. use Dcat\Admin\Grid\RowAction;
  6. use Dcat\Admin\Widgets\Modal;
  7. class ProductAudit extends RowAction
  8. {
  9. public function title()
  10. {
  11. return '<i class="feather icon-check-square"></i> '. admin_trans_label('audit');
  12. }
  13. public function render()
  14. {
  15. $form = ProductAuditForm::make()->payload(['id' => $this->getKey()]);
  16. // 实例化表单类
  17. return Modal::make()
  18. ->lg()
  19. ->title($this->title)
  20. ->body($form)
  21. // 因为此处使用了表单异步加载功能,所以一定要用 onLoad 方法
  22. ->button($this->title());
  23. }
  24. }