Commit ed95231e5d4b37a83e892418d4aece635aa2ba0d
1 parent
c3785e1a
fix: DEFECT-842 visual board dashboard component when value is not a number echo value 0
Showing
1 changed file
with
2 additions
and
2 deletions
| @@ -7,7 +7,7 @@ import { | @@ -7,7 +7,7 @@ import { | ||
| 7 | DataSource, | 7 | DataSource, |
| 8 | GradientInfo, | 8 | GradientInfo, |
| 9 | } from '/@/api/dataBoard/model'; | 9 | } from '/@/api/dataBoard/model'; |
| 10 | -import { isArray } from '/@/utils/is'; | 10 | +import { isArray, isNumber } from '/@/utils/is'; |
| 11 | import { buildUUID } from '/@/utils/uuid'; | 11 | import { buildUUID } from '/@/utils/uuid'; |
| 12 | 12 | ||
| 13 | export interface GradientInfoRecord { | 13 | export interface GradientInfoRecord { |
| @@ -256,7 +256,7 @@ export const update_instrument_2_font = (radioRecord: RadioRecord) => { | @@ -256,7 +256,7 @@ export const update_instrument_2_font = (radioRecord: RadioRecord) => { | ||
| 256 | }; | 256 | }; |
| 257 | 257 | ||
| 258 | const handleValue = (value: any) => { | 258 | const handleValue = (value: any) => { |
| 259 | - return Number(value).toFixed(2); | 259 | + return isNumber(value) ? Number(value).toFixed(2) : 0; |
| 260 | }; | 260 | }; |
| 261 | 261 | ||
| 262 | export const update_instrument_1_value = (params: DashBoardValue) => { | 262 | export const update_instrument_1_value = (params: DashBoardValue) => { |