BatchEditEpisode.php 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Admin\Actions\Grid;
  3. use Dcat\Admin\Actions\Response;
  4. use Dcat\Admin\Grid\BatchAction;
  5. use Dcat\Admin\Traits\HasPermissions;
  6. use Dcat\Admin\Widgets\Modal;
  7. use Illuminate\Contracts\Auth\Authenticatable;
  8. use Illuminate\Database\Eloquent\Model;
  9. use Illuminate\Http\Request;
  10. use App\Admin\Actions\Form\BatchEditEpisodeForm;
  11. class BatchEditEpisode extends BatchAction
  12. {
  13. /**
  14. * @return string
  15. */
  16. protected $title = '批量设置';
  17. public function render()
  18. {
  19. $form = BatchEditEpisodeForm::make();
  20. return Modal::make()
  21. ->lg()
  22. ->title($this->title)
  23. ->body($form)
  24. ->onLoad($this->getModalScript())
  25. ->button($this->title);
  26. }
  27. protected function getModalScript()
  28. {
  29. return <<<JS
  30. //获取选中的ID
  31. let key = {$this->getSelectedKeysScript()}
  32. $("#batch-id").val(key)
  33. JS;
  34. }
  35. }