wang
2024-06-06 10b1d48b7f7655d80e1e431257f3af4e00d5ef2e
UI-Project/src/views/Identify/identify.vue
@@ -38,12 +38,12 @@
  </el-scrollbar>
  </el-card>
</template>  
<script setup lang="ts">  
import { Delete, Upload } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, onMounted, onBeforeUnmount } from 'vue';  
import request from "@/utils/request"
import { WebSocketHost ,host} from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
const blind = ref(false)
const olWidth = ref(); 
@@ -76,12 +76,12 @@
      adjustedRects.value = rawRects.map(rect => ({  
        ...rect, // 复制原始对象的其他属性  
        x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3
        y_axis: (rect.y_axis*100) * 0.005,
        width: (rect.width*100) * 0.004 ,
        x_axis: (rect.x_axis*100) * 0.004, // 将x值除以3
        y_axis: (rect.y_axis*100) * 0.004,
        width: (rect.width*100) * 0.002 ,
        widtha: rect.width ,
        heighta: rect.height ,
        height:( rect.height*100) * 0.004 ,
        height:( rect.height*100) * 0.002 ,
        glass_state: rect.glass_state
      }));  
      console.log(adjustedRects.value);
@@ -175,7 +175,7 @@
    }  
  });  
}
const socketUrl = `ws://10.153.19.150:88/api/cacheGlass/api/talk/cacheGlass`;
const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
@@ -183,12 +183,12 @@
  // adjustedRects.value = data.currentCutTerritory[0]
  adjustedRects.value = data.currentCutTerritory[0].map(rect => ({  
        ...rect, // 复制原始对象的其他属性  
        x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3
        y_axis: (rect.y_axis*100) * 0.005,
        width: (rect.width*100) * 0.004 ,
        x_axis: (rect.x_axis*100) * 0.004, // 将x值除以3
        y_axis: (rect.y_axis*100) * 0.004,
        width: (rect.width*100) * 0.002 ,
        widtha: rect.width ,
        heighta: rect.height ,
        height:( rect.height*100) * 0.004 ,
        height:( rect.height*100) * 0.002 ,
        glass_state: rect.glass_state
      }));  
 // console.log("更新后数据", tableData);