修改实时地图
This commit is contained in:
parent
fc21b89982
commit
b226f189c3
@ -41,7 +41,7 @@
|
|||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<div class="top-item" style="border: none; color: #c60606">
|
<div class="top-item" style="border: none; color: #c60606">
|
||||||
<div class="top-item-title"> 异常 </div>
|
<div class="top-item-title"> 异常 </div>
|
||||||
<div class="top-item-num"> {{ data.taskStatusVO.abnormalNum || 0 }} </div>
|
<div class="top-item-num" style="color: #c60606"> {{ data.taskStatusVO.abnormalNum || 0 }} </div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -87,7 +87,7 @@
|
|||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<div class="top-item" style="border: none; color: #c60606">
|
<div class="top-item" style="border: none; color: #c60606">
|
||||||
<div class="top-item-title"> 故障 </div>
|
<div class="top-item-title"> 故障 </div>
|
||||||
<div class="top-item-num"> {{ data.statistics.fault || 0 }} </div>
|
<div class="top-item-num" style="color: #c60606"> {{ data.statistics.fault || 0 }} </div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -448,6 +448,7 @@ const carPointListFun = () => {
|
|||||||
// let data2 = JSON.parse(data['d0:65:78:c4:af:cc'])
|
// let data2 = JSON.parse(data['d0:65:78:c4:af:cc'])
|
||||||
// console.log(data2)
|
// console.log(data2)
|
||||||
}
|
}
|
||||||
|
|
||||||
//是否可以拖拽
|
//是否可以拖拽
|
||||||
const isDrag = ref(false)
|
const isDrag = ref(false)
|
||||||
const changeIsDrag = () => {
|
const changeIsDrag = () => {
|
||||||
@ -781,9 +782,19 @@ const linkWebSocket = (url) => {
|
|||||||
if (socketClient.value) {
|
if (socketClient.value) {
|
||||||
// 监听消息
|
// 监听消息
|
||||||
socketClient.value.onMessage((message) => {
|
socketClient.value.onMessage((message) => {
|
||||||
console.log('收到消息:', message)
|
console.log('收到消息:', message, window)
|
||||||
if (message.type == 'map_push') {
|
// ElMessage({
|
||||||
let data = JSON.parse(testJson.content)
|
// message: () => h('div', {
|
||||||
|
// onClick: () => lookError(),
|
||||||
|
// style: { cursor: 'pointer' }
|
||||||
|
// }, '这是一个可点击的消息'),
|
||||||
|
// showClose: true,
|
||||||
|
// duration: 0, // 让消息持续显示,直到用户关闭
|
||||||
|
// });
|
||||||
|
if (message == 'ping' || message == 'pong') return
|
||||||
|
let jsonMsg = JSON.parse(message)
|
||||||
|
if (jsonMsg.type == 'map_push') {
|
||||||
|
let data = JSON.parse(jsonMsg.content)
|
||||||
// console.log("============",data)
|
// console.log("============",data)
|
||||||
let dataList = []
|
let dataList = []
|
||||||
for (let key in data) {
|
for (let key in data) {
|
||||||
@ -795,8 +806,32 @@ const linkWebSocket = (url) => {
|
|||||||
// console.log('=====', dataList)
|
// console.log('=====', dataList)
|
||||||
testCarList.value = dataList
|
testCarList.value = dataList
|
||||||
}
|
}
|
||||||
|
if (jsonMsg.type == 'agv_warn') {
|
||||||
|
// ElMessage({
|
||||||
|
// dangerouslyUseHTMLString: true,
|
||||||
|
// message: `<span>${JSON.parse(jsonMsg.content)}</span> <el-button id="custom-button" @click="lookError">查看更多</el-button>`,
|
||||||
|
// })
|
||||||
|
ElMessage({
|
||||||
|
message: () =>
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
onClick: () => lookError(),
|
||||||
|
style: { cursor: 'pointer' }
|
||||||
|
},
|
||||||
|
`${JSON.parse(jsonMsg.content)}`
|
||||||
|
),
|
||||||
|
showClose: false,
|
||||||
|
duration: 2000, // 让消息持续显示,直到用户关闭
|
||||||
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const lookError = () => {
|
||||||
|
console.log('点击了')
|
||||||
}
|
}
|
||||||
// 发送websocket消息
|
// 发送websocket消息
|
||||||
const sendMessage = () => {
|
const sendMessage = () => {
|
||||||
@ -989,7 +1024,8 @@ const observeWidthChange = (id, callback) => {
|
|||||||
let stopObserving
|
let stopObserving
|
||||||
defineExpose({ getMapData }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ getMapData }) // 提供 open 方法,用于打开弹窗
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
carPointListFun()
|
window.lookError = lookError
|
||||||
|
// carPointListFun()
|
||||||
// getList()
|
// getList()
|
||||||
window.addEventListener('resize', computedRatio)
|
window.addEventListener('resize', computedRatio)
|
||||||
stopObserving = observeWidthChange('indexpage-container', (newWidth) => {
|
stopObserving = observeWidthChange('indexpage-container', (newWidth) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user