视频对接

This commit is contained in:
wuhongjian 2022-06-14 17:32:23 +08:00
parent 0ba396e9d3
commit 05be0ae3fb
3 changed files with 233 additions and 223 deletions

View File

@ -373,7 +373,7 @@
import detailsPageconetentTree from '@/views/home/detailsPageconetentTree.vue' import detailsPageconetentTree from '@/views/home/detailsPageconetentTree.vue'
import searchResultList from '@/views/home/components/searchResultList.vue' import searchResultList from '@/views/home/components/searchResultList.vue'
import KnowledgeBase from '@/views/home/components/KnowledgeBase.vue' import KnowledgeBase from '@/views/home/components/KnowledgeBase.vue'
import VideoSurveillance from '@/views/home/videoSurveillance' // import VideoSurveillance from '@/views/home/videoSurveillance'
export default defineComponent({ export default defineComponent({
setup() { setup() {
// const store = useStore() // const store = useStore()
@ -1008,60 +1008,11 @@
pageNo: paramsGetResources.pageNum, pageNo: paramsGetResources.pageNum,
pageSize: paramsGetResources.pageSize pageSize: paramsGetResources.pageSize
} }
resourceTotal.value = 10 getVideoList(params).then((res) => {
resourceList.data = [ //
{ resourceTotal.value = res.data.data.total
"id": "689299957948436480",//id resourceList.data = res.data.data.list
"cameraIndexCode": "37021100001316660963",// })
"cameraSerial": null,//
"gbIndexCode": "37021100001316660963",//
"name": "216省道与星海滩路桥底南",//
"deviceIndexCode": "",//
"longitude": "120.05622780039626",//WGS84
"latitude": "35.9411893638582",//WGS84
"altitude": "",//WGS84
"pixel": "1",//1-2-1303-2004-300
"cameraType": "2",//(0-1-2-3-)
"cameraTypeName": "Fast Ball Camera",//
"installPlace": "",//
"matrixCode": "",//
"chanNum": null,//
"viewshed": "",//JSON使
"capabilitySet": "@vss@",//
"capabilitySetName": "@Video capability@",//
"intelligentSet": "",//
"intelligentSetName": "",//
"recordLocation": "0",//0-1-
"recordLocationName": "Central storage",//
"ptzController": null,//(1-DVR2-3-MU40004-NC600)
"ptzControllerName": "",//
"deviceResourceType": "",//
"deviceResourceTypeName": "",//
"channelType": "analog",//
"channelTypeName": "Analog channel",//
"transType": "1",//0-UDP1-TCP
"transTypeName": "TCP",//
"updateTime": "2022-05-18T02:04:24.166+08:00",//ISO8601yyyy-MM-dd'T'HH:mm:ss.SSSzzz
"unitIndexCode": "37021100001310001004",//
"treatyType": "",//
"treatyTypeName": "",//
"createTime": null,//ISO8601yyyy-MM-dd'T'HH:mm:ss.SSSzzz
"status": "1",// 线0-线1-线
"statusName": "Online",//
"locationLong": 120.05622780039626,//使
"locationLat": 35.9411893638582,//使
"delFlag": 0,//(01)
"createdBy": null,//code
"createdTime": "2022-05-25 12:38:47",//
"updatedBy": null,//code
"updatedTime": "2022-06-08 17:05:26"//
}
]
// getVideoList(params).then((res) => {
// //
// resourceTotal.value = res.data.data.total
// resourceList.data = res.data.data.list
// })
} else if (Cardsname.value === '数据资源') { } else if (Cardsname.value === '数据资源') {
resourceTotal.value = resourceData.value.data.total || '' resourceTotal.value = resourceData.value.data.total || ''
getShoppingCartList(resourceData.value.data.records) getShoppingCartList(resourceData.value.data.records)
@ -1311,7 +1262,7 @@
DownOutlined, DownOutlined,
KnowledgeBase, KnowledgeBase,
// VideoCameraOutlined, // VideoCameraOutlined,
VideoSurveillance, // VideoSurveillance,
}, },
beforeUnmount() { beforeUnmount() {
mybus.off('selectCardsitem') mybus.off('selectCardsitem')

View File

@ -153,7 +153,11 @@
免费试用 免费试用
</a-button> </a-button>
</div> </div>
<a-button type="primary" v-if="item.cameraIndexCode" @click="openVideo( item)"> <a-button
type="primary"
v-if="item.cameraIndexCode"
@click="openVideo(item)"
>
视频预览 视频预览
</a-button> </a-button>
<a-button type="primary" v-else @click="toView('details', item)"> <a-button type="primary" v-else @click="toView('details', item)">
@ -169,11 +173,24 @@
</div> </div>
</div> </div>
</div> </div>
<a-modal
v-model:visible="visible"
title="视频预览"
:width="750"
destroyOnClose
>
<template #footer></template>
<div style="width: 100%; display: flex; justify-content: center">
<div style="width: 100%; height: 100%">
<vue3VideoPlay v-bind="options" />
</div>
</div>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import { ref } from 'vue' import { ref, reactive } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getUser, sgcInsert } from '@/api/home' import { getUser, sgcInsert } from '@/api/home'
@ -285,6 +302,33 @@
setup(props) { setup(props) {
let shoppingKey = ref(1) let shoppingKey = ref(1)
let videoUrl = ref('') let videoUrl = ref('')
let visible = ref(false)
const options = reactive({
width: '700px', //
height: '400px', //
color: '#409eff', //
title: '', //
src: '', //
muted: false, //
webFullScreen: false,
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //
autoPlay: true, //
loop: false, //
mirror: false, //
ligthOff: false, //
volume: 0.3, //
control: true, //
controlBtns: [
'audioTrack',
'quality',
'speedRate',
'volume',
'setting',
'pip',
'pageFullScreen',
'fullScreen',
], //,
})
// id // id
const selList = ref([ const selList = ref([
{ name: '发布时间', value: 'tdr.create_date' }, { name: '发布时间', value: 'tdr.create_date' },
@ -414,13 +458,18 @@
} }
getHls(param).then((res) => { getHls(param).then((res) => {
console.log('获取视频地址===============>', res) console.log('获取视频地址===============>', res)
videoUrl.value = res.data.data // videoUrl.value = res.data.data
options.value.src = res.data.data
visible.value = true
}) })
} }
mybus.on('chongzhi', () => { mybus.on('chongzhi', () => {
selData.value = 'total' selData.value = 'total'
}) })
return { return {
visible,
videoUrl,
options,
onSearch, onSearch,
resultList, resultList,
toView, toView,

View File

@ -17,16 +17,26 @@
</div> </div>
<div class="item"> <div class="item">
<div class="zj">组件服务</div> <div class="zj">组件服务</div>
<div class="name" v-for="(item, index) in zjList" :key="item.id" :class="index == 4 ? 'name-last' : ''" <div
@click="selectOne(item.id)"> class="name"
v-for="(item, index) in zjList"
:key="item.id"
:class="index == 4 ? 'name-last' : ''"
@click="selectOne(item.id)"
>
{{ index + 1 }}-{{ item.name }} {{ index + 1 }}-{{ item.name }}
</div> </div>
<div class="btn" @click="jumpPage('组件服务')">查看更多</div> <div class="btn" @click="jumpPage('组件服务')">查看更多</div>
</div> </div>
<div class="item"> <div class="item">
<div class="yy">应用资源</div> <div class="yy">应用资源</div>
<div class="name" v-for="(item, index) in yyList" :key="item.id" :class="index == 4 ? 'name-last' : ''" <div
@click="selectOne(item.id)"> class="name"
v-for="(item, index) in yyList"
:key="item.id"
:class="index == 4 ? 'name-last' : ''"
@click="selectOne(item.id)"
>
{{ index + 1 }}-{{ item.name }} {{ index + 1 }}-{{ item.name }}
</div> </div>
<div class="btn" @click="jumpPage('应用资源')">查看更多</div> <div class="btn" @click="jumpPage('应用资源')">查看更多</div>
@ -68,183 +78,183 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { pageWithAttrs } from '@/api/home.js' import { pageWithAttrs } from '@/api/home.js'
import { ref } from 'vue' import { ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useStore } from 'vuex' import { useStore } from 'vuex'
const store = useStore() const store = useStore()
const router = useRouter() const router = useRouter()
const zjList = ref([]) const zjList = ref([])
const yyList = ref([]) const yyList = ref([])
// const jcList = ref([]) // const jcList = ref([])
const paramsGetResources = { const paramsGetResources = {
districtId: '', districtId: '',
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
type: '', type: '',
name: '', name: '',
infoList: [], infoList: [],
orderField: 'total', // total visits 访 applyCount score collectCount orderField: 'total', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC orderType: 'DESC', // ASC DESC
} }
const getAppResources = (type, obj) => { const getAppResources = (type, obj) => {
paramsGetResources.type = type paramsGetResources.type = type
pageWithAttrs(paramsGetResources).then((res) => { pageWithAttrs(paramsGetResources).then((res) => {
console.log('查询列表============>', res.data.data.records) console.log('查询列表============>', res.data.data.records)
obj.value = res.data.data.records obj.value = res.data.data.records
}) })
} }
getAppResources('组件服务', zjList) getAppResources('组件服务', zjList)
getAppResources('应用资源', yyList) getAppResources('应用资源', yyList)
// getAppResources('', jcList) // getAppResources('', jcList)
function jumpPage(type) { function jumpPage(type) {
// store // store
store.commit('home/selectCardsData', { store.commit('home/selectCardsData', {
selectCardsnum: type, selectCardsnum: type,
}) })
console.log( console.log(
'选中===================>', '选中===================>',
store.getters['home/selectCardsnum'] store.getters['home/selectCardsnum']
) )
// router.push({ path: '/DetailsPageconetent' }) // router.push({ path: '/DetailsPageconetent' })
router.push({ router.push({
path: '/DetailsPageconetent', path: '/DetailsPageconetent',
query: { query: {
select: type, select: type,
}, },
}) })
} }
const selectOne = (id) => { const selectOne = (id) => {
console.log('点击===============》', id) console.log('点击===============》', id)
router.push({ router.push({
path: '/details', path: '/details',
query: { query: {
id: id, id: id,
}, },
}) })
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.capability-convergence { .capability-convergence {
height: 7.2rem; height: 7.2rem;
background: url('~@/assets/newHome/Convergence-bg.png') no-repeat; background: url('~@/assets/newHome/Convergence-bg.png') no-repeat;
background-size: 100%; background-size: 100%;
display: flex;
justify-content: center;
.main {
width: 13rem;
margin-top: 1.8rem;
display: flex; display: flex;
flex-direction: column; justify-content: center;
flex-wrap: wrap;
.top { .main {
font-size: 0.3rem; width: 13rem;
color: #212121; margin-top: 1.8rem;
text-align: center;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center;
align-items: center;
.line { .top {
width: 0.34rem; font-size: 0.3rem;
height: 0.03rem; color: #212121;
background-color: #0058e1; text-align: center;
margin-top: 0.08rem; display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.line {
width: 0.34rem;
height: 0.03rem;
background-color: #0058e1;
margin-top: 0.08rem;
}
} }
}
.bottom { .bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 0.4rem; margin-top: 0.4rem;
.item { .item {
width: 2.44rem; width: 2.44rem;
height: 3.91rem; height: 3.91rem;
font-size: 0.16rem; font-size: 0.16rem;
background-color: #fff; background-color: #fff;
border-radius: 0.02rem;
box-shadow: 0 0.05rem 0.2rem #ccc;
div:nth-of-type(1) {
height: 1.02rem;
line-height: 1.02rem;
font-size: 0.2rem;
color: #fff;
padding-left: 0.15rem;
background-size: 100%;
}
.jc {
background: url('~@/assets/newHome/Convergence-jc.png') no-repeat;
}
.sj {
background: url('~@/assets/newHome/Convergence-sj.png') no-repeat;
}
.zj {
background: url('~@/assets/newHome/Convergence-zj.png') no-repeat;
}
.yy {
background: url('~@/assets/newHome/Convergence-yy.png') no-repeat;
}
.zs {
background: url('~@/assets/newHome/Convergence-zs.png') no-repeat;
}
.name {
height: 0.47rem;
line-height: 0.47rem;
margin: 0 0.16rem;
border-bottom: 0.01rem solid #e9e9e9;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.name:hover {
color: #0058e1;
cursor: pointer;
}
.name-last {
border-bottom: none;
}
.btn {
cursor: pointer;
width: 0.8rem;
height: 0.24rem;
border: 0.01rem solid #0058e1;
font-size: 0.14rem;
color: #0058e1;
border-radius: 0.02rem; border-radius: 0.02rem;
text-align: center; box-shadow: 0 0.05rem 0.2rem #ccc;
margin-top: 0.1rem;
margin-left: 0.85rem; div:nth-of-type(1) {
height: 1.02rem;
line-height: 1.02rem;
font-size: 0.2rem;
color: #fff;
padding-left: 0.15rem;
background-size: 100%;
}
.jc {
background: url('~@/assets/newHome/Convergence-jc.png') no-repeat;
}
.sj {
background: url('~@/assets/newHome/Convergence-sj.png') no-repeat;
}
.zj {
background: url('~@/assets/newHome/Convergence-zj.png') no-repeat;
}
.yy {
background: url('~@/assets/newHome/Convergence-yy.png') no-repeat;
}
.zs {
background: url('~@/assets/newHome/Convergence-zs.png') no-repeat;
}
.name {
height: 0.47rem;
line-height: 0.47rem;
margin: 0 0.16rem;
border-bottom: 0.01rem solid #e9e9e9;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.name:hover {
color: #0058e1;
cursor: pointer;
}
.name-last {
border-bottom: none;
}
.btn {
cursor: pointer;
width: 0.8rem;
height: 0.24rem;
border: 0.01rem solid #0058e1;
font-size: 0.14rem;
color: #0058e1;
border-radius: 0.02rem;
text-align: center;
margin-top: 0.1rem;
margin-left: 0.85rem;
}
.btn:hover {
background: rgba(0, 88, 225, 0.3);
color: #000;
}
} }
.btn:hover { .item:hover {
background: rgba(0, 88, 225, 0.3); border-radius: 0.02rem;
color: #000; border: 0.01rem solid #0058e1;
box-shadow: 0rem 0.08rem 0.2rem rgba(0, 88, 225, 0.3);
} }
} }
.item:hover {
border-radius: 0.02rem;
border: 0.01rem solid #0058e1;
box-shadow: 0rem 0.08rem 0.2rem rgba(0, 88, 225, 0.3);
}
} }
} }
}
</style> </style>