Browse Source

feat: 无数据优化

main
betaqi 2 months ago
parent
commit
9be6a06930
  1. 2
      global.types/components.d.ts
  2. 1
      src/views/stationData/components/deviceDrawer.vue
  3. 3
      src/views/stationData/components/newDataChart.vue
  4. 8
      src/views/stationData/transferData.vue

2
global.types/components.d.ts vendored

@ -24,6 +24,8 @@ declare module 'vue' { @@ -24,6 +24,8 @@ declare module 'vue' {
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElEmpt: typeof import('element-plus/es')['ElEmpt']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']

1
src/views/stationData/components/deviceDrawer.vue

@ -246,6 +246,7 @@ const checkPointList = ref<IMyPoint[]>([]) @@ -246,6 +246,7 @@ const checkPointList = ref<IMyPoint[]>([])
function onchangePoints(checkPoints: IMyPoint[]) {
checkPointList.value = []
checkPointList.value = checkPoints
chartDatas.clear()
axisData.clear()

3
src/views/stationData/components/newDataChart.vue

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<template>
<div class="device-data-chart">
<v-chart class="chart" :option="chartOption" :autoresize="autoresize" :loading-options="loadingOpt"
<el-empty v-if="legends.length > 0 && chartDatas.size == 0" description="description" />
<v-chart v-else class="chart" :option="chartOption" :autoresize="autoresize" :loading-options="loadingOpt"
:loading="loading" ref="chartRef" @legendselectchanged="changeLegend" />
</div>
</template>

8
src/views/stationData/transferData.vue

@ -616,7 +616,7 @@ function zmqUpgradeCb(msg: PubMsgData) { @@ -616,7 +616,7 @@ function zmqUpgradeCb(msg: PubMsgData) {
const offTransferDlg = ref<typeof OffTransferDlg>()
const pubIdWithOffDevice = new Map<string, { offDevice: IOfflineDevice; action: 'import' }>()
const importQueue = ref<{ msg: PublishMsg<'import'>; offDevice: IOfflineDevice }[]>([]) //
const importQueue = ref<{ msg: PublishMsg<'import'>; offDevice: IOfflineDevice }[]>([])
const isImporting = ref(false)
async function processNextImport() {
@ -635,12 +635,10 @@ async function processNextImport() { @@ -635,12 +635,10 @@ async function processNextImport() {
}
function onOffDeviceTransfer(msg: PublishMsg<'import'>[], offDevice: IOfflineDevice[]) {
//
msg.forEach((m, index) => {
importQueue.value.push({ msg: m, offDevice: offDevice[index] })
})
//
processNextImport()
onBatchCancel()
openTransferMask('import')
@ -669,7 +667,6 @@ function zmqImportCb(msg: PubMsgData) { @@ -669,7 +667,6 @@ function zmqImportCb(msg: PubMsgData) {
}
if (code !== ZmqMsgResultType.PROGRESS) {
//
importQueue.value.shift()
isImporting.value = false
if (code === ZmqMsgResultType.ERROR) {
@ -679,7 +676,6 @@ function zmqImportCb(msg: PubMsgData) { @@ -679,7 +676,6 @@ function zmqImportCb(msg: PubMsgData) {
status: 'error'
})
}
//
processNextImport()
}
}
@ -696,11 +692,9 @@ function zmqImportTimeoutCb(msg: TimeoutMsg) { @@ -696,11 +692,9 @@ function zmqImportTimeoutCb(msg: TimeoutMsg) {
device: offDevice,
status: 'error'
})
//
importQueue.value.shift()
isImporting.value = false
//
processNextImport()
}
}

Loading…
Cancel
Save