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
| <!-- 空白页 -->
|
|
| <script setup>
| import { ref, computed } from 'vue'
| import * as echarts from 'echarts';
| </script>
| <script>
| export default {
| mounted() {
| const OptionDay={ // 绘制图表
| title: {
| text: '产量看板示例'
| },
| tooltip: {
| trigger: 'axis',
| axisPointer: {
| type: 'cross',
| label: {
| backgroundColor: '#6a7985'
| }
| }
| },
| legend: {
| data: ['计划产量', '实际产量']
| },
| toolbox: {
| feature: {
| saveAsImage: {}
| }
| },
| grid: {
| left: '3%',
| right: '4%',
| bottom: '3%',
| containLabel: true
| },
| xAxis: [
| {
| type: 'category',
| boundaryGap: false,
| data: ['1-01', '1-02', '1-03', '1-04', '1-05',
| '1-06', '1-07', '1-08', '1-09', '1-10',
| '1-11', '1-12', '1-13', '1-14', '1-15',
| '1-16', '1-17', '1-18', '1-19', '1-20',
| '1-21', '1-22', '1-23', '1-24', '1-25',
| '1-26', '1-27', '1-28', '1-29', '1-30', '1-31']
| }
| ],
| yAxis: [
| {
| type: 'value'
| }
| ],
| series: [
| {
| name: '计划产量',
| type: 'line',
| areaStyle: {},
| label: {
| show: true,
| position: 'top'
| },
| data: [120, 132, 101, 134, 90, 230, 210,
| 120, 132, 101, 134, 90, 230, 210,
| 120, 132, 101, 134, 90, 230, 210,
| 120, 132, 101, 134, 90, 230, 210,
| 120, 132, 101]
| },
| {
| name: '实际产量',
| type: 'line',
| areaStyle: {},
| emphasis: {
| focus: 'series'
| },
| data: [100, 122, 101, 124, 90, 200, 180,
| 100, 122, 101, 124, 90, 200, 180,
| 100, 122, 101, 124, 90, 200, 180,
| 100, 122, 101, 124, 90, 200, 180,
| 100, 122, 101]
| }
| ]
|
| }
| this.drawDay('drawLineChart_day11',OptionDay, 1);
| // this.drawLineChart('drawLineChart_day11', 1);
| // this.drawLineChart('drawLineChart_day21', 1);
| // this.drawLineChart('drawLineChart_day31', 1);
| // this.drawLineChart('drawLineChart_day41', 1);
| // this.drawLineChart('drawLineChart_day51', 1);
| //this.drawLineChart('drawLineChart_week', 1);
| //this.drawBarchart('drawBarchart', 1);
| },
| methods: {
| //方法
| draw(name, Option,data) {
| var myChart = echarts.init(document.getElementById(name));
| myChart.setOption(Option);
| },
| drawDay(name, Option,data) {
| Option.title.text="日看板";
| console.log(Option);
| this.draw(name, Option,data);
| },
| drawLineChart(name, Option,data) {
| console.log(name);
| console.log(data);
| var myChart = echarts.init(document.getElementById(name));
| myChart.setOption(Option);
| },
| drawBarchart(name, data) {
| var myChart = echarts.init(document.getElementById(name));
| myChart.setOption({ // 绘制图表
| title: {
| text: '总产量看板示例'
| },
| tooltip: {
| trigger: 'item'
| },
| legend: {
| top: '5%',
| left: 'center'
| },
| series: [
| {
| name: 'Access From',
| type: 'pie',
| radius: ['40%', '70%'],
| avoidLabelOverlap: false,
| label: {
| show: false,
| position: 'center'
| },
| emphasis: {
| label: {
| show: true,
| fontSize: 40,
| fontWeight: 'bold'
| }
| },
| labelLine: {
| show: false
| },
| data: [
| { value: 1000, name: '计划总片数' },
| { value: 900, name: '实际总片数' },
| { value: 10, name: '破损片数' }
| ]
| , label: {
| formatter: '{b}:{c}'
| }
| }
| ]
|
|
| });
| }
| }
| }
| </script>
|
| <template>
| <div>
| <div style="font-size: 30px;height: 70px;line-height: 70px;border: 1px solid #ccc;text-align: center;">
| JOOMO镜片制造中心驾驶舱
| </div>
| <div style="margin-left: 20px;">
| <el-button type="primary" @click="drawPieChart">标准品</el-button>
| <el-button type="primary" @click="drawPieChart">定制品</el-button>
| </div>
| <div style="width:100% ;height: 880px;">
| <div style="width:33.3% ;height: 100%;border: 1px solid #ccc;float: left;">
| <div id="drawLineChart_day11" style="height: 50%;width: 100%;border: 1px solid #ccc;">日单达成率-片数</div>
| <div id="drawLineChart_day21" style="height: 50%;width: 100%;border: 1px solid #ccc;">月单达成率-片数</div>
| </div>
| <div style="width:33.3% ;height: 100%;border: 1px solid #ccc;float: left;">
| <div id="drawLineChart_day31" style="height: 50%;width: 100%;border: 1px solid #ccc;">日单达成率-平方</div>
| <div id="drawLineChart_day41" style="height: 50%;width: 100%;border: 1px solid #ccc;">月单达成率-平方</div>
| </div>
| <div style="width:33.3% ;height: 100%;border: 1px solid #ccc;float: left;">
| <div id="drawLineChart_day51" style="height: 33.3%;width: 100%;border: 1px solid #ccc;">合格率-显示当天</div>
| <div id="drawLineChart_day61" style="height: 33.3%;width: 100%;border: 1px solid #ccc;">设备稼动率</div>
| <div id="drawLineChart_day71" style="height: 33.3%;width: 100%;border: 1px solid #ccc;">能耗管理-按天显示(手输)</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>
| </template>
| <style scoped>
| .float{
| float: left;
| }
| .style{
| width: 600px;
| height: 400px;
| border: 1px solid #ccc;
| }
| .chart {
| height: 400px;
| }
| </style>
|
|