提交代码
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" v-if="area">
|
<el-form-item label="区域" v-if="area">
|
||||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="select"></slot>
|
<slot name="select"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -81,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
const emit = defineEmits(['selectChange','areaChange'])
|
const emit = defineEmits(['selectChange', 'areaChange'])
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
const tableHeader = ref()
|
const tableHeader = ref()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
@@ -132,9 +132,8 @@ const headerFormSecondStyleClose = {
|
|||||||
padding: '0'
|
padding: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAreaChange = (data) => {
|
const onAreaChange = data => {
|
||||||
|
emit('areaChange', { label: data.label })
|
||||||
emit('areaChange', {label: data.label})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -142,7 +141,6 @@ watch(
|
|||||||
newVal => {
|
newVal => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
areaRef.value && areaRef.value.change()
|
areaRef.value && areaRef.value.change()
|
||||||
|
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -238,14 +236,14 @@ const onResetForm = () => {
|
|||||||
//时间重置成默认值
|
//时间重置成默认值
|
||||||
datePickerRef.value?.setTheDate(3)
|
datePickerRef.value?.setTheDate(3)
|
||||||
|
|
||||||
if(props.showTimeAll){
|
if (props.showTimeAll) {
|
||||||
timeAll.value = false
|
timeAll.value = false
|
||||||
delete tableStore.table.params.searchBeginTime
|
delete tableStore.table.params.searchBeginTime
|
||||||
delete tableStore.table.params.searchEndTime
|
delete tableStore.table.params.searchEndTime
|
||||||
delete tableStore.table.params.startTime
|
delete tableStore.table.params.startTime
|
||||||
delete tableStore.table.params.endTime
|
delete tableStore.table.params.endTime
|
||||||
delete tableStore.table.params.timeFlag
|
delete tableStore.table.params.timeFlag
|
||||||
delete tableStore.table.params.interval
|
delete tableStore.table.params.interval
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.datePicker && timeAll.value) {
|
if (props.datePicker && timeAll.value) {
|
||||||
@@ -264,7 +262,6 @@ const setTheDate = (val: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
|
|
||||||
tableStore.onTableAction('export', { showAllFlag: true })
|
tableStore.onTableAction('export', { showAllFlag: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,9 +98,10 @@ const dataSocket = reactive({
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
const socket = async () => {
|
const socket = async () => {
|
||||||
// const url = localStorage.getItem('WebSocketUrl3') || 'ws://192.168.2.130:10203/event/'
|
const url = localStorage.getItem('WebSocketUrl3') || 'null' //'ws://192.168.2.130:10203/event/'
|
||||||
const url = 'ws://192.168.2.130:10203/event/'
|
|
||||||
console.log('🚀 ~ socket ~ url:', url)
|
|
||||||
|
// const url = 'ws://192.168.1.68:10203/event/'
|
||||||
|
|
||||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||||
|
|
||||||
@@ -130,7 +131,10 @@ onMounted(() => {
|
|||||||
// const msg = JSON.parse(message.toString())
|
// const msg = JSON.parse(message.toString())
|
||||||
// console.log(msg)
|
// console.log(msg)
|
||||||
// })
|
// })
|
||||||
socket()
|
|
||||||
|
setTimeout(() => {
|
||||||
|
socket()
|
||||||
|
}, 3000)
|
||||||
})
|
})
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Flag } from '@element-plus/icons-vue/dist/types'
|
||||||
import { ElMessage, EVENT_CODE } from 'element-plus'
|
import { ElMessage, EVENT_CODE } from 'element-plus'
|
||||||
|
|
||||||
// 定义消息类型,用于类型检查
|
// 定义消息类型,用于类型检查
|
||||||
@@ -43,13 +44,9 @@ export default class SocketService {
|
|||||||
console.log('您的浏览器不支持WebSocket')
|
console.log('您的浏览器不支持WebSocket')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (url == 'null' || url == null) return
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// ws://192.168.1.69:10407/mgtt
|
|
||||||
// const url =
|
|
||||||
// (localStorage.getItem('WebSocketUrl') == 'null'
|
|
||||||
// ? 'ws://192.168.1.130:10405'
|
|
||||||
// : localStorage.getItem('WebSocketUrl')) + id
|
|
||||||
this.ws = new WebSocket(url)
|
this.ws = new WebSocket(url)
|
||||||
|
|
||||||
this.ws.onopen = () => this.handleOpen()
|
this.ws.onopen = () => this.handleOpen()
|
||||||
@@ -90,7 +87,7 @@ export default class SocketService {
|
|||||||
|
|
||||||
if (event.data == '连接成功') {
|
if (event.data == '连接成功') {
|
||||||
this.sendHeartbeat()
|
this.sendHeartbeat()
|
||||||
} else if (event.data == 'connect') {
|
} else if (event.data == 'over') {
|
||||||
} else if (event.data.length > 10) {
|
} else if (event.data.length > 10) {
|
||||||
let message: MessageType
|
let message: MessageType
|
||||||
try {
|
try {
|
||||||
@@ -112,7 +109,8 @@ export default class SocketService {
|
|||||||
// 丢弃或继续写你的逻辑
|
// 丢弃或继续写你的逻辑
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ElMessage.error(event.data)
|
this.callBackMapping['message']!({ Flag: false })
|
||||||
|
ElMessage.error(event.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ const makeUpSubmit = () => {
|
|||||||
logPopUp.value = true
|
logPopUp.value = true
|
||||||
}
|
}
|
||||||
const socket = async (form: any) => {
|
const socket = async (form: any) => {
|
||||||
const url = (localStorage.getItem('WebSocketUrl2') || 'ws://192.168.1.67:10405/api/recell/')
|
const url = (localStorage.getItem('WebSocketUrl2') || 'null')//'ws://192.168.1.67:10405/api/recell/')
|
||||||
logList.value = []
|
logList.value = []
|
||||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||||
await dataSocket.socketServe.send(form)
|
await dataSocket.socketServe.send(form)
|
||||||
|
|||||||
@@ -162,7 +162,7 @@
|
|||||||
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
||||||
<vxe-column field="deviceName" title="终端名称" minWidth="130px"></vxe-column>
|
<vxe-column field="deviceName" title="终端名称" minWidth="130px"></vxe-column>
|
||||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
||||||
<vxe-column v-if="VITE_FLAG" field="objName" title="监测对象" minWidth="130px"></vxe-column>
|
|
||||||
<vxe-column field="runFlag" title="运行状态" width="90px">
|
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag
|
<el-tag
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ const init = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const url = localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/'
|
const url = localStorage.getItem('WebSocketUrl') || 'null' //'ws://192.168.1.68:10407/api/pushMessage/'
|
||||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||||
@@ -768,6 +768,9 @@ const init = () => {
|
|||||||
let pids = monitoringPoint.state.pid.split(',')
|
let pids = monitoringPoint.state.pid.split(',')
|
||||||
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
||||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||||
|
if (res.Flag === false) {
|
||||||
|
return (loading.value = false)
|
||||||
|
}
|
||||||
txtContent.value = res.value
|
txtContent.value = res.value
|
||||||
let data = JSON.parse(res.value)
|
let data = JSON.parse(res.value)
|
||||||
time.value = data.TIME - 0
|
time.value = data.TIME - 0
|
||||||
|
|||||||
@@ -29,7 +29,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据筛选">
|
<el-form-item label="数据筛选">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入市公司、变电站、用户" />
|
<el-input
|
||||||
|
v-model="tableStore.table.params.searchValue"
|
||||||
|
clearable
|
||||||
|
placeholder="输入市公司、变电站、用户"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="通讯状态:">
|
<el-form-item label="通讯状态:">
|
||||||
@@ -102,8 +106,6 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" />
|
<Table ref="tableRef" />
|
||||||
@@ -115,6 +117,10 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
defineOptions({
|
||||||
|
name: 'harmonic-boot/run/terminalmessage'
|
||||||
|
})
|
||||||
|
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
|
|
||||||
const view = ref(true)
|
const view = ref(true)
|
||||||
@@ -159,7 +165,7 @@ const tableStore = new TableStore({
|
|||||||
{ field: 'manufacturer', title: '厂家', minWidth: 100 },
|
{ field: 'manufacturer', title: '厂家', minWidth: 100 },
|
||||||
|
|
||||||
{ field: 'devName', title: '终端名称', minWidth: 100 },
|
{ field: 'devName', title: '终端名称', minWidth: 100 },
|
||||||
{ field: 'ip', title: '网络参数' ,width:110 },
|
{ field: 'ip', title: '网络参数', width: 110 },
|
||||||
{ field: 'loginTime', title: '投运时间', minWidth: 90 },
|
{ field: 'loginTime', title: '投运时间', minWidth: 90 },
|
||||||
{ field: 'devType', title: '终端型号', minWidth: 100 },
|
{ field: 'devType', title: '终端型号', minWidth: 100 },
|
||||||
{ field: 'port', title: '端口', minWidth: 60 },
|
{ field: 'port', title: '端口', minWidth: 60 },
|
||||||
@@ -186,8 +192,7 @@ const tableStore = new TableStore({
|
|||||||
正常: 'success',
|
正常: 'success',
|
||||||
中断: 'danger'
|
中断: 'danger'
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
beforeSearchFun: () => {
|
beforeSearchFun: () => {
|
||||||
@@ -199,10 +204,10 @@ const tableStore = new TableStore({
|
|||||||
|
|
||||||
tableStore.table.params.runFlag = []
|
tableStore.table.params.runFlag = []
|
||||||
if (tableStore.table.params.runF != null && tableStore.table.params.runF != '') {
|
if (tableStore.table.params.runF != null && tableStore.table.params.runF != '') {
|
||||||
tableStore.table.params.runFlag = [tableStore.table.params.runF]
|
tableStore.table.params.runFlag = tableStore.table.params.runF
|
||||||
}
|
}
|
||||||
tableStore.table.params.comFlag = []
|
tableStore.table.params.comFlag = []
|
||||||
if (tableStore.table.params.comF != null&&tableStore.table.params.comF != '') {
|
if (tableStore.table.params.comF != null && tableStore.table.params.comF != '') {
|
||||||
tableStore.table.params.comFlag = tableStore.table.params.comF
|
tableStore.table.params.comFlag = tableStore.table.params.comF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,7 +225,6 @@ tableStore.table.params.scale = []
|
|||||||
tableStore.table.params.manufacturer = []
|
tableStore.table.params.manufacturer = []
|
||||||
tableStore.table.params.loadType = []
|
tableStore.table.params.loadType = []
|
||||||
|
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<vxe-column field="lineName" title="监测点" width="120"></vxe-column>
|
<vxe-column field="lineName" title="监测点" width="120"></vxe-column>
|
||||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)">
|
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ (row.featureAmplitude * 100).toFixed(2) }}
|
{{ row.featureAmplitude.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="duration" title="持续时间(s)"></vxe-column>
|
<vxe-column field="duration" title="持续时间(s)"></vxe-column>
|
||||||
|
|||||||
Reference in New Issue
Block a user