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