修改文件上传问题
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
@@ -55,10 +55,12 @@
|
||||
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import analytics from '@/components/echarts/analytics.vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, shallowRef } from 'vue'
|
||||
import { analysis } from '@/api/advance-boot/analyse'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { getMonitorEventAnalyseWave, downloadWaveFile } from '@/api/event-boot/transient'
|
||||
import { buildWaveStoreKey, registerWaveRaw, buildSlimWp, releaseWaveRaw } from '@/utils/waveRawStore'
|
||||
import { clearWaveCache } from '@/utils/waveCache'
|
||||
const emit = defineEmits(['backbxlb'])
|
||||
interface Props {
|
||||
// boxoList: any
|
||||
@@ -88,7 +90,7 @@ const shushiboxiRef = ref()
|
||||
const bxecharts = ref(mainHeight(145).height as any)
|
||||
const view2 = ref(true)
|
||||
const boxoList: any = ref(null)
|
||||
const wp = ref(null)
|
||||
const wp = shallowRef<any>(null)
|
||||
const showBoxi = ref(true)
|
||||
const view3 = ref(false)
|
||||
const view4 = ref(false)
|
||||
@@ -102,7 +104,9 @@ const open = async (row: any) => {
|
||||
if (res != undefined) {
|
||||
boxoList.value = row
|
||||
boxoList.value.pt = res.data.pt
|
||||
wp.value = res.data
|
||||
const storeKey = buildWaveStoreKey(row)
|
||||
registerWaveRaw(storeKey, res.data)
|
||||
wp.value = buildSlimWp(res.data, storeKey)
|
||||
loading.value = false
|
||||
view4.value = true
|
||||
}
|
||||
@@ -125,6 +129,9 @@ const bxhandleClick = (tab: any) => {
|
||||
// console.log(tab, event);
|
||||
}
|
||||
const backbxlb = () => {
|
||||
const storeKey = wp.value?.waveStoreKey
|
||||
releaseWaveRaw(storeKey, 'all')
|
||||
clearWaveCache()
|
||||
boxoList.value = null
|
||||
wp.value = null
|
||||
|
||||
@@ -154,8 +161,8 @@ const AdvancedAnalytics = () => {
|
||||
view2.value = false
|
||||
}
|
||||
const changeView = () => {
|
||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
||||
shushiboxiRef.value?.backbxlb?.()
|
||||
rmsboxiRef.value?.backbxlb?.()
|
||||
showBoxi.value = false
|
||||
setTimeout(() => {
|
||||
showBoxi.value = true
|
||||
|
||||
Reference in New Issue
Block a user