|
@@ -3,26 +3,302 @@
|
|
|
* @Author: wangcc
|
|
|
* @Date: 2023-01-09 11:22:53
|
|
|
* @LastEditors: wangcc
|
|
|
- * @LastEditTime: 2023-01-11 09:27:47
|
|
|
+ * @LastEditTime: 2023-01-29 17:59:41
|
|
|
* @FilePath: \parking_LargeScreen\src\components\ParkingRate\index.vue
|
|
|
* @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved.
|
|
|
-->
|
|
|
<template>
|
|
|
<div class="center">
|
|
|
+ <div class="vehicle-box">
|
|
|
+ <div class="vehicle-box-item">
|
|
|
+ <span class="vehicle-box-item-title">今日进场车 辆数(辆)</span>
|
|
|
+ <span class="vehicle-box-item-total">
|
|
|
+ <Count-to :startVal="startVal" :endVal="totalData.inVehicleCount" :duration="4000"></Count-to>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-box-item">
|
|
|
+ <span class="vehicle-box-item-title">今日出场车 辆数(辆)</span>
|
|
|
+ <span class="vehicle-box-item-total">
|
|
|
+ <Count-to :startVal="startVal" :endVal="totalData.outVehicleCount" :duration="4000"></Count-to>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-box-item">
|
|
|
+ <span class="vehicle-box-item-title">今日车位平 均使用率</span>
|
|
|
+ <span class="vehicle-box-item-total">
|
|
|
+ <!-- <Count-to :startVal="startVal" :endVal="totalData.spaceRat" :duration="4000"></Count-to> -->
|
|
|
+ {{totalData.spaceRat}}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video">
|
|
|
+ <div class="vehicle-video-right">
|
|
|
+ <div class="rankTitle">
|
|
|
+ <h3>路段实时监控</h3>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video-right-list">
|
|
|
+ <div v-if="rankOptions.length > 0">
|
|
|
+ <div
|
|
|
+ class="vehicle-video-right-list-item"
|
|
|
+ v-for="(item,index) in rankOptions"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <span class="vehicle-video-right-list-item-parkName">
|
|
|
+ {{item.parkName}}
|
|
|
+ <i class="el-icon-caret-bottom"></i>
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ class="vehicle-video-right-list-item-parkVideo"
|
|
|
+ :class="{vactive:cur==item.id+'-'+idx}"
|
|
|
+ @click="tabLink(idx,item)"
|
|
|
+ v-for="(its,idx) in item.child"
|
|
|
+ :key="idx"
|
|
|
+ >{{its.videoName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>暂无数据</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video-left">
|
|
|
+ <div v-show="videoPlayerOneRoad" id="videoPlayerCenterRoad" style="height: 100%;"></div>
|
|
|
+ <div class="noMore" v-if="!videoPlayerOneRoad">暂无视频</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video">
|
|
|
+ <div class="vehicle-video-right">
|
|
|
+ <div class="rankTitle">
|
|
|
+ <h3>停车场实时监控</h3>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video-right-list">
|
|
|
+ <div v-if="parkOptions.length > 0">
|
|
|
+ <div
|
|
|
+ class="vehicle-video-right-list-item"
|
|
|
+ v-for="(item,index) in parkOptions"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <span class="vehicle-video-right-list-item-parkName">
|
|
|
+ {{item.parkName}}
|
|
|
+ <i class="el-icon-caret-bottom"></i>
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ class="vehicle-video-right-list-item-parkVideo"
|
|
|
+ :class="{vactive:parkCur==item.id+'-'+idx}"
|
|
|
+ @click="parkLink(idx,item)"
|
|
|
+ v-for="(its,idx) in item.child"
|
|
|
+ :key="idx"
|
|
|
+ >{{its.videoName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>暂无数据</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-video-left">
|
|
|
+ <div v-show="videoPlayerOnePark" id="videoPlayerCenterPark" style="height: 100%;"></div>
|
|
|
+ <div class="noMore" v-if="!videoPlayerOnePark">暂无视频</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="vehicle-circumstance">
|
|
|
+ <div class="rankTitle">
|
|
|
+ <h3>路段停车位情况</h3>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import CountTo from 'vue-count-to';
|
|
|
+import { vehicleData } from '@/api/http';
|
|
|
export default {
|
|
|
name: '',
|
|
|
+ components: { CountTo },
|
|
|
data() {
|
|
|
return {
|
|
|
value: '',
|
|
|
- options: []
|
|
|
+ cur: 0,
|
|
|
+ parkCur: 0,
|
|
|
+ playerRoadUrl: '',
|
|
|
+ playerUrl: '',
|
|
|
+ startVal: 0,
|
|
|
+ videoPlayerOnePark: null,
|
|
|
+ videoPlayerOneRoad: null,
|
|
|
+ rankOptions: [],
|
|
|
+ parkOptions: [],
|
|
|
+ totalData: {}
|
|
|
};
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.videoPlayerPark();
|
|
|
+ this.videoPlayerRoad();
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getVehicleData()
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ // 页面销毁,同时也销毁 TcPlayer
|
|
|
+ if (this.videoPlayerOnePark) {
|
|
|
+ this.videoPlayerOnePark.destroy();
|
|
|
+ }
|
|
|
+ if (this.videoPlayerOneRoad) {
|
|
|
+ this.videoPlayerOneRoad.destroy();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tabLink(e, item) {
|
|
|
+ this.cur = item.id + '-' + e;
|
|
|
+ },
|
|
|
+ parkLink(e, item) {
|
|
|
+ this.parkCur = item.id + '-' + e;
|
|
|
+ },
|
|
|
+ // 查询数据总览
|
|
|
+ async getVehicleData() {
|
|
|
+ let { data, code } = await vehicleData();
|
|
|
+ if (code == 200) {
|
|
|
+ console.log(data);
|
|
|
+ this.totalData = data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 道路视频监控
|
|
|
+ videoPlayerRoad() {
|
|
|
+ this.videoPlayerOneRoad = new TcPlayer('videoPlayerCenterRoad', {
|
|
|
+ m3u8: this.playerRoadUrl,
|
|
|
+ autoplay: true, //iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的
|
|
|
+ // "coverpic": img,
|
|
|
+ width: '100%', //视频的显示宽度,请尽量使用视频分辨率宽度
|
|
|
+ height: '100%', //视频的显示高度,请尽量使用视频分辨率高度
|
|
|
+ remember: 1,
|
|
|
+ controls: 'none'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 停车场视频监控
|
|
|
+ videoPlayerPark() {
|
|
|
+ this.videoPlayerOnePark = new TcPlayer('videoPlayerCenterPark', {
|
|
|
+ m3u8: this.playerUrl,
|
|
|
+ autoplay: true, //iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的
|
|
|
+ // "coverpic": img,
|
|
|
+ width: '100%', //视频的显示宽度,请尽量使用视频分辨率宽度
|
|
|
+ height: '100%', //视频的显示高度,请尽量使用视频分辨率高度
|
|
|
+ remember: 1,
|
|
|
+ controls: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang='scss' scoped>
|
|
|
+.center {
|
|
|
+ position: absolute;
|
|
|
+ overflow: hidden;
|
|
|
+ top: 67px;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ z-index: 1002;
|
|
|
+ color: #fff;
|
|
|
+ padding: 0 20px 20px 20px;
|
|
|
+}
|
|
|
+.vehicle-box {
|
|
|
+ display: flex;
|
|
|
+ height: 84px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ &-item {
|
|
|
+ width: 230px;
|
|
|
+ margin-right: 80px;
|
|
|
+ &-title {
|
|
|
+ width: 70px;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ &-total {
|
|
|
+ font-size: 44px;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.vehicle-video {
|
|
|
+ background: linear-gradient(90deg, #293446 0%, rgba(41, 52, 70, 0.2) 100%);
|
|
|
+ backdrop-filter: blur(10px);
|
|
|
+ width: 890px;
|
|
|
+ height: 520px;
|
|
|
+ float: left;
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 20px;
|
|
|
+ margin-left: 10px;
|
|
|
+ &-right {
|
|
|
+ float: left;
|
|
|
+ width: 160px;
|
|
|
+ margin-right: 20px;
|
|
|
+ .rankTitle {
|
|
|
+ text-align: left;
|
|
|
+ // padding-left: 20px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #ffffff;
|
|
|
+ /* line-height: 22px; */
|
|
|
+ margin-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+ height: 22px;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .rankTitle::before {
|
|
|
+ content: '';
|
|
|
+ width: 16px;
|
|
|
+ height: 15px;
|
|
|
+ display: inline-block;
|
|
|
+ background-image: url('@/assets/images/check.png');
|
|
|
+ background-size: 100% 100%;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ &-list {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ &-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ span {
|
|
|
+ line-height: 30px;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ &-parkName {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ &-parkVideo {
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: rgba(255, 255, 255, 0.15);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.15);
|
|
|
+ }
|
|
|
+ .vactive {
|
|
|
+ color: #1dd4ff;
|
|
|
+ background: linear-gradient(
|
|
|
+ 180deg,
|
|
|
+ rgba(42, 215, 255, 0) 0%,
|
|
|
+ rgba(29, 212, 255, 0.6) 46%,
|
|
|
+ rgba(42, 214, 255, 0) 100%
|
|
|
+ );
|
|
|
+ border: 1px solid;
|
|
|
+ border-image: linear-gradient(
|
|
|
+ 90deg,
|
|
|
+ rgba(84, 237, 255, 0.16),
|
|
|
+ rgba(29, 212, 255, 1),
|
|
|
+ rgba(42, 215, 255, 0.16)
|
|
|
+ )
|
|
|
+ 1 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &-left {
|
|
|
+ width: 700px;
|
|
|
+ float: right;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+.noMore {
|
|
|
+ display: flex;
|
|
|
+ height: 100%;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|