wu
2024-12-23 b9b44b51b201e2f5a9a1f3665c7fb76b5690f9af
UI-Project/src/views/Identify/identifwu.vue
@@ -58,7 +58,6 @@
import request from "@/utils/request"
import {host, WebSocketHost} from '@/utils/constants'
import {useI18n} from 'vue-i18n'
const {t} = useI18n()
let language = ref(localStorage.getItem('lang') || 'zh')
const blind = ref(false)
@@ -84,7 +83,6 @@
const currentGlassRect = computed(() => {
  return adjustedRects.value.find(rect => rect.glass_id === currentGlassId.value);
});
function showDialog(glassId: number) {
  currentGlassId.value = glassId;
  blind.value = true;
@@ -92,7 +90,6 @@
      rect.glass_id === glassId ? {...rect, isActive: true} : rect
  );
}
const handleDialogClose = () => {
  adjustedRects.value = adjustedRects.value.map(rect => ({
    ...rect,
@@ -192,7 +189,6 @@
  } else {
  }
};
const handleCurrentChange = (val: number) => {
  currentPage.value = val;
  // window.localStorage.setItem('pagenumber', currentPage.value).
@@ -211,7 +207,6 @@
    glass_state: rect.glass_state
  }));
};
function getRectColor(state: number): string {
  switch (state) {
    case 0:
@@ -228,7 +223,6 @@
      return '#f3d19e';
  }
}
// 更新矩形状态
function updateRectStatus(glassId: string, status: number) {
  adjustedRects.value.forEach(rect => {
@@ -237,7 +231,6 @@
    }
  });
}
const connectWebSocket = () => {
  if (!webSocket) {
    const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
@@ -249,7 +242,6 @@
      if (data.currentCutTerritory && data.currentCutTerritory.length > 0) {
        const newRects = data.currentCutTerritory[0].map(rect => {
          const existingRect = adjustedRects.value.find(r => r.glass_id === rect.glass_id);
          if (existingRect) {
            return {
              ...existingRect,
@@ -291,20 +283,17 @@
    connectWebSocket();
  }
});
onUnmounted(() => {
  if (webSocket) {
    webSocket.close();
  }
});
</script>
<style scoped>
.rect {
  border: 1px solid black; /* 设置矩形的边框 */
  /* background-color: lightblue; 设置矩形的背景色   */
}
.centered-text {
  /* 设置文字居中样式 */
  /* display: flex; */
@@ -313,12 +302,10 @@
  height: 100%; /* 确保div占据整个矩形的高度 */
  font-size: small;
}
#rect {
  position: relative; /* 确保箭头可以相对于矩形定位 */
  /* 其他样式 */
}
#arrow {
  position: absolute;
  top: 70%; /* 箭头位于矩形中间 */
@@ -331,7 +318,6 @@
  border-right: 20px solid #911005; /* 右边框,形成箭头 */
  /* 根据需要调整边框大小和颜色 */
}
#line {
  position: absolute;
  top: 70%; /* 直线位于矩形中间 */
@@ -341,5 +327,4 @@
  width: 240px; /* 直线的长度,根据需要调整 */
  background-color: #911005; /* 直线的颜色 */
}
</style>