單一電站資訊: datepicker修正
This commit is contained in:
parent
437e3e3150
commit
b89508dd5a
@ -182,6 +182,10 @@
|
|||||||
var isloadingdone_history = false;
|
var isloadingdone_history = false;
|
||||||
var isloadingdone_exception = false;
|
var isloadingdone_exception = false;
|
||||||
var isloadingdone_operation = false;
|
var isloadingdone_operation = false;
|
||||||
|
var datepicker_record;
|
||||||
|
var datepicker_history;
|
||||||
|
var datepicker_exception;
|
||||||
|
|
||||||
|
|
||||||
function showLoading() {
|
function showLoading() {
|
||||||
var i = document.getElementById("loading");
|
var i = document.getElementById("loading");
|
||||||
@ -248,14 +252,16 @@
|
|||||||
});*@
|
});*@
|
||||||
|
|
||||||
//#region Date-Picker add by jiahao 2022-05-21
|
//#region Date-Picker add by jiahao 2022-05-21
|
||||||
datepicker = $('#date-range-history').daterangepicker({
|
if(document.getElementById('date-range-history') != null) {
|
||||||
autoUpdateInput: false,
|
datepicker_history = $('#date-range-history').daterangepicker({
|
||||||
locale: { format: 'YYYY-MM-DD' },
|
autoUpdateInput: false,
|
||||||
//miniDate: new Date(Date.setDate(Date.getDate() - 30)),
|
locale: { format: 'YYYY-MM-DD' },
|
||||||
//maxDate: Date.getDate(),
|
//miniDate: new Date(Date.setDate(Date.getDate() - 30)),
|
||||||
opens: 'left'
|
//maxDate: Date.getDate(),
|
||||||
}, function (start, end, label) {
|
opens: 'left'
|
||||||
});
|
}, function (start, end, label) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#date-range-history').on('apply.daterangepicker', function (ev, picker) {
|
$('#date-range-history').on('apply.daterangepicker', function (ev, picker) {
|
||||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' ~ ' + picker.endDate.format('YYYY-MM-DD'));
|
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' ~ ' + picker.endDate.format('YYYY-MM-DD'));
|
||||||
@ -274,8 +280,10 @@
|
|||||||
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
//var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
//var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
//datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
//datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
||||||
datepicker.data('daterangepicker').setStartDate(today_format);
|
if(datepicker_history != undefined && datepicker_history != null) {
|
||||||
datepicker.data('daterangepicker').setEndDate(today_format);
|
datepicker_history.data('daterangepicker').setStartDate(today_format);
|
||||||
|
datepicker_history.data('daterangepicker').setEndDate(today_format);
|
||||||
|
}
|
||||||
//$('#date-range-history').val(dateLimit_format + ' - ' + today_format);
|
//$('#date-range-history').val(dateLimit_format + ' - ' + today_format);
|
||||||
$('#date-range-history').val(today_format + ' ~ ' + today_format);
|
$('#date-range-history').val(today_format + ' ~ ' + today_format);
|
||||||
//alert(" date-range-history = "+$('#date-range-history').val());
|
//alert(" date-range-history = "+$('#date-range-history').val());
|
||||||
@ -898,13 +906,15 @@
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Date Picker record
|
//#region Date Picker record
|
||||||
datepicker = $('#date-range-record').daterangepicker({
|
if(document.getElementById('date-range-record') != null) {
|
||||||
autoUpdateInput: false,
|
datepicker_record = $('#date-range-record').daterangepicker({
|
||||||
locale: { format: 'YYYY/MM/DD' },
|
autoUpdateInput: false,
|
||||||
opens: 'left'
|
locale: { format: 'YYYY/MM/DD' },
|
||||||
}, function (start, end, label) {
|
opens: 'left'
|
||||||
@* console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));*@
|
}, function (start, end, label) {
|
||||||
});
|
@* console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));*@
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#date-range-record').on('apply.daterangepicker', function (ev, picker) {
|
$('#date-range-record').on('apply.daterangepicker', function (ev, picker) {
|
||||||
$(this).val(picker.startDate.format('YYYY/MM/DD') + ' ~ ' + picker.endDate.format('YYYY/MM/DD'));
|
$(this).val(picker.startDate.format('YYYY/MM/DD') + ' ~ ' + picker.endDate.format('YYYY/MM/DD'));
|
||||||
@ -918,13 +928,15 @@
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Date Picker exception
|
//#region Date Picker exception
|
||||||
datepicker = $('#date-range-exception').daterangepicker({
|
if(document.getElementById('date-range-exception') != null) {
|
||||||
autoUpdateInput: false,
|
datepicker_exception = $('#date-range-exception').daterangepicker({
|
||||||
locale: { format: 'YYYY/MM/DD' },
|
autoUpdateInput: false,
|
||||||
opens: 'left'
|
locale: { format: 'YYYY/MM/DD' },
|
||||||
}, function (start, end, label) {
|
opens: 'left'
|
||||||
@* console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));*@
|
}, function (start, end, label) {
|
||||||
});
|
@* console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));*@
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#date-range-exception').on('apply.daterangepicker', function (ev, picker) {
|
$('#date-range-exception').on('apply.daterangepicker', function (ev, picker) {
|
||||||
$(this).val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
|
$(this).val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
|
||||||
@ -1112,10 +1124,14 @@
|
|||||||
//#region 逆變器分析 tab
|
//#region 逆變器分析 tab
|
||||||
|
|
||||||
ChangeInverterDateToday();
|
ChangeInverterDateToday();
|
||||||
LoadInvertAnalysisHeatMap();
|
if(document.getElementById('InverterResult') != null) {
|
||||||
|
LoadInvertAnalysisHeatMap();
|
||||||
|
}
|
||||||
|
|
||||||
ChangeInverterkwhBarDaily('');
|
ChangeInverterkwhBarDaily('');
|
||||||
LoadInvertAnalysiskwhBar();
|
if(document.getElementById('inverter-kWh-convas-div') != null) {
|
||||||
|
LoadInvertAnalysiskwhBar();
|
||||||
|
}
|
||||||
|
|
||||||
//#region 載入電站逆變器資料
|
//#region 載入電站逆變器資料
|
||||||
showLoading();
|
showLoading();
|
||||||
@ -1571,8 +1587,8 @@
|
|||||||
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
|
||||||
datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
datepicker_exception.data('daterangepicker').setStartDate(dateLimit_format);
|
||||||
datepicker.data('daterangepicker').setEndDate(today_format);
|
datepicker_exception.data('daterangepicker').setEndDate(today_format);
|
||||||
|
|
||||||
$('#date-range-exception').val(dateLimit_format + ' - ' + today_format);
|
$('#date-range-exception').val(dateLimit_format + ' - ' + today_format);
|
||||||
$('#date-range-exception').trigger('change');
|
$('#date-range-exception').trigger('change');
|
||||||
@ -1827,8 +1843,8 @@
|
|||||||
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
|
||||||
datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
datepicker_record.data('daterangepicker').setStartDate(dateLimit_format);
|
||||||
datepicker.data('daterangepicker').setEndDate(today_format);
|
datepicker_record.data('daterangepicker').setEndDate(today_format);
|
||||||
|
|
||||||
$('#date-range-record').val(dateLimit_format + ' - ' + today_format);
|
$('#date-range-record').val(dateLimit_format + ' - ' + today_format);
|
||||||
$('#date-range-record').trigger('change');
|
$('#date-range-record').trigger('change');
|
||||||
@ -2310,6 +2326,9 @@
|
|||||||
type: 'heatmap',
|
type: 'heatmap',
|
||||||
height: 600
|
height: 600
|
||||||
},
|
},
|
||||||
|
accessibility: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
|
||||||
title: {
|
title: {
|
||||||
text: '各逆變器當日日均發電度數'
|
text: '各逆變器當日日均發電度數'
|
||||||
@ -2901,6 +2920,9 @@
|
|||||||
viewData: '檢視資料表格',
|
viewData: '檢視資料表格',
|
||||||
viewFullscreen: '全屏檢視'
|
viewFullscreen: '全屏檢視'
|
||||||
},
|
},
|
||||||
|
accessibility: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
chart: {
|
chart: {
|
||||||
renderTo: 'history-kWh',
|
renderTo: 'history-kWh',
|
||||||
height: 600,
|
height: 600,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user