Procházet zdrojové kódy

报警信息隐藏

liuwei před 2 měsíci
rodič
revize
48513005d4

+ 3 - 33
src/main/resources/views/modules/mes/mesScreen3.html

@@ -1504,39 +1504,9 @@
 		return { line: line, oprno: oprno };
 	}
 	function updateDeviceAlarmAlertsByApi() {
-		$.ajax({
-			url: '${ctx}/mes/mesProductScreen/alertList',
-			type: 'POST',
-			dataType: 'json',
-			data: {
-				pageNo: 1,
-				pageSize: 200,
-				state: '0'
-			},
-			success: function(resp) {
-				var rows = extractList(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();
-					var typ = (r.type != null && r.type !== undefined) ? String(r.type) : '';
-					var text = oprno
-						? (oprno + (typ ? (' | ' + typ) : ''))
-						: typ;
-					if (!text) continue;
-					alerts.push({ no: alerts.length + 1, text: text, oprno: oprno || '' });
-				}
-				mockData.alerts = alerts;
-				renderAlerts();
-			},
-			error: function() {
-				mockData.alerts = [];
-				renderAlerts();
-			}
-		});
+		// 报警记录接口暂未开发完成,先不请求
+		mockData.alerts = [];
+		renderAlerts();
 	}
 
 	/** 总览三卡:生产人数 / 设备数量 / 计划产量 <- mesProductScreen 最新配置 */

+ 7 - 34
src/main/resources/views/modules/mes/mesScreen4.html

@@ -292,7 +292,7 @@
 
 	<div class="mes4-header">
 		<img class="mes4-logo" src="${ctxStatic}/screen/imgs/ljrLogo.png" alt="logo">
-		<div class="mes4-title">半成品阶段统计大屏</div>
+		<div class="mes4-title">毛坯阶段统计大屏</div>
 		<div class="mes4-datetime">
 			<span class="mes4-date" id="mes4Date"></span>
 			<span class="mes4-time" id="mes4Time"></span>
@@ -424,6 +424,8 @@
 	var mockData = {};
 	/** 本屏产线:XT(工位 OP060-OP100,与 mesLineProcess 一致) */
 	var LINE_SN = 'XT';
+	/** 大屏配置类型:毛坯 */
+	var SCREEN_TYPE = 'MP';
 	/** 每小时上下线:上线 OP060 / 下线 OP100 */
 	var HOURLY_API_CFG = { lineSn: LINE_SN, onlineOprno: 'OP060', offlineOprno: 'OP100' };
 	function buildRecentHourLabels12() {
@@ -1098,39 +1100,9 @@
 		return '';
 	}
 	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 (!isOprnoInRange(oprno, 10, 100)) 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();
 	}
 
 	/** 总览三卡:生产人数 / 设备数量 / 计划产量 <- mesProductScreen 最新配置 */
@@ -1139,6 +1111,7 @@
 			url: '${ctx}/mes/mesProductScreen/latestConfig',
 			type: 'POST',
 			dataType: 'json',
+			data: { screenType: SCREEN_TYPE },
 			success: function(resp) {
 				if (!resp || resp.result !== 'true' || !resp.data) return;
 				var d = resp.data;

+ 6 - 33
src/main/resources/views/modules/mes/mesScreen5.html

@@ -490,6 +490,8 @@
 	var LINE_SN = 'XT';
 	var OP_FROM = 110;
 	var OP_TO = 160;
+	/** 大屏配置类型:机加 */
+	var SCREEN_TYPE = 'JJ';
 	/** 每小时上下线:上线 OP110 / 下线 OP160 */
 	var HOURLY_API_CFG = { lineSn: LINE_SN, onlineOprno: 'OP110', offlineOprno: 'OP160' };
 	function buildRecentHourLabels12() {
@@ -1179,39 +1181,9 @@
 		return '';
 	}
 	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 (!isOprnoInRange(oprno, OP_FROM, OP_TO)) 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();
 	}
 
 	/** 总览三卡:生产人数 / 设备数量 / 计划产量 <- mesProductScreen 最新配置 */
@@ -1220,6 +1192,7 @@
 			url: '${ctx}/mes/mesProductScreen/latestConfig',
 			type: 'POST',
 			dataType: 'json',
+			data: { screenType: SCREEN_TYPE },
 			success: function(resp) {
 				if (!resp || resp.result !== 'true' || !resp.data) return;
 				var d = resp.data;

+ 12 - 37
src/main/resources/views/modules/mes/mesScreen6.html

@@ -477,6 +477,8 @@
 	var mockData = {};
 	/** 每小时上下线:mesProduct/hourlyUpDownOkData(本页 lineSn=ZP,上线 OP190 / 下线 OP250) */
 	var HOURLY_API_CFG = { lineSn: 'ZP', onlineOprno: 'OP190', offlineOprno: 'OP250' };
+	/** 大屏配置类型:半成品 */
+	var SCREEN_TYPE = 'BP';
 	function buildRecentHourLabels12() {
 		var labels = [];
 		var nowH = new Date().getHours();
@@ -1200,18 +1202,23 @@
 
 	function updateLatestPlanProductionByApi() {
 		$.ajax({
-			url: '${ctx}/mes/mesPlan/latestPlanNums',
+			url: '${ctx}/mes/mesProductScreen/latestConfig',
 			type: 'POST',
 			dataType: 'json',
+			data: { screenType: SCREEN_TYPE },
 			success: function(resp) {
 				if (!resp || resp.result !== 'true' || !resp.data) {
 					return;
 				}
-				var planNums = Number(resp.data.nums) || 0;
+				var d = resp.data;
+				var planNums = Number(d.planNums) || 0;
 				mockData.cards = mockData.cards || {};
+				mockData.cards.productionPeople = Number(d.peopleNums) || 0;
+				mockData.cards.deviceCount = Number(d.deviceNums) || 0;
 				mockData.cards.planProduction = planNums;
 				applyLatestPlanNumsToTable(planNums);
 				syncAchieveRateWithPlan();
+				renderCards();
 			}
 		});
 	}
@@ -1290,39 +1297,9 @@
 		return '';
 	}
 	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() {
@@ -1477,8 +1454,6 @@
 		renderCards();
 		updateLatestPlanProductionByApi();
 		updateLineProcessTableByApi();
-		updateProductionPeopleByApi();
-		updateDeviceCountByApi();
 		updateActualProductionByApi();
 		updateDeviceAlarmAlertsByApi();
 		updateHourlyUpDownByApi();