<html>
	<head>
		<title>一分钟模式</title>
	</head>
	<body>
	<script type="text/javascript">
	var LeqT = new Array();
	var noiseCounter = prompt("输入噪声点位数","");
	noiseCounter = Number(noiseCounter) - 1;
	var noiseNumber = prompt("输入第一个噪声序号，可以是任何数字，比如27，10等","");
	noiseNumber = Number(noiseNumber) - 1;
	
	var noiseDay = prompt("请输入噪声的测量日期，格式如2017-03-01","");
	//获得日期
	
	var noiseTime = prompt("请输入第一个噪声的测量时间，格式如09:24:33","");
	var hourTime = noiseTime.substr(0,2);
	var minTime = noiseTime.substr(3,2);
	var secTime = noiseTime.substr(6,2);
	
	hourTime = Number(hourTime);
	minTime = Number(minTime);
	secTime = Number(secTime);
	var i;
	for (i = 0; i <= noiseCounter; i++)
	{
			var inputcounter = i + 1;
			LeqT[i] = prompt("请输入第 "+ inputcounter +" 个值:" + "比如56.3", "");
			LeqT[i] = Number(LeqT[i]);
			
	}
	//将噪声数据保存在数组中且转为数字类型
  
	for (noiseWrite=0;noiseWrite < LeqT.length; noiseWrite++)
	{
			noiseNumber = noiseNumber + 1;//变序号
			var varliang = parseInt(3*Math.random());
			minTime = minTime + 3 + varliang;
			secTime = secTime + 11 + varliang;
			
			var L5;
			var L10;
			var L50;
			var L90;
			var L95;
			var Lmax;
			var Lmin;
			var SD;
			var SEL;
			var Alternum=Math.random();
			Alternum = Alternum.toFixed(1);
			var Alternum1 = Math.random();
			Alternum1 = Alternum.toFixed(1);
			var Alternum2 = Math.random();
			Alternum2 = Alternum2.toFixed(1);
			var useful = Math.random();
			useful = useful*2;
			useful = Math.ceil(useful); 
			 //修约小数为一位数
			L5  = Number(LeqT[noiseWrite]) + 1.8 + Number(useful)+Number(Alternum);
			L10 = Number(LeqT[noiseWrite]) + 1.1 + Number(Alternum);
			L50 = Number(LeqT[noiseWrite]) - 1.4 - Number(Alternum);
			L90 = Number(L50) - 0.8 - Number(Alternum2);
			L95 = Number(L90) - 0.7 - Number(Alternum);
			L50 = L50.toFixed(1);
			L5  = L5.toFixed(1);
			L10 = L10.toFixed(1);
			L90 = L90.toFixed(1);
			L95 = L95.toFixed(1);
			SD  = Math.random();
			SD  = SD + 0.1 + (LeqT[noiseWrite] - L95)/2.6;
			SD  = SD.toFixed(1);
			Lmax= Number(L5) + 3*Number(Alternum) + 2.3*Number(Alternum2) + 2.1;
			Lmin= Number(L95) - 1.5*Number(Alternum2) - 0.4;
			SEL = Number(Lmax) + 6 + 0.8*Number(Alternum2) + 0.3*Number(Alternum);
			Lmax= Lmax.toFixed(1);
			Lmin= Lmin.toFixed(1);
			SEL = SEL.toFixed(1);
			
			if (noiseNumber < 100 && noiseNumber >= 10)
			{
				document.write("&nbsp;&nbsp;&nbsp;" + "No:00" + noiseNumber + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			}
			else if (noiseNumber < 10)
			{
				document.write("&nbsp;&nbsp;&nbsp;" + "No:000" + noiseNumber + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			}
			else
			{
				document.write("&nbsp;&nbsp;&nbsp;" + "No:0" + noiseNumber + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			}
			document.write("&nbsp;&nbsp;&nbsp;" + "Mode:stat." + "</br>");
			if(hourTime >= 10)
			{
				if (minTime < 10)
				{
					if (secTime < 10)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + ":" + "0" + secTime + "</br>");
					}
					else if (secTime >= 10 && secTime <60)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + ":" + secTime + "</br>");
					}
					else
					{
						var secwrite = secTime - 60;
						if (secwrite < 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + "0" + secwrite + "</br>");
						}
						else
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + ":" + secwrite + "</br>");
						}
					}
				}
				else if (minTime >=10 && minTime < 60)
				{
					if (secTime < 10)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" +  minTime + ":" +"0" + secTime + "</br>");
					}
					else if (secTime >= 10 && secTime <60)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" +  minTime + ":" + secTime + "</br>");
					}
					else
					{
						var secwrite = secTime - 60;
						if (secwrite < 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + minTime + ":" +"0" + secwrite + "</br>");
						}
						else
						{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + minTime + ":" +secwrite + "</br>");
						}
					}
				}
				else
				{
					minTime = minTime - 60;
					hourTime = hourTime + 1;
					if (minTime < 10)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + ":" + "22" + "</br>");
					}
					else if (minTime >=10)
					{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + minTime + ":" + "47" + "</br>");
					}
				}
			}
			if(hourTime < 10)
			{
				
				if (minTime < 10)
				{
					if (secTime < 10)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + "0" + minTime + "0" + secTime + "</br>");
					}
					else if (secTime >= 10 && secTime <60)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + "0" + minTime + secTime + "</br>");
					}
					else
					{
						var secwrite = secTime - 60;
						if (secwrite < 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + "0" + minTime + "0" + secwrite + "</br>");
						}
						else
						{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + "0" + minTime + secwrite + "</br>");
						}
					}
				}
				else if (minTime >=10 && minTime < 60)
				{
					if (secTime < 10)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + minTime + ":" +"0" + secTime + "</br>");
					}
					else if (secTime >= 10 && secTime <60)
					{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + minTime + ":" + secTime + "</br>");
					}
					else
					{
						var secwrite = secTime - 60;
						if (secwrite < 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + minTime + ":" +"0" + secwrite + "</br>");
						}
						else
						{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + minTime + ":" +secwrite + "</br>");
						}
					}
				}
				else
				{
					minTime = minTime - 60;
					hourTime = hourTime + 1;
					if (minTime < 10)
					{
						if ( hourTime < 10)
						{
						document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + "0" + minTime + ":" + "19" + "</br>");
						}
						else if (hourTime >= 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + "0" + minTime + ":" + "43" + "</br>");
						}
					}
					else if (minTime >=10)
					{
						if ( hourTime < 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "0" + hourTime + ":" + minTime + ":" + "33" + "</br>");
						}
						else if (hourTime >= 10)
						{
							document.write("&nbsp;&nbsp;&nbsp;" + noiseDay + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + hourTime + ":" + minTime + ":" + "52" + "</br>");
						}
					}
				}
			}

			
			
			document.write("&nbsp;&nbsp;&nbsp;" + "Ts=00h01m00s" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ "Weight:A F" + "</br>");
			document.write("&nbsp;&nbsp;&nbsp;" + "LeqT= " + LeqT[noiseWrite] + "dB" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +"L5" + "&nbsp;" + " = " + L5 +  "dB" + "</br>");
			document.write("&nbsp;&nbsp;&nbsp;" + "L10 = " + L10 + "dB" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "L50 = " + L50 + "dB" +  "</br>");
			document.write("&nbsp;&nbsp;&nbsp;" + "L90 = " + L90 + "dB" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "L95 = " + L95 +"dB" + "</br>");
			document.write("&nbsp;&nbsp;&nbsp;" + "Lmax= " + Lmax + "dB" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "Lmin= " + Lmin + "dB" +  "</br>");
			document.write("&nbsp;&nbsp;&nbsp;" + "SD&nbsp;&nbsp;=&nbsp;&nbsp;" + SD + "dB" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "SEL = " + SEL + "dB" + "</br>" + "</br>" + "</br>");
	}
	
		
	</script>
	</body>
</html>
LeqT填在B3格式框里。请用excel的函数公式来表示L5，L10,L50,L90,L95,SD,Lmin,Lmax,SEL，还要计算后的SEL值符合SEL=10*log(1200)+LeqT的。 Alternum, Alternum1, Alternum2随机生成的数不能为0