谐波次数切换时,原始数据显示为T项NaN问题
This commit is contained in:
@@ -167,7 +167,7 @@ const checkResultData = reactive<CheckData.CheckResult[]>([])
|
|||||||
|
|
||||||
const popoverWidth: ComputedRef<string> = computed(() => {
|
const popoverWidth: ComputedRef<string> = computed(() => {
|
||||||
// return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 160 : 0)}px`
|
// return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 160 : 0)}px`
|
||||||
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 230 : 0)}px`
|
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 220 : 0)}px`
|
||||||
})
|
})
|
||||||
|
|
||||||
// 原始数据表格数据
|
// 原始数据表格数据
|
||||||
@@ -486,7 +486,7 @@ const formatHarmNum = (num: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setRawData = (data: CheckData.RawDataItem[]) => {
|
const setRawData = (data: CheckData.RawDataItem[]) => {
|
||||||
console.log("原始数据", data)
|
|
||||||
data.forEach((item: CheckData.RawDataItem) => {
|
data.forEach((item: CheckData.RawDataItem) => {
|
||||||
item.dataA = stringToFixed(item.dataA)
|
item.dataA = stringToFixed(item.dataA)
|
||||||
item.dataB = stringToFixed(item.dataB)
|
item.dataB = stringToFixed(item.dataB)
|
||||||
@@ -494,6 +494,7 @@ const setRawData = (data: CheckData.RawDataItem[]) => {
|
|||||||
item.dataT = stringToFixed(item.dataT)
|
item.dataT = stringToFixed(item.dataT)
|
||||||
})
|
})
|
||||||
Object.assign(rawTableData, data)
|
Object.assign(rawTableData, data)
|
||||||
|
console.log("原始数据", rawTableData)
|
||||||
}
|
}
|
||||||
|
|
||||||
const numberToFixed = (num: number): string => {
|
const numberToFixed = (num: number): string => {
|
||||||
@@ -512,12 +513,17 @@ const stringToFixed = (str: string): string => {
|
|||||||
if (str == null || str == undefined) {
|
if (str == null || str == undefined) {
|
||||||
return '/'
|
return '/'
|
||||||
} else {
|
} else {
|
||||||
let result = Number(str).toFixed(fixed)
|
let num = Number(str)
|
||||||
|
if (isNaN(num)) {
|
||||||
|
return '/'
|
||||||
|
}else{
|
||||||
|
let result = num.toFixed(fixed)
|
||||||
if (result === "-0.0000") {
|
if (result === "-0.0000") {
|
||||||
return result.replace(/-/g, "")
|
return result.replace(/-/g, "")
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getError = (num1: number, num2: number): string => {
|
const getError = (num1: number, num2: number): string => {
|
||||||
|
|||||||
Reference in New Issue
Block a user