设备监控修改
This commit is contained in:
@@ -306,7 +306,7 @@ import {
|
||||
getOverLimitData
|
||||
} from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
import { deviceHisData, deviceRtData, getGroup } from '@/api/cs-device-boot/csGroup'
|
||||
import { ref, reactive, nextTick, onMounted, watch, onUnmounted } from 'vue'
|
||||
import { ref, reactive, nextTick, onMounted, watch, onUnmounted, inject } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import Trend from './tabs/trend.vue' //趋势数据
|
||||
@@ -346,7 +346,6 @@ const dataSet = ref('')
|
||||
const devTypeOptions = ref([])
|
||||
const devModelOptions = ref([])
|
||||
const tableData = ref<any[]>([])
|
||||
|
||||
const tableHeight = mainHeight(330).height
|
||||
const mangePopup = ref()
|
||||
const datePickerRef = ref()
|
||||
@@ -402,7 +401,7 @@ const handleTrend = async () => {
|
||||
})
|
||||
await getOverLimitData(lineId.value).then((res: any) => {
|
||||
console.log(res, '获取国标限制')
|
||||
if(res.code=='A0000'){
|
||||
if (res.code == 'A0000') {
|
||||
realTrendRef.value && realTrendRef.value.setOverLimitData(res.data)
|
||||
}
|
||||
})
|
||||
@@ -519,15 +518,13 @@ const pointTypeChange = (val: any, obj: any) => {
|
||||
nodeClick(obj)
|
||||
}
|
||||
const realTimeRef: any = ref()
|
||||
|
||||
//趋势数据组件
|
||||
const trendRef: any = ref()
|
||||
//暂态事件组件
|
||||
const eventRef: any = ref()
|
||||
const timer: any = ref()
|
||||
|
||||
const mqttRef = ref()
|
||||
|
||||
const url: any = inject('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
@@ -543,9 +540,6 @@ const connectMqtt = () => {
|
||||
username: 't_user',
|
||||
password: 'njcnpqs'
|
||||
}
|
||||
// 线上
|
||||
// const url = 'wss://pqmcn.com:8087/mqtt'
|
||||
const url = 'ws://192.168.1.24:8085/mqtt'
|
||||
mqttRef.value = mqtt.connect(url, options)
|
||||
}
|
||||
//tab点击事件
|
||||
@@ -762,7 +756,7 @@ const handleClick = async (tab?: any) => {
|
||||
//保留两位小数
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == 'number' && obj[i] != 0) {
|
||||
obj[i] = obj[i].toFixed(2)
|
||||
obj[i].toFixed(2)
|
||||
}
|
||||
}
|
||||
mqttMessage.value = obj
|
||||
|
||||
Reference in New Issue
Block a user