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_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.153:48080'
|
||||||
VITE_BASE_URL='http://192.168.0.45:48080'
|
# VITE_BASE_URL='http://192.168.0.45:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
@ -41,5 +41,5 @@ export const createFile = (data: any) => {
|
|||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
export const updateFile = (data: any) => {
|
export const updateFile = (data: any) => {
|
||||||
return request.upload({ url: '/infra/file/upload', data })
|
return request.upload({ url: '/infra/file/businessUploadFile', data })
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,11 @@ import axios from 'axios'
|
|||||||
* 获得上传 URL
|
* 获得上传 URL
|
||||||
*/
|
*/
|
||||||
export const getUploadUrl = (): string => {
|
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 = () => {
|
export const useUpload = () => {
|
||||||
// 后端上传地址
|
// 后端上传地址
|
||||||
const uploadUrl = getUploadUrl()
|
const uploadUrl = getUploadUrl()
|
||||||
|
@ -113,15 +113,7 @@
|
|||||||
zIndex: 9999
|
zIndex: 9999
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div style="font-size: 11px;position: absolute;top: -10px;left: 50%;transform: translateX(-50%);">
|
||||||
style="
|
|
||||||
font-size: 11px;
|
|
||||||
position: absolute;
|
|
||||||
top: -10px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ item.robotNo || '' }}
|
{{ item.robotNo || '' }}
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
@ -771,16 +763,10 @@ const linkWebSocket = (url) => {
|
|||||||
data: JSON.parse(data[key])
|
data: JSON.parse(data[key])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log('=====', data)
|
console.log('=====',dataList)
|
||||||
dataList.forEach((item) => {
|
|
||||||
// console.log('=====', item.data.pose2d.robotNo)
|
// testCarList.value = JSON.parse(JSON.stringify(dataList))
|
||||||
if (item.data.pose2d.robotNo == 'zn002') {
|
testCarList.value = mergeCarArrays(testCarList.value, dataList)
|
||||||
console.log(item)
|
|
||||||
console.log('x', item.data.pose2d.x)
|
|
||||||
console.log('y', item.data.pose2d.y)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
testCarList.value = dataList
|
|
||||||
computedRatio()
|
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) => {
|
const setIsSelect = (arr1, arr2) => {
|
||||||
for (let i = 0; i < arr1.length; i++) {
|
for (let i = 0; i < arr1.length; i++) {
|
||||||
const element = arr1[i]
|
const element = arr1[i]
|
||||||
@ -902,10 +920,10 @@ const computedRatio = () => {
|
|||||||
item.origin = JSON.parse(nowObject.value.yamlJson).origin
|
item.origin = JSON.parse(nowObject.value.yamlJson).origin
|
||||||
item.realX = convertActualToBrowser(item.data.pose2d.x, item.data.pose2d.y).x
|
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.realY = convertActualToBrowser(item.data.pose2d.x, item.data.pose2d.y).y
|
||||||
item.robotNo = item.data.pose2d.robotNo
|
item.robotNo =item.data.pose2d.robotNo
|
||||||
if (item.robotNo == 'zn002') {
|
if(item.robotNo == 'zn002'){
|
||||||
console.log('数据返回坐标', item.robotNo, item.data.pose2d.x, item.data.pose2d.y)
|
console.log('数据返回坐标',item.robotNo,item.data.pose2d.x,item.data.pose2d.y)
|
||||||
console.log('计算返回坐标', item.robotNo, item.realX, item.realY)
|
console.log('计算返回坐标',item.robotNo,item.realX,item.realY)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1041,7 +1059,7 @@ const boxLeft = ref(0)
|
|||||||
const getLeftPx = () => {
|
const getLeftPx = () => {
|
||||||
let indexpageContainer = document.getElementById('indexpage-container')
|
let indexpageContainer = document.getElementById('indexpage-container')
|
||||||
// console.log('距离左边的距离', indexpageContainer.getBoundingClientRect().left)
|
// console.log('距离左边的距离', indexpageContainer.getBoundingClientRect().left)
|
||||||
boxLeft.value = indexpageContainer?.getBoundingClientRect().left + 6
|
boxLeft.value = indexpageContainer.getBoundingClientRect().left + 6
|
||||||
console.log(boxLeft.value)
|
console.log(boxLeft.value)
|
||||||
}
|
}
|
||||||
// 封装监听元素宽度变化的方法
|
// 封装监听元素宽度变化的方法
|
||||||
|
Loading…
Reference in New Issue
Block a user