2 changed files with 157 additions and 136 deletions
@ -1,152 +1,152 @@ |
|||
|
|||
<template> |
|||
<div style="overflow:hidden ;"> |
|||
<p style="font-weight: 600; color:#0047EC;">视频墙</p> |
|||
<div class="div_table" :style="{ height: maxTableHeight + 'px' }"> |
|||
<div class="card"> |
|||
<div class="bgC"> |
|||
<div class="item" v-for="(item,index) in tableData" :key="index" @click="handelClickImg(item)"> |
|||
<img width="100%" src="../../../../assets/img/login_bg.jpg" alt=""> |
|||
<div > |
|||
<p>{{item.deviceName}}</p> |
|||
<p style="color:#666666 ;font-size: 14px; display: flex; align-items: center;"><img src="../../../../assets/img/arrow-down.png" alt=""> {{item.deviceAddress}}</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="pagination"> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="parseInt(pageSize)" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total"> |
|||
</el-pagination></div> |
|||
<video-dialog :dataV="selfVideo" ref="videoDialog"></video-dialog> |
|||
</div> |
|||
<div style="overflow:hidden ;"> |
|||
<p style="font-weight: 600; color:#0047EC;">视频墙</p> |
|||
<div class="div_table" :style="{ height: maxTableHeight + 'px' }"> |
|||
<div class="card"> |
|||
<div class="bgC"> |
|||
<div class="item" v-for="(item,index) in tableData" :key="index" @click="handelClickImg(item)"> |
|||
<img width="100%" src="../../../../assets/img/login_bg.jpg" alt=""> |
|||
<div > |
|||
<p>{{item.deviceName}}</p> |
|||
<p style="color:#666666 ;font-size: 14px; display: flex; align-items: center;"><img src="../../../../assets/img/arrow-down.png" alt=""> {{item.deviceAddress}}</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="pagination"> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="pageNo" |
|||
:page-sizes="[20, 50, 100, 200]" |
|||
:page-size="parseInt(pageSize)" |
|||
layout="sizes, prev, pager, next, total" |
|||
:total="total"> |
|||
</el-pagination></div> |
|||
<video-dialog :dataV="selfVideo" ref="videoDialog"></video-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
|
|||
<script> |
|||
import { requestPost,requestGet } from "@/js/dai/request"; |
|||
import { mapGetters } from "vuex"; |
|||
import videoDialog from "./videoDialog.vue"; |
|||
export default { |
|||
components: {videoDialog}, |
|||
components: {videoDialog}, |
|||
|
|||
data() { |
|||
return { |
|||
pageNo: '', |
|||
pageSize: 20, |
|||
total: 0, |
|||
tableData: [], |
|||
selfVideo:{}, |
|||
token:"" |
|||
}; |
|||
}, |
|||
computed: { |
|||
maxTableHeight() { |
|||
return this.clientHeight - 230; |
|||
}, |
|||
...mapGetters(["clientHeight", "iframeHeight"]), |
|||
data() { |
|||
return { |
|||
pageNo: '', |
|||
pageSize: 20, |
|||
total: 0, |
|||
tableData: [], |
|||
selfVideo:{}, |
|||
token:"" |
|||
}; |
|||
}, |
|||
computed: { |
|||
maxTableHeight() { |
|||
return this.clientHeight - 230; |
|||
}, |
|||
...mapGetters(["clientHeight", "iframeHeight"]), |
|||
|
|||
}, |
|||
watch: { |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
mounted() { |
|||
this.getTableData() |
|||
}, |
|||
methods: { |
|||
async getTableData(){ |
|||
let url = "/gov/org/icmonitoringdevice/page" |
|||
let params = { |
|||
pageNo: this.pageNo, |
|||
pageSize: this.pageSize, |
|||
} |
|||
let {data,code,msg} = await requestPost(url, params) |
|||
if (code == 0) { |
|||
this.tableData = data.list |
|||
this.total = data.total |
|||
console.log(this.tableData,'获取列表成功'); |
|||
}else{ |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`); |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`); |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
}, |
|||
mounted() { |
|||
this.getTableData() |
|||
}, |
|||
methods: { |
|||
async getTableData(){ |
|||
let url = "/gov/org/icmonitoringdevice/page" |
|||
let params = { |
|||
pageNo: this.pageNo, |
|||
pageSize: this.pageSize, |
|||
} |
|||
let {data,code,msg} = await requestPost(url, params) |
|||
if (code == 0) { |
|||
this.tableData = data.list |
|||
this.total = data.total |
|||
console.log(this.tableData,'获取列表成功'); |
|||
}else{ |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`); |
|||
this.pageSize = val; |
|||
window.localStorage.setItem("pageSize", val); |
|||
this.getTableData(); |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`); |
|||
this.pageNo = val; |
|||
this.getTableData(); |
|||
|
|||
}, |
|||
async videoLogin(){ |
|||
console.log(this.dataV); |
|||
let url = "/auth/thirdlogin/video/login" |
|||
let {data,code,msg} = await requestPost(url) |
|||
if(code == 0 ){ |
|||
// this.playerOptions.sources[0].src = "http://172.20.41.195:9015/video-play-plug?token="+data.token+"&playType=realPlay"+"&cameraCode="+this.dataV.deviceCode |
|||
// this.sendMessageToIframe(data.token) |
|||
// console.log(this.playerOptions.sources[0].src,"视频"); |
|||
this.token = data.token |
|||
} |
|||
}, |
|||
async handelClickImg(item){ |
|||
// this.selfVideo = item |
|||
await this.videoLogin() |
|||
// this.$nextTick(()=>{ |
|||
// this.$refs['videoDialog'].dialogVisible = true |
|||
// this.$refs['videoDialog'].videoLogin() |
|||
// }) |
|||
let src = `http://172.20.41.195:9015/video-play-plug?token="+${this.token}+"&playType=realPlay"+"&cameraCode="+${item.deviceCode}` |
|||
console.log(src); |
|||
window.open(src) |
|||
} |
|||
} |
|||
}, |
|||
async videoLogin(){ |
|||
console.log(this.dataV); |
|||
let url = "/auth/thirdlogin/video/login" |
|||
let {data,code,msg} = await requestPost(url) |
|||
if(code == 0 ){ |
|||
// this.playerOptions.sources[0].src = "http://172.20.41.195:9015/video-play-plug?token="+data.token+"&playType=realPlay"+"&cameraCode="+this.dataV.deviceCode |
|||
// this.sendMessageToIframe(data.token) |
|||
// console.log(this.playerOptions.sources[0].src,"视频"); |
|||
this.token = data.token |
|||
} |
|||
}, |
|||
async handelClickImg(item){ |
|||
// this.selfVideo = item |
|||
await this.videoLogin() |
|||
// this.$nextTick(()=>{ |
|||
// this.$refs['videoDialog'].dialogVisible = true |
|||
// this.$refs['videoDialog'].videoLogin() |
|||
// }) |
|||
console.log(this.token); |
|||
let src = `http://172.20.41.195:9015/video-play-plug?token=${this.token}&playType=realPlay&cameraCode=${item.deviceCode}` |
|||
console.log(src); |
|||
window.open(src) |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/management/list-main.scss"; |
|||
|
|||
.div_table { |
|||
overflow-y: hidden; |
|||
padding: 0 !important; |
|||
overflow-y: hidden; |
|||
padding: 0 !important; |
|||
} |
|||
|
|||
.div_table .card { |
|||
background-color: #fff; |
|||
overflow: auto; |
|||
height: 100%; |
|||
width: 100%; |
|||
background-color: #fff; |
|||
overflow: auto; |
|||
height: 100%; |
|||
width: 100%; |
|||
|
|||
.bgC { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
padding: 40px; |
|||
box-sizing: border-box; |
|||
background-color: #fbfcfd; |
|||
.bgC { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
padding: 40px; |
|||
box-sizing: border-box; |
|||
background-color: #fbfcfd; |
|||
|
|||
.item { |
|||
flex: 0 0 calc(25% - 30px); |
|||
/* 这里计算宽度为25%减去30px */ |
|||
margin: 0 0 30px 30px; |
|||
background-color: #fff; |
|||
} |
|||
.item { |
|||
flex: 0 0 calc(25% - 30px); |
|||
/* 这里计算宽度为25%减去30px */ |
|||
margin: 0 0 30px 30px; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
// |
|||
.item:nth-child(4n+1) { |
|||
margin-left: 0; |
|||
/* 每行的第一个item左边距为0 */ |
|||
} |
|||
} |
|||
.pagination{ |
|||
} |
|||
// |
|||
.item:nth-child(4n+1) { |
|||
margin-left: 0; |
|||
/* 每行的第一个item左边距为0 */ |
|||
} |
|||
} |
|||
.pagination{ |
|||
} |
|||
}</style> |
|||
|
Loading…
Reference in new issue