Переглянути джерело

Merge branch 'dev-wyf' into 'dev'

fix: 总览车今日车流量不查接口

See merge request product-group-fe/sfy-safety-group/sfy-safety!233
ai0197 6 місяців тому
батько
коміт
ff8f73189f

+ 2 - 2
src/views/security-confidentiality/overview/components/VehicleManagement.vue

@@ -16,7 +16,7 @@
 <script setup lang="ts">
   import { onMounted, ref } from 'vue';
   import VehicleChart from '../charts/VehicleChart.vue';
-  import { getVehicleOverviewChartData, getLastDayFlow } from '../hooks';
+  import { getVehicleOverviewChartData } from '../hooks';
   import type { BarChartData } from '../types';
 
   const barData = ref<BarChartData>();
@@ -24,7 +24,7 @@
 
   onMounted(async () => {
     barData.value = await getVehicleOverviewChartData();
-    lastDayFlow.value = await getLastDayFlow();
+    lastDayFlow.value = barData.value.value[barData.value.value.length - 1];
   });
 </script>
 

+ 0 - 18
src/views/security-confidentiality/overview/hooks.ts

@@ -1,7 +1,5 @@
 import { getPersonOverview, getVehicleOverview } from '@/api/security-confidentiality-overview';
 import type { PersonOverview, PieChartData, VehicleOverview, BarChartData } from './types';
-import dayjs from 'dayjs';
-import { getVehicleRecordList } from '@/api/security-confidentiality-vehicle';
 
 export async function getPersonOverviewChartData() {
   const personOverview: PersonOverview = await getPersonOverview();
@@ -18,19 +16,3 @@ export async function getVehicleOverviewChartData() {
     value: vehicleOverview.vehicleEntryRecordList.map((item) => item.vehicleCount),
   } as BarChartData;
 }
-
-export async function getLastDayFlow() {
-  const searchTime = [
-    dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
-    dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
-  ];
-  const list = await getVehicleRecordList({
-    pageNumber: 1,
-    pageSize: 1,
-    queryParam: {
-      startTime: searchTime[0],
-      endTime: searchTime[1],
-    },
-  });
-  return list.totalRow;
-}