diff --git a/.env.local b/.env.local
index 6efbfd9f..2d5925a2 100644
--- a/.env.local
+++ b/.env.local
@@ -5,7 +5,7 @@ VITE_DEV=true
# 请求路径
# VITE_BASE_URL='http://192.168.77.50:48080'
-# VITE_BASE_URL='http://10.10.100.32:48080'
+# VITE_BASE_URL='http://10.10.100.19:48080'
VITE_BASE_URL='http://10.10.5.5:48080'
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
diff --git a/src/assets/imgs/indexPage/chache-4@2x.png b/src/assets/imgs/indexPage/chache-4@2x.png
index e20226b1..488f0bf6 100644
Binary files a/src/assets/imgs/indexPage/chache-4@2x.png and b/src/assets/imgs/indexPage/chache-4@2x.png differ
diff --git a/src/assets/imgs/indexPage/chache-4备份 5@2x.png b/src/assets/imgs/indexPage/chache-4备份 5@2x.png
index 313a6790..21cff0f9 100644
Binary files a/src/assets/imgs/indexPage/chache-4备份 5@2x.png and b/src/assets/imgs/indexPage/chache-4备份 5@2x.png differ
diff --git a/src/assets/imgs/indexPage/chache-4备份@2x.png b/src/assets/imgs/indexPage/chache-4备份@2x.png
index d5be5870..9542b7f5 100644
Binary files a/src/assets/imgs/indexPage/chache-4备份@2x.png and b/src/assets/imgs/indexPage/chache-4备份@2x.png differ
diff --git a/src/views/mapPage/realTimeMap/components/indexPage.vue b/src/views/mapPage/realTimeMap/components/indexPage.vue
index 8b54e5ac..ac840b69 100644
--- a/src/views/mapPage/realTimeMap/components/indexPage.vue
+++ b/src/views/mapPage/realTimeMap/components/indexPage.vue
@@ -68,25 +68,22 @@
top: item.realY * radio + 'px',
width: (carWidth / imgBgObj.resolution / 100) * radio + 'px',
height: (carHeight / imgBgObj.resolution / 100) * radio + 'px',
- transform: 'rotate(' + radianToDegree(item.data.pose2d.yaw) + 'deg)',
zIndex: 9999
}"
>
-
+
{{ item.robotNo || '' }}
@@ -380,6 +377,7 @@ import { is } from 'bpmn-js/lib/util/ModelUtil'
import JSONBigInt from 'json-bigint'
import { propTypes } from '@/utils/propTypes'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import dayjs from 'dayjs'
const message = useMessage() // 消息弹窗
@@ -736,6 +734,7 @@ const linkWebSocket = (url) => {
// 车辆信息
if (jsonMsg.type == 'map_push') {
let data = JSON.parse(jsonMsg.content)
+ // console.log(data, dayjs().format('HH:mm:ss SSS'))
let dataList = []
for (let key in data) {
dataList.push({
@@ -743,6 +742,7 @@ const linkWebSocket = (url) => {
data: JSON.parse(data[key])
})
}
+
testCarList.value = mergeArraysWithoutDelete(testCarList.value, dataList)
testCarList.value.forEach((item) => {
item.originWidth = imgBgObj.width
@@ -796,6 +796,7 @@ const linkWebSocket = (url) => {
})
}
}
+
// 现在车辆的逻辑是这样 websoket map_push类型推送消息 每次推送新车 我就添加到车辆列表中 testCarList 不删除车辆
// 每几秒轮询调用查看当前楼层区域的在线车辆 如果不存在 则再把testCarList 中的车辆删除
const robotByFloorAndAreaList = ref([]) // 机器人列表
@@ -811,13 +812,16 @@ const getRobotByFloorAndAreaList = () => {
robotListTimerRef.value = setInterval(getRobotByFloorAndAreaList, 5000)
// 删掉不在线的车辆
-const filterArrayByRobotNo = (arr1, arr2) => {
- return arr1.filter((item) => {
- const robotNo = item.data.pose2d.robotNo
- return arr2.includes(robotNo)
- })
+const filterArrayByRobotNo = (fullArray, idArray) => {
+ const idSet = new Set(idArray)
+ return fullArray.filter((item) => idSet.has(item.data.pose2d.robotNo))
}
+//长时间情况下 有些车辆掉线 已经不在车辆列表里面 要剔除
+// const isItemVisible = (item) => {
+// return robotByFloorAndAreaList.value.includes(item.data.pose2d.robotNo)
+// }
+
const mergeCarArrays = (arr1, arr2) => {
const result = []
const macAddressSet = new Set()
@@ -1209,6 +1213,9 @@ onBeforeUnmount(() => {
.indexpage-car-item {
position: absolute;
cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
.affix-container-left {
@@ -1292,14 +1299,12 @@ onBeforeUnmount(() => {
font-size: 13px;
user-select: none;
color: #000;
- font-weight: 600;
}
.sort-num-location {
position: absolute;
font-size: 13px;
user-select: none;
color: #000;
- font-weight: 600;
}
.popover-robot-no {
diff --git a/vite.config.ts b/vite.config.ts
index 7e15f84e..d88c5a38 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -76,10 +76,23 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
rollupOptions: {
output: {
manualChunks: {
- echarts: ['echarts'] // 将 echarts 单独打包,参考 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IAB1SX 讨论
- }
+ echarts: ['echarts'],
+ // 将 Vue 相关库单独打包
+ vue: ['vue', 'vue-router', 'pinia', 'vue-i18n'],
+ // 将常用组件库单独打包
+ vendor: ['element-plus', '@vueuse/core'],
+ },
+ // 分包策略
+ chunkFileNames: 'assets/js/[name]-[hash].js',
+ entryFileNames: 'assets/js/[name]-[hash].js',
+ assetFileNames: 'assets/[ext]/[name]-[hash].[ext]'
},
},
+ // 启用 CSS 代码分割
+ cssCodeSplit: true,
+ // 启用 gzip 压缩
+ reportCompressedSize: false,
+ chunkSizeWarningLimit: 2000
},
optimizeDeps: {include, exclude}
}