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
| <template>
| <div id="Didproject">
| <div class="title pointer margin-bottom" @click="clickFullscreen">
| <div class="bg1"></div>
| <div class="bg2"></div>
| <p class="headline">智能仓库综合信息</p>
| </div>
| <!-- <classify justify="justify-around" :titlelist="titlelist1" :titlebg="titlebg" :titlecolor="titlecolor" /> -->
| <didnav justify="justify-around" :titlelist="titlelist1" :titlebg="titlebg" :titlecolor="titlecolor" />
| <didnav justify="justify-around" :titlelist="titlelist2" :titlebg="titlebg" :titlecolor="titlecolor" />
| <div class="width97 height-calc415 boxshadow4 margin-auto margin-top2 backgroundrgba overflow">
| <div class="flex justify-between padding1020">
| <p class="colorfff fontsiez1_5rem" style="width:300px;">设备综合运行时间</p>
| <div class="width margintopbot flex justify-end">
| <el-date-picker
| v-model="datatime"
| size="mini"
| type="datetimerange"
| value-format="yyyy-MM-dd HH:mm:ss"
| range-separator="至"
| start-placeholder="开始日期"
| end-placeholder="结束日期"
| >
| </el-date-picker>
| <el-button class="margin-left margin-right" type="primary" size="mini" @click="goodsinquer">查询</el-button>
| </div>
| </div>
| <div class="width height-calc75">
|
| <workpiece-echarts :colorList="barcolorList" :chartData="workpiece" class="width height" colors="#fff"/>
| </div>
| </div>
| </div>
| </template>
|
| <script>
| import screenfull from "screenfull";
| import classify from "./com/classify.vue";
| import didnav from "./com/didnav.vue";
| import WorkpieceEcharts from "./com/workpiece.vue";
| import { getDate, GetDateStr, GetTimeStr } from "@/utils/date";
| import { setInterval, clearInterval } from "timers";
| export default {
| data() {
| return {
| datatime: [GetDateStr(-15) + " 00:00:00", getDate() + " " + GetTimeStr(0)],
| //barcolorList: ["#ffc637", "#fc7293", "#8477e9", "#2599f0", "#31c3ea", "#17d8b9", "#e8bdf3"],
| barcolorList: ["#228B22", "#FFFF00", "#FF4500"],
| concolorList: ["#31c3ea", "#17d8b9", "#2599f0", "#e8bdf3", "#ffc637", "#fc7293", "#8477e9"],
| titlelist1: [
| {
| icon: "documentation",
| titel: "入库任务数",
| mun: 0,
| color: "#00CC00",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "storage",
| titel: "出库任务数",
| mun: 0,
| color: "#26CCFF",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "him",
| titel: "总库位数量",
| mun: 0,
| color: "#CC33FF",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "clipboard",
| titel: "剩余库位数量",
| mun: 0,
| color: "#FF0000",
| iconcolor: "#a2a5ab"
| }
| ],
| titlelist2: [
| {
| icon: "in-storage",
| titel: "RGV-1",
| mun: "正常",
| color: "#fff",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "in-storage",
| titel: "RGV-2",
| mun: "正常",
| color: "#fff",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "example",
| titel: "堆垛机-1",
| mun: "正常",
| color: "#fff",
| iconcolor: "#a2a5ab"
| },
| {
| icon: "example",
| titel: "堆垛机-2",
| mun: "正常",
| color: "#fff",
| iconcolor: "#a2a5ab"
| }
| ],
| workpiece: {
| data: [
| {
| name: "设备运行时间",
| xdata: ["20.32", "12.65", "0.00", "51.00", "0.00", "50.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00"]
| },
| {
| name: "设备等待时间",
| xdata: ["25.32", "22.65", "2.00", "5.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00"]
| },
| {
| name: "设备异常时间",
| xdata: ["22.32", "1.65", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00"]
| }
| ],
| legend: ["设备运行时间", "设备等待时间", "设备异常时间"],
| xdata: ["2021-07-09", "2021-07-10", "2021-07-11", "2021-07-12", "2021-07-13", "2021-07-14", "2021-07-15"]
| },
| clearInervaltim: null,
| //综合效率
| titlebg: "rgba(0,0,0,0.3)",
| titlecolor: "#fff"
| };
| },
| components: { classify, WorkpieceEcharts, didnav },
| mounted() {
| this.clearInervaltim = setInterval(() => {
| this.getDeviceInfo();
| }, 3000);
| },
| methods: {
| goodsinquer(){
| this.getDeviceInfo()
| },
| //跳转
| linkto() {
| const { href } = this.$router.resolve({
| path: "/workpiece"
| });
| window.open(href, "_blank");
| },
| clickFullscreen() {
| screenfull.toggle();
| },
| getDeviceInfo() {
| const url = "/api/task/GetDeviceInfo";
| if(this.datatime==null || this.datatime.length==0){
| this.$message.error("请选择时间范围!");
| return
| }
| const params = {
| startTime:this.datatime[0],
| endTime:this.datatime[1]
| };
|
|
| var callback = res => {
| if (res.result !== true) {
| return; //this.$message.error("获取设备信息失败");
| }
| for (let i = 0; i < res.data.list1.length; i++) {
| this.titlelist1[i].mun = res.data.list1[i];
| }
| for (let i = 0; i < res.data.list2.length; i++) {
| this.titlelist2[i].mun = res.data.list2[i];
| }
| debugger;
| this.workpiece = res.data.workpiece;
| };
| this.common.ajax(url, params, callback, false);
| }
| },
| beforeDestroy() {
| if (this.clearInervaltim) {
| clearInterval(this.clearInervaltim);
| this.clearInervaltim = null;
| }
| }
| };
| </script>
| <style lang="scss" scoped>
| #Didproject {
| width: 100%;
| height: 100%;
| margin-bottom: 2%;
| overflow: hidden;
| background: linear-gradient(165deg, #294f80, #3d256b, #1c1636);
| .title {
| position: relative;
| width: 100%;
| height: 80px;
| color: #fff;
| text-align: center;
| font-size: 2rem;
| .bg1 {
| position: absolute;
| top: 0;
| width: 100%;
| height: 40px;
| background: rgba(0, 0, 0, 0.3);
| }
| .bg2 {
| position: absolute;
| left: 50%;
| bottom: 0;
| width: 50%;
| // height: 40px;
| transform: translateX(-50%);
| border-right: 40px solid rgba(0, 0, 0, 0);
| border-top: 40px solid rgba(0, 0, 0, 0.3);
| border-left: 40px solid rgba(0, 0, 0, 0);
| }
| .headline {
| position: absolute;
| top: 50%;
| left: 50%;
| transform: translate(-50%, -50%);
| }
| }
| }
| </style>
|
|