wenhongquan %!s(int64=2) %!d(string=hai) anos
pai
achega
758b93b2b6

+ 9 - 1
src/api/gpsData/index.ts

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 import { AxiosPromise } from 'axios';
-import { gpsDataVO } from '@/api/gpsData/type';
+import { countData, gpsDataVO } from '@/api/gpsData/type';
 
 // 获取路由
 export function getGpsData(query): AxiosPromise<gpsDataVO[]> {
@@ -10,3 +10,11 @@ export function getGpsData(query): AxiosPromise<gpsDataVO[]> {
     params: query
   });
 }
+
+export function getCountData(query): AxiosPromise<countData[]> {
+  return request({
+    url: '/system/peoplecount/list',
+    method: 'get',
+    params: query
+  });
+}

+ 35 - 31
src/api/gpsData/type.ts

@@ -1,32 +1,36 @@
 export interface gpsDataVO {
-    /**
-     * 
-     */
-    devicecode: string | number;
-  
-    /**
-     * 路线名称
-     */
-    speed: string;
-  
-    /**
-     * 起止及经过站点信息(包括场站编号及路过场站的时间)
-     */
-    lat: string;
-  
-    /**
-     * 车辆信息
-     */
-    lng: string ;
-  
-    /**
-     * 司机
-     */
-    alt: string;
-  
-    /**
-     * 随车人员
-     */
-    ts: string;
-  
-  }
+  /**
+   *
+   */
+  devicecode: string | number;
+
+  /**
+   * 路线名称
+   */
+  speed: string;
+
+  /**
+   * 起止及经过站点信息(包括场站编号及路过场站的时间)
+   */
+  lat: string;
+
+  /**
+   * 车辆信息
+   */
+  lng: string;
+
+  /**
+   * 司机
+   */
+  alt: string;
+
+  /**
+   * 随车人员
+   */
+  ts: string;
+}
+
+export interface countData {
+  totalin: number;
+  totalout: number;
+}

+ 33 - 5
src/components/Public/timeLine.vue

@@ -25,21 +25,19 @@
           <div style="display: flex;flex-direction: row;">
             <div class="activitieyContent" v-if="index == 0" style="background: #06D903;">
               起
-              <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;">{{
-        formatDate(item.planInTime) }}</div>
+              <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;width:100px;text-align: left;left:-10px">{{ gettoptxt(item)  }}</div>
             </div>
             <div class="activitieyContent" v-if="index > 0 && index < list.length - 1" style="">
               {{ index }}
               <div
                 style="position: absolute;top:-26px;left:-35px;color:#C0C4CC;font-weight:bold;width:100px;display:flex;justify-content: space-evenly;">
-                <div>{{ formatDate(item.planInTime) }}</div>
+                <div>{{ gettoptxt(item)  }}</div>
                 <!-- <div>{{ formatDate(item.planOutTime) }}</div> -->
               </div>
             </div>
             <div class="activitieyContent" v-if="index == list.length - 1" style="background: #ad012f;">
               终
-              <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;">{{
-        formatDate(item.planInTime) }}</div>
+              <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;">{{ gettoptxt(item)  }}</div>
             </div>
             <div class="line" style="margin: 2px 4px;margin-top:13px;" v-if="index != list.length - 1"></div>
           </div>
@@ -54,6 +52,8 @@
 </template>
 <script lang="ts" setup>
 
