فهرست منبع

style(广告列表页面): 更新广告开始时间、日期字段展示格式

fxs 6 ماه پیش
والد
کامیت
d7e89af2ed
1فایلهای تغییر یافته به همراه21 افزوده شده و 2 حذف شده
  1. 21 2
      src/views/Home/AdvertisingData/AdvertisingList.vue

+ 21 - 2
src/views/Home/AdvertisingData/AdvertisingList.vue

@@ -11,6 +11,7 @@ import { useAnalysis } from '@/hooks/useAnalysis'
 import { usePage } from '@/hooks/usePage'
 import { FilterType, type QueryInfo, type SelectInfo, type TableFieldInfo } from '@/types/table'
 import { FieldSpecialEffectType, TextType } from '@/types/tableText'
+import { formatDate } from '@/utils/common'
 
 const { selectInfo } = useCommonStore()
 const { AllApi } = useRequest()
@@ -83,7 +84,13 @@ const tableFieldsInfo = reactive<Array<TableFieldInfo>>([
     name: 'date',
     cnName: '日期',
     isShow: true,
-    needSort: false
+    needSort: false,
+    specialEffect: {
+      type: FieldSpecialEffectType.CUSTOM,
+      otherInfo: {
+        render: formatDate
+      }
+    }
   },
   {
     name: 'createdAt',
@@ -95,7 +102,19 @@ const tableFieldsInfo = reactive<Array<TableFieldInfo>>([
     name: 'startTime',
     cnName: '广告开始时间',
     isShow: true,
-    needSort: false
+    needSort: false,
+    specialEffect: {
+      type: FieldSpecialEffectType.CUSTOM,
+      otherInfo: {
+        render: (val: string) => {
+          // 此格式为之前的数据,没有时间,需要特殊处理
+          if (val === '0001-01-01 00:00:00') {
+            return '无'
+          }
+          return val
+        }
+      }
+    }
   },
   {
     name: 'adsId',