diff --git a/Frontend/_historyData.html b/Frontend/_historyData.html index ea9cb63..09e1404 100644 --- a/Frontend/_historyData.html +++ b/Frontend/_historyData.html @@ -386,7 +386,7 @@ } } - function searchDate() { + function searchDate() { let start = new Date($('#his_startdate').val()); let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1)); @@ -399,8 +399,10 @@ else if (pageAct.dateType != "range") return; + pageAct.hisStartDate = start; + pageAct.hisEndDate = end; getData(formatDate(start, "date", true), formatDate(end, "date", true)); - } + } function formatDate(date, type, send = false) { if (!send) @@ -461,18 +463,16 @@ } } - function exportExcel() { + function exportExcel() { $(loadEle).Loading("start"); let token = cookies.get("JWT-Authorization"); let url = baseApiUrl + "/api/ExportHistory"; let v = {}; - v.starttime = (pageAct.dateType == "month" ? new Date($('#getmonth').val()) : new Date($('#his_startdate').val())); - v.endtime = $('#his_enddate input').val() === "" ? null : new Date($('#his_enddate input').val()); - v.dateType = pageAct.dateType; - v.building_tag = pageAct.buiTag; - v.device_number = pageAct.deviceNumber; - v.device_item = pageAct.deviceItem; - v.deviceComName = pageAct.deviceComName; + + v.starttime = pageAct.hisStartDate; + v.endtime = pageAct.hisEndDate; + v.dateType = pageAct.dateType; + v.device_number = pageAct.deviceNumber; objSendData.Data = v; $.ajax({ @@ -497,8 +497,17 @@ $(loadEle).Loading("close"); }, complete: (xhr) => { - $(loadEle).Loading("close"); + setLoading(false); }, }); - } + // ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) { + // $(loadEle).Loading("close"); + // }, function (rel) { + // if (rel) { + // downloadByBlob(xhr, rel); + // } + + // $(loadEle).Loading("close"); + // }, "POST",true).send(); + } \ No newline at end of file diff --git a/Frontend/_operation.html b/Frontend/_operation.html index 809a260..e080a32 100644 --- a/Frontend/_operation.html +++ b/Frontend/_operation.html @@ -8,13 +8,22 @@