修改mqtt连接方式
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
<div class="default-main">
|
||||
<el-tabs v-model.trim="activeName" type="border-card" class="demo-tabs">
|
||||
<el-tab-pane label="设备告警" name="1">
|
||||
<Device v-if="activeName == '1'" :deviceTree="deviceTree" />
|
||||
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="稳态越限告警" name="2">
|
||||
<Steady v-if="activeName == '2'" :deviceTree="deviceTree" />
|
||||
<Steady v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="暂态事件" name="3">
|
||||
<Transient v-if="activeName == '3'" :deviceTree="deviceTree" />
|
||||
<Transient v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="异常事件" name="4">
|
||||
<Abnormal v-if="activeName == '4'" :deviceTree="deviceTree" />
|
||||
<Abnormal v-if="activeName == '4'" :deviceTree="deviceTree" :key="key" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -28,6 +28,7 @@ defineOptions({
|
||||
})
|
||||
const deviceTree = ref([])
|
||||
const activeName = ref('1')
|
||||
const key = ref(0)
|
||||
getDeviceTree().then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
item.value = item.id
|
||||
@@ -43,6 +44,7 @@ getDeviceTree().then(res => {
|
||||
})
|
||||
})
|
||||
deviceTree.value = res.data
|
||||
key.value += 1
|
||||
})
|
||||
onMounted(() => { })
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -201,6 +201,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'name' },
|
||||
{ title: '网络设备ID', field: 'ndid' },
|
||||
{
|
||||
title: '设备类型',
|
||||
field: 'devType',
|
||||
@@ -208,6 +209,7 @@ const tableStore = new TableStore({
|
||||
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '设备型号',
|
||||
field: 'devModel',
|
||||
@@ -223,7 +225,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ title: '录入时间', field: 'createTime' },
|
||||
{ title: '网络设备ID', field: 'ndid' },
|
||||
|
||||
{
|
||||
title: '使用状态',
|
||||
render: 'switch',
|
||||
@@ -257,7 +259,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
passwordConfirm(value).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
@@ -79,10 +79,13 @@ const preservation = () => {
|
||||
ruleForm.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
emit('submitForm', formdata.value, title.value)
|
||||
formVisible.value = false
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const shutDown = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
|
||||
// 关闭
|
||||
const closeDialog = () => {
|
||||
@@ -99,6 +102,6 @@ const open = (text: string, row?: any) => {
|
||||
|
||||
formVisible.value = true
|
||||
}
|
||||
defineExpose({ open })
|
||||
defineExpose({ open,shutDown })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="mb10" style="display: flex; justify-content: flex-end">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:limit="1"
|
||||
:on-change="beforeUpload"
|
||||
>
|
||||
<el-upload ref="upload" action="" :auto-upload="false" :show-file-list="false" :limit="1"
|
||||
:on-change="beforeUpload">
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
|
||||
</el-upload>
|
||||
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出excel</el-button>
|
||||
<el-button type="primary" icon="el-icon-Check" @click="preservation">保存</el-button>
|
||||
<el-button icon="el-icon-ArrowLeftBold" @click="emit('shutDown')">返回</el-button>
|
||||
<el-button icon="el-icon-ArrowLeftBold" @click="emit('shutDown')">返回</el-button>
|
||||
</div>
|
||||
|
||||
<div style="display: flex">
|
||||
@@ -123,16 +117,25 @@ const submitForm = (formdata: any, text: string) => {
|
||||
params.append('name', formdata.name)
|
||||
params.append('reportType', formdata.reportType)
|
||||
params.append('reportForm', formdata.reportForm)
|
||||
ElMessage.info('正在保存请稍等!')
|
||||
if (text == '新增报表模板') {
|
||||
addTemplate(params).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
} else if (text == '编辑报表模板') {
|
||||
params.append('id', list.value.id)
|
||||
dateTemplateup(params).then(res => {
|
||||
ElMessage.success('编辑成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -147,7 +150,7 @@ const open = async (text: string, row?: any) => {
|
||||
info()
|
||||
}
|
||||
defineExpose({ open })
|
||||
onMounted(() => {})
|
||||
onMounted(() => { })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-tab-pane) {
|
||||
|
||||
@@ -99,6 +99,9 @@ const open = (text: string, row?: any) => {
|
||||
|
||||
formVisible.value = true
|
||||
}
|
||||
defineExpose({ open })
|
||||
const shutDown = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
defineExpose({ open,shutDown})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -125,16 +125,25 @@ const submitForm = (formdata: any, text: string) => {
|
||||
params.append('name', formdata.name)
|
||||
params.append('reportType', formdata.reportType)
|
||||
params.append('reportForm', formdata.reportForm)
|
||||
ElMessage.info('正在保存请稍等!')
|
||||
if (text == '新增报表模板') {
|
||||
addTemplate(params).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
} else if (text == '编辑报表模板') {
|
||||
params.append('id', list.value.id)
|
||||
dateTemplateup(params).then(res => {
|
||||
ElMessage.success('编辑成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user