Blame view

web/WebMvc/wwwroot/productjs/configure/projectoverview.js 29 KB
赖素文 authored
1
 let action = null;
2
3
4
layui.config({
    base: "/js/",
    version: 1
5
}).use(['system', "vue"], function () {
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,
17
        projectName = "",
赖素文 authored
18
19
        projectCode = "",
        sysEqAllSumObj = null,
20
        intervalTime = null,
21
        vueApp = null,
22
23
24
25
26
27
28
29
        app = null;

    action = {

    }

    app = {
        data: {
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) {
37
                        //if (d.Status == "" || d.Status == null) return "";
38
39
                        var bg = "layui-badge-dot layui-bg-green",
                            statusText = "在线";
40
                        if (d.Status == "Failure" || d.Status == "Error") {
41
42
43
                            statusText = "故障";
                            bg = "layui-badge-dot layui-bg-red";
                        }
44
                        if (d.seconds > 300 || d.seconds == -1) {
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

            colsFailure: [[
                { field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
                { field: "equipmentName", width: 220, title: "设备" },
56
57
58
59
60
61
                {
                    field: "alarmMessage", width: 300, title: "报警信息", templet: function (d) {

                        return d.alarmMessage + "," + d.remark;
                    }
                },
赖素文 authored
62
                { field: "createTime", width: 150, title: "开始时间" },
63
64
65
66
                { field: "updateTime", width: 150, title: "结束时间" },
                {
                    field: "errorduration", width: 200, title: "故障时间(分)", templet: function (d) {
                        var minutes = Math.floor(d.errorduration / 60); // 获取整数分钟
67
                        var remainingSeconds = Math.floor(d.errorduration % 60); // 获取剩余的秒数
68
69
70
                        return minutes + "分钟" + remainingSeconds + "秒";
                    }
                },
71
赖素文 authored
72
            ]],
赖素文 authored
73
            colsProper: [[
74
75
76
77
78
79
80
81
82
                { 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
83
            ]],
84
85
86
87
88
            colsPropers: [[
                { field: "index", width: 70, title: "序号", fixed: "left" },
                { field: "EquipmentName", width: 180, title: "设备名称" }

            ]],
赖素文 authored
89
90
91
            colsOee: [[
                { field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
                { field: "EquipmentCode", width: 220, title: "设备编码" },
92
                { field: "EquipmentName", width: 180, title: "设备名称" },
赖素文 authored
93
                { field: "Date", width: 120, title: "时间" },
94
95
96
97
98
99
100
101
102
103
104
105
106
                { 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
107
108
109
110
            ]],
            colsMttr: [[
                { field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
                { field: "EquipmentCode", width: 220, title: "设备编码" },
111
                { field: "EquipmentName", width: 180, title: "设备名称" },
赖素文 authored
112
                { field: "Date", width: 120, title: "时间" },
113
114
115
116
117
118
119
120
121
                { 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
122
123
124
125
126
            ]],

            colsMtbf: [[
                { field: "zizeng", width: 80, title: "序号", fixed: "left", type: "numbers" },
                { field: "EquipmentCode", width: 220, title: "设备编码" },
127
                { field: "EquipmentName", width: 180, title: "设备名称" },
赖素文 authored
128
                { field: "Date", width: 120, title: "时间" },
129
130
131
132
133
134
135
136
137
138
139
                { 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
140
141
            ]],
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
            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: "创建时间" }
            ]],
159
160
            tableIns: null,
            tableElem: "mainList",
161
            refreshDataTimeEle: document.getElementById('refreshDataTime'),
162
163
164
            echartOpt: {
                eqTuoShanRateEle: document.getElementById("eqTuoShanRate"),
                eqAlarmsNumberEle: document.getElementById("eqAlarmsNumber"),
165
                eqPowerOnTimeEle: document.getElementById("eqPowerOnTime"),
166
                tuoShanRatelegendData: "".GetTimeRange("","",6)
167
            }
168
169
        },
        methods: {
170
            //设备在线状况 表格
171
172
            initTable: function (opt) {
                var config = { projectKeys: projectKeys }
王硕 authored
173
174
175
176
                if (opt != undefined) $.extend(config, opt);
                let options = {
                    elem: "#" + app.data.tableElem,
177
                    url: `/configure/BaseProject/GetEqInfoByProjectKeys`,
178
179
180
181
182
183
184
185
                    cols: app.data.cols,
                    height: 'full-400', // 最大高度减去其他容器已占有的高度差
                    where: config,
                    page: false
                }
                app.data.tableIns = sysU.initTable(options);
            },
186
            //每台设备妥善率 曲线图
王硕 authored
187
            initEchartsTuoShanRate: function (failureTime) {
赖素文 authored
188
                let legendDataTemp = failureTime.uniqueFunc("EquipmentName")
王硕 authored
189
                let legendData = []
190
王硕 authored
191
192
                window.eqTuoShanRateOpt.xAxis[0].data = app.data.echartOpt.tuoShanRatelegendData
                window.eqTuoShanRateOpt.series = [];
王硕 authored
193
                for (let i = 0; i < legendDataTemp.length; i++) {
赖素文 authored
194
                    legendData.push(legendDataTemp[i].EquipmentName)
王硕 authored
195
王硕 authored
196
                    var seriesItem = {
赖素文 authored
197
                        name: legendDataTemp[i].EquipmentName,
王硕 authored
198
199
200
201
202
                        type: 'line',
                        data: []
                    };
                    for (let j = 0; j < app.data.echartOpt.tuoShanRatelegendData.length; j++) {
                        const timeVal = app.data.echartOpt.tuoShanRatelegendData[j];
203
                        const result = failureTime.GetArrValueRows({ key: 'Date', val: timeVal }, {
赖素文 authored
204
                            key: 'EquipmentName', val: seriesItem.name
205
                        });
206
王硕 authored
207
                        let data = 0;
208
                        if (result.length == 1) {
赖素文 authored
209
                            data = result[0].Proper.replace("%", "")
210
211
                        } else {
                            //console.log(`ProjectOverview 文件 GetArrValueRows 读取到:${result.length}条数据`)
王硕 authored
212
                        }
赖素文 authored
213
                        seriesItem.data.push(data);
王硕 authored
214
215
216
                    }
                    window.eqTuoShanRateOpt.series.push(seriesItem)
                }
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
                //新增默认 目标值
                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
239
                window.eqTuoShanRateOpt.legend.data = legendData
王硕 authored
240
                let myChart = echarts.init(app.data.echartOpt.eqTuoShanRateEle)
241
242
243
244
245
                myChart.clear()
                myChart.setOption(window.eqTuoShanRateOpt)
            },
246
            //设备开机时间
赖素文 authored
247
248
            //设备开机时间
            initEchartsPowerOnTime: function (PowerOnTimeData) {
249
                var opt = "".copyObj2(window.eqPowerOnTimeOpt)
赖素文 authored
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
                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
272
273
274
275
276
277
278
                let myChart = echarts.init(app.data.echartOpt.eqPowerOnTimeEle)

                myChart.clear()
                myChart.setOption(opt)
            },

            //故障次数 柱状图
279
            initEchartsAlarmsNumber: function (failureCount) {             
王硕 authored
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
                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;
305
306
307
                let myChart = echarts.init(app.data.echartOpt.eqAlarmsNumberEle)
                myChart.clear()
                myChart.setOption(window.eqAlarmsNumber)
308
309
310
311
312
313
314
315
316
317
                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,
318
                            Exel:true
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
                        },
                        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);
                });
347
            },
348
349
            //设备故障超40分钟
赖素文 authored
350
351
352
353
354
355
356
357
358
359
360
            initTableFailure40: function (failureOverFourty) {
                let options = {
                    elem: "#mainAlarms" ,
                    cols: app.data.colsFailure,
                    data: failureOverFourty,
                    height: 'full-400', // 最大高度减去其他容器已占有的高度差
                    page: false
                }
                app.data.tableIns = sysU.initTable(options);
            },
361
            refreshDataMethod: function () {
362
363
                let currenttime = parseInt(app.data.refreshDataTimeEle.innerHTML);
                if (currenttime === 0) {
364
                    currenttime = vueApp.refreshDataTime;
365
366
367
368
369
370
371
372
                    app.methods.getEquipmentDataList();
                    app.methods.getEqEchartsDataList();
                } else {
                    currenttime--;
                }
                app.data.refreshDataTimeEle.innerHTML = currenttime;
            },
赖素文 authored
373
374
375
376
377
378
379
            /**
              * 初始化vue
              */
            initVue: function () {
                vueApp = new Vue({
                    el: '.vueApp',
                    data: {
赖素文 authored
380
                        refreshDataTime: 40,
赖素文 authored
381
382
                        head: {
                            projectName: 0
383
384
385
                        },
                        body: {
                            eqCount: 0,
386
                            eqRunCount: 0,
387
                            eqStandBy: 0,
HuXiYu authored
388
                            eqOffline: 0,
赖素文 authored
389
                            eqError: 0,
390
赖素文 authored
391
                            eqOnlineRate: 0,
392
                        },
赖素文 authored
393
394
395
396
397
398
                        eqSumObj: {
                            oee: 0,
                            mttr: 0,
                            mtbf: 0,
                            proper:0
                        }
赖素文 authored
399
400
401
402
                    },
                    methods: {

                    },
403
                    ready: function () {
HuXiYu authored
404
                        this.head.projectName = `${projectName}`;
405
                    }
赖素文 authored
406
407
408
                });
            },
            /**
409
              * vue 集合赋值 result.Result.eqCount
赖素文 authored
410
              */
411
            initVueDataValue: function (result) {
412
413
                var res = result.Result;
                vueApp.body.eqCount = res.eqSumCount;
414
                vueApp.body.eqRunCount = res.eqRunCount;
HuXiYu authored
415
                vueApp.body.eqStandBy = res.eqStandByCount;
416
417
418
                vueApp.body.eqError = res.eqErrorCount;
                vueApp.body.eqOffline = res.eqOffLineCount;
HuXiYu authored
419
                vueApp.body.eqOnlineRate = res.runningRate;
420
421
422
            },

            getUrlParam: function () {
423
424
                projectKeys = localStorage.getItem("projectMapKeys");
                projectName = localStorage.getItem("projectMapName");
425
                projectCode = localStorage.getItem("projectCode");
426
            },
427
428
429
430
431
432
433
434
435
436
437
438

            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
439
            //妥善率/故障次数/设备故 障统一数据请求接口
王硕 authored
440
441
442
443
444
445
            getEqEchartsDataList() {
                var ajaxConfig = {
                    data: { projectKeys: projectKeys },
                    url: `/configure/BaseProject/GetFailureList`,
                    success: function (result) {
                        if (sysU.successBefore(result)) return false;
王硕 authored
446
                        app.methods.initEchartsAlarmsNumber(result.Result.failureCount);
赖素文 authored
447
                        app.methods.initTableFailure40(result.Result.failureOverFourty);                  
王硕 authored
448
449
450
451
                    }
                };
                sysU.ajax(ajaxConfig);
            },
赖素文 authored
452
453

            //OEE、MTTR、MTBF、妥善率 请求数据接口
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
            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
480
481
            //设备开机时间接口
            getEqEchartsPowerOnTimeDataList() {
赖素文 authored
482
                var ajaxConfig = {
赖素文 authored
483
484
                    data: { projectKeys: projectKeys },
                    url: `/configure/BaseProject/GetEqPowerOnTime`,
赖素文 authored
485
486
                    success: function (result) {
                        if (sysU.successBefore(result)) return false;
赖素文 authored
487
488
                        //设备开机时间
                        app.methods.initEchartsPowerOnTime(result.Result);
赖素文 authored
489
490
491
492
                    }
                };
                sysU.ajax(ajaxConfig);
            },
493
494
495
496
497

            convertSecondsToTime: function (seconds) {
                if (typeof seconds !== 'number') return seconds;
                var hours = Math.floor(seconds / 3600);
                var minutes = Math.floor((seconds % 3600) / 60);
498
                var remainingSeconds = Math.floor(seconds % 60);
499
500
501
502
503
504
505
506
507
508
509
510

                var result = '';
                if (hours > 0) {
                    result += hours + '小时';
                }
                if (minutes > 0) {
                    result += minutes + '分';
                }
                result += remainingSeconds + '秒';
                return result;
            },
511
512
513
            init: function () {
                var tempElem = $(".sys-a-det");
                tempElem.attr("href", tempElem.data("scr") + `?projectKeys=${projectKeys}`)
514
515

                app.methods.getEquipmentDataList();
王硕 authored
516
                app.methods.getEqEchartsDataList();
赖素文 authored
517
                app.methods.getEquipmentsExtendIndexData(); 
赖素文 authored
518
                app.methods.getEqEchartsPowerOnTimeDataList();
519
520
521
522
                intervalTime = setInterval(app.methods.refreshDataMethod, 1000);

                //
                for (var i = 0; i < app.data.echartOpt.tuoShanRatelegendData.length; i++) {
523
                    app.data.colsPropers[0].push({ field: "date" + i, width: 100, title: app.data.echartOpt.tuoShanRatelegendData[i] });
524
                }
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544

                // 保存之前的 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>`;
                            }
                        };
                    })
                ];
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
            },

            //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;
