123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Admin\Actions\Grid;
- use App\Admin\Forms\ProductAudit as ProductAuditForm;
- use Dcat\Admin\Grid\BatchAction;
- use Dcat\Admin\Grid\RowAction;
- use Dcat\Admin\Widgets\Modal;
- class ProductAudit extends RowAction
- {
- public function title()
- {
- return '<i class="feather icon-check-square"></i> '. admin_trans_label('audit');
- }
- public function render()
- {
- $form = ProductAuditForm::make()->payload(['id' => $this->getKey()]);
- // 实例化表单类
- return Modal::make()
- ->lg()
- ->title($this->title)
- ->body($form)
- // 因为此处使用了表单异步加载功能,所以一定要用 onLoad 方法
- ->button($this->title());
- }
- }
|