Commit 76bbfae46ed364dec2670269bdc6e9d171d8c44f
1 parent
1598f927
perf: board component dashboard component dynamic set max value
Showing
2 changed files
with
4 additions
and
3 deletions
| ... | ... | @@ -42,7 +42,6 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
| 42 | 42 | |
| 43 | 43 | const severityMean = alarmLevel(severity); |
| 44 | 44 | |
| 45 | - console.log('enter'); | |
| 46 | 45 | notification.open({ |
| 47 | 46 | message: '设备告警', |
| 48 | 47 | duration, |
| ... | ... | @@ -63,8 +62,6 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
| 63 | 62 | ]), |
| 64 | 63 | icon: h(ExclamationCircleOutlined, { style: { color: '#faa22d' } }), |
| 65 | 64 | onClose: () => { |
| 66 | - console.log('enter close'); | |
| 67 | - // currentNotifyId = null; | |
| 68 | 65 | key = null; |
| 69 | 66 | }, |
| 70 | 67 | btn: h( | ... | ... |
| ... | ... | @@ -279,9 +279,12 @@ const handleValue = (value: any) => { |
| 279 | 279 | |
| 280 | 280 | export const update_instrument_1_value = (params: DashBoardValue) => { |
| 281 | 281 | const { value = 0, unit = '°C', fontColor } = params; |
| 282 | + let max = value > 1 ? Number(1 + Array(String(value).length).fill(0).join('')) / 2 : 100 / 2; | |
| 283 | + max = value > max ? max * 2 : max; | |
| 282 | 284 | return { |
| 283 | 285 | series: [ |
| 284 | 286 | { |
| 287 | + max: max < 100 ? 100 : max, | |
| 285 | 288 | data: [{ value: handleValue(value) }], |
| 286 | 289 | detail: { |
| 287 | 290 | formatter: `{value} ${unit ?? ''}`, |
| ... | ... | @@ -289,6 +292,7 @@ export const update_instrument_1_value = (params: DashBoardValue) => { |
| 289 | 292 | }, |
| 290 | 293 | }, |
| 291 | 294 | { |
| 295 | + max: max < 100 ? 100 : max, | |
| 292 | 296 | data: [{ value: handleValue(value) }], |
| 293 | 297 | }, |
| 294 | 298 | ], | ... | ... |