|
@@ -477,6 +477,8 @@
|
|
|
var mockData = {};
|
|
var mockData = {};
|
|
|
/** 每小时上下线:mesProduct/hourlyUpDownOkData(本页 lineSn=ZP,上线 OP190 / 下线 OP250) */
|
|
/** 每小时上下线:mesProduct/hourlyUpDownOkData(本页 lineSn=ZP,上线 OP190 / 下线 OP250) */
|
|
|
var HOURLY_API_CFG = { lineSn: 'ZP', onlineOprno: 'OP190', offlineOprno: 'OP250' };
|
|
var HOURLY_API_CFG = { lineSn: 'ZP', onlineOprno: 'OP190', offlineOprno: 'OP250' };
|
|
|
|
|
+ /** 大屏配置类型:半成品 */
|
|
|
|
|
+ var SCREEN_TYPE = 'BP';
|
|
|
function buildRecentHourLabels12() {
|
|
function buildRecentHourLabels12() {
|
|
|
var labels = [];
|
|
var labels = [];
|
|
|
var nowH = new Date().getHours();
|
|
var nowH = new Date().getHours();
|
|
@@ -1200,18 +1202,23 @@
|
|
|
|
|
|
|
|
function updateLatestPlanProductionByApi() {
|
|
function updateLatestPlanProductionByApi() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url: '${ctx}/mes/mesPlan/latestPlanNums',
|
|
|
|
|
|
|
+ url: '${ctx}/mes/mesProductScreen/latestConfig',
|
|
|
type: 'POST',
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
|
|
+ data: { screenType: SCREEN_TYPE },
|
|
|
success: function(resp) {
|
|
success: function(resp) {
|
|
|
if (!resp || resp.result !== 'true' || !resp.data) {
|
|
if (!resp || resp.result !== 'true' || !resp.data) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- var planNums = Number(resp.data.nums) || 0;
|
|
|
|
|
|
|
+ var d = resp.data;
|
|
|
|
|
+ var planNums = Number(d.planNums) || 0;
|
|
|
mockData.cards = mockData.cards || {};
|
|
mockData.cards = mockData.cards || {};
|
|
|
|
|
+ mockData.cards.productionPeople = Number(d.peopleNums) || 0;
|
|
|
|
|
+ mockData.cards.deviceCount = Number(d.deviceNums) || 0;
|
|
|
mockData.cards.planProduction = planNums;
|
|
mockData.cards.planProduction = planNums;
|
|
|
applyLatestPlanNumsToTable(planNums);
|
|
applyLatestPlanNumsToTable(planNums);
|
|
|
syncAchieveRateWithPlan();
|
|
syncAchieveRateWithPlan();
|
|
|
|
|
+ renderCards();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -1290,39 +1297,9 @@
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
function updateDeviceAlarmAlertsByApi() {
|
|
function updateDeviceAlarmAlertsByApi() {
|
|
|
- $.ajax({
|
|
|
|
|
- url: '${ctx}/mes/mesProductScreen/alertList',
|
|
|
|
|
- type: 'POST',
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- data: {
|
|
|
|
|
- pageNo: 1,
|
|
|
|
|
- pageSize: 200,
|
|
|
|
|
- state: '0'
|
|
|
|
|
- },
|
|
|
|
|
- success: function(resp) {
|
|
|
|
|
- var rows = extractUserList(resp);
|
|
|
|
|
- var alerts = [];
|
|
|
|
|
- for (var i = 0; i < rows.length; i++) {
|
|
|
|
|
- var r = rows[i] || {};
|
|
|
|
|
- if (String(r.state) !== '0') continue;
|
|
|
|
|
- var sn = r.deviceSn || r.device_sn || r.deviceCode || r.device_code || '';
|
|
|
|
|
- var parts = parseDeviceSnParts(sn);
|
|
|
|
|
- var oprno = String(r.oprno || parts.oprno || '').toUpperCase();
|
|
|
|
|
- if (!oprno) continue;
|
|
|
|
|
- if (!isAlertOprnoOnZpLine(oprno)) continue;
|
|
|
|
|
- var typ = (r.type != null && r.type !== undefined) ? String(r.type) : '';
|
|
|
|
|
- var pname = resolveAlertProcessName(oprno);
|
|
|
|
|
- var text = oprno + (pname ? (' ' + pname) : '') + (typ ? (' | ' + typ) : '');
|
|
|
|
|
- alerts.push({ no: alerts.length + 1, text: text, oprno: oprno });
|
|
|
|
|
- }
|
|
|
|
|
- mockData.alerts = alerts;
|
|
|
|
|
- renderAlerts();
|
|
|
|
|
- },
|
|
|
|
|
- error: function() {
|
|
|
|
|
- mockData.alerts = [];
|
|
|
|
|
- renderAlerts();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // 报警记录接口暂未开发完成,先不请求
|
|
|
|
|
+ mockData.alerts = [];
|
|
|
|
|
+ renderAlerts();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateProductionPeopleByApi() {
|
|
function updateProductionPeopleByApi() {
|
|
@@ -1477,8 +1454,6 @@
|
|
|
renderCards();
|
|
renderCards();
|
|
|
updateLatestPlanProductionByApi();
|
|
updateLatestPlanProductionByApi();
|
|
|
updateLineProcessTableByApi();
|
|
updateLineProcessTableByApi();
|
|
|
- updateProductionPeopleByApi();
|
|
|
|
|
- updateDeviceCountByApi();
|
|
|
|
|
updateActualProductionByApi();
|
|
updateActualProductionByApi();
|
|
|
updateDeviceAlarmAlertsByApi();
|
|
updateDeviceAlarmAlertsByApi();
|
|
|
updateHourlyUpDownByApi();
|
|
updateHourlyUpDownByApi();
|