| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace UCore\DcatAdmin\Metrics\Examples;
- use Dcat\Admin\Widgets\Metrics\Card;
- use Dcat\Admin\Widgets\Metrics\RadialBar;
- use Illuminate\Http\Request;
- class Number extends Card
- {
- protected $height = 140;
- protected $title ='Number';
- public function __construct($title = null, $icon = null)
- {
- if($title){
- $this->title($title);
- }
- if($icon){
- $this->icon($icon);
- }
- if ($options = $this->defaultChartOptions()) {
- $this->chartOptions = $options;
- }
- $this->init();
- }
- /**
- * 处理请求
- *
- * @param Request $request
- *
- * @return mixed|void
- */
- public function handle(Request $request)
- {
- $this->withContent(162);
- }
- /**
- * 卡片内容
- *
- * @param string $content
- *
- * @return $this
- */
- public function withContent($content)
- {
- return $this->content(
- <<<HTML
- <div class="d-flex flex-column flex-wrap text-center">
- <h1 class="font-lg-2 mt-2 mb-0">{$content}</h1>
- </div>
- HTML
- );
- }
- }
|