testing historyData baja

This commit is contained in:
dev02 2022-11-22 17:13:47 +08:00
parent 0d6870f32f
commit 13eac5639c

View File

@ -8,7 +8,6 @@
</div> </div>
<!-- nav-menu-reset will reset the font colors --> <!-- nav-menu-reset will reset the font colors -->
<ul id="js_nested_list" class="nav-menu nav-menu-reset nav-menu-compact bg-success-900 bg-info-gradient mb-sm-4 mb-md-0 rounded" data-nav-accordion="true"> <ul id="js_nested_list" class="nav-menu nav-menu-reset nav-menu-compact bg-success-900 bg-info-gradient mb-sm-4 mb-md-0 rounded" data-nav-accordion="true">
</ul> </ul>
<div class="filter-message js-filter-message m-0 text-left pl-4 py-3 fw-500"></div> <div class="filter-message js-filter-message m-0 text-left pl-4 py-3 fw-500"></div>
</div> </div>
@ -53,7 +52,7 @@
<div class="row"> <div class="row">
<div class="frame-wrap"> <div class="frame-wrap">
<table class="table table-bordered table-striped text-center m-0"> <table id="tableData" class="table table-bordered table-striped text-center m-0">
<thead class="thead-themed"> <thead class="thead-themed">
<tr> <tr>
<th>設備名稱</th> <th>設備名稱</th>
@ -78,20 +77,19 @@
</main> </main>
<script> <script>
let sst = '';
let mst = '';
$(function () { $(function () {
initList(); initList();
// default list filter // default list filter
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter')); initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
// custom response message // custom response message
initApp.listFilter($('#js-list-msg'), $('#js-list-msg-filter')); initApp.listFilter($('#js-list-msg'), $('#js-list-msg-filter'));
//accordion filter //accordion filter
initApp.listFilter($('#js_list_accordion'), $('#js_list_accordion_filter')); initApp.listFilter($('#js_list_accordion'), $('#js_list_accordion_filter'));
// nested list filter // nested list filter
initApp.listFilter($('#js_nested_list'), $('#js_nested_list_filter')); initApp.listFilter($('#js_nested_list'), $('#js_nested_list_filter'));
//init navigation //init navigation
initApp.buildNavigation($('#js_nested_list')); initApp.buildNavigation($('#js_nested_list'));
initData(); initData();
@ -99,64 +97,65 @@
function initList() { function initList() {
let sendData = { let sendData = {
building_tag: pageAct.buiTag building_tag: pageAct.buiTag
} }
objSendData.Data = sendData; objSendData.Data = sendData;
let url = baseApiUrl + "/api/History/GetMainSub"; let url = baseApiUrl + "/api/History/GetMainSub";
function success(res) { function success(res) {
let strHtml = ``; let strHtml = ``;
let sst = '';
let mst = '';
$.each(res.data.history_Main_Systems, function (index, val) { $.each(res.data.history_Main_Systems, function (index, val) {
console.log(index) strHtml += `<li>
strHtml += `<li> <a href="#" data-filter-tags="user interface buttons compass action dropdown navigation sidebars" data-maintag="${val.main_system_tag}">
<a href="#" data-filter-tags="user interface buttons compass action dropdown navigation sidebars" data-maintag="${val.main_system_tag}"> <span class="nav-link-text">${val.full_name}</span>
<span class="nav-link-text">${val.full_name}</span> </a>
</a>
<ul style="${index == 0 ? `display:block;` : ``}">`; <ul style="${index == 0 ? `display:block;` : ``}">`;
$.each(val.history_Sub_systems, function (index2, val2) { $.each(val.history_Sub_systems, function (index2, val2) {
strHtml += `<li> strHtml += `<li>
<a href="#" onClick="getData(${val2.sub_system_tag}, ${val.main_system_tag})" data-filter-tags="user interface buttons" data-subtag="${val2.sub_system_tag}"> <a href="#" onClick="getData(${val2.sub_system_tag}, ${val.main_system_tag})" data-filter-tags="user interface buttons" data-subtag="${val2.sub_system_tag}">
<span class="nav-link-text"> <span class="nav-link-text">
${val2.full_name} ${val2.sub_system_tag} ${val2.full_name} ${val2.sub_system_tag}
</span> </span>
</a> </a>
</li>`; </li>`;
if (index == 0 && index2 == 0) { if (index == 0 && index2 == 0) {
sst = val2.sub_system_tag; sst = val2.sub_system_tag;
mst = val.main_system_tag; mst = val.main_system_tag;
} }
}); });
strHtml += `</ul> </li>`; strHtml += `</ul> </li>`;
}); });
$('#js_nested_list').html(strHtml); $('#js_nested_list').html(strHtml);
getData(sst, mst); getData(sst, mst);
} }
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send(); ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
} }
function initData() { function initData() {
getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1", getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1",
1667232000000, 1667232000000,
1667232000000, 1667232000000,
"空調設備", "空調設備",
"Mitsubishi_Sup", "Mitsubishi_Sup",
callbackForHistory); callbackForHistory);
} }
function getData(sst2, mst1) function getData(sst2, mst1) {
{ //getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1",
//getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1", // 1667232000000,
// 1667232000000, // 1667232000000,
// 1667232000000, // "空調設備",
// "空調設備", // "Mitsubishi_Sup",
// "Mitsubishi_Sup", // callbackForHistory);
// callbackForHistory); }
}
function callBackFromHistory(res) { function callBackFromHistory(res) {
//$('#tableData tbody').html();
console.log(res) console.log(res)
} }
</script> </script>