Sfoglia il codice sorgente

feat(用户消息): 使用dayjs格式化消息发送时间

在消息列表中添加dayjs依赖并格式化createTime字段为'YYYY-MM-DD HH:mm:ss'格式,提升时间显示的可读性
tanshanming 6 mesi fa
parent
commit
4727ade209
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/views/sys/user/userTab/userMessage.vue

+ 5 - 1
src/views/sys/user/userTab/userMessage.vue

@@ -38,6 +38,7 @@
 	import userCenterApi from '@/api/sys/userCenterApi'
 	import tool from '@/utils/tool'
 	import { nextTick } from 'vue'
+	import dayjs from 'dayjs'
 
 	const messageCategoryList = tool.dictList('MESSAGE_CATEGORY')
 	const selectedKeys = ref(new Array(messageCategoryList[0].value))
@@ -51,7 +52,10 @@
 		{
 			title: '发送时间',
 			dataIndex: 'createTime',
-			sorter: true
+			sorter: true,
+			customRender: ({ text }) => {
+				return dayjs(text).format('YYYY-MM-DD HH:mm:ss')
+			}
 		},
 		{
 			title: '是否已读',