569
            }
570
571
        },
        registerEvent: function () {
572
573
574
            $(".sys-a-det").click(function () {
                if (intervalTime != null) clearInterval(intervalTime)
            })
赖素文 authored
575
王硕 authored
576
577
            $('#clickToClickSuccessRate').click(function () {
                sysU.openPage({
578
                    title: "妥善率(近7天)总时间:堆垛机默认工作24小时,其他设备字典配置PowerOnTime、目标99%",
579
                    area: ["1100px", "590px"],
赖素文 authored
580
                    type: 1,
王硕 authored
581
                    btn: ['关闭'],
赖素文 authored
582
583
584
                    content: $('#tuoshanlv'),
                    successCallBackFn: function () {
                        app.methods.initEchartsTuoShanRate(sysEqAllSumObj);
585
586
                        debugger
                        var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Proper");
赖素文 authored
587
588
589
                        let options = {
                            elem: "#tableProper",
                            cols: app.data.colsProper,
590
                            data: data,
591
                            height: 'full-410', // 最大高度减去其他容器已占有的高度差
赖素文 authored
592
593
594
595
                            page: false
                        }
                        sysU.initTable(options);
                    }
王硕 authored
596
597
                });
            });
赖素文 authored
598
王硕 authored
599
600
601
            $('#clickToClickMTTR').click(function () {
                sysU.openPage({
                    title: "MTTR",
602
                    area: ["1100px", "590px"],
王硕 authored
603
604
                    type: 1,
                    btn: ['关闭'],
赖素文 authored
605
606
                    content: $('#eleMTTR'),
                    successCallBackFn: function () {
607
                        var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Mttr");
赖素文 authored
608
609
                        let options = {
                            elem: "#tableMTTR",
610
                            cols: app.data.colsPropers,
611
                            data: data,
612
                            height: 'full-110', // 最大高度减去其他容器已占有的高度差
赖素文 authored
613
614
615
616
                            page: false
                        }
                        sysU.initTable(options);
                    }
王硕 authored
617
618
                });
            });
赖素文 authored
619
王硕 authored
620
621
622
            $('#clickToClickMTBF').click(function () {
                sysU.openPage({
                    title: "MTBF",
623
                    area: ["1100px", "590px"],
赖素文 authored
624
625
626
627
                    type: 1,
                    btn: ['关闭'],
                    content: $('#eleMTBF'),
                    successCallBackFn: function () {
628
                        var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Mtbf");
赖素文 authored
629
630
                        let options = {
                            elem: "#tableMTBF",
631
                            cols: app.data.colsPropers,
632
                            data: data,
633
                            height: 'full-110', // 最大高度减去其他容器已占有的高度差
赖素文 authored
634
635
636
637
638
639
640
641
642
643
                            page: false
                        }
                        sysU.initTable(options);
                    }
                });
            });

            $('#clickToClickOEE').click(function () {
                sysU.openPage({
                    title: "OEE",
644
                    area: ["1100px", "590px"],
赖素文 authored
645
                    type: 1,
王硕 authored
646
                    btn: ['关闭'],
赖素文 authored
647
648
                    content: $('#eleOee'),
                    successCallBackFn: function () {
649
                        var data = app.methods.oeeAndMttrAndMTBFDataHandle(sysEqAllSumObj, app.data.echartOpt.tuoShanRatelegendData, "Oee");
赖素文 authored
650
651
                        let options = {
                            elem: "#tableOee",
652
                            cols: app.data.colsPropers,
653
                            data: data,
654
                            height: 'full-110', // 最大高度减去其他容器已占有的高度差
赖素文 authored
655
656
657
658
                            page: false
                        }
                        sysU.initTable(options);
                    }
王硕 authored
659
660
661
                });
            });  
        },
662
663
        init: function () {
            app.methods.getUrlParam();
赖素文 authored
664
            app.registerEvent();  
赖素文 authored
665
            app.methods.initVue();
666
            app.methods.initTable();
王硕 authored
667
            app.methods.init();  
668
669
670
671
        }
    };
    app.init();
});