Răsfoiți Sursa

修改大件合格率颜色

konghe 1 an în urmă
părinte
comite
1db8271c56
1 a modificat fișierele cu 10 adăugiri și 8 ștergeri
  1. 10 8
      wwwroot/main/Procedure/test9/DenKiln.html

+ 10 - 8
wwwroot/main/Procedure/test9/DenKiln.html

@@ -317,14 +317,16 @@
 				$.get('DenKiln.ashx?m=Rate', function (data) {
 					var json = JSON.parse(data);
 					if (json["success"] == true) {
-						$('#sumhgl').html("大件合格率:" + (Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/)) + "%"));
-						if (json["sumhgl"] >= 98.5) {
-							document.getElementById("sumhgl").style.color = "white";
-						} else if (json["sumhgl"] >= 98 && json["sumhgl"] < 98.5) {
-							document.getElementById("sumhgl").style.color = "yellow";
-						} else if (json["sumhgl"] < 98) {
-                            document.getElementById("sumhgl").style.color = "red";
-						}
+						var color = "";
+						if (json["sumhgl"] >= 98.8) {
+                            color = "white";// document.getElementById("sumhgl").style.color = "white";
+                            //} else if (json["sumhgl"] >= 98 && json["sumhgl"] < 98.5) {
+                            //	document.getElementById("sumhgl").style.color = "yellow";
+                        } else if (json["sumhgl"] < 98.8) {
+                            color = "red"//document.getElementById("sumhgl").style.color = "red";
+                        }
+						$('#sumhgl').html("大件合格率:<span style=color:" + color + ";>" + (Number(json["sumhgl"].toString().match(/^\d+(?:\.\d{0,2})?/)) + "%")+"</span>");
+						
 					}
 				});
 			}