链街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

<?php
namespace App\Admin\Extensions;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
use Illuminate\Http\Request;
class OrderDetailCopy extends RowAction
{
protected $title;
protected $order_id;
protected $currentPage;
public function __construct($orderId,$currentPage,$title=null)
{
$this->order_id = $orderId;
$this->currentPage = $currentPage;
parent::__construct($title);
}
public function render()
{
// 实例化表单类并传递自定义参数
$form = MyDetailPage::make(['order_id' => $this->order_id]);
return Modal::make()
->xl()
->title('订单详情')
->body($form)
->button($this->title);
}
// /**
// * 添加JS
// * @return string
// */
// protected function script()
// {
// return <<<JS
//$('.detail_{$this->order_id}').on('click', function () {
// window.location.href ="detail?order_id={$this->order_id}&page={$this->currentPage}";
// });
//JS;
// }
//
public function html()
{
$this->setHtmlAttribute(['class'=>"detail_{$this->order_id}"]);
return parent::html();
}
}