id('metric-card-'.Str::random(8)); $this->class('card'); $this->height(130); $this->dropdown([ '1' => '最近 1 天', '7' => '最近 7 天', '30' => '最近 30 天', '90' => '最近 90 天', ]); } /** * 卡片内容. * * @param string $new * @param string $open * @param string $response * * @return $this */ public function withContent($dataList ) { $string = ''; foreach ($dataList as $key => $value) { $value = number_format(floatval( $value), $this->decimal_places); $string .= <<

$key

{$value} HTML; } return $this->content( << $string HTML ); } }