title($this->title); // $this->height(380); // $this->chartHeight(330); // $this->chartOption('chart.sparkline.enabled', false); // $this->chartOption('legend.position', 'top'); // $this->chartColors([$color->primary(), $color]); // // $this->chartOption('stroke.width', [2.5, 2.5]); // $this->chartOption('stroke.dashArray', [0, 5]); // // $this->chartSmooth(); // // // 卡片内容 // $this->withContent(mt_rand(1000, 5000).'k'); $this->content($this->grid()); } public function grid() { $grid = new Grid(); $grid->filter(function (Grid\Filter $filter) { $filter->panel(); $filter->equal('product_id')->select(function (){ return Product::select(['id','name'])->get()->pluck('name','id')->toArray(); })->width(2); $filter->like('name')->width(2); }); return $grid; } public function handle(Request $request) { // dd($contractNum); $this->withChart($this->contractNum, $this->receiptNum); } public function withContent($content) { return $this->content( <<