diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml index d0f2247..8499f6f 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml @@ -325,7 +325,7 @@ SELECT SELECT DATE_FORMAT( r.check_time, '%Y-%m' ) date_time, r.hidden_danger_grade, - sum( CASE WHEN r.hidden_danger_id IS NOT NULL THEN 1 ELSE 0 END ) 'value' + IFNULL(SUM(r.hd_count),0) 'value' FROM ehs_hidden_danger r diff --git a/ruoyi-ui/src/views/ehs/ehsExamples/index.vue b/ruoyi-ui/src/views/ehs/ehsExamples/index.vue index 8a0ba69..01a2347 100644 --- a/ruoyi-ui/src/views/ehs/ehsExamples/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsExamples/index.vue @@ -215,6 +215,7 @@ export default { console.log(tab, event); }, async leftCenterinit() { + this.year = new Date().getFullYear(); let res = await getDangerList(this.year); let temp = res.data; let legendData = [];