From 1449f79f342919f5b65003312b113a8dad229692 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 12 十一月 2025 11:14:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
UI-Project/src/views/Identify/identifwutwo.vue | 125 +++++++++++++++++++++++++++++++++--------
1 files changed, 101 insertions(+), 24 deletions(-)
diff --git a/UI-Project/src/views/Identify/identifwutwo.vue b/UI-Project/src/views/Identify/identifwutwo.vue
index e7114ff..c1c1476 100644
--- a/UI-Project/src/views/Identify/identifwutwo.vue
+++ b/UI-Project/src/views/Identify/identifwutwo.vue
@@ -1,7 +1,11 @@
<template>
<div style="height: 500px;">
- <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading">
- <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;">
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;">
+ <div style="display: flex;margin-left: 40%;margin-bottom: 5px;">
+ <div style="text-align: center;"> {{ $t('processCard.layoutID') }}锛歿{ ava }}-{{ avanum }} </div>
+ <el-button @click="handleAllDamage" style="margin-left: 80%;margin-top: -5px;">{{$t('order.dilapidation')}}</el-button>
+ </div>
+ <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;">
<div style="position: relative;">
<div
v-for="(rect, index) in adjustedRects"
@@ -13,8 +17,9 @@
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: 10px;font-weight: bold;">{{ rect.glassId }}</div>
+ <div style="font-size: 10px;font-weight: bold;">{{ rect.flowCardId }}</div>
+ <div style="font-size: 15px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div>
</div>
</div>
</div>
@@ -36,7 +41,7 @@
</div>
</template>
<script setup lang="ts">
-import {ElMessage} from 'element-plus'
+import {avatarEmits, ElMessage, ElMessageBox } from 'element-plus'
import {onBeforeUnmount, computed, onMounted, onUnmounted, ref} from 'vue';
import request from "@/utils/request"
import {host, WebSocketHost} from '@/utils/constants'
@@ -47,32 +52,57 @@
const blind = ref(false)
const currentGlassId = ref(null);
const adjustedRects = ref([]);
+const ava = ref('');
+const avanum = ref('');
+const realwidth = ref('');
+const realheight = ref('');
let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/currentCutDrawingTwo`;
+const socketUrl = `ws://${window.ipConfig.serverUrl}/api/cacheGlass/api/talk/currentCutDrawingTwo`;
const handleMessage = (data: any) => {
- const scaleFactor = 1621.78 / 6000;
- const scaleFactory = 750 / 3300;
+ if (data.engineer != null) {
+ ava.value = data.engineer[0]
+ }else{
+ ava.value = ''
+ }
+ if (data.engineer != null) {
+ avanum.value = data.sequence[0]
+ }else{
+ avanum.value = ''
+ }
+ if (data.upPattenUsage && data.upPattenUsage.length > 0) {
+ realwidth.value = data.upPattenUsage[0].width;
+ realheight.value = data.upPattenUsage[0].height;
+ const realx = realwidth.value;
+ const realy = realheight.value;
+ const scaleFactora = 1621.78 / realx;
+ const scaleFactorya = 750 / realy;
+ window.localStorage.setItem('widthreturna', realy)
+ window.localStorage.setItem('scaleFactorb', scaleFactora)
+ window.localStorage.setItem('scaleFactoryb', scaleFactorya)
+ }
if (data.currentCutTerritory && data.currentCutTerritory.length > 0) {
+ let scaleFactor = window.localStorage.getItem('scaleFactorb')
+ let scaleFactory = window.localStorage.getItem('scaleFactoryb')
+ let widthreturn = window.localStorage.getItem('widthreturna')
const newRects = data.currentCutTerritory[0].map(rect => {
const existingRect = adjustedRects.value.find(r => r.glassId === rect.glassId);
if (existingRect) {
return {
...existingRect,
- xAxisa: (6000 - (rect.xAxis + rect.width)) * scaleFactor,
- yAxisa: rect.yAxis * scaleFactory,
+ xAxisa: rect.xAxis * scaleFactor,
+ yAxisa: (widthreturn - (rect.yAxis + rect.edgHeight )) * scaleFactory,
width: rect.edgWidth * scaleFactor,
height: rect.edgHeight * scaleFactory,
widtha: rect.edgWidth,
heighta: rect.edgHeight,
state: rect.state,
- // 淇濇寔 isActive 鐘舵�佷笉鍙�
};
} else {
// 濡傛灉涓嶅瓨鍦紝鍒欐坊鍔犳柊鐭╁舰锛岄粯璁� isActive 涓� false
return {
...rect,
- xAxisa: (6000 - (rect.xAxis + rect.width)) * scaleFactor,
- yAxisa: rect.yAxis * scaleFactory,
+ xAxisa: rect.xAxis * scaleFactor,
+ yAxisa: (widthreturn - (rect.yAxis + rect.edgHeight)) * scaleFactory,
width: rect.edgWidth * scaleFactor,
height: rect.edgHeight * scaleFactory,
widtha: rect.edgWidth,
@@ -104,6 +134,47 @@
isActive: false
}));
}
+// 涓�閿牬鎹熸墍鏈夌幓鐠�
+const handleAllDamage = async () => {
+ try {
+ const confirmResult = await ElMessageBox.confirm(
+ t('order.dilapidationWhether'),
+ t('workOrder.prompt'),
+ {
+ confirmButtonText: t('workOrder.yes'),
+ cancelButtonText: t('workOrder.cancel'),
+ type: 'warning',
+ }
+ );
+ // 绛涢�夊嚭state涓嶆槸8鍜�9鐨勭幓鐠僆D
+ const glassIdList = adjustedRects.value
+ .filter(rect => rect.state !== 8 && rect.state !== 9)
+ .map(rect => rect.glassId);
+ if (glassIdList.length === 0) {
+ ElMessage.warning(t('order.noGlassToDamage')); // 娌℃湁鍙牬鎹熺殑鐜荤拑
+ return;
+ }
+ const response = await request.post('/cacheGlass/taskCache/identControlsByPatternSequence', {
+ glassIdList: glassIdList,
+ state: 8,
+ line: 2,
+ workingProcedure: '鍒囧壊',
+ remark: '鎺扮墖'
+ });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ // 鏇存柊鎵�鏈夌幓鐠冪姸鎬�
+ glassIdList.forEach(glassId => {
+ updateRectStatus(glassId, 8);
+ });
+ } else {
+ ElMessage.error(response.msg);
+ }
+ } catch (error) {
+ console.error(error);
+ ElMessage.error(t(''));
+ }
+};
// 鐮存崯
const handleDamage = async () => {
try {
@@ -148,18 +219,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';
+ return '#911005';//鐮存崯
case 9:
- return '#f3d19e';
+ return '#4682B4';//鎷胯蛋
+ default:
+ return '#CDAF95';
}
}
// 鏇存柊鐭╁舰鐘舵��
@@ -188,7 +265,7 @@
justify-content: center;
align-items: center;
height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */
- font-size: small;
+ /* font-size: large; */
}
#line {
position: absolute;
--
Gitblit v1.8.0