This commit is contained in:
duanliang
2025-04-22 22:05:44 +08:00
parent d8a7a0f53e
commit 3bff33bf03
21 changed files with 318 additions and 119 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -224,7 +224,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size:vw(18); font-size:vw(18);
color:#999; // color:#999;
color:#02f9fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -1,11 +1,16 @@
<template> <template>
<div <div style="position:relative;">
:id="id" <div
:style="{ :id="id"
width: styleUtil.px2vw(width), :style="{
height: styleUtil.px2vh(height) width: styleUtil.px2vw(width),
}" height: styleUtil.px2vh(height)
/> }"
/>
<div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">暂无数据</div>
</div>
</template> </template>
<script setup> <script setup>
@@ -96,11 +101,17 @@
} }
] ]
} }
let condShow = ref(0)
let aIndex = 1
watch( watch(
() => props.dataList, () => props.dataList,
(newVal) => { (newVal) => {
aIndex+=1
if(aIndex>=3&&!newVal.length){
condShow.value = 1
}
if (newVal.length > 0) { if (newVal.length > 0) {
condShow.value = 2
nextTick(() => { nextTick(() => {
defaultCofig.legend.formatter = (name) => { defaultCofig.legend.formatter = (name) => {
let percent = props.dataList.find((item) => item.name == name).value let percent = props.dataList.find((item) => item.name == name).value
@@ -121,4 +132,19 @@
) )
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
.nYong-du{
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
font-size:vw(18);
// color:#999;
color:#02f9fa;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@@ -1,12 +1,17 @@
<!-- 购买来源 --> <!-- 购买来源 -->
<template> <template>
<div
:id="id" <div style="position:relative;">
:style="{ <div
width: styleUtil.px2vw(width), :id="id"
height: styleUtil.px2vh(height) :style="{
}" width: styleUtil.px2vw(width),
/> height: styleUtil.px2vh(height)
}"
/>
<div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">暂无数据</div>
</div>
</template> </template>
<script setup> <script setup>
@@ -32,12 +37,17 @@
}) })
let params = null let params = null
let condShow = ref(0)
let aIndex = 1
watch( watch(
() => props.list, () => props.list,
(val) => { (val) => {
if(aIndex>=3&&!newVal.length){
condShow.value = 1
}
if (val.length > 0) { if (val.length > 0) {
setTimeout(() => { setTimeout(() => {
condShow.value = 2
init() init()
}, 1000) }, 1000)
} }
@@ -48,18 +58,21 @@
) )
const getSeriesData = () => { const getSeriesData = () => {
console.log(props.list,'props.listprops.listprops.list')
return props.list.map((item) => { return props.list.map((item) => {
return { item.value?item.value:0;
type: 'bar', return {
name: item.name, type: 'bar',
clockwise: false, name: item.name,
silent: true, clockwise: false,
roundCap: true, silent: true,
barWidth: '13%', roundCap: true,
showBackground: true, barWidth: '13%',
coordinateSystem: 'polar', showBackground: true,
data: [item.value] coordinateSystem: 'polar',
} data: [item.value]
}
}) })
} }
@@ -75,7 +88,11 @@
itemGap: fitChartSize(6), itemGap: fitChartSize(6),
formatter: function (name) { formatter: function (name) {
let obj = props.list.find((item) => item.name == name) let obj = props.list.find((item) => item.name == name)
return '{name|' + name + '} {value|' + obj?.value + '}{value|%}' if(obj?.value){
obj.value?obj.value:0;
return '{name|' + name + '} {value|' + obj?.value + '}{value|%}'
}
}, },
textStyle: { textStyle: {
rich: { rich: {
@@ -114,7 +131,8 @@
}, },
series: getSeriesData() series: getSeriesData()
} }
} else { }
else {
params.series = getSeriesData() params.series = getSeriesData()
} }
setOption(params) setOption(params)
@@ -122,6 +140,20 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.nYong-du{
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
font-size:vw(18);
// color:#999;
color:#02f9fa;
display: flex;
align-items: center;
justify-content: center;
}
.legend { .legend {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -16,6 +16,20 @@
<source type="application/x-mpegURL" /> <source type="application/x-mpegURL" />
</video> --> </video> -->
<div class="action-box"> <div class="action-box">
<div class="action-item">
<div
v-if="isCollect == 1"
class="video-follow"
@click.stop="handleCollect()"
>取消关注
</div>
<div
v-if="isCollect == 0"
class="video-unfollow"
@click.stop="handleCollect()"
>关注
</div>
</div>
<div class="action-item"> <div class="action-item">
<img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" /> <img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" />
<span>聚焦</span> <span>聚焦</span>
@@ -35,19 +49,10 @@
</div> </div>
<div class="action-item"> <div class="action-item">
<div <div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-if="isDayCurr==0">收藏</div>
v-if="isCollect == 1" <div class="video-follow" @click="handleCollectAdd(cameraIndexCode, isDiy, index)" v-else="isDayCurr==1">取消收藏</div>
class="video-follow"
@click.stop="handleCollect()"
>取消关注
</div>
<div
v-if="isCollect == 0"
class="video-unfollow"
@click.stop="handleCollect()"
>关注
</div>
</div> </div>
</div> </div>
</div> </div>
<img class="close" src="@/assets/images/close.png" @click="handleClose" /> <img class="close" src="@/assets/images/close.png" @click="handleClose" />
@@ -58,10 +63,8 @@
<script setup> <script setup>
import Hls from 'hls.js' import Hls from 'hls.js'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { import { postVideoControlApi,postVideoCollectApi } from '@/api/monitor'
postVideoCollectApi import { getColletDiyApi } from '@/api/home'
} from '@/api/monitor'
import { postVideoControlApi } from '@/api/monitor'
import pubSub from 'pubsub-js' import pubSub from 'pubsub-js'
const Z00M_IN = 'ZOOM_IN' // 焦距变大 const Z00M_IN = 'ZOOM_IN' // 焦距变大
const Z00M_OUT = 'ZOOM_OUT' // 焦距变小 const Z00M_OUT = 'ZOOM_OUT' // 焦距变小
@@ -85,6 +88,10 @@
isCollect:{ isCollect:{
type: Number, type: Number,
default: 0 default: 0
},
isDiy:{
type: Number,
default: 0
} }
}) })
let colletCond = ref(0) let colletCond = ref(0)
@@ -109,6 +116,22 @@
immediate: true immediate: true
} }
) )
let isDayCurr = ref(props.isDiy)
// 收藏
const handleCollectAdd = async (id, status, index) => {
await getColletDiyApi({
cameraIndexCode:id,
isDiy: isDayCurr.value == 0 ? 1 : 0
})
if(isDayCurr.value==1){
isDayCurr.value=0
// modelValue.value = false
}else{
isDayCurr.value=1
}
pubSub.publish('videoIsDiy',{isDiy:isDayCurr.value,cameraIndexCode:props.cameraIndexCode} )
}
// 关注 // 关注
const handleCollect = async (id, status, index) => { const handleCollect = async (id, status, index) => {
await postVideoCollectApi({ await postVideoCollectApi({
@@ -196,10 +219,10 @@
// top: vw(8); // top: vw(8);
// z-index: 9999; // z-index: 9999;
// margin-left:vw(20); // margin-left:vw(20);
padding: 0 vw(20); padding: vw(10);
height: vh(24); // height: vh(24);
text-align: center; text-align: center;
line-height: vh(24); // line-height: vh(24);
font-weight: 400; font-weight: 400;
font-size: vw(16); font-size: vw(16);
color: #ffffff; color: #ffffff;

View File

@@ -32,7 +32,7 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<video-dialog v-model="videoShow" :src="src" :isCollect="isCollect" :cameraIndexCode="cameraIndexCode" /> <video-dialog v-model="videoShow" :src="src" :isDiy="isDiy" :isCollect="isCollect" :cameraIndexCode="cameraIndexCode" />
</template> </template>
<script setup> <script setup>
@@ -52,6 +52,7 @@
let src = ref('') let src = ref('')
let cameraIndexCode = ref('') let cameraIndexCode = ref('')
let videoShow = ref(false) let videoShow = ref(false)
let isDiy = ref(0)
let params = reactive({ let params = reactive({
pageNum: 1, pageNum: 1,
pageSize: 15, pageSize: 15,
@@ -70,7 +71,6 @@
) )
const onVideoCollect = () => { const onVideoCollect = () => {
pubSub.subscribe('videoCollect', () => { pubSub.subscribe('videoCollect', () => {
console.log(1111111111111111111111)
clearHlsRefs() clearHlsRefs()
getVideoList() getVideoList()
}) })
@@ -79,6 +79,7 @@
console.log(item,'iscollect') console.log(item,'iscollect')
src.value = item.hlsUrl src.value = item.hlsUrl
isCollect.value = item.isCollect isCollect.value = item.isCollect
isDiy.value = item.isDiy
cameraIndexCode.value = item.cameraIndexCode cameraIndexCode.value = item.cameraIndexCode
videoShow.value = true videoShow.value = true
} }

View File

@@ -32,7 +32,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<video-dialog v-model="videoShow" :src="src" :isCollect="isCollect" :cameraIndexCode="cameraIndexCode" /> <video-dialog v-model="videoShow" :src="src" :isCollect="isCollect" :isDiy="isDiy" :cameraIndexCode="cameraIndexCode" />
<all-list v-model="allShow" /> <all-list v-model="allShow" />
</template> </template>
@@ -71,11 +71,13 @@ let isCollect = ref(0)
let allShow = ref(false) let allShow = ref(false)
let hlsRefs = [] let hlsRefs = []
let timer = null let timer = null
let isDiy = ref(0)
const handleItem = (item) => { const handleItem = (item) => {
console.log(item,'1111111111111111111111111')
src.value = item.hlsUrl src.value = item.hlsUrl
cameraIndexCode.value = item.cameraIndexCode cameraIndexCode.value = item.cameraIndexCode
isCollect.value = item.isCollect isCollect.value = item.isCollect
isDiy.value = item.isDiy
videoShow.value = true videoShow.value = true
} }
@@ -161,6 +163,13 @@ let isCollect = ref(0)
onMounted(() => { onMounted(() => {
onVideoCollect() onVideoCollect()
getVideoList() getVideoList()
pubSub.subscribe('videoIsDiy', (msg, data) => {
console.log(data,'收藏 ++++++++++++++')
getVideoList()
})
}) })
onUnmounted(() => { onUnmounted(() => {

View File

@@ -4,7 +4,7 @@ export const proBaseUrl = 'http://192.168.77.200'
export const socketBaseUrl = 'ws://192.168.77.209:81/fjtcc-api' export const socketBaseUrl = 'ws://192.168.77.209:81/fjtcc-api'
export const proSocketBaseUrl = 'ws://192.168.77.200:8060' export const proSocketBaseUrl = 'ws://192.168.77.200:8060'
export const mode = 'dev' // 测试 dev 正式 pro export const mode = 'pro' // 测试 dev 正式 pro
export const devToken = export const devToken =
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1OWFmNWYwLTU3OWItNDJkNy1hZDJhLTY0Y2JlODA5ZWI1NiJ9.BTxvu6jUWbN0qONWf5K6VzXopE8T8qXzKuX-mij21VJT4U0LdgnqToyqeNDQ2OyJ6cvpdJBzQ9mEEb-dnwrTpQ' 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1OWFmNWYwLTU3OWItNDJkNy1hZDJhLTY0Y2JlODA5ZWI1NiJ9.BTxvu6jUWbN0qONWf5K6VzXopE8T8qXzKuX-mij21VJT4U0LdgnqToyqeNDQ2OyJ6cvpdJBzQ9mEEb-dnwrTpQ'

View File

@@ -48,13 +48,13 @@
<div class="box"> <div class="box">
<div class="pt-10"> <div class="pt-10">
<Title3 title="拥堵次数占比" /> <Title3 title="拥堵次数占比" />
<jam-count :list="homeStore.trafficInfoData.data.countRate" /> <jam-count :text="'暂无拥堵'" :list="homeStore.trafficInfoData.data.countRate" />
</div> </div>
</div> </div>
<div class="box"> <div class="box">
<div class="pt-10"> <div class="pt-10">
<Title3 title="拥堵时长" /> <Title3 title="拥堵时长" />
<jam-duration :list="homeStore.trafficInfoData.data.timeRate" /> <jam-duration :text="'暂无拥堵'" :list="homeStore.trafficInfoData.data.timeRate" />
</div> </div>
</div> </div>
</div> </div>
@@ -78,7 +78,7 @@
<div> <div>
<div v-for="item in homeStore.carStopInfoData.spotInfo"> <div v-for="item in homeStore.carStopInfoData.spotInfo">
<div class="label">{{ item.name }}</div> <div class="label">{{ item.name }}</div>
<div class="value" :class="{ error: item.type == 1, success: item.type == 0 }"> <div class="value" :class="{ error: item.type == 1, success: item.type == 0,type3: item.type==2 }">
{{ item.value }} {{ item.value }}
</div> </div>
</div> </div>
@@ -108,8 +108,12 @@
</div> </div>
<div class="box-1"> <div class="box-1">
<div class="pt-10"> <div class="pt-10">
<Title3 title="停车场空余" /> <Title3 title="停车场使用" />
<vacancy :list="homeStore.carStopInfoData.dataList2" /> <el-carousel trigger="click" interval="5000">
<el-carousel-item v-for="item in splitList" :key="item">
<vacancy :list="item" />
</el-carousel-item>
</el-carousel>
</div> </div>
</div> </div>
</div> </div>
@@ -259,7 +263,17 @@
const shipMove = computed(() => { const shipMove = computed(() => {
return homeStore.carShipData?.ship?.info.length > 3 return homeStore.carShipData?.ship?.info.length > 3
}) })
const splitArray = (arr,len)=>{
let result = [];
for (let i = 0; i < arr.length; i += len) {
result.push(arr.slice(i, i + len));
}
return result;
}
const splitList = computed(()=>{
let splittedArrays = splitArray(homeStore.carStopInfoData.dataList2, 3);
return splittedArrays
})
const parkData = computed(() => { const parkData = computed(() => {
return [{ data: homeStore.carStopInfoData.dataList.map((item) => item.value) }] return [{ data: homeStore.carStopInfoData.dataList.map((item) => item.value) }]
}) })
@@ -273,6 +287,7 @@
const congestionXAxisData = computed(() => { const congestionXAxisData = computed(() => {
return homeStore.trafficInfoData.data.congestion.map((item) => item.name) return homeStore.trafficInfoData.data.congestion.map((item) => item.name)
}) })
console.log(homeStore.carStopInfoData.spotInfo,'homeStore.carStopInfoData.spotInfo')
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -352,11 +367,14 @@
color: #ffffff; color: #ffffff;
} }
.error { .error {
color: #e21b1b; color: #F15A25;
} }
.success { .success {
color: #02f9fa; color: #02F9FA;
} }
.type3{
color:#E21B1B;
}
} }
} }
.car-ship { .car-ship {

View File

@@ -3,7 +3,7 @@
<div style="position: relative;"> <div style="position: relative;">
<div class="jam-count" :id="id" /> <div class="jam-count" :id="id" />
<div v-if="condShow==0" class="nYong-du">加载中...</div> <div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">暂无数据</div> <div v-if="condShow==1" class="nYong-du">{{text}}</div>
</div> </div>
</template> </template>
@@ -16,7 +16,11 @@
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []
} },
text:{
type: String,
default: '暂无数据'
}
}) })
const { id, setOption } = useEchart() const { id, setOption } = useEchart()
@@ -145,7 +149,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size:vw(18); font-size:vw(18);
color:#999; // color:#999;
color:#02f9fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -3,7 +3,7 @@
<div style="position:relative;"> <div style="position:relative;">
<div class="jam" :id="id" /> <div class="jam" :id="id" />
<div v-if="condShow==0" class="nYong-du">加载中...</div> <div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">暂无数据</div> <div v-if="condShow==1" class="nYong-du">{{text}}</div>
</div> </div>
</template> </template>
@@ -18,7 +18,11 @@
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []
} },
text:{
type: String,
default: '暂无数据'
}
}) })
let condShow = ref(0) let condShow = ref(0)
let aIndex = 1 let aIndex = 1
@@ -208,7 +212,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size:vw(18); font-size:vw(18);
color:#999; // color:#999;
color:#02f9fa;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -70,6 +70,7 @@
homeStore.setTrafficInfoData(val) homeStore.setTrafficInfoData(val)
break break
case 'carStopInfo': case 'carStopInfo':
console.log(val,'carStopInfocarStopInfocarStopInfocarStopInfocarStopInfo')
homeStore.setCarStopInfoData(val) homeStore.setCarStopInfoData(val)
break break
case 'carShipData': case 'carShipData':

