diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 9b0e4465..39671279 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -1,3 +1,5 @@ +import dayjs from 'dayjs' + /** * 时间日期转换 * @param date 当前时间,new Date() 格式 @@ -174,3 +176,18 @@ export function formatPast2(ms) { return 0 + '秒' } } + +/** + * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD HH:mm:ss 格式 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +// @ts-ignore +export const dateFormatter = (row, column, cellValue) => { + if (!cellValue) { + return + } + return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') +} diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index dd15ff8c..68bb5896 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -88,7 +88,7 @@ - + @@ -105,13 +105,13 @@ - - - - +