修改文件上传问题

This commit is contained in:
guanj
2026-07-08 11:14:32 +08:00
parent 40b1092718
commit 83a827ba5b
11 changed files with 1568 additions and 1389 deletions

View File

@@ -18,6 +18,8 @@ import { calcShuYAxisRange, formatAxisLabel } from '@/utils/chartAxisHelper'
import url from '@/assets/img/point.png'
import { buildWaveCacheKey, getWaveCache, setWaveCache } from '@/utils/waveCache'
import { getShuWorker, buildWorkerPayload } from '@/utils/waveWorkerPool'
import { compactShuWaveResult } from '@/utils/waveDisplayHelper'
import { getWaveRawList } from '@/utils/waveRawStore'
let waveRequestId = 0
const pendingCacheKeys = new Map<number, string>()
@@ -75,7 +77,6 @@ const eventValue = ref('')
const persistTime = ref('')
const lineName = ref('')
const subName = ref('')
const waveDatas = ref<WaveData[]>([])
const ptpass = ref('')
const waveHeight = ref<number>()
const rmsHeight = ref<number>()
@@ -156,12 +157,13 @@ watch(
)
const applyWorkerResult = (data: any) => {
titles.value = data.titles
iphasic.value = data.iphasic
time.value = data.time
type.value = data.type
severity.value = data.severity
initWave(data.waveDatas, data.time, data.type, data.severity, isOpen.value)
const compacted = compactShuWaveResult(data, props.value)
titles.value = compacted.titles
iphasic.value = compacted.iphasic
time.value = compacted.time
type.value = compacted.type
severity.value = compacted.severity
initWave(compacted.waveDatas, compacted.time, compacted.type, compacted.severity, isOpen.value)
loading.value = false
}
@@ -179,7 +181,7 @@ onMounted(() => {
}
const cacheKey = pendingCacheKeys.get(data.requestId)
if (cacheKey) {
setWaveCache(cacheKey, data)
setWaveCache(cacheKey, compactShuWaveResult(data, props.value))
pendingCacheKeys.delete(data.requestId)
}
applyWorkerResult(data)
@@ -240,7 +242,10 @@ const waveData = (instantF: any, instantS: any, shunshiF: any, shunshiS: any, ti
// 在组件中修改initWaves函数
const initWaves = () => {
if (!props.wp?.listWaveData?.length) {
const hasData =
props.wp?.listWaveData?.length ||
getWaveRawList('shu', props.wp?.waveStoreKey)?.length
if (!hasData) {
initWave(null, null, null, null, null)
loading.value = false
return
@@ -480,8 +485,8 @@ const initWave = (
type: 'value',
name: '时间\n(ms)',
boundaryGap: false,
min: props.wp?.listWaveData[0][0] || 0,
max: props.wp?.listWaveData[props.wp?.listWaveData.length - 1][0] + 1 || 1,
min: props.wp?.waveTimeRange?.min ?? props.wp?.listWaveData?.[0]?.[0] ?? 0,
max: props.wp?.waveTimeRange?.max ?? ((props.wp?.listWaveData?.[props.wp?.listWaveData?.length - 1]?.[0] ?? 0) + 1),
title: {
text: 'ms',
textStyle: {
@@ -789,8 +794,8 @@ const drawPics = (
type: 'value',
name: '时间\n(ms)',
boundaryGap: false,
min: props.wp.listWaveData[0][0],
max: props.wp.listWaveData[props.wp.listWaveData.length - 1][0] + 1,
min: props.wp?.waveTimeRange?.min ?? props.wp?.listWaveData?.[0]?.[0] ?? 0,
max: props.wp?.waveTimeRange?.max ?? ((props.wp?.listWaveData?.[props.wp?.listWaveData?.length - 1]?.[0] ?? 0) + 1),
title: {
text: 'ms',
textStyle: {
@@ -944,7 +949,6 @@ const drawPics = (
}
const backbxlb = () => {
waveDatas.value = []
const charts = [
myChartess.value,
myChartess1.value,
@@ -996,4 +1000,6 @@ const getMinOpen = (temp: number, tempA: number, tempB: number): number => {
temp = temp < tempB ? temp : tempB
return temp
}
defineExpose({ backbxlb })
</script>