wangfei
2024-08-15 65062cbdae525bd0b7e5639a5a149d942e3d1b03
UI-Project/src/views/Identify/identify.vue
@@ -142,11 +142,12 @@
      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 ,
@@ -166,12 +167,13 @@
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 ,
@@ -210,11 +212,12 @@
    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 ,