赖素文
authored
|
1
|
let action = null;
|
赖素文
authored
|
2
3
4
|
layui.config({
base: "/js/",
version: 1
|
赖素文
authored
|
5
|
}).use(['system', "vue"], function () {
|
赖素文
authored
|
6
7
8
9
10
11
12
13
14
15
16
|
var form = layui.form,
$ = layui.jquery,
element = layui.element,
table = layui.table,
system = layui.system,
sysU = new system.u(),
sendDataWhere = null,
sendDataDescWhere = null,
areaName = "configure",
controllerName = "BaseProject",
projectKeys = null,
|
HuXiYu
authored
|
17
|
projectName = "",
|
赖素文
authored
|
18
19
|
projectCode = "",
sysEqAllSumObj = null,
|
赖素文
authored
|
20
|
intervalTime = null,
|
赖素文
authored
|
21
|
vueApp = null,
|
赖素文
authored
|
22
23
24
25
26
27
28
29
|
app = null;
action = {
}
app = {
data: {
|
赖素文
authored
|
30
31
32
33
34
35
|
cols: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{
field: "equipmentName", width: 220, title: "设备"
},
{
|
赖素文
authored
|
36
|
field: "Status", width: 150, title: "ip地址(5min无数据)", templet: function (d) {
|
HuXiYu
authored
|
37
|
//if (d.Status == "" || d.Status == null) return "";
|
赖素文
authored
|
38
39
|
var bg = "layui-badge-dot layui-bg-green",
statusText = "在线";
|
赖素文
authored
|
40
|
if (d.Status == "Failure" || d.Status == "Error") {
|
赖素文
authored
|
41
42
43
|
statusText = "故障";
bg = "layui-badge-dot layui-bg-red";
}
|
赖素文
authored
|
44
|
if (d.seconds > 300 || d.seconds == -1) {
|
赖素文
authored
|
45
46
47
48
49
50
51
|
statusText = "离线";
bg = "layui-badge-dot layui-bg-gray";
}
return `<span class="${bg}" style=" left: 7px;"></span> <span style="padding-left: 8px;">${statusText}</span`;
}
}
]],
|
赖素文
authored
|
52
53
54
55
56
57
|
colsFailure: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{ field: "equipmentName", width: 220, title: "设备" },
{ field: "alarmMessage", width: 300, title: "报警信息" },
{ field: "createTime", width: 150, title: "开始时间" },
|
赖素文
authored
|
58
59
60
61
|
{ field: "updateTime", width: 150, title: "结束时间" },
{
field: "errorduration", width: 200, title: "故障时间(分)", templet: function (d) {
var minutes = Math.floor(d.errorduration / 60); // 获取整数分钟
|
赖素文
authored
|
62
|
var remainingSeconds = Math.floor(d.errorduration % 60); // 获取剩余的秒数
|
赖素文
authored
|
63
64
65
|
return minutes + "分钟" + remainingSeconds + "秒";
}
},
|
赖素文
authored
|
66
|
|
赖素文
authored
|
67
|
]],
|
赖素文
authored
|
68
|
colsProper: [[
|
赖素文
authored
|
69
70
71
72
73
74
75
76
77
|
{ field: "index", width: 70, title: "序号", fixed: "left" },
{ field: "EquipmentName", width: 180, title: "设备名称" }
//{
// field: "remark", width: 200, title: "故障时间-总时间(分)",
// templet: function (d) {
// return `${d.ErrorDuration}--${d.SumDuration}`; // 返回原始字符串
// }
//}
|
赖素文
authored
|
78
|
]],
|
赖素文
authored
|
79
80
81
82
83
|
colsPropers: [[
{ field: "index", width: 70, title: "序号", fixed: "left" },
{ field: "EquipmentName", width: 180, title: "设备名称" }
]],
|
赖素文
authored
|
84
85
86
|
colsOee: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{ field: "EquipmentCode", width: 220, title: "设备编码" },
|
赖素文
authored
|
87
|
{ field: "EquipmentName", width: 180, title: "设备名称" },
|
赖素文
authored
|
88
|
{ field: "Date", width: 120, title: "时间" },
|
赖素文
authored
|
89
90
91
92
93
94
95
96
97
98
99
100
101
|
{ field: "Oee", width: 150, title: "Oee" },
{
field: "remark", width: 200, title: "运行-空闲-故障时间(分钟)",
templet: function (d) {
var run = d.RunningDuration;
if (run == 0) run = 0;
var free = d.FreeDuration;
if (free == 0) free = 0;
var error = d.ErrorDuration;
if (error == 0) error = 0;
return `${run}--${free}--${error}`;
}
}
|
赖素文
authored
|
102
103
104
105
|
]],
colsMttr: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{ field: "EquipmentCode", width: 220, title: "设备编码" },
|
赖素文
authored
|
106
|
{ field: "EquipmentName", width: 180, title: "设备名称" },
|
赖素文
authored
|
107
|
{ field: "Date", width: 120, title: "时间" },
|
赖素文
authored
|
108
109
110
111
112
113
114
115
116
|
{ field: "Mttr", width: 150, title: "Mttr(单位H)" },
{
field: "remark", width: 200, title: "故障时间(H)-故障次数",
templet: function (d) {
var temp = (d.ErrorDuration / 60).toFixed(2);
if (temp == 0) temp = 0;
return `${temp}--${d.ErrorCount}`;
}
}
|
赖素文
authored
|
117
118
119
120
121
|
]],
colsMtbf: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{ field: "EquipmentCode", width: 220, title: "设备编码" },
|
赖素文
authored
|
122
|
{ field: "EquipmentName", width: 180, title: "设备名称" },
|
赖素文
authored
|
123
|
{ field: "Date", width: 120, title: "时间" },
|
赖素文
authored
|
124
125
126
127
128
129
130
131
132
133
134
|
{ field: "Mtbf", width: 150, title: "Mtbf(单位H)" },
{
field: "remark", width: 200, title: "运行(H)-空闲时间(H)-故障次数",
templet: function (d) {
var run = (d.RunningDuration / 60).toFixed(2);
if (run == 0) run = 0;
var free = (d.FreeDuration / 60).toFixed(2);
if (free == 0) free = 0;
return `${run}--${free}--${d.ErrorCount}`;
}
}
|
赖素文
authored
|
135
136
|
]],
|
赖素文
authored
|
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
colsAlarm: [[
{ field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
{ field: "equipmentCode", width: 200, title: "设备编号", hide: true, },
{ field: "equipmentName", width: 150, title: "设备名称" },
{
field: "alarmMessage", width: 400, title: "报警信息" ,templet: function (d) {
return d.alarmMessage + " " + d.remark;
}
},
{
field: "errorduration", width: 150, title: "报警持续时间", templet: function (d) {
return app.methods.convertSecondsToTime(d.errorduration)
}
},
{ field: "createTime", width: 150, title: "创建时间" }
]],
|
赖素文
authored
|
154
155
|
tableIns: null,
tableElem: "mainList",
|
王硕
authored
|
156
|
refreshDataTimeEle: document.getElementById('refreshDataTime'),
|
赖素文
authored
|
157
158
159
|
echartOpt: {
eqTuoShanRateEle: document.getElementById("eqTuoShanRate"),
eqAlarmsNumberEle: document.getElementById("eqAlarmsNumber"),
|
赖素文
authored
|
160
|
eqPowerOnTimeEle: document.getElementById("eqPowerOnTime"),
|
赖素文
authored
|
161
|
tuoShanRatelegendData: "".GetTimeRange("","",6)
|
赖素文
authored
|
162
|
}
|
赖素文
authored
|
163
164
|
},
methods: {
|
赖素文
authored
|
165
|
//设备在线状况 表格
|
赖素文
authored
|
166
167
|
initTable: function (opt) {
var config = { projectKeys: projectKeys }
|
王硕
authored
|
168
|
|
赖素文
authored
|
169
170
171
|
if (opt != undefined) $.extend(config, opt);
let options = {
elem: "#" + app.data.tableElem,
|
HuXiYu
authored
|
172
|
url: `/configure/BaseProject/GetEqInfoByProjectKeys`,
|
赖素文
authored
|
173
174
175
176
177
178
179
180
|
cols: app.data.cols,
height: 'full-400', // 最大高度减去其他容器已占有的高度差
where: config,
page: false
}
app.data.tableIns = sysU.initTable(options);
},
|
赖素文
authored
|
181
|
//每台设备妥善率 曲线图
|
王硕
authored
|
182
|
initEchartsTuoShanRate: function (failureTime) {
|
赖素文
authored
|
183
|
let legendDataTemp = failureTime.uniqueFunc("EquipmentName")
|
王硕
authored
|
184
|
let legendData = []
|
赖素文
authored
|
185
|
|
王硕
authored
|
186
187
|
window.eqTuoShanRateOpt.xAxis[0].data = app.data.echartOpt.tuoShanRatelegendData
window.eqTuoShanRateOpt.series = [];
|
王硕
authored
|
188
|
for (let i = 0; i < legendDataTemp.length; i++) {
|
赖素文
authored
|
189
|
legendData.push(legendDataTemp[i].EquipmentName)
|
王硕
authored
|
190
|
|
王硕
authored
|
191
|
var seriesItem = {
|
赖素文
authored
|
192
|
name: legendDataTemp[i].EquipmentName,
|
王硕
authored
|
193
194
195
196
197
|
type: 'line',
data: []
};
for (let j = 0; j < app.data.echartOpt.tuoShanRatelegendData.length; j++) {
const timeVal = app.data.echartOpt.tuoShanRatelegendData[j];
|
赖素文
authored
|
198
|
const result = failureTime.GetArrValueRows({ key: 'Date', val: timeVal }, {
|
赖素文
authored
|
199
|
key: 'EquipmentName', val: seriesItem.name
|
赖素文
authored
|
200
|
});
|
赖素文
authored
|
201
|
|
王硕
authored
|
202
|
let data = 0;
|
赖素文
authored
|
203
|
if (result.length == 1) {
|
赖素文
authored
|
204
|
data = result[0].Proper.replace("%", "")
|
赖素文
authored
|
205
206
|
} else {
//console.log(`ProjectOverview 文件 GetArrValueRows 读取到:${result.length}条数据`)
|
王硕
authored
|
207
|
}
|
赖素文
authored
|
208
|
seriesItem.data.push(data);
|
王硕
authored
|
209
210
211
|
}
window.eqTuoShanRateOpt.series.push(seriesItem)
}
|
赖素文
authored
|
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
//新增默认 目标值
legendData.push("目标值")
window.eqTuoShanRateOpt.series.push({
name: "目标值",
symbolSize: 10, //小圆点的大小
color: 'red',
type: 'line',
data: ["99", "99", "99", "99", "99", "99", "99", "99"],
lineStyle: {
normal: {
width: 3,
type: 'dashed',
},
},
itemStyle: {
normal: {
lineStyle: {
width: 4, //线条宽度
},
},
},
});
|
王硕
authored
|
234
|
window.eqTuoShanRateOpt.legend.data = legendData
|
王硕
authored
|
235
|
let myChart = echarts.init(app.data.echartOpt.eqTuoShanRateEle)
|
赖素文
authored
|
236
|
|
赖素文
authored
|
237
238
239
240
|
myChart.clear()
myChart.setOption(window.eqTuoShanRateOpt)
},
|
赖素文
authored
|
241
|
//设备开机时间
|
赖素文
authored
|
242
243
|
//设备开机时间
initEchartsPowerOnTime: function (PowerOnTimeData) {
|
赖素文
authored
|
244
|
var opt = "".copyObj2(window.eqPowerOnTimeOpt)
|
赖素文
authored
|
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
opt.legend.data = []
opt.series = [];
const legendData = [...new Set(PowerOnTimeData.map(x => x.EquipmentName))];
opt.legend.data = legendData
const deviceData = PowerOnTimeData.reduce((acc, curr) => {
const { EquipmentName, PowerOnTime } = curr;
if (!acc[EquipmentName]) {
acc[EquipmentName] = {
name: EquipmentName,
type: 'line',
data: []
};
}
acc[EquipmentName].data.push(PowerOnTime);
return acc;
}, {});
for (const key in deviceData) {
opt.series.push(deviceData[key]);
}
opt.xAxis[0].data = app.data.echartOpt.tuoShanRatelegendData
|
赖素文
authored
|
267
268
269
270
271
272
273
|
let myChart = echarts.init(app.data.echartOpt.eqPowerOnTimeEle)
myChart.clear()
myChart.setOption(opt)
},
//故障次数 柱状图
|
王硕
authored
|
274
|
initEchartsAlarmsNumber: function (failureCount) {
|
王硕
authored
|
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
var xaxisdata = [];
var faultFrequency = []
let totalCount = 0;
// 计算所有 x.count 的总和
failureCount.forEach(x => {
totalCount += x.count;
});
const relativeCount = []
failureCount.forEach(x => {
let totalCountNum = (x.count / totalCount) * 100
relativeCount.push(totalCountNum.toFixed(2))
xaxisdata.push(x.equipmentName)
faultFrequency.push(x.count)
})
if (failureCount.length <= 15) {
window.eqAlarmsNumber.dataZoom[0].end = 99
} else {
window.eqAlarmsNumber.dataZoom[0].end = 20
}
window.eqAlarmsNumber.xAxis[0].data =[]
window.eqAlarmsNumber.xAxis[0].data = xaxisdata;
window.eqAlarmsNumber.series[0].data = faultFrequency;
window.eqAlarmsNumber.series[1].data = relativeCount;
|
赖素文
authored
|
300
301
302
|
let myChart = echarts.init(app.data.echartOpt.eqAlarmsNumberEle)
myChart.clear()
myChart.setOption(window.eqAlarmsNumber)
|
赖素文
authored
|
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
myChart.off('click');
myChart.on("click", params => {
var equipmentCode = failureCount[params.dataIndex].equipmentCode;
var createTime = app.data.echartOpt.tuoShanRatelegendData[0] + " 00:00:01";
var updateTime = app.data.echartOpt.tuoShanRatelegendData[app.data.echartOpt.tuoShanRatelegendData.length - 1] + " 23:59:59";
var ajaxConfig = {
data: {
equipmentCode: equipmentCode,
createTime: createTime,
updateTime: updateTime,
},
url: `/equipment/DaqEquipmentAlarmRecord/LoadDesc`,
type: "post",
success: function (result) {
if (sysU.successBefore(result)) return false;
sysU.openPage({
title: `故障详情【${result.Count}条】`,
area: ["1100px", "590px"],
type: 1,
btn: ['关闭'],
content: $('#eleAlarm'),
successCallBackFn: function () {
let options = {
elem: "#tableAlarm",
cols: app.data.colsAlarm,
height: 'full-110',
data: result.Result,
page: false,
limit: Number.MAX_VALUE,
}
sysU.initTable(options);
}
});
}
};
sysU.ajax(ajaxConfig);
});
|
赖素文
authored
|
341
|
},
|
赖素文
authored
|
342
|
|
赖素文
authored
|
343
|
//设备故障超40分钟
|
赖素文
authored
|
344
345
346
347
348
349
350
351
352
353
354
|
initTableFailure40: function (failureOverFourty) {
let options = {
elem: "#mainAlarms" ,
cols: app.data.colsFailure,
data: failureOverFourty,
height: 'full-400', // 最大高度减去其他容器已占有的高度差
page: false
}
app.data.tableIns = sysU.initTable(options);
},
|
HuXiYu
authored
|
355
|
refreshDataMethod: function () {
|
王硕
authored
|
356
357
|
let currenttime = parseInt(app.data.refreshDataTimeEle.innerHTML);
if (currenttime === 0) {
|
HuXiYu
authored
|
358
|
currenttime = vueApp.refreshDataTime;
|
王硕
authored
|
359
360
361
362
363
364
365
366
|
app.methods.getEquipmentDataList();
app.methods.getEqEchartsDataList();
} else {
currenttime--;
}
app.data.refreshDataTimeEle.innerHTML = currenttime;
},
|
赖素文
authored
|
367
368
369
370
371
372
373
|
/**
* 初始化vue
*/
initVue: function () {
vueApp = new Vue({
el: '.vueApp',
data: {
|
赖素文
authored
|
374
|
refreshDataTime: 40,
|
赖素文
authored
|
375
376
|
head: {
projectName: 0
|
HuXiYu
authored
|
377
378
379
|
},
body: {
eqCount: 0,
|
赖素文
authored
|
380
|
eqRunCount: 0,
|
HuXiYu
authored
|
381
|
eqStandBy: 0,
|
HuXiYu
authored
|
382
|
eqOffline: 0,
|
赖素文
authored
|
383
|
eqError: 0,
|
HuXiYu
authored
|
384
|
|
赖素文
authored
|
385
|
eqOnlineRate: 0,
|
HuXiYu
authored
|
386
|
},
|
赖素文
authored
|
387
388
389
390
391
392
|
eqSumObj: {
oee: 0,
mttr: 0,
mtbf: 0,
proper:0
}
|
赖素文
authored
|
393
394
395
396
|
},
methods: {
},
|
HuXiYu
authored
|
397
|
ready: function () {
|
HuXiYu
authored
|
398
|
this.head.projectName = `${projectName}`;
|
赖素文
authored
|
399
|
}
|
赖素文
authored
|
400
401
402
|
});
},
/**
|
HuXiYu
authored
|
403
|
* vue 集合赋值 result.Result.eqCount
|
赖素文
authored
|
404
|
*/
|
HuXiYu
authored
|
405
|
initVueDataValue: function (result) {
|
HuXiYu
authored
|
406
407
|
var res = result.Result;
vueApp.body.eqCount = res.eqSumCount;
|
赖素文
authored
|
408
|
vueApp.body.eqRunCount = res.eqRunCount;
|
HuXiYu
authored
|
409
|
vueApp.body.eqStandBy = res.eqStandByCount;
|
HuXiYu
authored
|
410
411
412
|
vueApp.body.eqError = res.eqErrorCount;
vueApp.body.eqOffline = res.eqOffLineCount;
|
HuXiYu
authored
|
413
|
vueApp.body.eqOnlineRate = res.runningRate;
|
赖素文
authored
|
414
415
416
|
},
getUrlParam: function () {
|
赖素文
authored
|
417
418
|
projectKeys = localStorage.getItem("projectMapKeys");
projectName = localStorage.getItem("projectMapName");
|
|
419
|
projectCode = localStorage.getItem("projectCode");
|
赖素文
authored
|
420
|
},
|
HuXiYu
authored
|
421
422
423
424
425
426
427
428
429
430
431
432
|
getEquipmentDataList() {
var ajaxConfig = {
data: { pageRequest: null, entity: { flag: "projectMapList", keys: projectKeys } },
url: `/configure/BaseProject/LoadProjectOverview`,
success: function (result) {
if (sysU.successBefore(result)) return false;
app.methods.initVueDataValue(result);
}
};
sysU.ajax(ajaxConfig);
},
|
王硕
authored
|
433
|
//妥善率/故障次数/设备故 障统一数据请求接口
|
王硕
authored
|
434
435
436
437
438
439
|
getEqEchartsDataList() {
var ajaxConfig = {
data: { projectKeys: projectKeys },
url: `/configure/BaseProject/GetFailureList`,
success: function (result) {
if (sysU.successBefore(result)) return false;
|
王硕
authored
|
440
|
app.methods.initEchartsAlarmsNumber(result.Result.failureCount);
|
赖素文
authored
|
441
|
app.methods.initTableFailure40(result.Result.failureOverFourty);
|
王硕
authored
|
442
443
444
445
|
}
};
sysU.ajax(ajaxConfig);
},
|
赖素文
authored
|
446
447
|
//OEE、MTTR、MTBF、妥善率 请求数据接口
|
赖素文
authored
|
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
getEquipmentsExtendIndexData() {
var endDay = new Date();
var startDay = new Date(endDay.getTime() - (6 * 24 * 60 * 60 * 1000)); // 6天前
var ajaxConfig = {
data: {
projectName: projectName,
argument: projectCode,
tag: 2,
startDay: startDay.format("yyyy-MM-dd"),
endDay: endDay.format("yyyy-MM-dd"),
},
url: `/api/BusEquipmentData/GetEquipmentsExtendIndexData`,
type: "get",
success: function (result) {
if (sysU.successBefore(result)) return false;
vueApp.eqSumObj.oee = result.Result.sumDt.Oee;
vueApp.eqSumObj.mttr = result.Result.sumDt.Mttr;
vueApp.eqSumObj.mtbf = result.Result.sumDt.Mtbf;
vueApp.eqSumObj.proper = result.Result.sumDt.Proper;
sysEqAllSumObj = result.Result.detailDt;
}
};
sysU.ajax(ajaxConfig);
},
|
赖素文
authored
|
474
475
|
//设备开机时间接口
getEqEchartsPowerOnTimeDataList() {
|
赖素文
authored
|
476
|
var ajaxConfig = {
|
赖素文
authored
|
477
478
|
data: { projectKeys: projectKeys },
url: `/configure/BaseProject/GetEqPowerOnTime`,
|
赖素文
authored
|
479
480
|
success: function (result) {
if (sysU.successBefore(result)) return false;
|
赖素文
authored
|
481
482
|
//设备开机时间
app.methods.initEchartsPowerOnTime(result.Result);
|
赖素文
authored
|
483
484
485
486
|
}
};
sysU.ajax(ajaxConfig);
},
|
赖素文
authored
|
487
488
489
490
491
|
convertSecondsToTime: function (seconds) {
if (typeof seconds !== 'number') return seconds;
var hours = Math.floor(seconds / 3600);
var minutes = Math.floor((seconds % 3600) / 60);
|
赖素文
authored
|
492
|
var remainingSeconds = Math.floor(seconds % 60);
|
赖素文
authored
|
493
494
495
496
497
498
499
500
501
502
503
504
|
var result = '';
if (hours > 0) {
result += hours + '小时';
}
if (minutes > 0) {
result += minutes + '分';
}
result += remainingSeconds + '秒';
return result;
},
|
赖素文
authored
|
505
506
507
|
init: function () {
var tempElem = $(".sys-a-det");
tempElem.attr("href", tempElem.data("scr") + `?projectKeys=${projectKeys}`)
|
HuXiYu
authored
|
508
509
|
app.methods.getEquipmentDataList();
|
王硕
authored
|
510
|
app.methods.getEqEchartsDataList();
|
赖素文
authored
|
511
|
app.methods.getEquipmentsExtendIndexData();
|
赖素文
authored
|
512
|
app.methods.getEqEchartsPowerOnTimeDataList();
|
赖素文
authored
|
513
514
515
516
|
intervalTime = setInterval(app.methods.refreshDataMethod, 1000);
//
for (var i = 0; i < app.data.echartOpt.tuoShanRatelegendData.length; i++) {
|
赖素文
authored
|
517
|
app.data.colsPropers[0].push({ field: "date" + i, width: 100, title: app.data.echartOpt.tuoShanRatelegendData[i] });
|
赖素文
authored
|
518
|
}
|
赖素文
authored
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
|
// 保存之前的 colsProper 定义
const originalColsProper = app.data.colsProper[0].slice();
// 更新 colsProper 数组
app.data.colsProper[0] = [
...originalColsProper,
...app.data.echartOpt.tuoShanRatelegendData.map((legend, index) => {
return {
field: `date${index}`,
width: 100,
title: legend,
templet: function (d) {
const properValue = parseInt(d[`date${index}`]);
const color = properValue < 90 ? 'red' : 'black';
return `<span style="color: ${color};">${d[`date${index}`]}</span>`;
}
};
})
];
|
赖素文
authored
|
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
|
},
//dataSources 数据源,dateList:日期列表,comparisonKeys 返回的列表的key
oeeAndMttrAndMTBFDataHandle: function (dataSources, dateList, comparisonKeys) {
var resultData = []
const uniqueEqName = dataSources.uniqueFunc('EquipmentName');
let index = 0
var nowVal = "";
for (let i = 0; i < uniqueEqName.length; i++) {
nowVal = "";
index = 0
var defaultCol = { index: i + 1, EquipmentName: uniqueEqName[i].EquipmentName }
dateList.forEach((item) => {
for (let xp = 0; xp < dataSources.length; xp++) {
if (uniqueEqName[i].EquipmentName == dataSources[xp].EquipmentName && dataSources[xp].Date == item) {
nowVal = dataSources[xp][comparisonKeys];
break
}
}
defaultCol['date' + index++] = nowVal;
})
resultData.push(defaultCol)
}
return resultData;
|
赖素文
authored
|
563
|
}
|
赖素文
authored
|
564
565
|
},
registerEvent: function () {
|
赖素文
authored
|
566
567
568
|
$(".sys-a-det").click(function () {
if (intervalTime != null) clearInterval(intervalTime)
})
|
赖素文
authored
|
569
|
|
王硕
authored
|
570
571
|
$('#clickToClickSuccessRate').click(function () {
sysU.openPage({
|
赖素文
authored
|
572
|
title: "妥善率(近7天)总时间:堆垛机默认工作24小时,其他设备字典配置PowerOnTime、目标99%",
|
|
573
|
area: ["1100px", "590px"],
|
赖素文
authored
|
574
|
type: 1,
|
王硕
authored
|
575
|
btn: ['关闭'],
|
赖素文
authored
|
576
577
578
|
content: $('#tuoshanlv'),
successCallBackFn: function () {
app.methods.initEchartsTuoShanRate(sysEqAllSumObj);
|
赖素文
authored
|
579
580
|
debugger
var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Proper");
|
赖素文
authored
|
581
582
583
|
let options = {
elem: "#tableProper",
cols: app.data.colsProper,
|
赖素文
authored
|
584
|
data: data,
|
|
585
|
height: 'full-410', // 最大高度减去其他容器已占有的高度差
|
赖素文
authored
|
586
587
588
589
|
page: false
}
sysU.initTable(options);
}
|
王硕
authored
|
590
591
|
});
});
|
赖素文
authored
|
592
|
|
王硕
authored
|
593
594
595
|
$('#clickToClickMTTR').click(function () {
sysU.openPage({
title: "MTTR",
|
|
596
|
area: ["1100px", "590px"],
|
王硕
authored
|
597
598
|
type: 1,
btn: ['关闭'],
|
赖素文
authored
|
599
600
|
content: $('#eleMTTR'),
successCallBackFn: function () {
|
赖素文
authored
|
601
|
var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Mttr");
|
赖素文
authored
|
602
603
|
let options = {
elem: "#tableMTTR",
|
赖素文
authored
|
604
|
cols: app.data.colsPropers,
|
赖素文
authored
|
605
|
data: data,
|
|
606
|
height: 'full-110', // 最大高度减去其他容器已占有的高度差
|
赖素文
authored
|
607
608
609
610
|
page: false
}
sysU.initTable(options);
}
|
王硕
authored
|
611
612
|
});
});
|
赖素文
authored
|
613
|
|
王硕
authored
|
614
615
616
|
$('#clickToClickMTBF').click(function () {
sysU.openPage({
title: "MTBF",
|
|
617
|
area: ["1100px", "590px"],
|
赖素文
authored
|
618
619
620
621
|
type: 1,
btn: ['关闭'],
content: $('#eleMTBF'),
successCallBackFn: function () {
|
赖素文
authored
|
622
|
var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Mtbf");
|
赖素文
authored
|
623
624
|
let options = {
elem: "#tableMTBF",
|
赖素文
authored
|
625
|
cols: app.data.colsPropers,
|
赖素文
authored
|
626
|
data: data,
|
|
627
|
height: 'full-110', // 最大高度减去其他容器已占有的高度差
|
赖素文
authored
|
628
629
630
631
632
633
634
635
636
637
|
page: false
}
sysU.initTable(options);
}
});
});
$('#clickToClickOEE').click(function () {
sysU.openPage({
title: "OEE",
|
|
638
|
area: ["1100px", "590px"],
|
赖素文
authored
|
639
|
type: 1,
|
王硕
authored
|
640
|
btn: ['关闭'],
|
赖素文
authored
|
641
642
|
content: $('#eleOee'),
successCallBackFn: function () {
|
赖素文
authored
|
643
|
var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Oee");
|
赖素文
authored
|
644
645
|
let options = {
elem: "#tableOee",
|
赖素文
authored
|
646
|
cols: app.data.colsPropers,
|
赖素文
authored
|
647
|
data: data,
|
|
648
|
height: 'full-110', // 最大高度减去其他容器已占有的高度差
|
赖素文
authored
|
649
650
651
652
|
page: false
}
sysU.initTable(options);
}
|
王硕
authored
|
653
654
655
|
});
});
},
|
赖素文
authored
|
656
657
|
init: function () {
app.methods.getUrlParam();
|
赖素文
authored
|
658
|
app.registerEvent();
|
赖素文
authored
|
659
|
app.methods.initVue();
|
赖素文
authored
|
660
|
app.methods.initTable();
|
王硕
authored
|
661
|
app.methods.init();
|
赖素文
authored
|
662
663
664
665
|
}
};
app.init();
});
|