fix: 综合PUE通用1修改数据

This commit is contained in:
huanghao1412 2024-08-20 17:40:01 +08:00
parent 117fa5d72f
commit ce86b24b46

View File

@ -488,14 +488,31 @@ const toTwoDecimalPlaces = (num:number) => {
return parseFloat(num.toFixed(2)); return parseFloat(num.toFixed(2));
} }
// const resetData = () => {
// let a = toTwoDecimalPlaces(1 + Math.random() * 0.6)
// let b = toTwoDecimalPlaces(1 + Math.random() * 0.6)
// let c = toTwoDecimalPlaces(1 + Math.random() * 0.6)
// let d = toTwoDecimalPlaces(1 + Math.random() * 0.6)
// let e = toTwoDecimalPlaces(Math.random() * 5000)
// let f = toTwoDecimalPlaces(e * (0.8 + Math.random() * 0.1))
// let g = e - f
//
// dataArr.value = [a, b, c, d, e, f, g]
// option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e)
// option2.value.title[0].text = toTwoDecimalPlaces(f * 100 / e) + ''
// option3.value.series[0].data[0].value = toTwoDecimalPlaces(g * 100/ e)
// option3.value.title[0].text = toTwoDecimalPlaces(g * 100 / e) + ''
// }
const resetData = () => { const resetData = () => {
let random = 0.8 + Math.random() * 0.2
let a = toTwoDecimalPlaces(1 + Math.random() * 0.6) let a = toTwoDecimalPlaces(1 + Math.random() * 0.6)
let b = toTwoDecimalPlaces(1 + Math.random() * 0.6)
let c = toTwoDecimalPlaces(1 + Math.random() * 0.6) let c = toTwoDecimalPlaces(1 + Math.random() * 0.6)
let d = toTwoDecimalPlaces(1 + Math.random() * 0.6) let d = toTwoDecimalPlaces(1 + Math.random() * 0.6)
let e = toTwoDecimalPlaces(Math.random() * 5000) let f = 1152 * 4 * random
let f = toTwoDecimalPlaces(e * (0.8 + Math.random() * 0.1)) let g = 277 * 4 * random
let g = e - f let e = f + g
let b = e / f
dataArr.value = [a, b, c, d, e, f, g] dataArr.value = [a, b, c, d, e, f, g]
option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e) option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e)