| | |
| | | const rawRects = response.data[0]; |
| | | rawData.value = response.data; |
| | | totalPages.value = rawData.value.length; |
| | | const scaleFactor = 1621.78/6000; |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | width: rect.width * scaleFactor , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |
| | |
| | | const handleCurrentChange = (val: number) => { |
| | | currentPage.value = val; |
| | | const page = currentPage.value - 1 |
| | | const scaleFactor = 1621.78/6000; |
| | | adjustedRects.value = rawData.value[page]?.map(rect => ({ |
| | | // adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | width: rect.width * scaleFactor , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |
| | |
| | | webSocket = new WebSocket(socketUrl); |
| | | webSocket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | const scaleFactor = 1621.78/6000; |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085, |
| | | x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * 0.17, |
| | | width: rect.width * 0.2 , |
| | | width: rect.width * scaleFactor , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height: rect.height * 0.165 , |