Ver código fonte

新增 工地跳轉

manto07m 3 anos atrás
pai
commit
59a347698f
2 arquivos alterados com 30 adições e 25 exclusões
  1. 28 23
      script/js/c3.js
  2. 2 2
      script/js/home.js

+ 28 - 23
script/js/c3.js

@@ -23,27 +23,32 @@ var isCompare = false;
 var saveCheckCompare = "";
 
 
-$(document).ready(function() {
-    
+$(document).ready(function () {
+
     GetCheckAllAJAXValue();
     LoadPage();
 
-    $(".monitor").on('click', function() {
-        let option = $(this).attr("monitor");
-        isAll = true;
-        isCompare = false;
-        passString(option);
-        document.getElementById("monitorName").innerHTML = option + "監測儀器";
-        if (lastNode != null) {
-            lastNode.style = "color:#abb4be;";
-        }
-        document.getElementById("errorCheck").checked = false;
-        document.getElementById("compareCheck").checked = false;
+    $(".monitor").on('click', function () {
+        let site = $(this).parent().parent().parent().attr("monitor");
+        if (site != 'c3') {
+            location.href = `../${site}/Index.php`;
+        } else {
+            let option = $(this).attr("monitor");
+            isAll = true;
+            isCompare = false;
+            passString(option);
+            document.getElementById("monitorName").innerHTML = option + "監測儀器";
+            if (lastNode != null) {
+                lastNode.style = "color:#abb4be;";
+            }
+            document.getElementById("errorCheck").checked = false;
+            document.getElementById("compareCheck").checked = false;
 
-        lastNode = document.getElementById(option).parentNode;
-        lastNode.style = "color:#0088cc;";
+            lastNode = document.getElementById(option).parentNode;
+            lastNode.style = "color:#0088cc;";
 
-        LoadPage();
+            LoadPage();
+        }
     });
 })
 
@@ -76,7 +81,7 @@ function displayWellInfo2(equipment) {
         data: {
             equipment: equipment,
         }
-    }).success(function(data){
+    }).success(function (data) {
         GetWellNameList(data);
     }).error(function (error) {
         console.log("錯誤");
@@ -191,12 +196,12 @@ var sparklinePieData = [];
 function getCheckValue() {
     var dataArray = [];
     var phase
-    if(document.getElementById("phase") !== null){
+    if (document.getElementById("phase") !== null) {
         phase = document.getElementById("phase").value;
-    }else{
+    } else {
         phase = 7;
     }
-    
+
     var option = window.localStorage.getItem("option");
     for (i = 0; i < errorTable.length; i++) {
         if (errorTable[i].table_name == option) {
@@ -254,9 +259,9 @@ function GetCheckAllAJAXValue() {
 
     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++) {
@@ -1258,4 +1263,4 @@ function reset() {
     table.className = "display";
     //table.style.width = "100%";
     myNode.appendChild(table);
-}
+}

+ 2 - 2
script/js/home.js

@@ -65,7 +65,7 @@ function GetCheckAllAJAXValue() {
 
 $(document).ready(function() {
     $(".monitor").on('click', function() {
-        let monitor = $(this).parent().parent().parent().attr("monitor");
-        location.href = `./${monitor}/Index.php`;
+        let site = $(this).parent().parent().parent().attr("monitor");    
+        location.href = `./${site}/Index.php`;
     });
 })