Browse Source

修复预报到数据概览js错误

master
Hjj 4 days ago
parent
commit
68d0449f80
  1. 9
      app/Admin/Metrics/Examples/Follow/AllEnrollCollege.php
  2. 23
      app/Admin/Metrics/Examples/Follow/AllEnrollSpeciality.php
  3. 11
      app/Admin/Metrics/Examples/Follow/AllNewFollowCollege.php
  4. 11
      app/Admin/Metrics/Examples/Follow/AllNewFollowSpeciality.php

9
app/Admin/Metrics/Examples/Follow/AllEnrollCollege.php

@ -64,8 +64,15 @@ class AllEnrollCollege extends Round @@ -64,8 +64,15 @@ class AllEnrollCollege extends Round
// 女生
$girl = $all[2] ?? 0;
$this->chartLabels(['总人数', '男生', '女生']);
$manPercent = $total != 0 ? number_format(($man /$total) * 100) : 0;
$girlPercent = $total != 0 ? number_format(($girl / $total) * 100) : 0;
// 卡片内容
$this->withContent($total, $man, $girl)->height('220px');
$this->chartLabels(['男生', '女生']);
// 图表数据
$this->withChart([$manPercent, $girlPercent]);
// 总数
$this->chartTotal('总人数', $total);
}

23
app/Admin/Metrics/Examples/Follow/AllEnrollSpeciality.php

@ -66,8 +66,15 @@ class AllEnrollSpeciality extends Round @@ -66,8 +66,15 @@ class AllEnrollSpeciality extends Round
// 女生
$girl = $all[2] ?? 0;
$this->chartLabels(['总人数', '男生', '女生']);
$this->withContent($total, $man, $girl);
$manPercent = $total != 0 ? number_format(($man /$total) * 100) : 0;
$girlPercent = $total != 0 ? number_format(($girl / $total) * 100) : 0;
// 卡片内容
$this->withContent($total, $man, $girl)->height('220px');
$this->chartLabels(['男生', '女生']);
// 图表数据
$this->withChart([$manPercent, $girlPercent]);
// 总数
$this->chartTotal('总人数', $total);
}
@ -86,18 +93,6 @@ class AllEnrollSpeciality extends Round @@ -86,18 +93,6 @@ class AllEnrollSpeciality extends Round
}
/**
* @param int $percent
*
* @return $this
*/
public function up($percent)
{
return $this->footer(
"<i class=\"feather icon-trending-up text-success\" style=\"padding-left: 15px;\"></i> {$percent}人 为当前年份已导入新生人数"
);
}
/**
* 卡片内容.
*

11
app/Admin/Metrics/Examples/Follow/AllNewFollowCollege.php

@ -76,12 +76,15 @@ class AllNewFollowCollege extends Round @@ -76,12 +76,15 @@ class AllNewFollowCollege extends Round
// 女生
$girl = $all[2] ?? 0;
$manPercent = $total != 0 ? number_format(($man /$total) * 100) : 0;
$girlPercent = $total != 0 ? number_format(($girl / $total) * 100) : 0;
// 卡片内容
$this->withContent($total, $man, $girl)->height('220px');
$this->chartLabels(['男生', '女生']);
// 图表数据
$this->withChart([$man, $girl]);
$this->withChart([$manPercent, $girlPercent]);
// 总数
$this->chartTotal('总人数', $girl + $man);
// 卡片内容
$this->withContent($girl + $man, $man, $girl)->height('220px');
$this->chartTotal('总人数', $total);
}

11
app/Admin/Metrics/Examples/Follow/AllNewFollowSpeciality.php

@ -61,12 +61,15 @@ class AllNewFollowSpeciality extends Round @@ -61,12 +61,15 @@ class AllNewFollowSpeciality extends Round
// 女生
$girl = $all[2] ?? 0;
$manPercent = $total != 0 ? number_format(($man /$total) * 100) : 0;
$girlPercent = $total != 0 ? number_format(($girl / $total) * 100) : 0;
// 卡片内容
$this->withContent($total, $man, $girl)->height('220px');
$this->chartLabels(['男生', '女生']);
// 图表数据
$this->withChart([$man, $girl]);
$this->withChart([$manPercent, $girlPercent]);
// 总数
$this->chartTotal('总人数', $total);
// 卡片内容
$this->withContent($total, $man, $girl);
}
@ -77,7 +80,7 @@ class AllNewFollowSpeciality extends Round @@ -77,7 +80,7 @@ class AllNewFollowSpeciality extends Round
*/
public function withChart(array $data)
{
$this->chartColors(['#586cb1', '#dda451', '#ea5455']);
$this->chartColors(['#dda451', '#ea5455']);
return $this->chart([
'series' => $data,
]);

Loading…
Cancel
Save