change param

This commit is contained in:
dev02 2022-11-23 08:59:16 +08:00
parent 8285149267
commit e4fa5d5e2d
2 changed files with 25 additions and 20 deletions

View File

@ -91,8 +91,6 @@
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();
}); });
function initList() { function initList() {
@ -103,7 +101,8 @@
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 sst = '';
let sstn = '';
let mst = ''; let mst = '';
$.each(res.data.history_Main_Systems, function (index, val) { $.each(res.data.history_Main_Systems, function (index, val) {
@ -115,7 +114,7 @@
$.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('${val.main_system_tag}', '${val2.sub_system_tag}', '${val2.full_name}')" 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>
@ -125,37 +124,42 @@
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;
sstn = val2.full_name;
} }
}); });
strHtml += `</ul> </li>`; strHtml += `</ul> </li>`;
}); });
$('#js_nested_list').html(strHtml); $('#js_nested_list').html(strHtml);
getData(sst, mst); getData(mst, sst, sstn);
} }
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send(); ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
} }
function initData() { function getData(mst, sst, sstn) {
getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1", //var dt = new Date();
1667232000000, //console.log(dt);
1667232000000, // var start = dt.getFullYear().toString() + "-" + dt.getMonth().toString() + "-" + (dt.getDate()).toString() + "T00:00:00Z";
"空調設備", //var end = dt.getFullYear().toString() + "-" + dt.getMonth().toString() + "-" + (dt.getDate() + 1).toString() + "T00:00:00Z";
// console.log(new Date(start).getTime());
// console.log(new Date(end).getTime());
getHistoryDataByBaja("TPE_B1_EE_E4", //"TPE_" + pageAct.buiTag + "_" + mst + "_" + sst,
/*1666396800000,*/
//1666483200000,
1668927197000,
1668963661000,
sstn,
"Mitsubishi_Sup", "Mitsubishi_Sup",
callbackForHistory); callBackFromHistory);
}
function getData(sst2, mst1) {
//getHistoryDataByBaja("TPE_B1_EE_E4_R2F_NA_WHT_N1_A1",
// 1667232000000,
// 1667232000000,
// "空調設備",
// "Mitsubishi_Sup",
// callbackForHistory);
} }
function callBackFromHistory(res) { function callBackFromHistory(res) {
//$('#tableData tbody').html(); //$('#tableData tbody').html();
console.log(res) console.log(res)
} }
function callbackForHistory(result) {
console.log(result);
}
</script> </script>

View File

@ -2490,6 +2490,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
"lib/app.menu", "lib/app.menu",
"datatables.net.b4", "datatables.net.b4",
"n4js/alarmbaja", "n4js/alarmbaja",
"n4js/historybaja",
"lib/statistics/flot/flot.bundle", "lib/statistics/flot/flot.bundle",
"lib/statistics/peity/peity.bundle", "lib/statistics/peity/peity.bundle",
], loadedMasterPack); ], loadedMasterPack);