ZengTao
2024-05-28 05beaea41133a9e1bfd544a2a5d5f727bb930468
UI-Project/src/views/Identify/identify.vue
@@ -21,21 +21,17 @@
     <!-- <div  class="centered-text" >NG24030401B01</div> -->
     <div  class="centered-text">
    <div>{{ rect.process_id }}</div>
    <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>
    <div style="margin-top: 50px;margin-left: -85px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
  </div>
  </div> 
  <!-- 点击弹出 -->
  <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
    <!-- <template #footer> -->
      <!-- <div id="dialog-footer"> -->
        <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)"  style="width: 120px;margin-left: 10px;">
          破损
        </el-button>
        <el-button  type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 120px;margin-top: 10px;">
          <el-icon class="el-icon--right"><Upload /></el-icon>
          人工拿走</el-button>
      <!-- </div> -->
    <!-- </template> -->
  </el-dialog> 
   </div>
  </div>  
@@ -82,6 +78,8 @@
        x_axis: (rect.x_axis*100) * 0.005, // 将x值除以3  
        y_axis: (rect.y_axis*100) * 0.005,
        width: (rect.width*100) * 0.004 ,
        widtha: rect.width ,
        heighta: rect.height ,
        height:( rect.height*100) * 0.004 ,
        glass_state: rect.glass_state
      }));  
@@ -113,6 +111,7 @@
      ElMessage.success(response.message);
      // window.location.reload() 
      blind.value = false;
      updateRectStatus(currentGlassId.value, 201);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -138,6 +137,7 @@
      ElMessage.success(response.message);
      // window.location.reload() 
      blind.value = false;
      updateRectStatus(currentGlassId.value, 200);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -165,7 +165,15 @@
    default:  
      return '#911005'; // 默认颜色  
  }  
}
}
// 更新矩形状态
function updateRectStatus(glassId: string, status: number) {
  adjustedRects.value.forEach(rect => {
    if (rect.glass_id === glassId) {
      rect.glass_state = status; // 更新矩形的状态
    }
  });
}
</script>  
  
<style scoped>