mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 04:08:44 +08:00 
			
		
		
		
	重构:优化配置管理的 date 格式化
This commit is contained in:
		@@ -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')
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user