var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var SrmRateData; var RobotRateData; var page = { init: function () { $("#beginTime").val(beginTime); $("#endTime").val(endTime); page.initGird(); page.bind(); }, bind: function () { // 查询 $('#btn_Search').on('click', function () { if (page.SearchValid('beginTime', 'endTime')) { return; } page.search({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }); }); }, SearchValid: function (begin,end) { let result = false; var beginTime = $("#"+begin).val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (beginTime.length == 0) { learun.alert.error('开始时间不能为空!'); result = true; return result; } var endTime = $("#"+end).val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (endTime.length == 0) { learun.alert.error('结束时间不能为空!'); result = true; return result; } if (!page.isDateValid(beginTime)) { learun.alert.error('开始时间格式不正确!'); result = true; return result; } if (!page.isDateValid(endTime)) { learun.alert.error('结束时间格式不正确!'); result = true; return result; } }, isDateValid: function (dateString) { const date = new Date(dateString); return !isNaN(date.getTime()); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/PTManager/DeviceEffectives/GetSRMPageList', headData: [ { label: "设备名", name: "Code", width: 80, align: "left" }, { label: "出库", name: "OutDepot", width: 80, align: "left" }, { label: "入库", name: "EnterDepot", width: 80, align: "left" }, { label: "移库", name: "MoveDepot", width: 80, align: "left" }, //{ // label: "状态分析", name: "State", width: 500, align: "left" // , formatter: function (cellvalue) { // let w1 = cellvalue[0] <= 30 ? 30 : cellvalue[0] >= 100?100:cellvalue[0]*1; // let w2 = cellvalue[1] <= 30 ? 30 : cellvalue[1] >= 100?100:cellvalue[1]*1; // let w3 = cellvalue[2] <= 30 ? 30 : cellvalue[2] >= 100?100:cellvalue[2]*1; // let w4 = cellvalue[3] <= 30 ? 30 : cellvalue[3] >= 100?100:cellvalue[3]*1; // let w5 = cellvalue[4] <= 30 ? 30 : cellvalue[4] >= 100?100:cellvalue[4]*1; // return '
' //} //}, { label: "空闲(分钟)", name: "Free", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "手动(分钟)", name: "Manual", width: 80, align: "left" , formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "自动(分钟)", name: "Automatic", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "报警(分钟)", name: "Alarm", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "运行(分钟)", name: "Working", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "总时间(分钟)", name: "TotalTime", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "设备执行分析", name: "DevAction", width: 400, align: "left" , formatter: function (cellvalue) { let str = '