懒羊羊
2024-01-23 4f91e27a1a497b5ed9de6be2267a8a57085e7c82
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
<template>
  <div class="main">
    <div style="width: 640px;height: 440px;float: left;">
      <dv-border-box-2>
        <div>
          <div class="d-flex pt-2 pl-2">
        <span>
          <icon name="chart-line" style="background-color: #c3cbde" class="text-icon"></icon>
        </span>
            <div class="d-flex">
              <span class="fs-xl text mx-2">不良分布</span>
            </div>
          </div>
          <BottomLeftChart />
        </div>
      </dv-border-box-2>
    </div>
    <div style="width: 872px;height: 440px;float: right">
      <dv-border-box-2>
      <div id="centerRight1">
        <div class="bg-color-black">
          <div class="d-flex jc-center body-box">
            <dv-scroll-board class="dv-scr-board" :config="config" />
          </div>
        </div>
      </div>
      </dv-border-box-2>
 
    </div>
  </div>
</template>
 
<script>
import BottomLeftChart from '@/components/echart/bottom/bottomLeftChart'
 
 
export default {
  name: "center",
  components: {
    BottomLeftChart,
  },
  data() {
    return {
      value:'',
      config: {
        header: ['时间', '目标', '实际产量', '差异', '良率'],
        data: [
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>8:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>9:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>30</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>40</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>10:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>11:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>12:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>13:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>14:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>15:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>16:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          ['<span style=\'font-size: 20px\' class=\'colorRed\'>17:00</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>', '<span style=\'font-size: 20px\' class=\'colorRed\'>0</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>70</span>','<span style=\'font-size: 20px\' class=\'colorRed\'>100%</span>'],
          //
          // ['9:00', '70', "10","60","90%"],
          // ['10:00', '70', "3","67","100%"],
          // ['11:00', '70', "2","68","50%"],
          // ['12:00', '70', "1","69","100%"],
          // ['13:00', '70', "4","66","100%"],
          // ['14:00', '70', "5","65","100%"],
          // ['15:00', '70', "0","70","100%"],
          // ['16:00', '70', "0","70","100%"],
          // ['17:00', '70', "0","70","100%"],
        ],
        rowNum: 7, //表格行数
        headerHeight: 35,
        headerBGC: '#0f1325', //表头
        oddRowBGC: '#0f1325', //奇数行
        evenRowBGC: '#171c33', //偶数行
        index: true,
        columnWidth: [50],
        align: ['center'],
      }
    }
  },
  mounted() {
    this.tops();
    this.changeTiming();
    this.$bus.$on('refresh-components', (value) => {
      // 刷新初始化方法
      this.value = value;
      this.tops();
    })
  },
  methods: {
    tops(){
      // this.$http.get('http://127.0.0.1:8080/productionOrdeInfo/centerRightData?workOrderNo='+this.value)
      this.$http.get('http://172.20.1.10:8080/productionOrdeInfo/centerRightData?workOrderNo='+this.value)
          .then((response)=>{
            this.config = {
              header: ['时间', '目标', '实际产量', '差异', '良率'],
              data:  response.data.data,
              rowNum: 7, //表格行数
              headerHeight: 35,
              headerBGC: '#0f1325', //表头
              oddRowBGC: '#0f1325', //奇数行
              evenRowBGC: '#171c33', //偶数行
              index: true,
              columnWidth: [50],
              align: ['center'],
            }
            console.log(response.data.data)
          })
    },
    changeTiming() {
      setInterval(() => {
        this.tops();
      }, 300000)
    },
  }
}
</script>
 
<style lang="scss" scoped>
$box-height: 440px;
$box-width: 867px;
.body-box {
  border-radius: 10px;
  overflow: hidden;
  .dv-scr-board {
    width: 100%;
    height: 360px;
  }
}
#centerRight1 {
  padding: 5px;
  padding-top: 20px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
  .bg-color-black {
    height: $box-height - 30px;
    border-radius: 10px;
  }
  .text {
    color: #c3cbde;
    font-size: 20px;
    margin-top: -1px;
  }
  .body-box {
    border-radius: 10px;
    overflow: hidden;
    .dv-scr-board {
      width: $box-width;
      height: $box-height - 60px;
    }
  }
}
.text {
  color: #c3cbde;
  font-size: 20px;
  margin-top: -1px;
}
</style>