修改mqtt连接方式

This commit is contained in:
GGJ
2024-12-30 10:07:26 +08:00
parent 0f57e4b746
commit 6a06652532
19 changed files with 173 additions and 93 deletions

View File

@@ -86,7 +86,7 @@ const zblist = ref<any[]>([])
const init = () => {
return new Promise((resolve, reject) => {
queryByCode('Harmonic_Type').then(res => {
queryCsDictTree(res.data.id).then(res => {
queryCsDictTree(res.data?.id).then(res => {
zblist.value = res.data.map((item: any) => {
return {
value: item.id,
@@ -302,11 +302,11 @@ const search = () => {
} else {
echartsData.value = null
}
})
setTimeout(() => {
loading.value = false
}, 0)
}).catch(() => {
loading.value = false
})
}
</script>

View File

@@ -1,13 +1,15 @@
<template>
<div class="default-main">
<div class="analyze-dvr" v-show="view" :style="{ height: pageHeight.height }" v-loading="loading">
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
<Table v-if="view" ref="tableRef"></Table>
</div>
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
</div>
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
@handleHideCharts="isWaveCharts = false" :wp="wp" style="padding: 10px;"/>
<!-- <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<el-row>
<el-col :span="12">
<div v-if="view2" style="display: flex">
@@ -38,20 +40,21 @@
</rmsboxi>
</el-tab-pane>
</el-tabs>
<!-- <xiebofenxi ref="child" :bxshuju="bxshuju" @backfh="back"></xiebofenxi> -->
</div>
</div> -->
</div>
</template>
<script setup lang="ts">
import { ref, reactive, provide, onMounted } from 'vue'
import { ref, nextTick, provide, onMounted } from 'vue'
import { mainHeight } from '@/utils/layout'
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
import { analyseWave } from '@/api/common'
import shushiboxi from '@/components/echarts/shushiboxi.vue'
import rmsboxi from '@/components/echarts/rmsboxi.vue'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'govern/analyze/DVR'
})
@@ -60,11 +63,12 @@ const loading = ref(false)
const view = ref(true)
const view2 = ref(false)
const showBoxi = ref(true)
const isWaveCharts = ref(false)
const bxactiveName = ref('ssbx')
const boxoList = ref({})
const boxoList: any = ref({})
const wp = ref({})
const value = ref(1)
const waveFormAnalysisRef = ref()
const options = ref([
{
value: 1,
@@ -79,7 +83,8 @@ const tableStore = new TableStore({
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
method: 'POST',
column: [
{ title: '事件描述', field: 'evtParamPosition' },
{ title: '事件描述', field: 'showName' },
{ title: '发生位置', field: 'evtParamPosition' },
{ title: '持续时间(s)', field: 'evtParamTm' },
{ title: '暂降深度', field: 'evtParamVVaDepth' },
{ title: '发生时刻', field: 'startTime' },
@@ -100,20 +105,31 @@ const tableStore = new TableStore({
},
click: async row => {
row.loading = true
boxoList.value = row
row.loading1 = true
loading.value = true
isWaveCharts.value = true
await analyseWave(row.id)
.then(res => {
row.loading = false
row.loading1 = false
if (res != undefined) {
boxoList.value = row
boxoList.value.featureAmplitude = row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
// boxoList.value.systemType = 'WX'
wp.value = res.data
view.value = false
view2.value = true
}
loading.value = false
})
.catch(() => {
row.loading = false
row.loading1 = false
loading.value = false
})
nextTick(() => {
waveFormAnalysisRef.value && waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(false, 150)
})
}
},
{
@@ -127,7 +143,28 @@ const tableStore = new TableStore({
},
}
},
{
name: 'edit',
title: '波形下载',
type: 'primary',
icon: 'el-icon-Check',
loading: 'loading2',
render: 'basicButton',
disabled: row => {
// && row.evtParamTm < 20
return !row.wavePath
},
click: row => {
row.loading2 = true
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
window.open(url, '_self')
setTimeout(() => {
ElMessage.success('波形下载成功!')
row.loading2 = false
}, 1500)
}
},
]
}
],