var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var SrmRateData; var RobotRateData; var page = { init: function () { $("#beginTime").val(beginTime); $("#endTime").val(endTime); $("#robotbeginTime").val(beginTime); $("#robotendTime").val(endTime); //page.GetSrmRateData(); //page.GetRobotRateData(); page.initGird(); page.bind(); }, bind: function () { // 查询 $('#btn_Search').on('click', function () { page.search({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }); }); $('#btn_robotSearch').on('click', function () { page.searchrobot({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '3' }) }); }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/SXManager/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: "TransferDepot", 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); } }, ], mainId: 'Code', isPage: true, reloadSelected: true, autowWidth: true, sidx: 'Code', sord: 'DESC', }); page.search({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }); $('#gridtable2').jfGrid({ url: top.$.rootUrl + '/SXManager/DeviceEffectives/GetRobotPageList', headData: [ { label: "设备名", name: "Code", width: 80, align: "left" }, { label: "出库", name: "OutDepot", 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); } }, ], mainId: 'Code', isPage: true, reloadSelected: true, autowWidth: true, sidx: 'Code', sord: 'DESC', }); page.searchrobot({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '3' }) }); }, search: function (param) { $('#gridtable').jfGridSet('reload', param); }, searchrobot: function (param) { $('#gridtable2').jfGridSet('reload', param); }, //GetSrmRateData: function () { // learun.httpAsync('GET', top.$.rootUrl + '/SXManager/DeviceEffectives/GetSRMPageList', { queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }, function (res) { // if (res.code > 0) { // SrmRateData = res.data; // let floor = $("#SRMSpan span.active").attr('data-queryValue'); // for (let i = 0; i < SrmRateData[floor].length; i++) { // page.GetSRMRate(SrmRateData[floor][i].code, SrmRateData[floor][i]); // }; // } // }); //}, //GetRobotRateData: function () { // learun.httpAsync('GET', top.$.rootUrl + '/SXManager/DeviceEffectives/GetRobotRateData', { queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), floor: $("#SRMSpan span.active").attr('data-queryValue'), DevType: '3' }) }, function (res) { // if (res.code > 0) { // RobotRateData = res.data; // } // }); //}, }; refreshGirdData = function () { }; page.init(); }