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.
80 lines
1.6 KiB
80 lines
1.6 KiB
<?php
|
|
|
|
namespace App\Admin\Actions\Grid;
|
|
|
|
use Dcat\Admin\Actions\Response;
|
|
use Dcat\Admin\Grid\BatchAction;
|
|
use Dcat\Admin\Traits\HasPermissions;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* 批量审核产品
|
|
* Class BatchAuditProduct
|
|
* @package App\Admin\Actions\Grid
|
|
*/
|
|
class BatchAuditProduct extends BatchAction
|
|
{
|
|
/**
|
|
* @return string
|
|
*/
|
|
protected $title = '批量审核';
|
|
|
|
public function __construct($title = null)
|
|
{
|
|
parent::__construct($title);
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
$redirect = request()->fullUrl();
|
|
|
|
return <<<HTML
|
|
<a data-name="{$this->parent->getName()}"
|
|
data-action="batch-delete"
|
|
data-redirect="{$redirect}"
|
|
data-url="{$this->resource()}"><i class="fa fa-check-square"></i> {$this->title}</a>
|
|
HTML;//拒绝图标:fa-times-circle
|
|
}
|
|
|
|
/**
|
|
* Handle the action request.
|
|
*
|
|
* @param Request $request
|
|
*
|
|
* @return Response
|
|
*/
|
|
public function handle(Request $request)
|
|
{
|
|
return $this->response()
|
|
->success('Processed successfully: '.json_encode($this->getKey()))
|
|
->redirect('/');
|
|
}
|
|
|
|
/**
|
|
* @return string|array|void
|
|
*/
|
|
public function confirm()
|
|
{
|
|
// return ['Confirm?', 'contents'];
|
|
}
|
|
|
|
/**
|
|
* @param Model|Authenticatable|HasPermissions|null $user
|
|
*
|
|
* @return bool
|
|
*/
|
|
protected function authorize($user): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function parameters()
|
|
{
|
|
return [];
|
|
}
|
|
}
|