wangfei
2024-08-22 a9c266890270e55a5840411b6d0fd4fe43494af8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
<script setup>
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import request from "@/utils/request"
import { ref, onMounted, onBeforeUnmount,nextTick  } from 'vue';  
import { WebSocketHost ,host} from '@/utils/constants'
import { ElMessage, ElMessageBox } from 'element-plus'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
  import { useI18n } from 'vue-i18n'
  import { useRouter } from 'vue-router'
  const { t } = useI18n()
  let language = ref(localStorage.getItem('lang') || 'zh')
const dialogFormVisible = ref(false)
const dialogFormVisiblea = ref(true)
const dialogFormVisibleb = ref(false)
const dialogFormVisiblec = ref(false)
const blind1 = ref(false)
const blind2 = ref(false)
const blinda = ref(false)
const blindb = ref(false)
const dialogVisible = ref(false)
const width = ref();
const height = ref();
const adjustedRects1 = ref([]);
const adjustedRects2 = ref([]);
const adjustedRectsa = ref([]);
const adjustedRectsb = ref([]);
const tableData = ref([])
const engineerId = ref('')
const router = useRouter()
const currentGlassId = ref(null);
const currenttemperingFeedSequence = ref(null);
onMounted(async () => {  
  try {  
    const response = await request.post('/loadGlass/damage/selectDamagePrint', {
    type: 9,
    workingProcedure: '钢化',
    })
    if (response.code === 200) {  
          tableData.value = response.data
          console.log(response.data);
    } else {  
      ElMessage.warning(res.msg)
    }  
  } catch (error) {  
    // console.error('Error fetching rects :', error);  
  }  
}); 
const selectReportData = async () => {
  let postData = {  
    type: 9,  
    workingProcedure: '钢化',  
    ...(engineerId.value !== '' && { engineerId: engineerId.value }),  
  };  
  const response = await request.post("/loadGlass/damage/selectDamagePrint", postData)
  if (response.code === 200) {
    tableData.value = response.data;
    ElMessage.success(response.message);
  } else {
    ElMessage.error(response.message);
  }
};
const printing = async () => {
  let postData = {  
    type: 9,  
    workingProcedure: '钢化',  
    ...(engineerId.value !== '' && { engineerId: engineerId.value }),  
  };  
  console.log(engineerId.value);
  
  const response = await request.post("/loadGlass/damage/selectDamagePrintDetails", postData)
  if (response.code === 200) {
  dialogVisible.value = true;
    tableData.value = response.data; 
    await nextTick(); 
  window.print();  
} else {
    ElMessage.error(response.message);
  }
};
const printTable = () => {  
  // 这里可以添加一些CSS样式来优化打印效果  
  // 例如,可以添加一个隐藏的打印样式表  
  window.print();  
};  
const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`;
const handleMessage = (data) => {  
  if (data.intoGlass2 && data.intoGlass2.length > 0) {  
    const newRects = data.intoGlass2[0].map(rect => {  
      const scaleFactor =  794.67/5087; 
        let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
        let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
        heighta = rect.width;
      }else {
        widtha = rect.width;
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;   
    newX = 5087 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * scaleFactor;  
    adjustedHeight = widtha * 0.1;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + heighta); 
  } 
        return {  
        ...rect, 
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
        widtha: rect.width, 
        heighta: rect.height,
      }
    });  
    // 合并新旧矩形,保留 isActive 状态  
    adjustedRects2.value = adjustedRects2.value.map(oldRect => {  
      const newRect = newRects.find(r => r.glassId === oldRect.glassId);  
      if (newRect) {  
        return { ...oldRect, ...newRect, isActive: oldRect.isActive };  
      }  
      return oldRect; // 如果旧矩形在新数据中不存在,则保留原样  
    }).concat(newRects.filter(r => !adjustedRects2.value.some(o => o.glassId === r.glassId)));  
  }
  if (data.intoGlass && data.intoGlass.length > 0) {  
    const newRects = data.intoGlass[0].map(rect => {  
      const scaleFactor =  794.67/5087; 
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
      let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
        heighta = rect.width;
      }else {
        widtha = rect.width;
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * scaleFactor;  
    adjustedHeight = widtha * 0.1;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + heighta);  
  } 
        return {  
        ...rect, 
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
        widtha: rect.width, 
        heighta: rect.height,
      }
    });  
    // 合并新旧矩形,保留 isActive 状态  
    adjustedRects1.value = adjustedRects1.value.map(oldRect => {  
      const newRect = newRects.find(r => r.glassId === oldRect.glassId);  
      if (newRect) {  
        return { ...oldRect, ...newRect, isActive: oldRect.isActive };  
      }  
      return oldRect; // 如果旧矩形在新数据中不存在,则保留原样  
    }).concat(newRects.filter(r => !adjustedRects1.value.some(o => o.glassId === r.glassId)));  
  }
  if (data.waitingGlass && data.waitingGlass.length > 0) {  
    const newRects = data.waitingGlass[0].map(rect => {  
      const scaleFactor =  1621.78/5190; 
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; 
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
        heighta = rect.width;
      }else {
        widtha = rect.width;
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * scaleFactor;  
    adjustedHeight = heighta * 0.16;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5190 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * scaleFactor;  
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5190 - (rect.yCoordinate + heighta);  
  }  
  return {  
    ...rect, 
    x: newX * scaleFactor,  
    y: rect.xCoordinate * 0.16,  
    width: adjustedWidth,  
    height: adjustedHeight,  
    widtha: rect.width, 
    heighta: rect.height,
  }
    });  
    // 合并新旧矩形,保留 isActive 状态  
    adjustedRectsa.value = adjustedRectsa.value.map(oldRect => {  
      const newRect = newRects.find(r => r.glassId === oldRect.glassId);  
      if (newRect) {  
        return { ...oldRect, ...newRect, isActive: oldRect.isActive };  
      }  
      return oldRect; // 如果旧矩形在新数据中不存在,则保留原样  
    }).concat(newRects.filter(r => !adjustedRectsa.value.some(o => o.glassId === r.glassId)));  
  }
  if (data.outGlass && data.outGlass.length > 0) {  
    const newRects = data.outGlass[0].map(rect => {  
      const scaleFactor =  1621.78/5190; 
      const scaleFactory =  550/2800; 
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta,newY;
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
        heighta = rect.width;
      }else {
        widtha = rect.width;
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * scaleFactor;  
    adjustedHeight = heighta * scaleFactory;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    // newX = 5190 - (rect.yCoordinate + widtha); 
    newY = 2800 - (rect.xCoordinate + heighta); 
  } else {  
    adjustedWidth = heighta * scaleFactor;  
    adjustedHeight = widtha * scaleFactory;  
    // adjustedWidtha = heighta;  
    // adjustedHeighta = widtha;  
    // newX = 5190 - (rect.yCoordinate + heighta);  
    newY = 2800 - (rect.xCoordinate + widtha); 
  }  
  return {  
        ...rect, // 复制原始对象的其他属性  
        x: newX * scaleFactor,
        y: newY * scaleFactory,
        width: adjustedWidth,  
        height: adjustedHeight,  
        widtha: rect.width, 
        heighta: rect.height,
  }
    });  
    // 合并新旧矩形,保留 isActive 状态  
    adjustedRectsb.value = adjustedRectsb.value.map(oldRect => {  
      const newRect = newRects.find(r => r.glassId === oldRect.glassId);  
      if (newRect) {  
        return { ...oldRect, ...newRect, isActive: oldRect.isActive };  
      }  
      return oldRect; // 如果旧矩形在新数据中不存在,则保留原样  
    }).concat(newRects.filter(r => !adjustedRectsb.value.some(o => o.glassId === r.glassId)));  
  }
}; 
onMounted(() => {
  initializeWebSocket(socketUrl, handleMessage);
});
function updateRectColors() {  
  adjustedRectsa.value.forEach(rect => {  
    if (rect.glassId === glassId) {  
      rect.state = 5;
    }
  });  
}  
function getRectColora(state) {  
  switch (state) {  
    case 0:  
      return '#7AC5CD';  
    case 1:  
      return '#95d475';
    case -1:  
      return '#CDAF95';  
    case 5:  
      return '#911005';  
  }
}
function getRectColorb(state) {  
  switch (state) {  
    case 3:  
      return '#eebe77';  
    case 4:  
      return '#CD6090';
    case 5:  
      return '#911005';  
  }  
}
function showDialog1(rect) {
  const index = adjustedRects1.value.findIndex(r => r.glassId === rect.glassId);  
  if (index !== -1) {  
    adjustedRects1.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
  blind1.value = true;  
function showDialog2(rect) {
  const index = adjustedRects2.value.findIndex(r => r.glassId === rect.glassId);  
  if (index !== -1) {  
    adjustedRects2.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
  blind2.value = true;  
function showDialoga(rect) {
  const index = adjustedRectsa.value.findIndex(r => r.glassId === rect.glassId);  
  if (index !== -1) {  
    adjustedRectsa.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
  blinda.value = true;  
function showDialogb(rect) {
  const index = adjustedRectsb.value.findIndex(r => r.glassId === rect.glassId);  
  if (index !== -1) {  
    adjustedRectsb.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
  blindb.value = true;  
  const handleDialogClose1 = () => {  
  adjustedRects1.value.forEach(rect => {  
    rect.isActive = false;  
  });  
  blind1.value = false; 
};  
  const handleDialogClose2 = () => {  
  adjustedRects2.value.forEach(rect => {  
    rect.isActive = false;  
  });  
  blind2.value = false; 
};  
  const handleDialogClosea = () => {  
  adjustedRectsa.value.forEach(rect => {  
    rect.isActive = false;  
  });  
  blinda.value = false; 
};  
  const handleDialogCloseb = () => {  
  adjustedRectsb.value.forEach(rect => {  
    rect.isActive = false;  
  });  
  blindb.value = false; 
};  
// 破损
const handleDamage1 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blind1.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handleDamage2 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blind2.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handleDamagea = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blinda.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handleDamageb = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
    glassId: currentGlassId.value,
    // temperingFeedSequence: currenttemperingFeedSequence.value,
    line: 4001,
    status: 2,
    workingProcedure: '钢化',
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blindb.value = false;
      updateRectColors();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
});
</script>
<template>
  <div style="margin-top: 10px;">
     <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;dialogFormVisiblec = false;" >{{ $t('processCard.beforefurnace') }}</el-button>
     <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;dialogFormVisiblec = false;">{{ $t('processCard.intofurnace') }}</el-button>
    <el-button  id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false;dialogFormVisiblec = false;">{{ $t('processCard.outfurnace') }}</el-button>
    <el-button  id="searchButton" type="info" @click="dialogFormVisiblec = true;dialogFormVisibleb = false;dialogFormVisible = false;dialogFormVisiblea = false">{{ $t('processCard.print') }}</el-button>
<div v-if="dialogFormVisible" >
    <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
<div style="width: 49%;float: left;background-color: #f4f4f5;height: 550px;">
    <div v-if="adjustedRects1.length > 0">
      <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
    <div style="text-align: center;"> 炉号:{{ adjustedRects1[0].engineerId }}-{{ adjustedRects1[0].temperingLayoutId }} </div>
    <el-scrollbar height="550px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRects1"
      :key="index"  
      @click="showDialog1(rect)"  
      class="rect"
      :style="{ position: 'absolute', 
       top: `${rect.ycoordinate}px`, 
       left: `${rect.xcoordinate}px`,
        width: `${rect.width}px`, 
        height: `${rect.height}px`,
        backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 5 ? '#911005' : 'lightblue' }"
    >
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
    <div>{{ rect.widtha }}*{{ rect.heighta }}</div>  
  </div>
  </div>
   </div>
   </el-scrollbar>
   </div>
  </div>
<div style="width: 49%;float: right;background-color: #f4f4f5;height: 550px;">
    <div v-if="adjustedRects2.length > 0">
    <div style="text-align: center;"> 炉号:{{ adjustedRects2[0].engineerId }}-{{ adjustedRects2[0].temperingLayoutId }} </div>
    <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay2 }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
    <el-scrollbar height="550px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRects2"
      :key="index"
      @click="showDialog2(rect)"  
      class="rect"
      :style="{ position: 'absolute', 
       top: `${rect.ycoordinate}px`, 
       left: `${rect.xcoordinate}px`, 
       width: `${rect.width}px`, 
       height: `${rect.height}px`,
       backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 5 ? '#911005' : 'lightblue' }"
       >
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
    <div>{{ rect.widtha }}*{{ rect.heighta }}</div>  
  </div>
  </div>
   </div>
   </el-scrollbar>
   </div>
</div>
   </el-card>
    </div>
<div v-if="dialogFormVisiblea">
  <!-- 进炉前 -->
  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
    <div v-if="adjustedRectsa.length > 0">
    <div style="text-align: center;"> 炉号:{{ adjustedRectsa[0].engineerId }}-{{ adjustedRectsa[0].temperingLayoutId }} </div>
    <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplaya }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
      <el-scrollbar height="550px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRectsa"  
      :key="index"  
      @click="showDialoga(rect)"  
      class="rect"  
      :style="{ position: 'absolute',  top: `${rect.y}px`, left: `${rect.x}px`,
       width: `${rect.width}px`, height: `${rect.height}px`,
      backgroundColor: rect.isActive ? '#ADFF2F' : getRectColora(rect.state) }">
    <div  class="centered-text">
    <div>{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
    <div>{{ rect.widtha }}*{{ rect.heighta }}</div>  
  </div>
  </div> 
   </div>
   </el-scrollbar>
   </div>
   </el-card>
</div>
<div v-if="dialogFormVisibleb">
  <!-- 已出炉 -->
  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
      <div v-if="adjustedRectsb.length > 0">
    <div style="text-align: center;"> 炉号:{{ adjustedRectsb[0].engineerId }}-{{ adjustedRectsb[0].temperingLayoutId }} </div>
    <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplayb }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
      <el-scrollbar height="550px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRectsb"  
      :key="index"  
      @click="showDialogb(rect)"  
      class="rect"  
      :style="{ position: 'absolute',  top: `${rect.y}px`, left: `${rect.x}px`,
       width: `${rect.width}px`, height: `${rect.height}px`,
      backgroundColor: rect.isActive ? '#ADFF2F' : getRectColorb(rect.state) }">
       <!-- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> -->
     <div  class="centered-text">
    <div >{{ rect.glassId }}</div>  
    <div >{{ rect.flowCardId }}</div>  
    <div>{{ rect.widtha }}*{{ rect.heighta }}</div>  
  </div>
  </div> 
   </div>
   </el-scrollbar>
   </div>
   </el-card>
</div>
<div v-if="dialogFormVisiblec">
  <!-- 打印 -->
  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
    <div style="display: flex; flex-direction: row; align-items: center; margin-top: 5px;margin-left: 10px;">  
    <el-input :placeholder="$t('processCard.projectnumber')" v-model="engineerId" autocomplete="off" style="width: 300px;"/>
    <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('processCard.inquire') }}</el-button>
    <el-button type="info" style="margin-left: 10px;" @click="printing()">{{ $t('processCard.printing') }}</el-button>
  </div>
 
    <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
      <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
    <el-table
    height="350"
     ref="table" 
     :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
      :data="tableData"
    >
      <el-table-column prop="engineerId" :label="$t('processCard.project')" width="200" align="center"/>
      <el-table-column prop="workingProcedure" :label="$t('processCard.awayprocess')" align="center"/>
      <el-table-column prop="deviceName" :label="$t('processCard.awayequipment')" align="center"/>
      <el-table-column prop="teamsGroupsName" :label="$t('processCard.awayteam')" align="center"/>
    </el-table>
      </div>
      </el-card>
   </el-card>
</div>
<el-dialog v-model="blind1" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose1">
        <el-button type="warning" plain :icon="Delete" @click="handleDamage1"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2">
        <el-button type="warning" plain :icon="Delete" @click="handleDamage2"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blinda" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClosea">
        <el-button type="warning" plain :icon="Delete" @click="handleDamagea"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb">
        <el-button type="warning" plain :icon="Delete" @click="handleDamageb"  style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
  </el-dialog> 
  <el-dialog  
      v-model="dialogVisible"
      width="100%" 
      :title="$t('processCard.glasstakeout')"
      top="0vh"
      >  
      <el-table  
        :data="tableData"  
        style="width: 100%;height: 860px"  
      >  
      <el-table-column prop="flowCardId" :label="$t('processCard.flowcard')" width="140" align="center"/>
      <el-table-column prop="layer" :label="$t('processCard.layer')" align="center" width="80"/>
      <el-table-column prop="engineerId" :label="$t('processCard.project')" align="center" width="110"/>
      <el-table-column prop="temperingLayoutId" :label="$t('processCard.temperinglayout')" align="center" width="80"/>
      <el-table-column prop="temperingFeedSequence" :label="$t('processCard.temperingfeed')" align="center" width="80"/>
      <el-table-column prop="width" :label="$t('processCard.width')" align="center" width="80"/>
      <el-table-column prop="height" :label="$t('processCard.height')" align="center" width="80"/>
      <el-table-column prop="thickness" :label="$t('processCard.thickness')" align="center" width="80"/>
      </el-table>  
    </el-dialog>  
  </div>
</template>
<style scoped>
#boxa{
  border: 1px solid rgb(119, 116, 116);
  background-color:  #529b2e;
  text-align: center;
  display: inline-block;
    /* align-items:center; */
    /* justify-content:center; */
  margin-left: 20px;
}
#boxb{
  border: 1px solid rgb(119, 116, 116);
  background-color:  #a0cfff;
  /* display:flex; */
  text-align: center;
  display: inline-block;
    align-items:center;
    justify-content:center;
  margin-left: 20px;
}
#box{
  border: 1px solid black;
  background-color:  #337ecc;
  display:flex;
    align-items:center;
    justify-content:center;
}
#home-card {
    width: 100%;
    overflow: hidden;
    padding: 10px 0px;
    display: flex;
    flex-wrap: wrap;
    #home-item {
      border-style: solid;
      border-width: 1px;
      border-color: #E4E4E4;
      width: calc(34% - 20px);
      padding: 20px 0px 20px 20px;
      margin-right: 10px;
      margin-bottom: 10px;
      display: flex;
      justify-content: center;
      /* align-items: center; */
      background: #fff;
      #home-img {
        display: inline-block;
        width: 160px;
        height: 60px;
        margin: 0;
        padding: 0;
      }
      #home-right {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        margin-left: 10px;
        #home-num {
          font-size: 40px;
          margin: 5px 0;
        }
      }
    }
  }
  .rect {  
  border: 1px solid black; /* 设置矩形的边框 */  
  background-color: lightblue; /* 设置矩形的背景色 */  
#rect {  
  position: relative; /* 确保箭头可以相对于矩形定位 */  
  /* 其他样式 */  
}  
.centered-text {
  /* 设置文字居中样式 */  
  /* display: flex; */
  justify-content: center;  
  align-items: center; 
  height: 100%; /* 确保div占据整个矩形的高度 */  
  /* font-size: small; */
</style>