diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index ad3f587357..27b1bab4c8 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -472,7 +472,10 @@ export function exportExcelDownload(chart, snapshot, width, height, loadingWrapp if ((chart.render === 'echarts' || ['text', 'label'].includes(chart.type)) && !(chart.data?.series?.length && chart.data?.series[0].data?.length)) { callBack() return - } else if ((chart.render === 'antv' && !['text', 'label'].includes(chart.type)) && !chart.data?.data?.length) { + } else if ((chart.render === 'antv' && !['text', 'label', 'flow-map'].includes(chart.type)) && !chart.data?.data?.length) { + callBack() + return + } else if (chart.type === 'flow-map' && !chart.data?.tableRow?.length) { callBack() return } diff --git a/core/frontend/src/utils/timeUitils.js b/core/frontend/src/utils/timeUitils.js index 34e2f9a87f..84ee9d25f8 100644 --- a/core/frontend/src/utils/timeUitils.js +++ b/core/frontend/src/utils/timeUitils.js @@ -1,4 +1,5 @@ -export const getRange = (selectValue, timeGranularity) => { +export const getRange = (outerTimeValue, timeGranularity) => { + const selectValue = timeGranularity === 'y_M_d_H' ? outerTimeValue + ':' : outerTimeValue if (new Date(selectValue).toString() === 'Invalid Date') { return selectValue } @@ -57,7 +58,8 @@ const getMonthEnd = timestamp => { } const getDayEnd = timestamp => { - return [+new Date(timestamp), +new Date(timestamp) + 60 * 1000 * 60 * 24 - 1000] + const utcTime = getUtcTime(timestamp) + return [+utcTime, +utcTime + 60 * 1000 * 60 * 24 - 1000] } const getHourEnd = timestamp => { @@ -89,3 +91,12 @@ const getDayBegin = timestamp => { return +new Date(timestamp) } +const getUtcTime = timestamp => { + if (timestamp) { + const time = new Date(timestamp) + const utcDate = new Date(time.getUTCFullYear(), time.getUTCMonth(), time.getUTCDate(), time.getUTCHours(), time.getUTCMinutes(), time.getUTCSeconds()) + return utcDate + } else { + return timestamp + } +}