+import {getCurrentInstance} from 'vue'
+
 const props = defineProps({
   list: {
     type: [Object],
@@ -62,11 +62,39 @@ const props = defineProps({
   stationInfo: {
     type: Object,
     default: ""
+  },
+  parentdata: {
+    type: Object,
+    default: {}
   }
 });
 
+const internalInstance = getCurrentInstance();
+
+const gettoptxt = (item) => {
+  var counttext = "";
+  if (props.parentdata.peoplecount != undefined) {
+     counttext=  (Object.keys(props.parentdata.peoplecount).indexOf(item.stationName) != -1 ? `上:${props.parentdata.peoplecount[item.stationName].totalin}  下:${props.parentdata.peoplecount[item.stationName].totalout}` : ``)
+
+    //   console.log(item.stationName)
+    //  console.log(props.parentdata.peoplecount)
+  }
+
+  return (item.planInTime != undefined && item.planInTime != null ? (formatDate(item.planInTime)+"  ") : '') +counttext;
+  // return counttext;
+}
+
 const carIndex = ref(-1)
 
+// setTimeout(() => {
+//   internalInstance.ctx.$forceUpdate();
+// }, 2000);
+
+
+// watch(() => props.peoplecount, (val) => {
+//   console.log('发生变化咯',props,val)
+// })
+
 const activities = [
   {
     content: '白下',

+ 36 - 4
src/views/yunying/scheduling/index.vue

@@ -59,7 +59,7 @@
                         </div>
                         <div style="width: 80%;">
                             <el-scrollbar ref="scrollbarRef" height="400px" always @scroll="scroll">
-                                <timeLineDiv :list="JSON.parse(item.pathInfo).pathLine"
+                                <timeLineDiv :list="JSON.parse(item.pathInfo).pathLine" :parentdata="item"
                                     :stationInfo="JSON.parse(item.stationInfo)"></timeLineDiv>
                             </el-scrollbar>
                         </div>
@@ -72,7 +72,7 @@
                             </div>
                         </div>
                         <div style="position:absolute;bottom:10px;right:6px;font-size:10px">
-                            <span>乘客:11人 </span> <span style="margin-left: 10px;">货物:11个</span>
+                            <span>乘客:{{ gettotalpeople(item) }}人 </span> <span style="margin-left: 10px;">货物:11个</span>
                         </div>
                     </div>
                 </el-card>
@@ -96,7 +96,7 @@ import api from "@/api/system/user"
 import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
 import { listCarInfo, getCarInfo, delCarInfo, addCarInfo, updateCarInfo } from '@/api/carInfo';
 import { CarInfoVO, CarInfoQuery, CarInfoForm } from '@/api/carInfo/types';
-import tableElm from "@/components/Public/table.vue";
+import tableElm from "@/componentquery, p0: stringlic/table.vue";
 import { useRoute, useRouter } from "vue-router";
 import timeLineDiv from "@/components/Public/timeline";
 import { getDicts } from '@/api/system/dict/data'
@@ -105,10 +105,13 @@ import mapDiv from "@/components/Map/index.vue"
 import { listCarSchedule, getCarSchedule, delCarSchedule, addCarSchedule, updateCarSchedule } from '@/api/carSchedule';
 import { CarScheduleVO, CarScheduleQuery, CarScheduleForm } from '@/api/carSchedule/types';
 import moment from 'moment';
+import { getCountData } from '@/api/gpsData';
+import { countData } from '@/api/gpsData/type';
 
 
 import videojs from "video.js"
 import "video.js/dist/video-js.css"
+import { values } from "video.js/dist/types/utils/obj";
 
 
 
@@ -134,6 +137,14 @@ const queryFormRef = ref<ElFormInstance>();
 const carInfoFormRef = ref<ElFormInstance>();
 
 
+const gettotalpeople = (item) => {
+  if (item.peoplecount != undefined && item.peoplecount != null) {
+    var totalpeople = item.peoplecount['total'];
+    return totalpeople.totalin - totalpeople.totalout>0?totalpeople.totalin - totalpeople.totalout:0;
+  }
+  return 0;
+}
+
 const dialogMap = reactive<DialogOption>({
     visible: false,
     title: '地图'
@@ -262,6 +273,27 @@ const getScheduleList = async () => {
     }
     const res = await listCarSchedule(param);
     carScheduleList.value = res.rows;
+    carScheduleList.value.map(i => {
+
+    if (i.ext1 != undefined && i.ext1 != null) {
+      var datajson = JSON.parse(i.ext1)
+      var times = Object.values(datajson).map(j => {
+        return j.intime + "|" + j.outtime
+      }).join("$");
+      times+="$"+i.scheduleDate+"|"+moment().format("YYYY-MM-DD HH:mm:ss")
+      getCountData({ "params[times]": `${times}` }).then(res1 => {
+        var pcount = {}
+        var index = 0;
+        Object.keys(datajson).map(j => {
+          pcount[j]=res1.data[index++]
+        })
+        pcount['total'] = res1.data[index]
+        i['peoplecount'] = pcount;
+      });
+    }
+  })
+
+
     reloadData.value = true
 }
 
@@ -501,7 +533,7 @@ onMounted(() => {
     //         mapElmDiv.value.getGpsDataList(param);
     //     }
     // }, 2000);
-}); 
+});
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
vite.config.ts

@@ -26,8 +26,8 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
       open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          // target: 'http://localhost:8080',
-          target: 'http://47.104.97.60/api',
+          target: 'http://localhost:8080',
+          // target: 'http://47.104.97.60/api',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')