|
|
@@ -55,33 +55,7 @@ $(document).ready(function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- 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": ": 降冪排列"
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
+
|
|
|
|
|
|
})
|
|
|
|
|
|
@@ -200,17 +174,11 @@ function showWell(str, changeCamera) {
|
|
|
isCompare = false;
|
|
|
$("#compareCheck").checked = false;
|
|
|
|
|
|
- if (str == "") {
|
|
|
- dataTable.clear();
|
|
|
- dataTable.draw();
|
|
|
- $("#tableName").text("模型無此監測儀器");
|
|
|
- return;
|
|
|
- }
|
|
|
strLocal = str;
|
|
|
|
|
|
$("#monitorSelect2").innerHTML = strLocal;
|
|
|
|
|
|
- getTable(str, changeCamera);
|
|
|
+ getTable(str);
|
|
|
displayChart(str, "myChart");
|
|
|
if (isLoad) {
|
|
|
myGameInstance.SendMessage("MainCamera", "GetDataFromWebGL", str);
|
|
|
@@ -231,17 +199,77 @@ function getTable(monitor) {
|
|
|
monitor: monitor
|
|
|
}
|
|
|
}).success(function (result) {
|
|
|
+
|
|
|
let table = result.table;
|
|
|
let unit = result.unit;
|
|
|
- dataTable.clear();
|
|
|
- dataTable.draw();
|
|
|
+ let haveDepth = result.haveDepth;
|
|
|
+ let haveDirection = result.haveDirection;
|
|
|
+ var header = "";
|
|
|
+ if (haveDepth) {
|
|
|
+ for (i = 0; i < table[0].length - 1; i++) {
|
|
|
+ head = i * 0.5;
|
|
|
+ if (head == 0)
|
|
|
+ head = "TOP";
|
|
|
+ header += `<th>${head}</th>`;
|
|
|
+ }
|
|
|
+ } else if(haveDirection){
|
|
|
+ header = `<th>${monitor}(1~3向)</th><th>${monitor}(2~4向)</th>`;
|
|
|
+ }else {
|
|
|
+ header = `<th id="unit">測量值 單位:</th>`;
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#tabData").empty();
|
|
|
+ $("#tabData").append(`<table id="dataTable" class="display">
|
|
|
+ <thead>
|
|
|
+ <tr id="dataTableCol">
|
|
|
+ <th>測量日期</th>
|
|
|
+ ${header}
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="table">
|
|
|
+ </tbody>
|
|
|
+ </table>`);
|
|
|
+ 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": ": 降冪排列"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if (dataTable != null) {
|
|
|
+ dataTable.clear();
|
|
|
+ dataTable.draw();
|
|
|
+ }
|
|
|
+ if (monitor == '') {
|
|
|
+ monitor = '查無監測儀器或';
|
|
|
+ }
|
|
|
$("#tableName").text(monitor + "資料表");
|
|
|
$("#unit").text(`測量值(${unit})`);
|
|
|
table.forEach(function (data) {
|
|
|
dataTable.row.add(data)
|
|
|
dataTable.draw();
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
/*$("#tableName").innerHTML = monitor + "資料表";
|
|
|
saveCheckCompare = monitor + "資料表";
|
|
|
displayChart(monitor, "myChart");
|
|
|
@@ -249,7 +277,7 @@ function getTable(monitor) {
|
|
|
|
|
|
document.getElementById("dataTable").innerHTML = data;*/
|
|
|
|
|
|
- console.log(dataTable);
|
|
|
+ console.log(result);
|
|
|
|
|
|
}).error(function (error) {
|
|
|
console.log(error);
|