vchannelSelect

This commit is contained in:
shijing 2022-10-19 11:59:09 +08:00
parent 3696aa6725
commit 5617114e1b
2 changed files with 70 additions and 10 deletions

View File

@ -5,21 +5,23 @@
<el-button type="primary" icon="el-icon-refresh" @click="syncData" :loading="syncLoading">同步</el-button>
</div>
<div class="right-panel">
<!-- <el-input
v-model="query.channelCode"
placeholder="编号"
clearable
@click="handleQuery"
></el-input>
<el-select v-model="areaId" placeholder="选择区域">
<el-option
v-for="item in areaoptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button> -->
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="apiParams" :pageStr="pageStr"
<scTable ref="table" :apiObj="apiObj" row-key="id" :params="apiParams" :pageStr="pageStr" :data="pageData"
:pageSizeStr="pageSizeStr" :orderStr="orderStr" :parseData="parseData" @selection-change="selectionChange"
stripe @resetQuery="resetQuery">
<el-table-column label="序号" type="index" width="50"></el-table-column>
@ -132,9 +134,12 @@ export default {
},
code: "video_realtime",
},
areaId:'',
channelCode: '',
channelId: '',
channelArea: '',
pageData:[],
areaoptions: [],
channelAreas: [],
channelLocation: {},
flvPlayer: null,
@ -150,8 +155,21 @@ export default {
scriptInfo.setAttribute("data-callType", "callScript");
scriptInfo.src = "https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js";
document.head.appendChild(scriptInfo);
this.getAllVchannel();
},
mounted(){
this.getArea();
},
methods: {
getAllVchannel(){
debugger;
this.$API.am.video.list.req({pageSize:999}).then(res=>{
debugger;
console.log(res)
let allVchannel = JSON.stringify(res.pageData);
localStorage.setItem('allVchannel',allVchannel)
})
},
handleView(row) {
let that = this;
that.channelCode = row.channelCode;
@ -174,9 +192,15 @@ export default {
},
viewClose() {
this.limitedVisible = false;
},
//
getArea() {
this.$API.am.area.list.req({ page: 0 }).then((res) => {
this.areaoptions = res;
});
},
handlePosition(row) {
debugger;
// debugger;
console.log(row)
if(row.my_info.id&&row.my_info.id!==null){
this.channelId = row.my_info.id ? row.my_info.id : null;
@ -196,7 +220,24 @@ export default {
},
//
handleQuery() { this.$refs.table.refresh(); },
handleQuery() {
debugger;
let that = this;
let vchannel = localStorage.getItem('allVchannel');
console.log(vchannel)
let allVchannel = JSON.parse(vchannel);
debugger;
console.log(allVchannel)
console.log(that.areaId)
that.pageData = allVchannel.filter(item=>{
if(item.my_info.area == that.areaId){
debugger;
}
return item.my_info.area == that.areaId;
})
// console.log(localStorage.getItem('allVchannel'))
},
resetQuery() {
this.query = {};

View File

@ -2197,6 +2197,25 @@ export default {
this.music.play();//
},
},
beforeRouteLeave(to, from, next){
next();
if (this.timerUser) {
clearInterval(this.timerUser);
this.timerUser = null;
}
if (this.timerTime) {
clearInterval(this.timerTime);
this.timerTime = null;
}
if (this.eventTimer) {
clearInterval(this.eventTimer);
this.eventTimer = null;
}
if (this.eventAudioTimer) {
clearInterval(this.eventAudioTimer);
this.eventAudioTimer = null;
}
},
unmounted() {
// window.map.destroy();
window.map = null;