优化
This commit is contained in:
parent
64213fedce
commit
d8c5e5a3f9
@ -5,7 +5,7 @@ VITE_DEV=true
|
|||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
# VITE_BASE_URL='http://192.168.77.50:48080'
|
# 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'
|
VITE_BASE_URL='http://10.10.5.5:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -68,25 +68,22 @@
|
|||||||
top: item.realY * radio + 'px',
|
top: item.realY * radio + 'px',
|
||||||
width: (carWidth / imgBgObj.resolution / 100) * radio + 'px',
|
width: (carWidth / imgBgObj.resolution / 100) * radio + 'px',
|
||||||
height: (carHeight / imgBgObj.resolution / 100) * radio + 'px',
|
height: (carHeight / imgBgObj.resolution / 100) * radio + 'px',
|
||||||
transform: 'rotate(' + radianToDegree(item.data.pose2d.yaw) + 'deg)',
|
|
||||||
zIndex: 9999
|
zIndex: 9999
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div style="font-size: 13px; color: #fff; z-index: 9999; background: #cb00c7">
|
||||||
style="
|
|
||||||
font-size: 15px;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 40%;
|
|
||||||
transform: translateX(-50%) translateY(-50%);
|
|
||||||
color: greenyellow;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ item.robotNo || '' }}
|
{{ item.robotNo || '' }}
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
src="@/assets/imgs/indexPage/chache-4备份 7@2x.png"
|
src="@/assets/imgs/indexPage/chache-4备份 7@2x.png"
|
||||||
style="width: 100%; height: 100%"
|
:style="{
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
transform: 'rotate(' + radianToDegree(item.data.pose2d.yaw) + 'deg)'
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -380,6 +377,7 @@ import { is } from 'bpmn-js/lib/util/ModelUtil'
|
|||||||
import JSONBigInt from 'json-bigint'
|
import JSONBigInt from 'json-bigint'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@ -736,6 +734,7 @@ const linkWebSocket = (url) => {
|
|||||||
// 车辆信息
|
// 车辆信息
|
||||||
if (jsonMsg.type == 'map_push') {
|
if (jsonMsg.type == 'map_push') {
|
||||||
let data = JSON.parse(jsonMsg.content)
|
let data = JSON.parse(jsonMsg.content)
|
||||||
|
// console.log(data, dayjs().format('HH:mm:ss SSS'))
|
||||||
let dataList = []
|
let dataList = []
|
||||||
for (let key in data) {
|
for (let key in data) {
|
||||||
dataList.push({
|
dataList.push({
|
||||||
@ -743,6 +742,7 @@ const linkWebSocket = (url) => {
|
|||||||
data: JSON.parse(data[key])
|
data: JSON.parse(data[key])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
testCarList.value = mergeArraysWithoutDelete(testCarList.value, dataList)
|
testCarList.value = mergeArraysWithoutDelete(testCarList.value, dataList)
|
||||||
testCarList.value.forEach((item) => {
|
testCarList.value.forEach((item) => {
|
||||||
item.originWidth = imgBgObj.width
|
item.originWidth = imgBgObj.width
|
||||||
@ -796,6 +796,7 @@ const linkWebSocket = (url) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 现在车辆的逻辑是这样 websoket map_push类型推送消息 每次推送新车 我就添加到车辆列表中 testCarList 不删除车辆
|
// 现在车辆的逻辑是这样 websoket map_push类型推送消息 每次推送新车 我就添加到车辆列表中 testCarList 不删除车辆
|
||||||
// 每几秒轮询调用查看当前楼层区域的在线车辆 如果不存在 则再把testCarList 中的车辆删除
|
// 每几秒轮询调用查看当前楼层区域的在线车辆 如果不存在 则再把testCarList 中的车辆删除
|
||||||
const robotByFloorAndAreaList = ref([]) // 机器人列表
|
const robotByFloorAndAreaList = ref([]) // 机器人列表
|
||||||
@ -811,13 +812,16 @@ const getRobotByFloorAndAreaList = () => {
|
|||||||
robotListTimerRef.value = setInterval(getRobotByFloorAndAreaList, 5000)
|
robotListTimerRef.value = setInterval(getRobotByFloorAndAreaList, 5000)
|
||||||
|
|
||||||
// 删掉不在线的车辆
|
// 删掉不在线的车辆
|
||||||
const filterArrayByRobotNo = (arr1, arr2) => {
|
const filterArrayByRobotNo = (fullArray, idArray) => {
|
||||||
return arr1.filter((item) => {
|
const idSet = new Set(idArray)
|
||||||
const robotNo = item.data.pose2d.robotNo
|
return fullArray.filter((item) => idSet.has(item.data.pose2d.robotNo))
|
||||||
return arr2.includes(robotNo)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//长时间情况下 有些车辆掉线 已经不在车辆列表里面 要剔除
|
||||||
|
// const isItemVisible = (item) => {
|
||||||
|
// return robotByFloorAndAreaList.value.includes(item.data.pose2d.robotNo)
|
||||||
|
// }
|
||||||
|
|
||||||
const mergeCarArrays = (arr1, arr2) => {
|
const mergeCarArrays = (arr1, arr2) => {
|
||||||
const result = []
|
const result = []
|
||||||
const macAddressSet = new Set()
|
const macAddressSet = new Set()
|
||||||
@ -1209,6 +1213,9 @@ onBeforeUnmount(() => {
|
|||||||
.indexpage-car-item {
|
.indexpage-car-item {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.affix-container-left {
|
.affix-container-left {
|
||||||
@ -1292,14 +1299,12 @@ onBeforeUnmount(() => {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
.sort-num-location {
|
.sort-num-location {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.popover-robot-no {
|
.popover-robot-no {
|
||||||
|
@ -76,10 +76,23 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
|
|||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
manualChunks: {
|
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}
|
optimizeDeps: {include, exclude}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user