فهرست منبع

feat: (dashborad) search time

gemercheung 3 سال پیش
والد
کامیت
e719154c0a
1فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 5 6
      src/views/dashboard/analysis/enterprise.vue

+ 5 - 6
src/views/dashboard/analysis/enterprise.vue

@@ -36,11 +36,12 @@
 
   import { ListApi as ListCorporationApi } from '/@/api/corporation/list';
   import { listRoomsApi, ListApi as ListLiveApi } from '/@/api/scene/list';
-  import { formatToDate } from '/@/utils/dateUtil';
-  import dayjs from 'dayjs';
+  import { dateUtil, formatToDate } from '/@/utils/dateUtil';
 
   const loading = ref(true);
   // const { t } = useI18n();
+  const today = formatToDate(dateUtil(new Date()));
+  const priorDate = formatToDate(dateUtil(new Date().setDate(new Date().getDate() - 30)));
 
   const columns: BasicColumn[] = [
     {
@@ -167,6 +168,7 @@
       {
         field: 'time',
         label: '时间段',
+        defaultValue: [priorDate, today],
         component: 'RangePicker',
         colProps: {
           lg: 24,
@@ -180,16 +182,13 @@
           // showTime: { format: 'HH:mm:ss' },
           disabledDate(current) {
             // console.log('current', current, date);
-            return current && current > dayjs().endOf('day');
+            return current && current > dateUtil().endOf('day');
           },
         },
       },
     ],
   };
 
-  const today = formatToDate(dayjs(new Date()));
-  const priorDate = formatToDate(dayjs(new Date().setDate(new Date().getDate() - 30)));
-
   const searchInfo = reactive({
     liveRoomId: '',
     limit: 20,