fix: 修复实体详情的安全事件tab时间显示异常的问题

This commit is contained in:
刘洪洪
2023-12-27 18:10:25 +08:00
parent d7bd49a9ac
commit fc24f6bbfb
2 changed files with 22 additions and 5 deletions

View File

@@ -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 '-'
}
}