ZengTao
2025-03-10 2e05d43a7da078224a40e6620544969799504a9f
UI-Project/src/views/Identify/identifwu.vue
@@ -9,12 +9,13 @@
              class="rect"
              @click="showDialog(rect.glassId)"
              :style="{ position: 'absolute',
              top: `${rect.yAxis}px`, left: `${rect.xAxis}px`, width: `${rect.width}px`, height: `${rect.height}px`,
              top: `${rect.yAxisa}px`, left: `${rect.xAxisa}px`, width: `${rect.width}px`, height: `${rect.height}px`,
              backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.state)
               }">
            <div class="centered-text">
              <div>{{ rect.glassId }}</div>
              <div>{{ rect.widtha }}*{{ rect.heighta }}</div>
              <div style="font-size: 20px;font-weight: bold;">{{ rect.glassId }}</div>
              <div style="font-size: 20px;font-weight: bold;">{{ rect.flowCardId }}</div>
              <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div>
            </div>
          </div>
        </div>
@@ -108,18 +109,24 @@
}
function getRectColor(state: number): string {
  switch (state) {
    case 0:
      return '#e1f3d8';
    case 100:
      return '#c8c9cc';
    case 110:
      return '#b3e19d';
    case 120:
      return '#f89898';
    case 0:
      return '#7AC5CD';
    case 1:
      return '#95d475';
    case -1:
      return '#99BBFF';
    case 2:
      return 'lightblue';
    case 3:
      return '#eebe77';
    case 4:
      return '#CD6090';
    case 8:
      return '#911005';
    case 9:
      return '#f3d19e';
      return '#4682B4';
    default:
      return '#CDAF95';
  }
}
// 更新矩形状态
@@ -140,12 +147,12 @@
          if (existingRect) {
            return {
              ...existingRect,
              xAxis: (6000 - (rect.xAxis + rect.width)) * scaleFactor,
              yAxis: rect.yAxis * scaleFactory,
              width: rect.width * scaleFactor,
              height: rect.height * scaleFactory,
              widtha: rect.width,
              heighta: rect.height,
              xAxisa: rect.xAxis * scaleFactor * 1.1,
              yAxisa: (3300 - (rect.yAxis + rect.edgHeight + 300)) * scaleFactory * 1.1,
              width: rect.edgWidth * scaleFactor * 1.1,
              height: rect.edgHeight * scaleFactory * 1.1,
              widtha: rect.edgWidth,
              heighta: rect.edgHeight,
              state: rect.state,
              // 保持 isActive 状态不变
            };
@@ -153,12 +160,12 @@
            // 如果不存在,则添加新矩形,默认 isActive 为 false
            return {
              ...rect,
              xAxis: (6000 - (rect.xAxis + rect.width)) * scaleFactor,
              yAxis: rect.yAxis * scaleFactory,
              width: rect.width * scaleFactor,
              height: rect.height * scaleFactory,
              widtha: rect.width,
              heighta: rect.height,
              xAxisa: rect.xAxis * scaleFactor * 1.1,
              yAxisa: (3300 - (rect.yAxis + rect.edgHeight + 300)) * scaleFactory * 1.1,
              width: rect.edgWidth * scaleFactor * 1.1,
              height: rect.edgHeight * scaleFactory * 1.1,
              widtha: rect.edgWidth,
              heighta: rect.edgHeight,
              state: rect.state,
              isActive: false,
              glassId: rect.glassId,
@@ -188,7 +195,7 @@
  justify-content: center;
  align-items: center;
  height: 100%; /* 确保div占据整个矩形的高度 */
  font-size: small;
  /* font-size: large; */
}
#line {
  position: absolute;