Commit 7fbdc8ddd70c1471e454d241e515405496f3c66c
Merge branch 'perf/dashboard-statistics' into 'main_dev'
perf: 优化首页消息统计和告警数统计tooltip提示 See merge request yunteng/thingskit-front!616
Showing
4 changed files
with
32 additions
and
11 deletions
| ... | ... | @@ -6,8 +6,24 @@ |
| 6 | 6 | @tabChange="onTabChange" |
| 7 | 7 | v-if="!isAdmin(role)" |
| 8 | 8 | > |
| 9 | + <template #alarm> | |
| 10 | + <div>告警数统计</div> | |
| 11 | + </template> | |
| 9 | 12 | <template #tabBarExtraContent> |
| 10 | 13 | <div class="extra-date"> |
| 14 | + <Tooltip overlay-class-name="!max-w-80 w-80"> | |
| 15 | + <template #title> | |
| 16 | + <div> 30天: 查询最近30天的数据,间隔时间为1天.</div> | |
| 17 | + <div>7天: 查询最近7天的数据,间隔时间为2小时.</div> | |
| 18 | + <div>1天: 查询最近1天的数据,间隔时间为30分钟.</div> | |
| 19 | + <div>1小时: 查询最近1小时的数据,间隔时间为5分钟.</div> | |
| 20 | + <div> | |
| 21 | + 间隔时间: | |
| 22 | + 以当前时间作为结束时间,往前推移对应天数或小时的时间作为开始时间,然后在此时间区间内进行分组聚合查询. | |
| 23 | + </div> | |
| 24 | + </template> | |
| 25 | + <QuestionCircleOutlined class="!mr-1" /> | |
| 26 | + </Tooltip> | |
| 11 | 27 | <template v-for="(item, index) in dateList" :key="item.value"> |
| 12 | 28 | <span |
| 13 | 29 | @click=" |
| ... | ... | @@ -99,7 +115,7 @@ |
| 99 | 115 | </template> |
| 100 | 116 | <script lang="ts" setup> |
| 101 | 117 | import { ref, reactive } from 'vue'; |
| 102 | - import { Card, DatePicker } from 'ant-design-vue'; | |
| 118 | + import { Card, DatePicker, Tooltip } from 'ant-design-vue'; | |
| 103 | 119 | import VisitAnalysis from './VisitAnalysis.vue'; |
| 104 | 120 | import VisitAnalysisBar from './VisitAnalysisBar.vue'; |
| 105 | 121 | import { RoleEnum, isAdmin } from '/@/enums/roleEnum'; |
| ... | ... | @@ -113,6 +129,7 @@ |
| 113 | 129 | import { useDate } from '../hooks/useDate'; |
| 114 | 130 | import { getTrendData } from '/@/api/dashboard'; |
| 115 | 131 | import { useGlobSetting } from '/@/hooks/setting'; |
| 132 | + import { QuestionCircleOutlined } from '@ant-design/icons-vue'; | |
| 116 | 133 | |
| 117 | 134 | defineExpose({ |
| 118 | 135 | isAdmin, |
| ... | ... | @@ -126,7 +143,7 @@ |
| 126 | 143 | const tabListTitle = [ |
| 127 | 144 | { |
| 128 | 145 | key: '1', |
| 129 | - tab: '告警数统计', | |
| 146 | + slots: { tab: 'alarm' }, | |
| 130 | 147 | }, |
| 131 | 148 | // { |
| 132 | 149 | // key: '2', | ... | ... |
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | > |
| 9 | 9 | <template #messageStatistics> |
| 10 | 10 | <span>消息量统计</span> |
| 11 | - <Tooltip> | |
| 11 | + <Tooltip overlay-class-name="!max-w-120 w-120"> | |
| 12 | 12 | <template #title> |
| 13 | 13 | <div>传输消息量: 即设备上报的消息数量,设备每上报一次数据量+1.</div> |
| 14 | 14 | <div class="mt-1"> |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | </template> |
| 22 | 22 | <template #tabBarExtraContent> |
| 23 | 23 | <div class="extra-date"> |
| 24 | - <Tooltip> | |
| 24 | + <Tooltip overlay-class-name="!max-w-80 w-80"> | |
| 25 | 25 | <template #title> |
| 26 | 26 | <div> 30天: 查询最近30天的数据,间隔时间为1天.</div> |
| 27 | 27 | <div>7天: 查询最近7天的数据,间隔时间为2小时.</div> | ... | ... |
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | legend: { |
| 41 | 41 | data: ['告警数'], |
| 42 | 42 | left: 'center', |
| 43 | - formatter: (name) => `${name} ${alarmTotal}`, | |
| 43 | + formatter: (name) => `汇总${name} ${alarmTotal}`, | |
| 44 | 44 | }, |
| 45 | 45 | xAxis: { |
| 46 | 46 | type: 'time', |
| ... | ... | @@ -80,7 +80,7 @@ |
| 80 | 80 | legend: { |
| 81 | 81 | data: ['告警数'], |
| 82 | 82 | left: 'center', |
| 83 | - formatter: (name) => `${name} ${alarmTotal}`, | |
| 83 | + formatter: (name) => `汇总${name} ${alarmTotal}`, | |
| 84 | 84 | }, |
| 85 | 85 | xAxis: { |
| 86 | 86 | type: 'time', | ... | ... |
| ... | ... | @@ -44,10 +44,12 @@ |
| 44 | 44 | type: 'time', |
| 45 | 45 | }, |
| 46 | 46 | legend: { |
| 47 | - data: ['总计传输数据点', '总计传输消息量'], | |
| 47 | + data: ['传输数据点', '传输消息量'], | |
| 48 | 48 | left: 'center', |
| 49 | 49 | formatter: (name) => { |
| 50 | - return name === '传输数据点' ? `${name} ${dataPointTotal}` : `${name} ${messageTotal}`; | |
| 50 | + return name === '传输数据点' | |
| 51 | + ? `汇总${name} ${dataPointTotal}` | |
| 52 | + : `汇总${name} ${messageTotal}`; | |
| 51 | 53 | }, |
| 52 | 54 | }, |
| 53 | 55 | |
| ... | ... | @@ -60,7 +62,7 @@ |
| 60 | 62 | }, |
| 61 | 63 | series: [ |
| 62 | 64 | { |
| 63 | - name: '总计传输数据点', | |
| 65 | + name: '传输数据点', | |
| 64 | 66 | type: 'line', |
| 65 | 67 | stack: 'total', |
| 66 | 68 | data: props.dataPointList, |
| ... | ... | @@ -68,7 +70,7 @@ |
| 68 | 70 | color: '#5AEEED', |
| 69 | 71 | }, |
| 70 | 72 | { |
| 71 | - name: '总计传输消息量', | |
| 73 | + name: '传输消息量', | |
| 72 | 74 | type: 'line', |
| 73 | 75 | stack: 'total', |
| 74 | 76 | // barWidth: '10%', |
| ... | ... | @@ -105,7 +107,9 @@ |
| 105 | 107 | data: ['传输数据点', '传输消息量'], |
| 106 | 108 | left: 'center', |
| 107 | 109 | formatter: (name) => { |
| 108 | - return name === '传输数据点' ? `${name} ${dataPointTotal}` : `${name} ${messageTotal}`; | |
| 110 | + return name === '传输数据点' | |
| 111 | + ? `汇总${name} ${dataPointTotal}` | |
| 112 | + : `汇总${name} ${messageTotal}`; | |
| 109 | 113 | }, |
| 110 | 114 | }, |
| 111 | 115 | ... | ... |