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
| <template>
| <div id="Didproject">
| <div class="title pointer" @click="linkto">智能仓库综合信息</div>
| <!-- <classify :titlelist="titlelist1" /> -->
| <didnav :titlelist="titlelist1" />
| <didnav :titlelist="titlelist2" />
| <div class="width height-calc250 margin-auto overflow">
| <div class="flex justify-between">
| <p class="width15 fontsiez1rem">设备综合运行时间</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 :color-list="barcolorList" :chart-data="workpiece" class="width height" />
| </div>
| </div>
| </div>
| </template>
|
| <script>
| 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";
| export default {
| components: { classify, WorkpieceEcharts, didnav },
| data() {
| return {
| // datatime: [],
| 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: 85,
| color: "#40C9C6",
| iconcolor: "#40C9C6"
| },
| {
| icon: "storage",
| titel: "出库任务数",
| mun: 0,
| color: "#F4516C",
| iconcolor: "#F4516C"
| },
| {
| icon: "him",
| titel: "总库位数量",
| mun: 0,
| color: "#36A3F7",
| iconcolor: "#36A3F7"
| },
| {
| icon: "clipboard",
| titel: "剩余库位数量",
| mun: 0,
| color: "#34BFA3",
| iconcolor: "#34BFA3"
| }
| ],
| titlelist2: [
| {
| icon: "documentation",
| titel: "RGV-1",
| mun: "正常",
| color: "#345",
| iconcolor: "#40C9C6"
| },
| {
| icon: "storage",
| titel: "RGV-2",
| mun: "正常",
| color: "#345",
| iconcolor: "#F4516C"
| },
| {
| icon: "him",
| titel: "堆垛机-1",
| mun: "正常",
| color: "#345",
| iconcolor: "#36A3F7"
| },
| {
| icon: "clipboard",
| titel: "堆垛机-2",
| mun: "正常",
| color: "#345",
| iconcolor: "#34BFA3"
| }
| ],
| workpiece: {
| data: [
| {
| name: "设备运行时间",
| xdata: ["20.32", "12.65", "50.00", "33.00", "44.00", "20.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00"]
| },
| {
| name: "设备等待时间",
| xdata: ["25.32", "22.65", "33.00", "25.00", "68.00", "23.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00"]
| },
| {
| name: "设备异常时间",
| xdata: ["22.32", "30.65", "40.00", "30.00", "40.00", "53.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
| // 综合效率
| };
| },
| mounted() {
| this.clearInervaltim = setInterval(() => {
| this.getDeviceInfo();
| }, 3000);
| },
| methods: {
| goodsinquer(){
| this.getDeviceInfo()
| },
| // 跳转
| linkto() {
| const { href } = this.$router.resolve({
| path: "/workpiece"
| });
| window.open(href, "_blank");
| },
| // 调接口
| getUserList() {
| const url = "GetTakeStock";
| const params = {};
|
| const callback = res => {};
| this.common.ajax2(url, params, callback, true);
| },
| getDeviceInfo() {
| const url = "/api/task/GetDeviceInfo";
| // debugger
| 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 => {
| //debugger;
| 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];
| }
| this.workpiece = res.data.workpiece;
| };
| this.common.ajax(url, params, callback, false);//不显示loading 【EditBy shaocx,2022-09-22】
| }
| },
| beforeDestroy() {
| if (this.clearInervaltim) {
| clearInterval(this.clearInervaltim);
| this.clearInervaltim = null;
| }
| }
| };
| </script>
| <style lang="scss" scoped>
| // @import url("./didproject.scss");
| #Didproject {
| width: 100%;
| height: 100%;
| overflow: hidden;
| .title {
| position: relative;
| width: 100%;
| text-align: center;
| font-size: 2rem;
| }
| }
| </style>
|
|