|
|
@@ -16,21 +16,24 @@ $.ajaxSettings.async = true;
|
|
|
var lastNode;
|
|
|
var errorArray = [];
|
|
|
var switchNumber = 0;
|
|
|
-passString('OW');
|
|
|
+passString('SIS');
|
|
|
var wellTBA = [];
|
|
|
var wellNameLists = [];
|
|
|
var isAll = true;
|
|
|
var isCompare = false;
|
|
|
var saveCheckCompare = "";
|
|
|
|
|
|
+var dataTable;
|
|
|
|
|
|
$(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");
|
|
|
$(".monitor").on('click', function () {
|
|
|
+ $('.monitor').css('color', '#abb4be')
|
|
|
let site = $(this).parent().parent().parent().attr("monitor");
|
|
|
+ $(this).css("color","#0088cc");
|
|
|
if (site != 'r03') {
|
|
|
location.href = `../${site}/Index.php`;
|
|
|
} else {
|
|
|
@@ -39,18 +42,47 @@ $(document).ready(function () {
|
|
|
isCompare = false;
|
|
|
passString(option);
|
|
|
document.getElementById("monitorName").innerHTML = option + "監測儀器";
|
|
|
- if (lastNode != null) {
|
|
|
+ /*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.style = "color:#0088cc;";*/
|
|
|
+
|
|
|
LoadPage();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ dataTable = $('#dataTable').DataTable({
|
|
|
+ bProcessing: true,
|
|
|
+ responsive: true,
|
|
|
+ "searching": true,
|
|
|
+ "pageLength": 10,
|
|
|
+ "language": {
|
|
|
+ "processing": "處理中...",
|
|
|
+ "loadingRecords": "載入中...",
|
|
|
+ "lengthMenu": "顯示 _MENU_ 項結果",
|
|
|
+ "zeroRecords": "沒有符合的結果或是沒有資料",
|
|
|
+ "info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",
|
|
|
+ "infoEmpty": "顯示第 0 至 0 項結果,共 0 項",
|
|
|
+ "infoFiltered": "(從 _MAX_ 項結果中過濾)",
|
|
|
+ "infoPostFix": "",
|
|
|
+ "search": "",
|
|
|
+ "paginate": {
|
|
|
+ "first": '<i class="fa fa-step-backward"></i>',
|
|
|
+ "previous": '<i class="fa fa-backward"></i>',
|
|
|
+ "next": '<i class="fa fa-forward"></i>',
|
|
|
+ "last": '<i class="fa fa-step-forward"></i>'
|
|
|
+ },
|
|
|
+ "aria": {
|
|
|
+ "sortAscending": ": 升冪排列",
|
|
|
+ "sortDescending": ": 降冪排列"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
})
|
|
|
|
|
|
//Pass monitor equipment's name to index.php select form
|
|
|
@@ -105,7 +137,7 @@ function LoadPage() {
|
|
|
else
|
|
|
document.getElementById("displayCompareChart").style.display = 'none';
|
|
|
|
|
|
- if(isLoad){
|
|
|
+ if (isLoad) {
|
|
|
if (option == "HM" || option == "SIS" || option == "RS" || option == "VG" || option == "SID") {
|
|
|
myGameInstance.SendMessage("Monitor", "ChangeTransparent");
|
|
|
myGameInstance.SendMessage("Monitor", "RemoveModel", "true");
|
|
|
@@ -114,7 +146,7 @@ function LoadPage() {
|
|
|
myGameInstance.SendMessage("Monitor", "RemoveModel", "false");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (option != "ELP" && option != "SIS" && option != "SID") {
|
|
|
document.getElementById("phase").style.display = "none";
|
|
|
@@ -128,11 +160,11 @@ function LoadPage() {
|
|
|
dataValue = dataValue.concat(',', wellTBALocal[i]);
|
|
|
|
|
|
}
|
|
|
- if(isLoad){
|
|
|
+ if (isLoad) {
|
|
|
myGameInstance.SendMessage("Monitor", "AddDataTable", dataValue);
|
|
|
myGameInstance.SendMessage("Monitor", "Initialization");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var wellNameList = window.localStorage.getItem("wellNameList");
|
|
|
var wellNameListsLocal = wellNameList.split(",");
|
|
|
|
|
|
@@ -166,41 +198,61 @@ function showWell(str, changeCamera) {
|
|
|
var executed = false;
|
|
|
var xhttp;
|
|
|
isCompare = false;
|
|
|
- document.getElementById("compareCheck").checked = false;
|
|
|
+ $("#compareCheck").checked = false;
|
|
|
if (str == "") {
|
|
|
- document.getElementById("dataTable").innerHTML = "";
|
|
|
+ $("#dataTable").innerHTML = "";
|
|
|
return;
|
|
|
}
|
|
|
strLocal = str;
|
|
|
|
|
|
- document.getElementById("monitorSelect2").innerHTML = strLocal;
|
|
|
- xhttp = new XMLHttpRequest();
|
|
|
- xhttp.onreadystatechange = function () {
|
|
|
- if (this.readyState == 4 && this.status == 200) {
|
|
|
+ $("#monitorSelect2").innerHTML = strLocal;
|
|
|
+ getTable(str, changeCamera);
|
|
|
+ if (isLoad) {
|
|
|
+ myGameInstance.SendMessage("MainCamera", "GetDataFromWebGL", str);
|
|
|
+ }
|
|
|
+ if (!changeCamera) {
|
|
|
+ ResetCamera();
|
|
|
+ }
|
|
|
|
|
|
- document.getElementById("tableName").innerHTML = strLocal + "資料表";
|
|
|
- saveCheckCompare = strLocal + "資料表";
|
|
|
- displayChart(str, "myChart");
|
|
|
- reset();
|
|
|
- if(isLoad){
|
|
|
- myGameInstance.SendMessage("MainCamera", "GetDataFromWebGL", str);
|
|
|
- }
|
|
|
-
|
|
|
+}
|
|
|
+var sparklinePieData = [];
|
|
|
|
|
|
- if (!changeCamera) {
|
|
|
- ResetCamera();
|
|
|
- }
|
|
|
+function getTable(monitor) {
|
|
|
+ $.ajax({
|
|
|
+ url: '/BIM-Monitor/script/php/get_monitor_table.php',
|
|
|
+ type: "GET",
|
|
|
+ dataType: "JSON",
|
|
|
+ data: {
|
|
|
+ monitor: monitor
|
|
|
+ }
|
|
|
+ }).success(function (result) {
|
|
|
+ let table = result.table;
|
|
|
+ dataTable.clear();
|
|
|
+ dataTable.draw();
|
|
|
+ let unit = result.unit;
|
|
|
+ $("#tableName").text(monitor + "資料表");
|
|
|
+ $("#unit").text(`測量值(${unit})`);
|
|
|
+ table.forEach(function (data) {
|
|
|
+ dataTable.row.add( data)
|
|
|
+ dataTable.draw();
|
|
|
+ });
|
|
|
|
|
|
- document.getElementById("dataTable").innerHTML = this.responseText;
|
|
|
- $('#dataTable').DataTable();
|
|
|
+ /*$("#tableName").innerHTML = monitor + "資料表";
|
|
|
+ saveCheckCompare = monitor + "資料表";
|
|
|
+ displayChart(monitor, "myChart");
|
|
|
+ reset();
|
|
|
|
|
|
- }
|
|
|
- };
|
|
|
- xhttp.open("GET", "/BIM-Monitor/script/php/getData2.php?q=" + str, true);
|
|
|
- xhttp.send();
|
|
|
+ document.getElementById("dataTable").innerHTML = data;*/
|
|
|
+
|
|
|
+ console.log(dataTable);
|
|
|
+
|
|
|
+ }).error(function (error) {
|
|
|
+ console.log(error);
|
|
|
+ }).complete(function (e) {
|
|
|
|
|
|
+ });
|
|
|
}
|
|
|
-var sparklinePieData = [];
|
|
|
+
|
|
|
|
|
|
function getCheckValue() {
|
|
|
var dataArray = [];
|
|
|
@@ -536,7 +588,7 @@ function displayCompareChart() {
|
|
|
|
|
|
//Reset the camera
|
|
|
function ResetCamera() {
|
|
|
- if(isLoad){
|
|
|
+ if (isLoad) {
|
|
|
myGameInstance.SendMessage("MainCamera", "ResetCamera");
|
|
|
}
|
|
|
}
|
|
|
@@ -601,7 +653,7 @@ function SetList() {
|
|
|
}
|
|
|
|
|
|
function UpdateGPS(GPS) {
|
|
|
- if(isLoad){
|
|
|
+ if (isLoad) {
|
|
|
myGameInstance.SendMessage("PlayerArmature", "UpdateGPS", GPS);
|
|
|
}
|
|
|
}
|