修改mqtt连接方式
This commit is contained in:
@@ -790,7 +790,7 @@ const trendRef: any = ref()
|
||||
//暂态事件组件
|
||||
const eventRef: any = ref()
|
||||
const mqttRef = ref()
|
||||
const url: any = inject('MQTTURL')
|
||||
const url: any = window.localStorage.getItem('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
@@ -806,6 +806,8 @@ const connectMqtt = () => {
|
||||
username: 't_user',
|
||||
password: 'njcnpqs'
|
||||
}
|
||||
|
||||
|
||||
mqttRef.value = mqtt.connect(url, options)
|
||||
}
|
||||
const getRealDataMqttMsg = async () => {
|
||||
|
||||
@@ -152,7 +152,7 @@ const clearRadioRowEvent = () => {
|
||||
}
|
||||
}
|
||||
const mqttRef = ref()
|
||||
const url: any = inject('MQTTURL')
|
||||
const url: any = window.localStorage.getItem('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 暂态事件-波形解析组件 -->
|
||||
<!-- 暂态事件-波形分析组件 -->
|
||||
<template>
|
||||
<div class="home">
|
||||
<div class="home_header">
|
||||
@@ -132,8 +132,10 @@ const handleBack = () => {
|
||||
emit('handleHideCharts')
|
||||
}
|
||||
const setHeight = (h: any, vh: any) => {
|
||||
if (h != false) {
|
||||
parentHeight.value = h
|
||||
}
|
||||
|
||||
parentHeight.value = h
|
||||
setTimeout(() => {
|
||||
bxecharts.value = mainHeight(vh).height
|
||||
}, 100)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<div class="view">
|
||||
<TableHeader datePicker ref="headerRef" v-if="!isWaveCharts" :showReset="false"></TableHeader>
|
||||
<Table ref="tableRef" v-if="!isWaveCharts" />
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef" @handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp" />
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -79,7 +79,7 @@ const tableStore: any = new TableStore({
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形解析',
|
||||
title: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Check',
|
||||
render: 'basicButton',
|
||||
|
||||
@@ -523,7 +523,7 @@ watch(
|
||||
}
|
||||
)
|
||||
const mqttRef = ref()
|
||||
const url: any = inject('MQTTURL')
|
||||
const url: any = window.localStorage.getItem('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
|
||||
@@ -83,7 +83,7 @@ const tableStore = new TableStore({
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形解析',
|
||||
title: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Check',
|
||||
render: 'basicButton',
|
||||
@@ -103,7 +103,7 @@ const tableStore = new TableStore({
|
||||
boxoList.value = row
|
||||
boxoList.value.systemType = 'WX'
|
||||
wp.value = res.data
|
||||
|
||||
|
||||
|
||||
}
|
||||
loading.value = false
|
||||
|
||||
Reference in New Issue
Block a user