新增地图弹窗 bug修改

This commit is contained in:
duanliang
2025-03-21 18:12:04 +08:00
parent 2208efc12e
commit 08041130e8
13 changed files with 262 additions and 51 deletions

View File

@@ -14,11 +14,16 @@
{{ item.dictLabel }}
</span>
</div>
<div
:class="{ active: current == 3 }"
@click="handleNav(3)" class="li">
<span>自定义</span>
</div>
</div>
<div class="bom-box">
<Title2 title="检索" />
<div class="search-box">
<el-input placeholder="请输入内容" v-model="cameraName" clearable @input="onInput" />
<el-input placeholder="请输入内容" v-model="cameraName" @input="onInput" />
<img class="search-icon" src="/src/assets/images/search-icon-1.png" alt="" />
</div>
@@ -38,7 +43,7 @@
class="tree-item__child-item"
v-for="(resource, x) in item.videoResources"
:key="x"
@click="handleCamera(resource.cameraIndexCode)"
@click="handleCamera(resource.cameraIndexCode,resource)"
>
{{ resource.cameraName || resource.cameraIndexCode }}
</div>
@@ -60,13 +65,13 @@
<div
v-if="item.isCollect == 1"
class="video-item__follow"
@click.stop="handleCollect(item.id, item.isCollect, index)"
@click.stop="handleCollect(item.cameraIndexCode, item.isCollect, index)"
>取消关注
</div>
<div
v-if="item.isCollect == 0"
class="video-item__unfollow"
@click.stop="handleCollect(item.id, item.isCollect, index)"
@click.stop="handleCollect(item.cameraIndexCode, item.isCollect, index)"
>关注
</div>
<video
@@ -157,7 +162,7 @@
</div>
</div>
</div>
<VideoDialog v-model="show" :src="videoSrc" />
<VideoDialog v-model="show" :isCollect="isCollect" :src="videoSrc" />
</template>
<script setup>
@@ -188,6 +193,7 @@
label: 'label',
children: 'children'
}
let isCollect = ref(0)
let command = ref('')
let videoList = ref([])
let navList = ref([])
@@ -264,6 +270,10 @@
videoList.value = []
total.value = 0
current.value = e
if(e==3){
getVideoList(3)
return false
}
getVideoList()
}
const handleBack = () => {
@@ -311,17 +321,18 @@
const handleRegions = (e) => {
regionList.value[e].show = !regionList.value[e].show
}
const handleCamera = async (cameraIndexCode) => {
const handleCamera = async (cameraIndexCode,resource) => {
show.value = true
let res = await getPreviewUrlApi({
type: 'hls',
cameraIndexCode
})
isCollect.value = resource.isCollect
videoSrc.value = res.data.url
}
const handleCollect = async (id, status, index) => {
await postVideoCollectApi({
id,
cameraIndexCode:id,
isCollect: status == 0 ? 1 : 0
})
if (status == 0) {
@@ -331,15 +342,22 @@
}
pubSub.publish('videoCollect', id)
}
const getVideoList = async () => {
const getVideoList = async (val) => {
try {
if (loading.value) return
loading.value = true
params.businessVideoDisplayPosition = navList.value[current.value].dictValue
if(val==3){
params.businessVideoDisplayPosition = ''
}else{
params.businessVideoDisplayPosition = navList.value[current.value].dictValue
}
let res = await getVideoListApi(params)
console.log(res,'list 55555')
total.value = res.total
if (res.data.length > 0) {
postVideoRemain()
// postVideoRemain()
videoList.value = res.data
nextTick(() => {
videoList.value.forEach(async (x, index) => {
@@ -386,7 +404,9 @@
console.log(regionList.value, ' regionList.value')
}
const onMonitorChange = () => {
monitorChange = pubSub.subscribe('monitorChange', (res, data) => {
current.value = 0
params.businessScenicArea = data.scenicSpotId
params.pageNum = 1
videoList.value = []
@@ -558,7 +578,7 @@
&__child-item {
padding: vh(0) vw(20) vh(20) vw(20);
cursor: pointer;
color: #999;
color: rgb(192,216,254);
font-weight: 400;
font-size: vw(15);
white-space: nowrap;