Merge remote-tracking branch 'origin/hainan' into hainan
# Conflicts: # frontend/src/views/machine/freqConverter/components/freqConverterDipChart.vue
This commit is contained in:
@@ -125,23 +125,29 @@ const sortedChartPoints = computed(() => {
|
||||
|
||||
const sortedCharacteristicCurveData = computed(() => {
|
||||
return [...characteristicCurveData.value].sort((a, b) => {
|
||||
if (a.timeMs !== null && b.timeMs !== null && a.timeMs !== b.timeMs) {
|
||||
return a.timeMs - b.timeMs
|
||||
}
|
||||
|
||||
if (a.timeMs !== null && b.timeMs === null) {
|
||||
return -1
|
||||
}
|
||||
|
||||
if (a.timeMs === null && b.timeMs !== null) {
|
||||
return 1
|
||||
}
|
||||
|
||||
if (a.duration !== b.duration) {
|
||||
// 保留1位小数
|
||||
let aResidualVoltage = Math.floor(a.residualVoltage * 10) / 10
|
||||
let bResidualVoltage = Math.floor(b.residualVoltage * 10) / 10
|
||||
if (aResidualVoltage != bResidualVoltage) {
|
||||
return a.residualVoltage - b.residualVoltage;
|
||||
} else {
|
||||
let aDuration = a.duration * 1000 - a.duration * 1000 % 10
|
||||
let bDuration = b.duration * 1000 - b.duration * 1000 % 10
|
||||
if (aDuration != bDuration) {
|
||||
return a.duration - b.duration
|
||||
} else if (a.timeMs !== null && b.timeMs !== null && a.timeMs !== b.timeMs) {
|
||||
return a.timeMs - b.timeMs
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
|
||||
return a.residualVoltage - b.residualVoltage
|
||||
}
|
||||
// if (a.timeMs !== null && b.timeMs !== null && a.timeMs !== b.timeMs) {
|
||||
// return a.timeMs - b.timeMs
|
||||
// } else {
|
||||
// return 0
|
||||
// }
|
||||
//
|
||||
// return a.residualVoltage - b.residualVoltage
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user