Merge branch 'xhf' of http://git.znkjfw.com/ak/zn-admin-vue3-wcs into xhf
This commit is contained in:
commit
a2a664ab16
@ -4,9 +4,9 @@ NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
# VITE_BASE_URL='http://192.168.0.74:48080'
|
||||
VITE_BASE_URL='http://192.168.0.74:48080'
|
||||
# VITE_BASE_URL='http://192.168.0.153:48080'
|
||||
VITE_BASE_URL='http://192.168.0.45:48080'
|
||||
# VITE_BASE_URL='http://192.168.0.45:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
@ -41,5 +41,5 @@ export const createFile = (data: any) => {
|
||||
|
||||
// 上传文件
|
||||
export const updateFile = (data: any) => {
|
||||
return request.upload({ url: '/infra/file/upload', data })
|
||||
return request.upload({ url: '/infra/file/businessUploadFile', data })
|
||||
}
|
||||
|
@ -7,8 +7,10 @@ import axios from 'axios'
|
||||
* 获得上传 URL
|
||||
*/
|
||||
export const getUploadUrl = (): string => {
|
||||
return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/infra/file/upload'
|
||||
// return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/infra/file/upload'
|
||||
return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/infra/file/businessUploadFile'
|
||||
}
|
||||
|
||||
|
||||
export const useUpload = () => {
|
||||
// 后端上传地址
|
||||
|
@ -109,19 +109,11 @@
|
||||
? (carHeight / nowObject.showYamlJson.resolution / 100) * radio + 'px'
|
||||
: '0',
|
||||
transform: 'rotate(' + radianToDegree(item.data.pose2d.yaw) + 'deg)',
|
||||
|
||||
|
||||
zIndex: 9999
|
||||
}"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
font-size: 11px;
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
"
|
||||
>
|
||||
>
|
||||
<div style="font-size: 11px;position: absolute;top: -10px;left: 50%;transform: translateX(-50%);">
|
||||
{{ item.robotNo || '' }}
|
||||
</div>
|
||||
<img
|
||||
@ -771,16 +763,10 @@ const linkWebSocket = (url) => {
|
||||
data: JSON.parse(data[key])
|
||||
})
|
||||
}
|
||||
console.log('=====', data)
|
||||
dataList.forEach((item) => {
|
||||
// console.log('=====', item.data.pose2d.robotNo)
|
||||
if (item.data.pose2d.robotNo == 'zn002') {
|
||||
console.log(item)
|
||||
console.log('x', item.data.pose2d.x)
|
||||
console.log('y', item.data.pose2d.y)
|
||||
}
|
||||
})
|
||||
testCarList.value = dataList
|
||||
console.log('=====',dataList)
|
||||
|
||||
// testCarList.value = JSON.parse(JSON.stringify(dataList))
|
||||
testCarList.value = mergeCarArrays(testCarList.value, dataList)
|
||||
computedRatio()
|
||||
}
|
||||
//告警信息
|
||||
@ -828,6 +814,38 @@ const linkWebSocket = (url) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
const mergeCarArrays =(arr1, arr2) => {
|
||||
const result = [];
|
||||
const macAddressSet = new Set();
|
||||
// 先处理第一个数组中原本就有的元素,进行更新或保留
|
||||
for (const item1 of arr1) {
|
||||
const macAddress1 = item1.macAddress;
|
||||
macAddressSet.add(macAddress1);
|
||||
let foundInSecond = false;
|
||||
for (const item2 of arr2) {
|
||||
const macAddress2 = item2.macAddress;
|
||||
if (macAddress1 === macAddress2) {
|
||||
foundInSecond = true;
|
||||
// 更新pose2d信息
|
||||
item1.data.pose2d = item2.data.pose2d;
|
||||
result.push(item1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!foundInSecond) {
|
||||
// 如果没在第二个数组中找到,就不添加到结果中,相当于删除
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 再处理第二个数组中存在但第一个数组中不存在的元素,添加到结果中
|
||||
for (const item2 of arr2) {
|
||||
const macAddress2 = item2.macAddress;
|
||||
if (!macAddressSet.has(macAddress2)) {
|
||||
result.push(item2);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const setIsSelect = (arr1, arr2) => {
|
||||
for (let i = 0; i < arr1.length; i++) {
|
||||
const element = arr1[i]
|
||||
@ -902,10 +920,10 @@ const computedRatio = () => {
|
||||
item.origin = JSON.parse(nowObject.value.yamlJson).origin
|
||||
item.realX = convertActualToBrowser(item.data.pose2d.x, item.data.pose2d.y).x
|
||||
item.realY = convertActualToBrowser(item.data.pose2d.x, item.data.pose2d.y).y
|
||||
item.robotNo = item.data.pose2d.robotNo
|
||||
if (item.robotNo == 'zn002') {
|
||||
console.log('数据返回坐标', item.robotNo, item.data.pose2d.x, item.data.pose2d.y)
|
||||
console.log('计算返回坐标', item.robotNo, item.realX, item.realY)
|
||||
item.robotNo =item.data.pose2d.robotNo
|
||||
if(item.robotNo == 'zn002'){
|
||||
console.log('数据返回坐标',item.robotNo,item.data.pose2d.x,item.data.pose2d.y)
|
||||
console.log('计算返回坐标',item.robotNo,item.realX,item.realY)
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -1041,7 +1059,7 @@ const boxLeft = ref(0)
|
||||
const getLeftPx = () => {
|
||||
let indexpageContainer = document.getElementById('indexpage-container')
|
||||
// console.log('距离左边的距离', indexpageContainer.getBoundingClientRect().left)
|
||||
boxLeft.value = indexpageContainer?.getBoundingClientRect().left + 6
|
||||
boxLeft.value = indexpageContainer.getBoundingClientRect().left + 6
|
||||
console.log(boxLeft.value)
|
||||
}
|
||||
// 封装监听元素宽度变化的方法
|
||||
|
Loading…
Reference in New Issue
Block a user