链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

  1. <?php
  2. namespace App\Admin\Extensions;
  3. use Dcat\Admin\Grid\RowAction;
  4. use Dcat\Admin\Widgets\Modal;
  5. use Illuminate\Http\Request;
  6. class OrderDetailCopy extends RowAction
  7. {
  8. protected $title;
  9. protected $order_id;
  10. protected $currentPage;
  11. public function __construct($orderId,$currentPage,$title=null)
  12. {
  13. $this->order_id = $orderId;
  14. $this->currentPage = $currentPage;
  15. parent::__construct($title);
  16. }
  17. public function render()
  18. {
  19. // 实例化表单类并传递自定义参数
  20. $form = MyDetailPage::make(['order_id' => $this->order_id]);
  21. return Modal::make()
  22. ->xl()
  23. ->title('订单详情')
  24. ->body($form)
  25. ->button($this->title);
  26. }
  27. // /**
  28. // * 添加JS
  29. // * @return string
  30. // */
  31. // protected function script()
  32. // {
  33. // return <<<JS
  34. //$('.detail_{$this->order_id}').on('click', function () {
  35. // window.location.href ="detail?order_id={$this->order_id}&page={$this->currentPage}";
  36. // });
  37. //JS;
  38. // }
  39. //
  40. public function html()
  41. {
  42. $this->setHtmlAttribute(['class'=>"detail_{$this->order_id}"]);
  43. return parent::html();
  44. }
  45. }