[Frontend] 時間格式統一 Y:M:D H:M:S
This commit is contained in:
		
							parent
							
								
									a18152e23a
								
							
						
					
					
						commit
						c2bb9cb199
					
				@ -1049,7 +1049,7 @@
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		function refTable(data) {
 | 
						function refTable(data) {
 | 
				
			||||||
				let tag = "#alertTable";
 | 
									let tag = "#alertTable";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				let column_defs = [
 | 
									let column_defs = [
 | 
				
			||||||
@ -1109,16 +1109,7 @@
 | 
				
			|||||||
								title: "發生時間",
 | 
													title: "發生時間",
 | 
				
			||||||
								data: "timestamp",
 | 
													data: "timestamp",
 | 
				
			||||||
								render: function (data) {
 | 
													render: function (data) {
 | 
				
			||||||
										return (
 | 
					                                    return displayDate(data);
 | 
				
			||||||
												new Date(data).toLocaleString("zh-tw", {
 | 
					 | 
				
			||||||
														year: "numeric",
 | 
					 | 
				
			||||||
														month: "2-digit",
 | 
					 | 
				
			||||||
														day: "2-digit",
 | 
					 | 
				
			||||||
														hour: "2-digit",
 | 
					 | 
				
			||||||
														minute: "2-digit",
 | 
					 | 
				
			||||||
												}),
 | 
					 | 
				
			||||||
												displayDate(data, "datetime")
 | 
					 | 
				
			||||||
										);
 | 
					 | 
				
			||||||
								},
 | 
													},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
@ -1133,9 +1124,7 @@
 | 
				
			|||||||
										let btnCol = data == "1" ? "warning" : "info";
 | 
															let btnCol = data == "1" ? "warning" : "info";
 | 
				
			||||||
										return data == "1"
 | 
															return data == "1"
 | 
				
			||||||
												? `<td><button onclick="chgAck('${row.uuid}')" class="btn btn-${btnCol}">${confirm}</button></td>`
 | 
																	? `<td><button onclick="chgAck('${row.uuid}')" class="btn btn-${btnCol}">${confirm}</button></td>`
 | 
				
			||||||
												: `<td><span>${new Date(row.ackedTime).toLocaleString(
 | 
					                                            : `<td><span>${displayDate(row.ackedTime)}</span></td>` /*`<td><button class="btn btn-${btnCol}">${confirm}</button></td>`*/;
 | 
				
			||||||
														"zh-tw"
 | 
					 | 
				
			||||||
												)}</span></td>` /*`<td><button class="btn btn-${btnCol}">${confirm}</button></td>`*/;
 | 
					 | 
				
			||||||
								},
 | 
													},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										4630
									
								
								Frontend/index.html
									
									
									
									
									
								
							
							
						
						
									
										4630
									
								
								Frontend/index.html
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -227,46 +227,29 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var _occurrenceTime = new Date(
 | 
					            var _occurrenceTime = new Date(
 | 
				
			||||||
              record.get("timestamp").$cEncStr
 | 
					              record.get("timestamp").$cEncStr
 | 
				
			||||||
            ).toLocaleString("zh-tw", {
 | 
					            )
 | 
				
			||||||
              year: "numeric",
 | 
					 | 
				
			||||||
              month: "2-digit",
 | 
					 | 
				
			||||||
              day: "2-digit",
 | 
					 | 
				
			||||||
              hour: "2-digit",
 | 
					 | 
				
			||||||
              minute: "2-digit",
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            // _occurrenceTime += _timestampTemp.getFullYear().toString() + "-" + addzero(_timestampTemp.getMonth() + 1).toString() + "-" + addzero(_timestampTemp.getDate()).toString() + " " + addzero(_timestampTemp.getHours()).toString() + ":" + addzero(_timestampTemp.getMinutes()).toString() + ":" + addzero(_timestampTemp.getSeconds()).toString();
 | 
					            // _occurrenceTime += _timestampTemp.getFullYear().toString() + "-" + addzero(_timestampTemp.getMonth() + 1).toString() + "-" + addzero(_timestampTemp.getDate()).toString() + " " + addzero(_timestampTemp.getHours()).toString() + ":" + addzero(_timestampTemp.getMinutes()).toString() + ":" + addzero(_timestampTemp.getSeconds()).toString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //var _occurrenceTime = _timestamp.format("yyyy-MM-dd hh:mm:ss");//.toLocaleString();
 | 
					            //var _occurrenceTime = _timestamp.format("yyyy-MM-dd hh:mm:ss");//.toLocaleString();
 | 
				
			||||||
            var _ackTime = new Date(
 | 
					            var _ackTime = new Date(
 | 
				
			||||||
              record.get("ackTime").$cEncStr
 | 
					              record.get("ackTime").$cEncStr
 | 
				
			||||||
            ).toLocaleString("zh-tw", {
 | 
					            )
 | 
				
			||||||
              year: "numeric",
 | 
					 | 
				
			||||||
              month: "2-digit",
 | 
					 | 
				
			||||||
              day: "2-digit",
 | 
					 | 
				
			||||||
              hour: "2-digit",
 | 
					 | 
				
			||||||
              minute: "2-digit",
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            // _normalTime += _normaltime.getFullYear().toString() + "-" + addzero(_normaltime.getMonth() + 1).toString() + "-" + addzero(_normaltime.getDate()).toString() + " " + addzero(_normaltime.getHours()).toString() + ":" + addzero(_normaltime.getMinutes()).toString() + ":" + addzero(_normaltime.getSeconds()).toString();
 | 
					            // _normalTime += _normaltime.getFullYear().toString() + "-" + addzero(_normaltime.getMonth() + 1).toString() + "-" + addzero(_normaltime.getDate()).toString() + " " + addzero(_normaltime.getHours()).toString() + ":" + addzero(_normaltime.getMinutes()).toString() + ":" + addzero(_normaltime.getSeconds()).toString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var _normalTime = new Date(
 | 
					            var _normalTime = new Date(
 | 
				
			||||||
              record.get("normalTime").$cEncStr
 | 
					              record.get("normalTime").$cEncStr
 | 
				
			||||||
            ).toLocaleString("zh-tw", {
 | 
					            )
 | 
				
			||||||
              year: "numeric",
 | 
					 | 
				
			||||||
              month: "2-digit",
 | 
					 | 
				
			||||||
              day: "2-digit",
 | 
					 | 
				
			||||||
              hour: "2-digit",
 | 
					 | 
				
			||||||
              minute: "2-digit",
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var _msgText = record.get("alarmData").get("msgText"); // == 1 ? _occurrenceTime : "未確認";
 | 
					            var _msgText = record.get("alarmData").get("msgText"); // == 1 ? _occurrenceTime : "未確認";
 | 
				
			||||||
            var _ackText =
 | 
					            var _ackText =
 | 
				
			||||||
              record.get("ackState") == 0 ? _ackTime : "未確認";
 | 
					              record.get("ackState")
 | 
				
			||||||
            _ss.push({
 | 
					            _ss.push({
 | 
				
			||||||
              uuid: _resultUuid[0],
 | 
					              uuid: _resultUuid[0],
 | 
				
			||||||
              msgText: _msgText,
 | 
					              msgText: _msgText,
 | 
				
			||||||
              ackState: _ackText,
 | 
					              ackState: _ackText,
 | 
				
			||||||
              timestamp: _occurrenceTime,
 | 
					              timestamp: _occurrenceTime,
 | 
				
			||||||
              normalTime: _normalTime,
 | 
					              normalTime: _normalTime,
 | 
				
			||||||
 | 
					              ackedTime: _ackTime
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            _index++;
 | 
					            _index++;
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
 | 
				
			|||||||
@ -1001,9 +1001,9 @@ function BajaSubscribeElectricmeterByBql(
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //使用bql語法
 | 
					    //使用bql語法
 | 
				
			||||||
    // console.log(
 | 
					     console.log(
 | 
				
			||||||
    //   `local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
 | 
					       `local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
 | 
				
			||||||
    // );
 | 
					     );
 | 
				
			||||||
    baja.Ord.make(
 | 
					    baja.Ord.make(
 | 
				
			||||||
      `local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
 | 
					      `local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
 | 
				
			||||||
    ).get(function (table) {
 | 
					    ).get(function (table) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user