wang
2024-05-21 eea9f3f7b76d4e6bb8e79e8d0e07ffe9d4b66b5c
UI-Project/src/views/Identify/identify.vue
@@ -26,16 +26,12 @@
  </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>  
@@ -113,6 +109,7 @@
      ElMessage.success(response.message);
      // window.location.reload() 
      blind.value = false;
      updateRectStatus(currentGlassId.value, 201);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -138,6 +135,7 @@
      ElMessage.success(response.message);
      // window.location.reload() 
      blind.value = false;
      updateRectStatus(currentGlassId.value, 200);
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.msg);
@@ -166,6 +164,14 @@
      return '#911005'; // 默认颜色  
  }  
}  
// 更新矩形状态
function updateRectStatus(glassId: string, status: number) {
  adjustedRects.value.forEach(rect => {
    if (rect.glass_id === glassId) {
      rect.glass_state = status; // 更新矩形的状态
    }
  });
}
</script>  
  
<style scoped>