Commit d7cb02da1d0b45df7a600259697a2f7893763de5
1 parent
17b0b4ce
fix: DEFECT-696 data board component page data charts data keep out
Showing
1 changed file
with
15 additions
and
9 deletions
| @@ -104,9 +104,9 @@ export const instrumentComponent1 = (params?: Partial<ComponentInfo>): EChartsOp | @@ -104,9 +104,9 @@ export const instrumentComponent1 = (params?: Partial<ComponentInfo>): EChartsOp | ||
| 104 | detail: { | 104 | detail: { |
| 105 | valueAnimation: true, | 105 | valueAnimation: true, |
| 106 | width: '60%', | 106 | width: '60%', |
| 107 | - lineHeight: 30, | 107 | + lineHeight: 10, |
| 108 | borderRadius: 8, | 108 | borderRadius: 8, |
| 109 | - offsetCenter: [0, '-15%'], | 109 | + offsetCenter: [0, '30%'], |
| 110 | fontSize: 14, | 110 | fontSize: 14, |
| 111 | fontWeight: 'bolder', | 111 | fontWeight: 'bolder', |
| 112 | formatter: `{value} ${unit ?? ''}`, | 112 | formatter: `{value} ${unit ?? ''}`, |
| @@ -220,6 +220,7 @@ export const instrumentComponent2 = (params?: Partial<ComponentInfo>): EChartsOp | @@ -220,6 +220,7 @@ export const instrumentComponent2 = (params?: Partial<ComponentInfo>): EChartsOp | ||
| 220 | valueAnimation: true, | 220 | valueAnimation: true, |
| 221 | formatter: `{value} ${unit ?? ''}`, | 221 | formatter: `{value} ${unit ?? ''}`, |
| 222 | color: params?.fontColor || 'inherit', | 222 | color: params?.fontColor || 'inherit', |
| 223 | + offsetCenter: [0, '70%'], | ||
| 223 | fontSize: 14, | 224 | fontSize: 14, |
| 224 | }, | 225 | }, |
| 225 | data: [ | 226 | data: [ |
| @@ -254,7 +255,8 @@ export const update_instrument_1_font = (radio: number) => { | @@ -254,7 +255,8 @@ export const update_instrument_1_font = (radio: number) => { | ||
| 254 | }; | 255 | }; |
| 255 | 256 | ||
| 256 | export const update_instrument_2_font = (radio: number) => { | 257 | export const update_instrument_2_font = (radio: number) => { |
| 257 | - const axisLabelFontSize = fontSize({ radio, basic: 10, max: 18 }); | 258 | + const axisLabelFontSize = fontSize({ radio, basic: 10, max: 16 }); |
| 259 | + const detailFontSize = fontSize({ radio, basic: 12 }); | ||
| 258 | return { | 260 | return { |
| 259 | series: [ | 261 | series: [ |
| 260 | { | 262 | { |
| @@ -262,31 +264,35 @@ export const update_instrument_2_font = (radio: number) => { | @@ -262,31 +264,35 @@ export const update_instrument_2_font = (radio: number) => { | ||
| 262 | fontSize: axisLabelFontSize, | 264 | fontSize: axisLabelFontSize, |
| 263 | }, | 265 | }, |
| 264 | detail: { | 266 | detail: { |
| 265 | - fontSize: axisLabelFontSize, | 267 | + fontSize: detailFontSize, |
| 266 | }, | 268 | }, |
| 267 | }, | 269 | }, |
| 268 | ], | 270 | ], |
| 269 | } as EChartsOption; | 271 | } as EChartsOption; |
| 270 | }; | 272 | }; |
| 271 | 273 | ||
| 272 | -export const update_instrument_1_value = (value) => { | 274 | +const handleValue = (value: any) => { |
| 275 | + return Number(value).toFixed(2); | ||
| 276 | +}; | ||
| 277 | + | ||
| 278 | +export const update_instrument_1_value = (value: number) => { | ||
| 273 | return { | 279 | return { |
| 274 | series: [ | 280 | series: [ |
| 275 | { | 281 | { |
| 276 | - data: [{ value }], | 282 | + data: [{ value: handleValue(value) }], |
| 277 | }, | 283 | }, |
| 278 | { | 284 | { |
| 279 | - data: [{ value }], | 285 | + data: [{ value: handleValue(value) }], |
| 280 | }, | 286 | }, |
| 281 | ], | 287 | ], |
| 282 | } as EChartsOption; | 288 | } as EChartsOption; |
| 283 | }; | 289 | }; |
| 284 | 290 | ||
| 285 | -export const update_instrument_2_value = (value) => { | 291 | +export const update_instrument_2_value = (value: number) => { |
| 286 | return { | 292 | return { |
| 287 | series: [ | 293 | series: [ |
| 288 | { | 294 | { |
| 289 | - data: [{ value }], | 295 | + data: [{ value: handleValue(value) }], |
| 290 | }, | 296 | }, |
| 291 | ], | 297 | ], |
| 292 | } as EChartsOption; | 298 | } as EChartsOption; |