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.
98 lines
2.5 KiB
98 lines
2.5 KiB
<?php |
|
|
|
namespace App\Admin\Metrics\Examples\Follow; |
|
|
|
use App\Models\SecondaryCollege; |
|
use Dcat\Admin\Widgets\Metrics\Round; |
|
use Illuminate\Http\Request; |
|
|
|
class AllColleges extends Round |
|
{ |
|
/** |
|
* 初始化卡片内容 |
|
*/ |
|
protected function init() |
|
{ |
|
parent::init(); |
|
|
|
$this->title('全校录取人数'); |
|
$this->chartLabels(['男生', '女生']); |
|
|
|
// 图表数据 |
|
$this->withChart([0, 0]); |
|
|
|
// 总数 |
|
$this->chartTotal('全部', 344); |
|
|
|
// $this->dropdown($data); |
|
} |
|
|
|
/** |
|
* 处理请求 |
|
* @param Request $request |
|
* @return void |
|
*/ |
|
public function handle(Request $request) |
|
{ |
|
// 卡片内容 |
|
$this->withContent(0, 0, 0); |
|
} |
|
|
|
/** |
|
* 设置图表数据. |
|
* @param array $data |
|
* @return $this |
|
*/ |
|
public function withChart(array $data): AllColleges |
|
{ |
|
return $this->chart([ |
|
'series' => $data, |
|
]); |
|
} |
|
|
|
/** |
|
* 卡片内容. |
|
* @param int $finished |
|
* @param int $pending |
|
* @param int $rejected |
|
* @return $this |
|
*/ |
|
public function withContent(int $finished, int $pending, int $rejected): AllColleges |
|
{ |
|
return $this->content( |
|
<<<HTML |
|
<div class="col-12 d-flex flex-column flex-wrap text-center" style="max-width: 220px"> |
|
<div class="chart-info d-flex justify-content-between mb-1 mt-2" > |
|
<div class="series-info d-flex align-items-center"> |
|
<i class="fa fa-circle-o text-bold-700 text-primary"></i> |
|
<span class="text-bold-600 ml-50">全部</span> |
|
</div> |
|
<div class="product-result"> |
|
<span>{$finished}</span> |
|
</div> |
|
</div> |
|
|
|
<div class="chart-info d-flex justify-content-between mb-1"> |
|
<div class="series-info d-flex align-items-center"> |
|
<i class="fa fa-circle-o text-bold-700 text-warning"></i> |
|
<span class="text-bold-600 ml-50">男生</span> |
|
</div> |
|
<div class="product-result"> |
|
<span>{$pending}</span> |
|
</div> |
|
</div> |
|
|
|
<div class="chart-info d-flex justify-content-between mb-1"> |
|
<div class="series-info d-flex align-items-center"> |
|
<i class="fa fa-circle-o text-bold-700 text-danger"></i> |
|
<span class="text-bold-600 ml-50">女生</span> |
|
</div> |
|
<div class="product-result"> |
|
<span>{$rejected}</span> |
|
</div> |
|
</div> |
|
</div> |
|
HTML |
|
); |
|
} |
|
}
|
|
|