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.
50 lines
1.2 KiB
50 lines
1.2 KiB
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use App\Admin\Actions\Grid\CloneEquipResourceRecordAction;
|
|
use App\Admin\Repositories\EquipResourceRecord;
|
|
use App\Admin\Services\EquipInfoService;
|
|
use App\Http\Controllers\Controller;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Layout\Content;
|
|
|
|
class EquipInfoController extends Controller
|
|
{
|
|
/**
|
|
* 查看数据点
|
|
* @param Content $content
|
|
* @return Content
|
|
*/
|
|
public function index(Content $content)
|
|
{
|
|
return $content
|
|
->header('表格')
|
|
->description('表格功能展示')
|
|
->body($this->grid());
|
|
}
|
|
/**
|
|
* Make a grid builder.
|
|
*
|
|
* @return Grid
|
|
*/
|
|
protected function grid()
|
|
{
|
|
return Grid::make(null, function (Grid $grid) {
|
|
$param = request()->all();
|
|
|
|
$grid->column('at');
|
|
$grid->column('value');
|
|
$grid->model()->setData(EquipInfoService::getDatapoints($param));
|
|
$grid->disableCreateButton();
|
|
$grid->disableActions();
|
|
$grid->disableBatchDelete();
|
|
$grid->disablePagination();
|
|
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
$filter->between('at', 'At')->datetime();
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|