View File

@@ -61,7 +61,7 @@
class="video-item" class="video-item"
v-for="(item, index) in videoList" v-for="(item, index) in videoList"
:key="index" :key="index"
@click="handleItemVideo(item.hlsUrl, 100, item.cameraIndexCode)" @click="handleItemVideo(item.hlsUrl, 100, item.cameraIndexCode,item)"
> >
<div class="video-item__inner"> <div class="video-item__inner">
<div <div
@@ -110,6 +110,10 @@
<source type="application/x-mpegURL" /> <source type="application/x-mpegURL" />
</video> </video>
<div class="action-box"> <div class="action-box">
<div class="action-item">
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-if="thisVideo.isCollect==0">关注</span>
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-else="thisVideo.isCollect==1">取消关注</span>
</div>
<div class="action-item"> <div class="action-item">
<img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" /> <img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" />
<span>聚焦</span> <span>聚焦</span>
@@ -142,7 +146,7 @@
class="item" class="item"
v-for="(item, index) in videoList" v-for="(item, index) in videoList"
:key="index" :key="index"
@click="handleItemVideo(item.hlsUrl, 101, item.handleItemVideo)" @click="handleItemVideo(item.hlsUrl, 101, item.handleItemVideo,item)"
> >
<div> <div>
<p class="item-title--primary"> <p class="item-title--primary">
@@ -176,7 +180,7 @@
<el-pagination background layout="prev, pager, next" :total="1000" /> <el-pagination background layout="prev, pager, next" :total="1000" />
</div> --> </div> -->
</div> </div>
<VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isCollect="isCollect" :src="videoSrc" /> <VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isDiy="isDiy" :isCollect="isCollect" :src="videoSrc" />
</template> </template>
<script setup> <script setup>
@@ -238,8 +242,11 @@
isCollect: status == 0 ? 1 : 0 isCollect: status == 0 ? 1 : 0
}) })
if (status == 0) { if (status == 0) {
thisVideo.value.isCollect=1
videoList.value[index].isCollect = 1 videoList.value[index].isCollect = 1
} else { } else {
thisVideo.value.isCollect=0
videoList.value[index].isCollect = 0 videoList.value[index].isCollect = 0
} }
pubSub.publish('videoCollect', id) pubSub.publish('videoCollect', id)
@@ -272,6 +279,7 @@
initVideo() initVideo()
} }
let isCollect = ref(0) let isCollect = ref(0)
let isDiy = ref(0)
let videoSrc = ref('') let videoSrc = ref('')
const handleCamera = async (itemCode,resource) => { const handleCamera = async (itemCode,resource) => {
show.value = true show.value = true
@@ -281,6 +289,7 @@
}) })
cameraIndexCode.value = itemCode; cameraIndexCode.value = itemCode;
isCollect.value = resource.isCollect isCollect.value = resource.isCollect
isDiy.value = resource.isDiy
videoSrc.value = res.data.url videoSrc.value = res.data.url
} }
//清除 hls //清除 hls
@@ -339,7 +348,7 @@
break; break;
default: default:
console.log('无法恢复的错误,销毁播放器'); console.log('无法恢复的错误,销毁播放器');
hls.destroy(); // hls.destroy();
break; break;
} }
} }
@@ -358,7 +367,9 @@
} }
} }
const handleItemVideo = (url, type, code) => { let thisVideo = ref(null)
const handleItemVideo = (url, type, code,item) => {
thisVideo.value = item
videoLog.value = 2 videoLog.value = 2
cameraIndexCode.value = code cameraIndexCode.value = code
setTimeout(() => { setTimeout(() => {
@@ -446,6 +457,9 @@
</script> </script>
<style></style> <style></style>
<style scoped lang="scss"> <style scoped lang="scss">
.item-sc{
padding:vw(10);
}
.empty-box{ .empty-box{
display:flex; display:flex;
align-items: center; align-items: center;

View File

@@ -562,10 +562,12 @@
} }
} }
&:nth-child(4) { &:nth-child(4) {
background-image: url('/src/assets/images/four-t-3.png'); // background-image: url('/src/assets/images/four-t-3.png');
background-image: url('/src/assets/images/four-t-1.png');
background-size: 100% 100%; background-size: 100% 100%;
.scenic-item__value { .scenic-item__value {
color: #f15a25; // color: #f15a25;
color: #02f9fa;
} }
} }
&:nth-child(5) { &:nth-child(5) {

View File

@@ -112,6 +112,10 @@
<source type="application/x-mpegURL" /> <source type="application/x-mpegURL" />
</video> </video>
<div class="action-box"> <div class="action-box">
<div class="action-item">
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-if="thisVideo.isCollect==0">关注</span>
<span class="item-sc" @click="handleCollect(thisVideo.cameraIndexCode, thisVideo.isCollect, index)" v-else="thisVideo.isCollect==1">取消关注</span>
</div>
<div class="action-item"> <div class="action-item">
<img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" /> <img src="@/assets/images/plus.png" title="焦距变大" @click="handleAction(Z00M_IN)" />
<span>聚焦</span> <span>聚焦</span>
@@ -170,7 +174,7 @@
</div> </div>
</div> </div>
</div> </div>
<VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isCollect="isCollect" :src="videoSrc" /> <VideoDialog v-model="show" :cameraIndexCode="cameraIndexCode" :isDiy="isDiy" :isCollect="isCollect" :src="videoSrc" />
</template> </template>
<script setup> <script setup>
@@ -202,6 +206,7 @@
children: 'children' children: 'children'
} }
let isCollect = ref(0) let isCollect = ref(0)
let isDiy = ref(0)
let command = ref('') let command = ref('')
let videoList = ref([]) let videoList = ref([])
let navList = ref([]) let navList = ref([])
@@ -346,6 +351,7 @@
regionList.value[e].show = !regionList.value[e].show regionList.value[e].show = !regionList.value[e].show
} }
const handleCamera = async (itemCode,resource) => { const handleCamera = async (itemCode,resource) => {
console.log(resource,'resourceresourceresourceresourceresourceresource')
show.value = true show.value = true
let res = await getPreviewUrlApi({ let res = await getPreviewUrlApi({
type: 'hls', type: 'hls',
@@ -353,6 +359,7 @@
}) })
cameraIndexCode.value = itemCode; cameraIndexCode.value = itemCode;
isCollect.value = resource.isCollect isCollect.value = resource.isCollect
isDiy.value = resource.isDiy
videoSrc.value = res.data.url videoSrc.value = res.data.url
} }
const handleCollect = async (id, status, index) => { const handleCollect = async (id, status, index) => {
@@ -361,8 +368,10 @@
isCollect: status == 0 ? 1 : 0 isCollect: status == 0 ? 1 : 0
}) })
if (status == 0) { if (status == 0) {
thisVideo.value.isCollect=1
videoList.value[index].isCollect = 1 videoList.value[index].isCollect = 1
} else { } else {
thisVideo.value.isCollect=0
videoList.value[index].isCollect = 0 videoList.value[index].isCollect = 0
} }
pubSub.publish('videoCollect', id) pubSub.publish('videoCollect', id)
@@ -426,9 +435,9 @@
hls.on(Hls.Events.MANIFEST_PARSED, () => { hls.on(Hls.Events.MANIFEST_PARSED, () => {
video.play() video.play()
}) })
console.log(7778888)
hls.on(Hls.Events.ERROR, (event, data) => { hls.on(Hls.Events.ERROR, (event, data) => {
console.error('HLS 播放器遇到错误:', data); // console.error('HLS 播放器遇到错误:', data);
// hls.startLoad();
// initVideo() // initVideo()
// 根据错误类型进行处理 // 根据错误类型进行处理
if (data.fatal) { if (data.fatal) {
@@ -444,7 +453,7 @@
default: default:
console.log('无法恢复的错误,销毁播放器'); console.log('无法恢复的错误,销毁播放器');
hls.destroy(); // hls.destroy();
break; break;
} }
} }
@@ -478,7 +487,9 @@
cameraName: cameraName.value, cameraName: cameraName.value,
businessScenicArea: params.businessScenicArea businessScenicArea: params.businessScenicArea
}) })
console.log(params.businessScenicArea,'测收拾收拾')
regionList.value = res.data regionList.value = res.data
regionList.value.videoResources = res.data.videoResources
regionList.value[0].show = true regionList.value[0].show = true
if(search=='search'){ if(search=='search'){
regionList.value.forEach((item,index)=>{ regionList.value.forEach((item,index)=>{
@@ -506,6 +517,20 @@
getVideoType() getVideoType()
getVideoRegions() getVideoRegions()
onMonitorChange() onMonitorChange()
pubSub.subscribe('videoIsDiy', (msg, data) => {
console.log(data,'收藏 ++++++++++++++')
if(data.isDiy){
if(current.value==navList.value.length){
getColletList()
}
}else{
videoList.value.forEach((item,index)=>{
if(item.cameraIndexCode==data.cameraIndexCode){
videoList.value.splice(index,1)
}
})
}
})
}) })
onUnmounted(() => { onUnmounted(() => {
clearHlsRefs() clearHlsRefs()

View File

@@ -167,8 +167,8 @@ let tabsIndex = ref(0)
if(val[0].map){ if(val[0].map){
tabs.value[0].leng = val[0].all.length tabs.value[0].leng = val[0].all.length
tabs.value[1].leng = val[0].moving.length tabs.value[1].leng = val[0].moving.length
tabs.value[2].leng = val[0].offline.length tabs.value[2].leng = val[0].still.length
tabs.value[3].leng = val[0].still.length tabs.value[3].leng = val[0].offline.length
} }
if(val[1]==0){ if(val[1]==0){
listTabs.value = val[0].all listTabs.value = val[0].all
@@ -177,10 +177,10 @@ let tabsIndex = ref(0)
listTabs.value = val[0].moving listTabs.value = val[0].moving
} }
if(val[1]==2){ if(val[1]==2){
listTabs.value = val[0].offline listTabs.value = val[0].still
} }
if(val[1]==3){ if(val[1]==3){
listTabs.value = val[0].still listTabs.value = val[0].offline
} }
return false return false

View File

@@ -20,7 +20,9 @@
</div> </div>
</div> </div>
<div class="main"> <div class="main">
<div @click="hanldeToDetails" class="look-btn">查看详情</div> <a @click="hanldeToDetails" class="look-btn">
<img src="@/assets/images/d-ico-1.png" />
</a>
<iframe v-if="scenicSpotId == 'root000000'" width="100%" height="100%" src="/map/sxzd/bdc.html"></iframe> <iframe v-if="scenicSpotId == 'root000000'" width="100%" height="100%" src="/map/sxzd/bdc.html"></iframe>
<iframe v-if="scenicSpotId == 'root00000000'" width="100%" height="100%" src="/map/sxzd/sxzd.html"></iframe> <iframe v-if="scenicSpotId == 'root00000000'" width="100%" height="100%" src="/map/sxzd/sxzd.html"></iframe>
<iframe v-if="scenicSpotId == '龙桥河'" width="100%" height="100%" src="/map/lqh/lqh.html"></iframe> <iframe v-if="scenicSpotId == '龙桥河'" width="100%" height="100%" src="/map/lqh/lqh.html"></iframe>
@@ -152,7 +154,6 @@ import pubSub from 'pubsub-js'
onMounted(() => { onMounted(() => {
scenicChange = PubSub.subscribe('scenicChange', (msg, data) => { scenicChange = PubSub.subscribe('scenicChange', (msg, data) => {
hrefItem.value = data hrefItem.value = data
console.log(data,'llllllllllllllllllllllllllllllll')
// initMap('scenic-map', data.lng, data.lat, 15) // initMap('scenic-map', data.lng, data.lat, 15)
// map.value.setDisplayOptions({ // map.value.setDisplayOptions({
// poiText: false, // 隐藏poi标注 // poiText: false, // 隐藏poi标注
@@ -248,18 +249,23 @@ import pubSub from 'pubsub-js'
overflow-y: hidden; overflow-y: hidden;
position:relative; position:relative;
.look-btn{ .look-btn{
cursor: pointer;
position: absolute; position: absolute;
right: vw(20); right: vw(20);
top: 10%; top: 6%;
transform: translateY(-50%); transform: translateY(-50%);
padding: vw(12); padding: vw(12);
display: flex; display: flex;
align-items: center; align-items: center;
background: #0a4190; // background: #0a4190;
border-radius: vw(4); border-radius: vw(4);
font-size: vw(14); font-size: vw(14);
color: #fff; color: #fff;
z-index: 999; z-index: 999;
img{
width:vw(100);
// height:;
}
} }
.scenic-box { .scenic-box {
width: 100%; width: 100%;

View File

@@ -101,22 +101,20 @@
<div class="pt-10"> <div class="pt-10">
<Title3 title="车辆归属地占比" /> <Title3 title="车辆归属地占比" />
</div> </div>
<div v-if="dataLists.length"> <PieRow
<PieRow label="停车总数"
label="停车总数" :dataList="dataLists"
:dataList="dataLists" :total="carTotal"
:total="carTotal" :width="360"
:width="360" :height="300"
:height="300" />
/>
</div>
<div class="null-box" v-else> 暂无数据 </div>
</div> </div>
</div> </div>
</div> </div>
<div class="box-2"> <div class="box-2">
<Title1 title="异常信息 " /> <Title1 title="异常信息 " />
<div @click="handleToWorkOrder" class="count-box flex"> <div @click="handleToWorkOrder" style="cursor: pointer;" class="count-box flex">
<count-item <count-item
v-for="item in headList" v-for="item in headList"
:label="item.name" :label="item.name"
@@ -166,14 +164,16 @@
:height="300" :height="300"
sub-title="拥堵频次总数" sub-title="拥堵频次总数"
:list="scenicStore.trafficData.data.countRate" :list="scenicStore.trafficData.data.countRate"
:text="'暂无拥堵'"
/> />
</div> </div>
<div class="border"> <div class="border">
<Title3 title="拥堵时长占比" /> <Title3 title="拥堵时长占比" />
<jam <jam
:text="'暂无拥堵'"
:width="220" :width="220"
:height="300" :height="300"
sub-title="拥堵总时长" sub-title="拥堵总时长(分钟)"
:list="scenicStore.trafficData.data.timeRate" :list="scenicStore.trafficData.data.timeRate"
/> />
</div> </div>
@@ -502,6 +502,7 @@
.look-box { .look-box {
position: relative; position: relative;
.look-btn { .look-btn {
cursor: pointer;
position: absolute; position: absolute;
right: vw(20); right: vw(20);
top: 50%; top: 50%;

View File

@@ -1,11 +1,16 @@
<template> <template>
<div
:id="id" <div style="position: relative;">
:style="{ <div
width: styleUtil.px2vw(width), :id="id"
height: styleUtil.px2vh(height) :style="{
}" width: styleUtil.px2vw(width),
/> height: styleUtil.px2vh(height)
}"
/>
<div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">{{text}}</div>
</div>
</template> </template>
<script setup> <script setup>
@@ -33,16 +38,26 @@
subTitle: { subTitle: {
type: [String, Number], type: [String, Number],
default: () => '' default: () => ''
} },
text:{
type: String,
default: '暂无数据'
}
}) })
const { id, setOption } = useEchart() const { id, setOption } = useEchart()
let condShow = ref(0)
let aIndex = 1
watch( watch(
() => props.list, () => props.list,
() => { (val) => {
aIndex+=1
if(aIndex>=3&&!val.length){
condShow.value = 1
}
if (props.list.length > 0) { if (props.list.length > 0) {
setTimeout(() => { setTimeout(() => {
condShow.value = 2
init() init()
}, 1000) }, 1000)
} }
@@ -139,4 +154,19 @@
} }
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
.nYong-du{
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
font-size:vw(18);
// color:#999;
color:#02f9fa;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@@ -34,13 +34,13 @@
<div class="child-box"> <div class="child-box">
<p class="item__label">{{ item.licenseNumber }}</p> <p class="item__label">{{ item.licenseNumber }}</p>
<span v-if="item.type == 0" class="label_img"> <span v-if="item.type == 0" class="label_img">
</span> </span>
<span v-if="item.type == 2" class="label_img"> <span v-if="item.type == 2" class="label_img">
直通车 直通车
</span> </span>
<span class="label_img label_img_2" v-if="item.type == 1" > <span class="label_img label_img_2" v-if="item.type == 1" >
</span> </span>
</div> </div>
@@ -155,8 +155,8 @@ import PubSub from 'pubsub-js'
if(val[0].map){ if(val[0].map){
tabs.value[0].leng = val[0].all.length tabs.value[0].leng = val[0].all.length
tabs.value[1].leng = val[0].moving.length tabs.value[1].leng = val[0].moving.length
tabs.value[2].leng = val[0].offline.length tabs.value[2].leng = val[0].still.length
tabs.value[3].leng = val[0].still.length tabs.value[3].leng = val[0].offline.length
} }
if(val[1]==0){ if(val[1]==0){
listTabs.value = val[0].all listTabs.value = val[0].all
@@ -165,10 +165,10 @@ import PubSub from 'pubsub-js'
listTabs.value = val[0].moving listTabs.value = val[0].moving
} }
if(val[1]==2){ if(val[1]==2){
listTabs.value = val[0].offline listTabs.value = val[0].still
} }
if(val[1]==3){ if(val[1]==3){
listTabs.value = val[0].still listTabs.value = val[0].offline
} }
}, },
{ immediate: true } { immediate: true }