Browse Source

定时更新数据

bls-dan 2 years ago
parent
commit
68e36d9542

+ 13 - 8
src/pages/views/home/components/CehicleOperation.vue

@@ -1048,13 +1048,6 @@ watch(() => store.currentLineId, () => {
   getBusLineDriver()
   getBusLineDriver()
   getBusLineDetail()
   getBusLineDetail()
 })
 })
-const timer = setInterval(() => {
-  getBusLineCar()
-}, 5 * 1000)
-
-onUnmounted(() => {
-  clearInterval(timer)
-})
 
 
 const nameMap:any = {
 const nameMap:any = {
   1: '老年卡',
   1: '老年卡',
@@ -1115,6 +1108,18 @@ async function getVehicleStatusService() {
 }
 }
 getVehicleStatusService()
 getVehicleStatusService()
 
 
+const timer = setInterval(() => {
+  getBusLineDetail()
+  getBusLineDriver()
+  getBusLineCar()
+
+  getPassengerPercent()
+  getVehicleStatusService()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -1495,7 +1500,7 @@ getVehicleStatusService()
             color: #333333;
             color: #333333;
           }
           }
 
 
-          &.no {
+          &:hover {
             td {
             td {
               background: linear-gradient(180deg, #00A8F0 0%, #02B3B3 100%);
               background: linear-gradient(180deg, #00A8F0 0%, #02B3B3 100%);
 
 

+ 15 - 1
src/pages/views/home/components/FacilityManagement.vue

@@ -149,7 +149,7 @@ import Layout from '@/components/layout.vue'
 import Echart from '@/components/chart.vue'
 import Echart from '@/components/chart.vue'
 
 
 import Box from '@/components/box.vue'
 import Box from '@/components/box.vue'
-import { ref } from 'vue'
+import { onUnmounted, ref } from 'vue'
 import FacilityManagementService from '../services/facilityManagement.service'
 import FacilityManagementService from '../services/facilityManagement.service'
 
 
 const facilityStatistics = ref({
 const facilityStatistics = ref({
@@ -1048,6 +1048,20 @@ async function getFacilityVehicleComponents() {
   vehicleComponents.value.good = goodTotal
   vehicleComponents.value.good = goodTotal
 }
 }
 getFacilityVehicleComponents()
 getFacilityVehicleComponents()
+
+const timer = setInterval(() => {
+  getFacilityStatistics()
+  getFacilityVehicleModel()
+  getFacilityStation()
+
+  getFacilityCarWasher()
+  getFacilityChargingStation()
+  getFacilityVehicleComponents()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 5 - 4
src/pages/views/home/components/HomePage.vue

@@ -540,15 +540,16 @@ const leftContent:any = ref({
           height: 20,
           height: 20,
           bottom: 8,
           bottom: 8,
           handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
           handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
-          handleSize: '100%',
+          handleSize: '140%',
           handleStyle: {
           handleStyle: {
-            color: '#409eff'
+            color: '#fff'
           },
           },
+          moveHandleSize: 0,
           textStyle: {
           textStyle: {
             color: '#666'
             color: '#666'
           },
           },
-          fillerColor: 'rgba(255,255,255,0.2)',
-          borderColor: 'rgba(64,158,225,0.3)'
+          fillerColor: 'rgba(24,38,73,.3)',
+          borderColor: 'none'
         }
         }
       },
       },
       btns: [ '总', '年', '月', '日' ],
       btns: [ '总', '年', '月', '日' ],

+ 13 - 3
src/pages/views/home/components/LineAnalysis.vue

@@ -138,7 +138,7 @@ import Echart from '@/components/chart.vue'
 import SelectDate from '@/components/selectDate.vue'
 import SelectDate from '@/components/selectDate.vue'
 
 
 import {
 import {
-  Ref, h, ref, watch
+  Ref, h, onUnmounted, ref, watch
 } from 'vue'
 } from 'vue'
 import { graphic } from 'echarts'
 import { graphic } from 'echarts'
 import LineAnalysisService from '../services/lineAnalysis.service'
 import LineAnalysisService from '../services/lineAnalysis.service'
@@ -406,7 +406,7 @@ const rightContent: Ref<any> = ref({
       }
       }
     },
     },
     {
     {
-      name: '线路据分布',
+      name: '线路据分布',
       option: {
       option: {
         title: {
         title: {
           text: '总', // 图标内容文本
           text: '总', // 图标内容文本
@@ -909,7 +909,6 @@ const stationRankRange = ref([ subDays(Date.now(), 7), Date.now() ])
 async function getAnalysisStationRank(params: any) {
 async function getAnalysisStationRank(params: any) {
   const res = await lineAnalysisService.getAnalysisStationRank(params)
   const res = await lineAnalysisService.getAnalysisStationRank(params)
   const groupData = groupBy(res, 'stationName')
   const groupData = groupBy(res, 'stationName')
-  console.log(groupData, 'groupData')
   const xAxisData = []
   const xAxisData = []
   const seriesData1 = []
   const seriesData1 = []
 
 
@@ -954,6 +953,17 @@ function groupBy(array: any[], id: string) {
   // return Object.values(groups);
   // return Object.values(groups);
   return groups
   return groups
 }
 }
+
+const timer = setInterval(() => {
+  getAnalysisRegionFlow()
+  getAnalysisLineType()
+  getAnalysisLineLength()
+  getAnalysisLineDistance()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 22 - 1
src/pages/views/home/components/MaintenanceDynamics.vue

@@ -165,7 +165,7 @@ import Box from '@/components/box.vue'
 import SelectDate from '@/components/selectDate.vue'
 import SelectDate from '@/components/selectDate.vue'
 
 
 import {
 import {
-  Ref, computed, onMounted, ref, watch
+  Ref, computed, onMounted, onUnmounted, ref, watch
 } from 'vue'
 } from 'vue'
 import Echart from '@/components/chart.vue'
 import Echart from '@/components/chart.vue'
 import MaintenanceDynamicsService from '../services/maintenanceDynamics.Service'
 import MaintenanceDynamicsService from '../services/maintenanceDynamics.Service'
@@ -722,12 +722,33 @@ getMaintenanceDetail()
 
 
 watch(() => leftContent.value.bottom.range, getMaintenanceDetail)
 watch(() => leftContent.value.bottom.range, getMaintenanceDetail)
 
 
+const statisticsType = ref(1)
 function selectDatechange(type: any) {
 function selectDatechange(type: any) {
+  statisticsType.value = type
   getMaintenanceStatistics(type)
   getMaintenanceStatistics(type)
 }
 }
 onMounted(() => {
 onMounted(() => {
   selectDatechange(1)
   selectDatechange(1)
 })
 })
+
+const timer = setInterval(() => {
+  getBusLineDetailAll()
+  getMaintenanceStatistics(statisticsType.value)
+
+  getMaintenanceCarOperate()
+  getMaintenanceCarStatus()
+
+  getMaintenanceRidingDistance()
+  getMaintenanceLocationNum()
+  getMaintenanceConsumption()
+
+  getMaintenanceCheckupProblem()
+  getMaintenanceImplementation()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 17 - 1
src/pages/views/home/components/PassengerFlow.vue

@@ -99,7 +99,7 @@
 import Layout from '@/components/layout.vue'
 import Layout from '@/components/layout.vue'
 import Box from '@/components/box.vue'
 import Box from '@/components/box.vue'
 import Echart from '@/components/chart.vue'
 import Echart from '@/components/chart.vue'
-import { ref } from 'vue'
+import { onUnmounted, ref } from 'vue'
 import { graphic } from 'echarts'
 import { graphic } from 'echarts'
 import PassengerFlowService from '../services/passengerFlow.service'
 import PassengerFlowService from '../services/passengerFlow.service'
 
 
@@ -1331,6 +1331,22 @@ async function getTrafficFlowRank() {
   rightContent.value.top1!.series[0].data = seriesData
   rightContent.value.top1!.series[0].data = seriesData
 }
 }
 getTrafficFlowRank()
 getTrafficFlowRank()
+
+const timer = setInterval(() => {
+  getTrafficAreaFlow()
+
+  getTrafficRidingDistance()
+  getTrafficTransferProportion()
+  getTrafficTypeNumber()
+  getTrafficCommutingTime()
+  getTrafficConsumeType()
+
+  getTrafficFlowRank()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 29 - 7
src/pages/views/home/components/StationManagement.vue

@@ -216,6 +216,7 @@
               :columns="columns"
               :columns="columns"
               :data="tableData"
               :data="tableData"
               max-height="200"
               max-height="200"
+              style="font-size: 18px;"
             />
             />
           </Box>
           </Box>
         </div>
         </div>
@@ -228,7 +229,7 @@
 import Layout from '@/components/layout.vue'
 import Layout from '@/components/layout.vue'
 import Box from '@/components/box.vue'
 import Box from '@/components/box.vue'
 import {
 import {
-  Ref, computed, h, ref
+  Ref, computed, h, onUnmounted, ref
 } from 'vue'
 } from 'vue'
 import Echart from '@/components/chart.vue'
 import Echart from '@/components/chart.vue'
 import StationManagementService from '../services/stationManagement.service'
 import StationManagementService from '../services/stationManagement.service'
@@ -750,6 +751,7 @@ const chargingStatus = ref([
 ])
 ])
 async function getStationChargingStatus() {
 async function getStationChargingStatus() {
   const res = await stationManagementService.getStationChargingStatus()
   const res = await stationManagementService.getStationChargingStatus()
+  chargingStatus.value = res.slice(0, 4)
 }
 }
 getStationChargingStatus()
 getStationChargingStatus()
 
 
@@ -767,6 +769,26 @@ async function getStationResourceRate() {
   originData.value = await stationManagementService.getStationResourceRate()
   originData.value = await stationManagementService.getStationResourceRate()
 }
 }
 getStationResourceRate()
 getStationResourceRate()
+
+const timer = setInterval(() => {
+  getStationRegion()
+  getStationTypes()
+  getStationArea()
+  getStationOwnership()
+  getStationConstruct()
+  getStationUse()
+  getStationOperate()
+  getStationChargingTrends()
+  getStationInstalledCapacity()
+
+  getStationChargingStatus()
+  getStationChargingStatistics()
+  getStationResourceRate()
+}, 5 * 1000)
+
+onUnmounted(() => {
+  clearInterval(timer)
+})
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -837,9 +859,9 @@ getStationResourceRate()
 
 
     .text {
     .text {
       position: absolute;
       position: absolute;
-      left: 42%;
-      top: 40%;
-      font-size: 28px;
+      left: 45%;
+      top: 45%;
+      font-size: 18px;
       text-align: center;
       text-align: center;
     }
     }
 
 
@@ -928,9 +950,9 @@ getStationResourceRate()
 
 
       .text {
       .text {
         position: absolute;
         position: absolute;
-        left: 42%;
-        top: 40%;
-        font-size: 28px;
+        left: 45%;
+        top: 45%;
+        font-size: 18px;
         text-align: center;
         text-align: center;
       }
       }
     }
     }