Merge branch 'base' of gitee.com:paddy_technology/jiqu-mall-server into base
commit
4b700f8c13
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Extensions\Grid\Tools;
|
||||||
|
|
||||||
|
use App\Admin\Forms\DrawActivityTicketChange as DrawActivityTicketChangeForm;
|
||||||
|
use App\Models\DrawActivity;
|
||||||
|
use Dcat\Admin\Grid\Tools\AbstractTool;
|
||||||
|
use Dcat\Admin\Widgets\Modal;
|
||||||
|
|
||||||
|
class DrawActivityTicketChange extends AbstractTool
|
||||||
|
{
|
||||||
|
protected $style = 'btn btn-primary';
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
private DrawActivity $drawActivity,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function authorize($user): bool
|
||||||
|
{
|
||||||
|
return $user->can('dcat.admin.draw_activities.change_tickets');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按钮文本
|
||||||
|
*
|
||||||
|
* @return string|void
|
||||||
|
*/
|
||||||
|
public function title()
|
||||||
|
{
|
||||||
|
return '增加/扣除';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$form = DrawActivityTicketChangeForm::make();
|
||||||
|
$form->payload(['id' => $this->drawActivity->id]);
|
||||||
|
|
||||||
|
return Modal::make()
|
||||||
|
->lg()
|
||||||
|
->title($this->title())
|
||||||
|
->body($form)
|
||||||
|
->button($this->html());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置请求参数
|
||||||
|
*
|
||||||
|
* @return array|void
|
||||||
|
*/
|
||||||
|
public function parameters()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue