huang
2025-04-15 ef714be504f98f6b9549b134148a18d416a9dcb0
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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
<script setup>
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
import * as echarts from 'echarts'
import request from '@/utils/request'
 
const dashboardRef = ref(null)
const standardWidth = 1920 // 设计稿标准宽度
const standardHeight = 1080 // 设计稿标准高度
 
// 计算缩放比例并应用
const setScale = () => {
  if (!dashboardRef.value) return
  
  const w = window.innerWidth
  const h = window.innerHeight
  
  // 计算宽高比例
  const wScale = w / standardWidth
  const hScale = h / standardHeight
  
  // 使用较小的缩放比例,确保内容完全显示
  const scale = Math.min(wScale, hScale)
  
  // 计算居中偏移
  const offsetX = (w - standardWidth * scale) / 2
  const offsetY = (h - standardHeight * scale) / 2
  
  // 应用变换
  dashboardRef.value.style.transform = `scale(${scale})`
  dashboardRef.value.style.transformOrigin = '0 0'
  dashboardRef.value.style.marginLeft = `${offsetX}px`
  dashboardRef.value.style.marginTop = `${offsetY}px`
}
 
// 监听窗口大小变化
const handleResize = () => {
  setScale()
  // 重新渲染所有图表
  charts.forEach(chart => {
    chart.resize()
  })
}
 
// 存储所有图表实例
const charts = []
 
// 获取能耗数据
const loadEnergyData = async () => {
  try {
    const res = await request({
      url: '/deviceInteraction/energy/consumption/chartEnergy',
      method: 'post'
    })
    if (res.code === 200) {
      energyData.value = res.data.actual || [];
      updateEnergyChart()
    }
  } catch (error) {
    console.error('获取能耗数据失败:', error)
  }
}
 
 
const energyData = ref([])
const notCompleteData = ref([]) // 完整数据集
const displayedData = ref([]) // 当前显示的数据集
const pageSize = 20 // 每批显示的数据量
let currentPage = 0 // 当前显示的批次
let scrollTimer = null // 滚动计时器
 
// 获取未完成数据
const loadNotCompleteData = async () => {
  try {
    const res = await request.post('/deviceInteraction/primitiveTask/findDayNotCompleteOutput', {
      "dayCount": 2
    })
    
    if (res.code === 200) {
      notCompleteData.value = res.data;
      console.log("加载数据完成,共" + res.data.length + "条");
      
      // 加载第一批数据
      loadNextBatch();
      
      // 开始滚动显示
      nextTick(() => {
        startScrollingWithBatches();
      });
    } else {
      console.error('请求当日产量数据失败:', res.message);
    }
  } catch (error) {
    console.error('请求当日产量数据失败:', error);
  }
}
 
// 加载下一批数据
const loadNextBatch = () => {
  const startIndex = currentPage * pageSize;
  let endIndex = startIndex + pageSize;
  
  // 如果到达数据末尾,则重新从头开始
  if (startIndex >= notCompleteData.value.length) {
    currentPage = 0;
    loadNextBatch();
    return;
  }
  
  // 更新当前显示的数据
  displayedData.value = notCompleteData.value.slice(
    startIndex, 
    Math.min(endIndex, notCompleteData.value.length)
  );
  currentPage++;
}
 
// 使用分批方式实现滚动
const startScrollingWithBatches = () => {
  const tableBody = document.querySelector('.el-table__body');
  const tableWrapper = document.querySelector('.el-table__body-wrapper');
  
  if (!tableBody || !tableWrapper) return;
  
  // 数据量较少时不滚动
  if (notCompleteData.value.length <= 5) {
    tableBody.style.animation = 'none';
    return;
  }
  
  // 清除之前的定时器
  if (scrollTimer) clearTimeout(scrollTimer);
  
  // 计算当前批次的总滚动时间
  const currentBatchRows = displayedData.value.length;
  if (currentBatchRows === 0) {
    loadNextBatch();
    scrollTimer = setTimeout(startScrollingWithBatches, 500);
    return;
  }
  
  
  // 每条数据的显示时间和总滚动时间
  const timePerRow = 0.8;
  const scrollTime = Math.max(currentBatchRows * timePerRow, 5);
 
  console.log('显示第' + currentPage + '批数据')
  
  // 删除旧样式并重置动画
  const oldStyle = document.getElementById('scroll-animation-style');
  if (oldStyle) document.head.removeChild(oldStyle);
  tableBody.style.animation = 'none';
  tableBody.offsetHeight; // 强制重排
  
  // 计算滚动距离
  const tableHeight = tableBody.offsetHeight;
  const wrapperHeight = tableWrapper.offsetHeight;
  const scrollDistance = tableHeight - wrapperHeight;
  
  if (scrollDistance > 0) {
    // 创建滚动动画样式
    const style = document.createElement('style');
    style.id = 'scroll-animation-style';
    style.innerHTML = `
      @keyframes scroll-animation {
        0% { transform: translateY(0); }
        5% { transform: translateY(0); }
        90% { transform: translateY(-${scrollDistance}px); }
        100% { transform: translateY(-${scrollDistance}px); }
      }
    `;
    document.head.appendChild(style);
    
    // 应用滚动动画
    tableBody.style.animation = `scroll-animation ${scrollTime}s linear`;
    
    // 滚动结束后加载下一批数据
    scrollTimer = setTimeout(() => {
      loadNextBatch();
      startScrollingWithBatches();
    }, scrollTime * 1000);
  } else {
    // 内容不足以滚动时,直接显示3秒后切换
    scrollTimer = setTimeout(() => {
      loadNextBatch();
      startScrollingWithBatches();
    }, 3000);
  }
}
 
// 修改图表初始化方法
const draw = (name, Option) => {
  const chart = echarts.init(document.getElementById(name))
  chart.setOption(Option)
  charts.push(chart)
}
 
// 更新能耗图表
const updateEnergyChart = () => {
  // 按日期排序并格式化日期
  const sortedData = [...energyData.value].sort((a, b) =>
    new Date(a.recordDate) - new Date(b.recordDate)
  ).map(item => {
    const date = new Date(item.recordDate);
    return {
      ...item,
      recordDate: `${date.getMonth() + 1}-${date.getDate().toString().padStart(2, '0')}`
    };
  });
 
  const energyoption = {
    title: {
      text: '能耗管理',
      textStyle: {
        fontSize: 25,
        fontWeight: 'bold',
        color: 'white' // 设置标题颜色为白色
      },
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        label: {
          backgroundColor: '#6a7985',
          fontSize: 16,  // 提示框文字大小
          color: 'white' // 设置提示框文字颜色为白色
        }
      }
    },
    legend: {
      data: ['能耗值'],
      textStyle: {
        fontSize: 25,
        fontWeight: 'bold',
        color: 'white' // 设置图例文字颜色为白色
      }
    },
    toolbox: {
      show: true,
      feature: {
        dataZoom: {
          yAxisIndex: 'none'
        },
        dataView: { readOnly: false },
        magicType: { type: ['line', 'bar'] },
        restore: {},
        saveAsImage: {}
      },
      iconStyle: {
        color: 'white' // 设置工具框图标颜色为白色
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '10%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        boundaryGap: false,
        data: sortedData.map(item => item.recordDate),
        axisLabel: {
          fontSize: 20,
          interval: 'auto',    // 自动计算间隔
          margin: 15,          // 与轴线的距离
          formatter: (value) => {
            // 只显示月-日
            const date = new Date(value);
            return `${date.getMonth() + 1}-${date.getDate()}`;
          },
          color: 'white' // 设置 x 轴标签颜色为白色
        },
        nameTextStyle: {
          fontSize: 20,
          color: 'white' // 设置 x 轴名称颜色为白色
        }
      }
    ],
    yAxis: [
      {
        type: 'value',
        axisLabel: {
          fontSize: 20,   // y 轴标签文字大小
          color: 'white' // 设置 y 轴标签颜色为白色
        },
        nameTextStyle: {
          fontSize: 20,   // 坐标轴名称文字大小
          color: 'white' // 设置 y 轴名称颜色为白色
        }
      }
    ],
    series: [
      {
        name: '能耗值',
        type: 'line',
        areaStyle: {},
        label: {
          show: true,
          position: 'top',
          fontSize: 16,  // 数据标签文字大小
          formatter: '{c}',
          color: 'white' // 设置数据标签颜色为白色
        },
        data: sortedData.map(item => item.energyValue)
      }
    ]
  }
 
  draw('drawLineChart_day71', energyoption);
}
 
onMounted(() => {
  setScale()
  window.addEventListener('resize', handleResize)
  loadEnergyData();
  loadNotCompleteData();
})
 
onUnmounted(() => {
  window.removeEventListener('resize', handleResize)
  charts.forEach(chart => {
    chart.dispose()
  })
})
 
</script>
 
<template>
  <div class="dashboard-container" ref="dashboardRef">
    <div class="dashboard-content">
      <div style="font-weight: 800;font-size: 30px;height: 70px;line-height: 70px;border: 1px solid #ccc;text-align: center;">
        JOMOO配套工厂镜片车间生产看板
      </div>
 
      <div style="width:100% ;height: 880px;">
        <div style="width:100% ;height: 33.3%;border: 1px solid #ccc;">
          <div id="drawLineChart_day11" style="height: 100%;width: 30%;border: 1px solid #ccc;float: left;">日单达成率-片数</div>
          <div id="drawLineChart_day12" class="table-container">
            <div class="table-title">当日未完成量</div>
            <div class="table-scroll-wrapper">
              <el-table
                height="100%"
                :data="displayedData"
                :header-cell-style="{ background: '#052c52', color: 'white', textAlign: 'center' }"
                :cell-style="{ textAlign: 'center' }">
                <el-table-column prop="OrderNo" :label="$t('glassInfo.OrderNo')" />
                <el-table-column prop="notComplete" :label="$t('glassInfo.notCompleteCount')" />
                <el-table-column 
                  prop="area_sum" 
                  :label="$t('glassInfo.notCompleteArea')" 
                  :formatter="row => row.area_sum ? Number(row.area_sum).toFixed(2) : '0.00'" />
              </el-table>
            </div>
          </div>
          <div id="drawLineChart_day71" style="height: 100%;width: 40%;border: 1px solid #ccc;float: left;">能耗管理-按天显示(手输)
          </div>
        </div>
        <div style="width:100% ;height: 37.5%;border: 1px solid #ccc;">
          <div id="drawLineChart_day31" style="height: 100%;width: 100%;border: 1px solid #ccc;">两线生产对比-片数</div>
        </div>
        <div style="width:100% ;height: 37.5%;border: 1px solid #ccc;">
          <div id="drawLineChart_day51" style="height: 100%;width: 80%;border: 1px solid #ccc;float: left;">计划量-片数、平方</div>
          <div id="drawLineChart_day91" style="height: 100%;width: 20%;float: left;">
            <div style="font-weight: 700;font-size: 20px;height: 30px;line-height: 30px;text-align: center;border: 1px solid #ccc;">总计划量-片数、平方</div>
            <div id="textDay" style="font-size: 20px;height: 30px;margin-left: 20px;margin-top: 20px;">日期:2023-03-01  - 2023-03-01</div>
            <div id="textprice" style="font-size: 20px;height: 30px;margin-left: 20px;margin-top: 20px;">片数:25</div>
            <div id="textarea" style="font-size: 20px;height: 30px;margin-left: 20px;margin-top: 20px;">平方数:2999</div>
          </div>
        </div>
      </div>
 
      <!-- <div style="width:33% ;height: 880px;border: 1px solid #ccc;">
        <div id="drawLineChart_day1" style="height: 300px;width: 25%;border: 1px solid #ccc;float: left;"></div>
        <div id="drawLineChart_day2" style="height: 300px;width: 25%;border: 1px solid #ccc;float: left;"></div>
      </div> -->
    </div>
  </div>
</template>
 
 
<script>
export default {
  mounted() {
    const OptionDayMode = {
      title: {
        text: '计划量看板',
        textStyle: {
          fontSize: 25,
          fontWeight: 'bold',
          color: 'white' // 设置标题颜色为白色
        }
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          label: {
            fontSize: 16,
            color: 'white' // 设置提示框文字颜色为白色
          }
        }
      },
      legend: {
        textStyle: {
          fontSize: 20,
          fontWeight: 'bold',
          color: 'white' // 设置图例文字颜色为白色
        }
      },
      toolbox: {
        show: true,
        feature: {
          dataZoom: {
            yAxisIndex: 'none'
          },
          dataView: { readOnly: false },
          magicType: { type: ['line', 'bar'] },
          restore: {},
          saveAsImage: {}
        },
        iconStyle: {
          color: 'white' // 设置工具框图标颜色为白色
        }
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '10%',
        containLabel: true
      },
      xAxis: {
        type: 'category',
        boundaryGap: false,
        axisTick: { alignWithLabel: true },
        axisLabel: {
          fontSize: 20,
          interval: 'auto',
          margin: 15,
          formatter: (value, index) => {
            // 如果是日期格式
            if (value.includes('-')) {
              // 对第一个日期显示完整年月日
              if (index === 0) {
                return value;  // 返回完整日期 (例如: 2024-03-21)
              }
              // 其他日期只显示月-日
              return value.split('-').slice(1).join('-');  // (例如: 03-21)
            }
            return value;
          },
          color: 'white' // 设置 x 轴标签颜色为白色
        },
        nameTextStyle: {
          fontSize: 20,
          color: 'white' // 设置 x 轴名称颜色为白色
        }
      },
      yAxis: {
        type: 'value',
        axisLabel: {
          fontSize: 20,
          formatter: '{value} ',
          color: 'white' // 设置 y 轴标签颜色为白色
        },
        nameTextStyle: {
          fontSize: 20,
          color: 'white' // 设置 y 轴名称颜色为白色
        }
      },
      series: [
        {
          name: '平方',
          type: 'line',
          barWidth: '40%',
          barGap: '10%',
          label: {
            show: true,
            fontSize: 16,
            formatter: (params) => {
              // 保留两位小数
              return params.value ? Number(params.value).toFixed(2) : '0.00';
            },
            color: 'white' // 设置数据标签颜色为白色
          },
          lineStyle: {
            color: 'blue'
          },
        },
        {
          name: '片数',
          type: 'line',
          barWidth: '40%',
          barGap: '10%',
          label: {
            show: true,
            fontSize: 16,
            color: 'white' // 设置数据标签颜色为白色
          }
        }
      ]
    };
    const OptionYear = {
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            fontSize: 16,
            color: 'white' // 设置提示框文字颜色为白色
          }
        }
      },
      legend: {
        textStyle: {
          fontSize: 20,
          fontWeight: 'bold',
          color: 'white' // 设置图例文字颜色为白色
        }
      },
      toolbox: {
        show: true,
        feature: {
          dataZoom: {
            yAxisIndex: 'none'
          },
          dataView: { readOnly: false },
          magicType: { type: ['line', 'bar'] },
          restore: {},
          saveAsImage: {}
        },
        iconStyle: {
          color: 'white' // 设置工具框图标颜色为白色
        }
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '10%',
        containLabel: true
      },
      xAxis: [
        {
          type: 'category',
          axisTick: { alignWithLabel: true },
          boundaryGap: '20%', 
          axisLabel: {
            fontSize: 20,
            interval: 'auto',
            margin: 15,
            formatter: (value, index) => {
              // 如果是日期格式
              if (value.includes('-')) {
                // 对第一个日期显示完整年月日
                if (index === 0) {
                  return value;  // 返回完整日期 (例如: 2024-03-21)
                }
                // 其他日期只显示月-日
                return value.split('-').slice(1).join('-');  // (例如: 03-21)
              }
              return value;
            },
            color: 'white' // 设置 x 轴标签颜色为白色
          },
          nameTextStyle: {
            fontSize: 20,
            color: 'white' // 设置 x 轴名称颜色为白色
          }
        }
      ],
      yAxis: [
        {
          type: 'value',
          axisLabel: {
            fontSize: 20,
            color: 'white' // 设置 y 轴标签颜色为白色
          },
          nameTextStyle: {
            fontSize: 20,
            color: 'white' // 设置 y 轴名称颜色为白色
          }
        }
      ],
      series: [
        {
          name: '计划量',
          type: 'bar',
          barWidth: '27%',
          barGap: '20%',
          label: {
            show: true,
            fontSize: 16,
            formatter: (params) => params.value,
            color: 'white',
            position: 'top'
          }
        },
        {
          name: '一线',
          type: 'bar',
          barWidth: '27%',
          barGap: '20%',  
          label: {
            show: true,
            fontSize: 16,
            formatter: (params) => params.value,
            color: 'white',
            position: 'top'
          },
        },
        {
          name: '二线',
          type: 'bar',
          barWidth: '27%',
          barGap: '10%',  
          label: {
            show: true,
            fontSize: 16,
            formatter: (params) => params.value,
            color: 'white',
            position: 'top'
          },
        }
      ]
    };
    // //请求当日产量
    // request.post('/deviceInteraction/primitiveTask/findDailyOutput',
    //   {
    //     "dayCount": 1
    //   }).then((res) => {
    //     if (res.code == 200) {
    //       const modeOptions = res.data;
    //       this.drawDay('drawLineChart_day11', OptionYear, modeOptions);
    //       // this.drawDay('drawLineChart_day31', OptionYear, modeOptions);
    //       // this.drawYear('drawLineChart_day51', OptionDayMode, modeOptions);
    //     } else {
    //       console.error('请求当日产量数据失败:', error);
    //     }
    //   });
 
    //请求日产量-月
    request.post('/deviceInteraction/primitiveTask/findDailyOutput',
      {
        "dayCount": 30
      }).then((res) => {
        if (res.code == 200) {
          const modeOptions = res.data;
          const modeOptions2 = [res.data[res.data.length - 1]];
          console.log(modeOptions2);
          //this.drawDay('drawLineChart_day11', OptionYear, modeOptions);
          this.drawDay('drawLineChart_day31', OptionYear, modeOptions);
          this.drawDay('drawLineChart_day11', OptionYear, modeOptions2);
          // this.drawYear('drawLineChart_day51', OptionDayMode, modeOptions);
        } else {
          console.error('请求日产量-月数据失败:', error);
        }
      });
    //请求计划量
    request.post('/deviceInteraction/primitiveTask/findPlannedQuantity',
      {
        "dayCount": 30
      }).then((res) => {
        if (res.code == 200) {
          const modeOptions = res.data;
          this.drawYear('drawLineChart_day51', OptionDayMode, modeOptions);
          let textDay = document.getElementById('textDay');
          let textprice = document.getElementById('textprice');
          let textarea = document.getElementById('textarea');
 
          let y_pingfang = res.data.map(v => { return v.area_sum });
          let y_pianshu = res.data.map(v => { return v.task_quantity_sum });
          let y_pingfang_sum = 0;
          let y_pianshu_sum = 0;
          for (let i = 0; i < y_pingfang.length; i++) {
            y_pingfang_sum += y_pingfang[i];
          }
          for (let i = 0; i < y_pianshu.length; i++) {
            y_pianshu_sum += y_pianshu[i];
          }
 
          textDay.innerHTML = "日期:" + res.data[0].CreateDate + " - " + res.data[res.data.length - 1].CreateDate;
          textprice.innerHTML = "片数:" + y_pianshu_sum;
          textarea.innerHTML = "平方数:" + Number(y_pingfang_sum).toFixed(2);
          // this.drawYear('drawLineChart_day51', OptionDayMode, modeOptions);
        } else {
          console.error('请求计划量-月数据失败:', error);
        }
      });
 
  },
  methods: {
    draw(name, Option) {
      var myChart = echarts.init(document.getElementById(name));
      myChart.setOption(Option);
    },
    drawDay(name, Option, data) {
      // console.log(data);
      //Option.title.text="日看板";
      //日看板- 计划量,一线完成,二线完成(片数)
      let x_data = data.map(v => { return v.date });
      let y_jihua = data.map(v => { return v.plan });
      let y_one = data.map(v => { return v.line1 });
      let y_two = data.map(v => { return v.line2 });
      Option.xAxis[0].data = x_data;
      Option.series[0].data = y_jihua;
      Option.series[1].data = y_one;
      Option.series[2].data = y_two;
      this.draw(name, Option);
    },
    drawYear(name, Option, data) {
      //计划量- 平方,片数
      let x_data = data.map(v => { return v.CreateDate });
      let y_pingfang = data.map(v => { return v.area_sum });
      let y_pianshu = data.map(v => { return v.task_quantity_sum });
      Option.xAxis.data = x_data;
      Option.series[0].data = y_pingfang;
      Option.series[1].data = y_pianshu;
      this.draw(name, Option);
    },
    requsstData() {
 
    }
  }
}
</script>
 
<style scoped>
.dashboard-container {
  position: absolute;
  width: 1920px; /* 设计稿宽度 */
  background: linear-gradient(to bottom, #001f3f, #0074d9d7);
  color: white;
  overflow: hidden;
  transition: transform 0.3s ease-out, margin 0.3s ease-out;
}
 
.dashboard-content {
  width: 100%;
  height: 100%;
}
 
:deep(.el-table__header th) {
  background: #052c52!important; 
  color: white!important;
  font-size: large;
}
:deep(.el-table) {
  background: #0b3d6f; 
  color: white;
}
:deep(.el-table__body tr) {
  background: #0b3d6f; 
  color: rgb(3, 160, 181);
  font-size: 23px;
}
 
/*0b3d6f*/
.float {
  float: left;
}
 
.style {
  width: 600px;
  height: 400px;
  border: 1px solid #ccc;
}
 
.chart {
  height: 400px;
}
 
/* 确保图表容器内的echarts实例能够正确显示 */
:deep(.echarts) {
  width: 100% !important;
  height: 100% !important;
}
 
.table-container {
  height: 100%;
  width: 30%;
  border: 1px solid #ccc;
  float: left;
  display: flex;
  flex-direction: column;
}
 
.table-title {
  font-weight: bold;
  font-size: 20px;
  padding: 10px;
  text-align: center;
  background-color: #052c52;
  color: white;
}
 
.table-scroll-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}
 
/* 强制隐藏滚动条但允许滚动内容 */
:deep(.el-table__body-wrapper) {
  overflow: hidden !important;
}
 
/* 鼠标悬停时暂停动画 */
:deep(.el-table__body-wrapper:hover .el-table__body) {
  animation-play-state: paused !important;
}
 
/* 表格字体颜色*/
:deep(.el-table__body tr) {
  color: white;
}
 
:deep(.el-table__body tr:hover td) {
  background-color: #1a4d7f !important;
}
</style>