From fc24f6bbfbdf4680297d92025b48c58a2d83d762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Wed, 27 Dec 2023 18:10:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E5=AE=89=E5=85=A8=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?tab=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tools.js | 18 ++++++++++++++++++ .../charts/entityDetail/tabs/SecurityEvent.vue | 9 ++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/utils/tools.js b/src/utils/tools.js index 8a807434..8d9d96b8 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -8,6 +8,7 @@ import router from '@/router' import store from '@/store' import indexedDBUtils from '@/indexedDB' import { columnType } from '@/components/advancedSearch/meta/meta' +import { dateFormatByAppearance, getMillisecond } from '@/utils/date-util' export const tableSort = { // 是否需要排序 @@ -1463,3 +1464,20 @@ export const changeI18nOfSeverity = (severity) => { return '-' } } + +/** + * 将时间戳转为YYYY-MM-DD hh:mm:ss格式 + * @param timestamp + * @returns {string|*} + */ +export const changeTimestampToTime = (timestamp) => { + if (timestamp) { + if (_.isNumber(Number(timestamp))) { + return dateFormatByAppearance(getMillisecond(Number(timestamp))) + } else { + return '-' + } + } else { + return '-' + } +} diff --git a/src/views/charts2/charts/entityDetail/tabs/SecurityEvent.vue b/src/views/charts2/charts/entityDetail/tabs/SecurityEvent.vue index a976e58c..fff0dac5 100644 --- a/src/views/charts2/charts/entityDetail/tabs/SecurityEvent.vue +++ b/src/views/charts2/charts/entityDetail/tabs/SecurityEvent.vue @@ -58,7 +58,7 @@