manto07m 3 år sedan
förälder
incheckning
6722187abc
5 ändrade filer med 77 tillägg och 10 borttagningar
  1. 0 1
      R03/Index.php
  2. 2 2
      script/js/global.js
  3. 28 5
      script/js/home.js
  4. 46 1
      script/js/r03.js
  5. 1 1
      script/php/get_monitor_chart.php

+ 0 - 1
R03/Index.php

@@ -78,7 +78,6 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
 						<section class="panel">
 							<header class="panel-heading">
 								<div class="panel-actions">
-									<!--<label id="displayCompareChart" style="display:block"><input type="checkbox" id="compareCheck" onclick="CheckCompare()">顯示全部比較</label>-->
 									<a style="display:none" href="#" class="fa fa-caret-down"></a>
 									<a style="display:none" href="#" class="fa fa-times"></a>
 								</div>

+ 2 - 2
script/js/global.js

@@ -99,9 +99,9 @@ vm.component('side-bar', {
         GetLocation(sitName) {
             var site = window.location.pathname.split('/')[2];
             if (sitName == (site)) {
-                return "nav-parent nav-active nav-expanded";
+                return "nav-parent nav-expanded";
             } else {
-                return "nav-parent nav-active";
+                return "nav-parent";
             }
         }
     }

+ 28 - 5
script/js/home.js

@@ -16,11 +16,34 @@ var errorArray = [];
 
 function GetCheckAllAJAXValue() {
 
+    for (i = 0; i < sites["r03"].length; i++) {
+        var option = sites["r03"][i].code;
+        $.ajax({
+                url: "/BIM-Monitor/script/php/get_abnormal.php",
+                data: {
+                    type: option
+                },
+                async: false,
+                contentType: "application/json",
+                dataType: "json"
+            })
+            .success(function (response) {
+                var normal_count = response['normal_count'];
+                var abnormal_count = response['abnormal_count'];
+                var all_count = 0 + normal_count + abnormal_count;
+                $(`.${option}`).html("(<font color='#FF0000'>" + abnormal_count + "</font>/" + all_count + ")");
+            })
+            .error(function () {
+                console.log("錯誤統計未正常獲取");
+            })
+            .complete(function () {});
+    }
+
     errorArray = [];
     var phase
-    if(document.getElementById("phase") !== null){
+    if (document.getElementById("phase") !== null) {
         phase = document.getElementById("phase").value;
-    }else{
+    } else {
         phase = 7;
     }
     for (i = 0; i < errorTable.length; i++) {
@@ -63,9 +86,9 @@ function GetCheckAllAJAXValue() {
     }
 }
 
-$(document).ready(function() {
-    $(".monitor").on('click', function() {
-        let site = $(this).parent().parent().parent().attr("monitor");    
+$(document).ready(function () {
+    $(".monitor").on('click', function () {
+        let site = $(this).parent().parent().parent().attr("monitor");
         location.href = `./${site}/Index.php`;
     });
 })

+ 46 - 1
script/js/r03.js

@@ -28,7 +28,7 @@ $(document).ready(function () {
 
     GetCheckAllAJAXValue();
     LoadPage();
-    $("#menu > ul > li.nav-parent.nav-active.nav-expanded > ul > li.nav-parent.nav-active.nav-expanded > ul > li:nth-child(1) > a").css("color", "#0088cc");
+    $("#menu > ul > li.nav-parent.nav-active.nav-expanded > ul > li.nav-parent.nav-expanded > ul > li:nth-child(1) > a").css("color", "#0088cc");
     $(".monitor").on('click', function () {
         $('.monitor').css('color', '#abb4be')
         let site = $(this).parent().parent().parent().attr("monitor");
@@ -306,6 +306,51 @@ function GetCheckAllAJAXValue() {
             .complete(function () {});
     }
 
+    errorArray = [];
+    var phase
+    if (document.getElementById("phase") !== null) {
+        phase = document.getElementById("phase").value;
+    } else {
+        phase = 7;
+    }
+    for (i = 0; i < errorTable.length; i++) {
+
+        var method = errorTable[i].method;
+        var option = errorTable[i].table_name;
+        var table_name = errorTable[i].table_name + "data";
+        var warning1 = errorTable[i].warning1;
+        var warning2 = errorTable[i].warning2;
+        var warning_Count = errorTable[i].warning_Count;
+        $.ajax({
+                url: "/BIM-Monitor/script/php/checkValue2.php",
+                data: {
+                    method: method,
+                    table_name: table_name,
+                    warning1: warning1,
+                    warning2: warning2,
+                    warning_Count: warning_Count,
+                    phase: phase
+                },
+                async: false,
+                contentType: "application/json",
+                dataType: "json"
+            })
+
+            .success(function (response) {
+
+                var normal_count = response['normal_count'];
+                var abnormal_count = response['abnormal_count'];
+                var all_count = 0 + normal_count + abnormal_count;
+
+
+                document.getElementById(option).innerHTML = "(<font color='#FF0000'>" + abnormal_count + "</font>/" + all_count + ")";
+                errorArray.push(abnormal_count);
+            })
+            .error(function () {
+                alert("錯誤統計未正常獲取");
+            })
+            .complete(function () {});
+    }
 }
 
 function CheckError() {

+ 1 - 1
script/php/get_monitor_chart.php

@@ -33,7 +33,7 @@ switch ($type) {
         FROM (
                     SELECT [Date], [TotalDisplacement], [Depth], [WarningValue], [ActionValue]
             FROM [BIMMonitor].[dbo].[{$type}_Data]
-            WHERE [EquipmentID] = '{$monitor}' AND [WarningValue] <> 'NULL'
+            WHERE [EquipmentID] = '{$monitor}' AND [WarningValue] <> 'NULL' AND [WarningValue] <> '---'
                 ) o
                 PIVOT (
                     MAX([TotalDisplacement])