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
| <template>
| <div class="data-container">
| <!-- <wrapper-title
| :title="'工单数据'"
| :path="'/work-order-center/maintenance/work-order/work-order'"
| ></wrapper-title> -->
|
| <div class="data-content">
| <div class="data-panel">
| <div class="panel-title" style="margin-bottom: 30px">
| <div class="icon">
| <img src="@/assets/icons/arrow.png" alt="" />
| </div>
| <div class="title">整体工单数</div>
| </div>
| <div class="panel-container">
| <div class="panel-item">
| <data-hola
| :holaTitle="`工单总数`"
| :centerValue="workOrderData.workOrderTotal.totalNum"
| :holaColor="`#4ea8ff`"
| ></data-hola>
| </div>
| <div class="panel-item">
| <data-hola
| :holaTitle="`已处理工单数`"
| :centerValue="workOrderData.workOrderTotal.todolNum"
| :holaColor="`#5dec24`"
| ></data-hola>
| </div>
| <div class="panel-item">
| <data-hola
| :holaTitle="`未处理工单数`"
| :centerValue="workOrderData.workOrderTotal.doneNum"
| :holaColor="`#dfc639`"
| ></data-hola>
| </div>
| </div>
| </div>
| <div class="data-panel">
| <div class="panel-title" style="margin: 50px 0 30px 0">
| <div class="icon">
| <img src="@/assets/icons/arrow.png" alt="" />
| </div>
| <div class="title">分区工单数</div>
| </div>
| <div class="echart-container">
| <div id="barChart" ref="barChart"></div>
| </div>
| </div>
| </div>
| </div>
| </template>
|
| <script>
| import * as echarts from "echarts";
| import WrapperTitle from "../wrapper-title/index";
| import DataHola from "./components/data-hola";
| let chart = null;
| export default {
| name: "ScreenData",
| components: {
| WrapperTitle,
| DataHola,
| },
| props: {
| workOrderData: {
| type: Object,
| default: null,
| },
| },
| data() {
| return {
| dataList: {
| name: [
| "富顺县",
| "荣县",
| "高新区",
| "自流井区",
| "贡井区",
| "大安区",
| "沿滩区",
| ],
| data1: [210, 310, 40, 102, 111, 201, 123],
| data2: [20, 30, 10, 10, 11, 21, 5],
| },
| };
| },
| methods: {
| initEchart() {
| const option = {
| grid: {
| top: "10%",
| right: 0,
| bottom: "17%",
| },
| legend: {
| right: 0,
| textStyle: {
| color: "#fff",
| },
| },
| tooltip: {},
| xAxis: {
| type: "category",
| axisLabel: {
| color: "#fff",
| rotate: 45,
| },
| data: this.dataList.name,
| },
| yAxis: {
| axisLabel: {
| color: "#fff",
| },
| },
| series: [
| {
| type: "bar",
| name: "已处理工单数",
| stack: "total",
| itemStyle: {
| color: "#4ea8ff",
| },
| data: this.dataList.data1,
| },
| {
| type: "bar",
| name: "未处理工单数",
| stack: "total",
| itemStyle: {
| color: "#dfc639",
| },
| data: this.dataList.data2,
| },
| ],
| };
| chart.setOption(option, true);
| },
| },
| mounted() {
| chart = echarts.init(this.$refs.barChart);
| this.initEchart();
| },
| };
| </script>
|
| <style lang="scss" scoped>
| .data-container {
| width: 100%;
| height: 500px;
| display: flex;
| flex-direction: column;
|
| .data-content {
| flex: 1;
| padding: 10px;
| }
| }
|
| .echart-container {
| width: 100%;
| height: 260px;
|
| #barChart {
| width: 100%;
| height: 100%;
| }
| }
|
| .panel-title {
| color: #b9b9b9;
| display: flex;
| align-items: center;
|
| .icon {
| width: 20px;
| margin-right: 5px;
|
| img {
| width: 100%;
| display: block;
| }
| }
| }
|
| .panel-container {
| width: 100%;
| display: flex;
| justify-content: space-around;
| margin: 10px 0;
|
| .panel-item {
| width: 110px;
| height: 110px;
| }
| }
| </style>
|
|