From 53eaf232862fea86acf286809ddbe19652beebd6 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 8 May 2024 18:48:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=A0=E6=97=B6=E5=8C=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E5=B9=B4=E6=9C=88=E6=97=A5=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/utils/timeUitils.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 + } +} From d766114eece4d0d575c00fa5c757930ab0a9fcfb Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 8 May 2024 21:21:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=B5=81=E5=90=91=E5=9C=B0=E5=9B=BE=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20Excel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/components/canvas/utils/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }