merge-requests/1/head
qiushui 4 years ago
parent a0c82c4bda
commit e28ef3e027

@ -22,7 +22,8 @@
</a-layout-content> </a-layout-content>
</a-layout> </a-layout>
<a-layout-footer> <a-layout-footer>
<a-tabs default-active-key="1" tab-position="bottom" @change="value => select.row = value" v-if="total.row > nums.row"> <!-- <a-tabs default-active-key="1" tab-position="bottom" @change="value => select.row = value" v-if="total.row > nums.row"> -->
<a-tabs default-active-key="1" tab-position="bottom" @onchange="changeTab" @change="value => select.row = value" v-if="total.row > nums.row">
<a-tab-pane <a-tab-pane
v-for="index in latticeRow" v-for="index in latticeRow"
:key="index" :key="index"
@ -86,7 +87,9 @@ export default {
return parseInt(this.total.column / this.nums.column) + (this.total.column % this.nums.column > 0 ? 1 : 0); return parseInt(this.total.column / this.nums.column) + (this.total.column % this.nums.column > 0 ? 1 : 0);
}, },
random() { random() {
return { return {
row: this.getRandomRow(this.select.row), row: this.getRandomRow(this.select.row),
column: this.getRandomColumn(this.select.column), column: this.getRandomColumn(this.select.column),
} }
@ -117,6 +120,9 @@ export default {
destroyed() { destroyed() {
}, },
methods: { methods: {
changeTab(){
console.log("latticeRow"+this.latticeRow)
},
// //
getRandom(index, lattice, num, total) { getRandom(index, lattice, num, total) {
if(index !== lattice) { if(index !== lattice) {
@ -166,36 +172,41 @@ export default {
// } // }
}, },
async getStatus() { async getStatus() {
console.log( "column"+this.latticeColumn)
console.log( "row"+this.latticeRow)
// for(let i = 1 ; i++; i < this.latticeRow) { // for(let i = 1 ; i++; i < this.latticeRow) {
// let rowColumn = this.getRandomRow(i); // let r = this.getRandomRow(i);
// this.status.row[i] = this.fragmentStatus('row', i); // console.log(r)
// //this.status.row[i] = this.fragmentStatus('row', i);
// } // }
//
// for(let i = 1 ; i++; i < this.latticeColumn) { // for(let i = 1 ; i++; i < this.latticeColumn) {
// let rowColumn = this.getRandomColumn(i); // let rowColumn = this.getRandomColumn(i);
// this.status.column[i] = this.fragmentStatus('column', i); // this.status.column[i] = this.fragmentStatus('column', i);
// } // }
for(let row = 1; row <= this.total.row; row++) { // for(let row = 1; row <= this.total.row; row++) {
for(let column = 1; column <= this.total.column; column++) {
let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0; // for(let column = 1; column <= this.total.column; column++) {
if(status < 2) {
// // let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0;
let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0); // if(status < 2) {
let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0); // //
if(status === 1) { // let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0);
console.log('第几段', latticeRow, latticeColumn); // let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0);
console.log(row, column,status); // if(status === 1) {
this.$set(this.status.row, latticeRow, status); // console.log('', latticeRow, latticeColumn);
this.$set(this.status.column, latticeColumn, status); // console.log(row, column,status);
}else { // this.$set(this.status.row, latticeRow, status);
if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status); // this.$set(this.status.column, latticeColumn, status);
if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status); // }else {
} // if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status);
} // if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status);
} // }
} // }
console.log(this.status); // }
// }
// console.log(this.status);
}, },
} }
} }

@ -193,7 +193,7 @@ export default {
}).then(res => { }).then(res => {
this.data = res.data.list; this.data = res.data.list;
this.select = res.data.list[0].id this.select = res.data.list[0].id
this.getStockList(res.data.list[0].id) //this.getStockList(res.data.list[0].id)
this.getStreetDetail(res.data.list[0].id); this.getStreetDetail(res.data.list[0].id);
this.getStockRowColumn(); this.getStockRowColumn();
}).catch(err => { }).catch(err => {
@ -225,10 +225,10 @@ export default {
leftShelveId, leftShelveId,
rightShelveId rightShelveId
}; };
this.$api.httpNodeApi.getStockRowColumnAPI({params}).then(({data})=>{ // this.$api.httpNodeApi.getStockRowColumnAPI({params}).then(({data})=>{
this.$set(this, 'stockInfo', data); // this.$set(this, 'stockInfo', data);
// this.stockInfo = data; // // this.stockInfo = data;
}); // });
} }
this.timer && clearInterval(this.timer); this.timer && clearInterval(this.timer);
init(); init();
@ -254,23 +254,23 @@ export default {
}) })
}, },
// //
getStockList(streetId) { // getStockList(streetId) {
this.$api.httpApi.getStockList({ // this.$api.httpApi.getStockList({
params: { // params: {
streetId: streetId, // streetId: streetId,
} // }
}).then(res => { // }).then(res => {
this.checkList = res.data // this.checkList = res.data
}).catch(err => { // }).catch(err => {
}); // });
}, // },
handleChange(value) { handleChange(value) {
console.error('handleChange'); console.error('handleChange');
console.log(value) console.log(value)
this.select = value this.select = value
this.getStreetDetail(value) this.getStreetDetail(value)
this.getStockList(value); //this.getStockList(value);
this.getStockRowColumn() this.getStockRowColumn()
}, },
tocheckOperation(checkObj, item) { tocheckOperation(checkObj, item) {

@ -1,157 +0,0 @@
<template>
<video-player
v-if="showVideo"
ref="video-player"
class="vjs-custom-skin"
:options="playerOptions"
@pause="onPlayerPause"
@playing="onPlayerPlaying"
@timeupdate="onPlayerTimeupdate"
@ended="onPlayerEnded"
@error="onError"
@emptied="onEmptied"
@statechanged="playerStateChanged"
@loadeddata="onPlayerLoadeddata"
/>
</template>
<script>
import 'vue-video-player/src/custom-theme.css'
export default {
name: 'VideoPlayer',
props: {
src: {
type: String,
// default: 'http://cctvalih5ca.v.myalicdn.com/live/cctv6_1/index.m3u8',
required: true
}
},
components: {
videoPlayer
},
data() {
return {
timer: null, //
currentTime: 0, //
showVideo: true,
isPlay: false, //
playerOptions: {
sources: [{
type: 'application/x-mpegURL',
withCredentials: false,
src: this.src
}],
height: '100%',
language: 'zh-CN',
preload: 'auto', // <video>auto,
techOrder: ['html5'],
flash: { hls: { withCredentials: false }},
html5: { hls: { withCredentials: false }},
autoplay: true, //
muted: true, //
controls: true,
notSupportedMessage: '不支持的视频格式',
controlBar: {
timeDivider: false, //
durationDisplay: false, //
remainingTimeDisplay: false, //
fullscreenToggle: true //
}
}
}
},
mounted() {
this.$nextTick(()=> {
const videoRef = this.$refs['video-player'];
// videoRef.player.play();
console.log(videoRef);
})
},
methods: {
//
onPlayerPause() {
this.isPlay && this.$emit('showModel');
// this.isPlay = false;
console.log('onPlayerPause');
},
//
onPlayerPlaying(...args) {
this.isPlay = true;
console.log('onPlayerPlaying');
},
//
onPlayerEnded($event) {
this.isPlay = false;
console.log('onPlayerEnded');
},
onTimer() {
this.timer && clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.onloadVideo();
}, 8 * 1000)
},
onloadVideo() {
console.log('重新加载了');
const videoRef = this.$refs['video-player'];
console.log(videoRef);
this.showVideo = false;
this.$nextTick(() => {
this.showVideo = true;
})
},
onError(data) {
console.log('onError');
console.log(data);
},
onEmptied(data) {
console.log('onEmptied');
console.log(data);
},
onPlayerLoadeddata($event) {
console.log('onPlayerLoadeddata')
},
playerStateChanged(playerCurrentState) {
//
if(playerCurrentState.waiting) {
// this.onTimer();
}else {
this.timer && clearTimeout(this.timer);
}
// console.log('player current update state', playerCurrentState)
},
//
onPlayerTimeupdate($event) {
//
const bufferedEnd = $event.bufferedEnd();
//
const currentTime = $event.currentTime();
this.currentTime = currentTime;
// this.onTimer();
//
const differTime = bufferedEnd - currentTime;
}
}
}
</script>
<style lang="scss" scoped>
.vjs-custom-skin /deep/{
width: 100%;
height: 100%;
cursor: pointer;
.video-player, .video-js {
height: 100% !important;
}
//
.vjs-control-bar {
display: none !important;
}
//
.vjs-loading-spinner {
// display: none;
}
}
</style>

@ -1,157 +0,0 @@
<template>
<video-player
v-if="showVideo"
ref="video-player"
class="vjs-custom-skin"
:options="playerOptions"
@pause="onPlayerPause"
@playing="onPlayerPlaying"
@timeupdate="onPlayerTimeupdate"
@ended="onPlayerEnded"
@error="onError"
@emptied="onEmptied"
@statechanged="playerStateChanged"
@loadeddata="onPlayerLoadeddata"
/>
</template>
<script>
import 'vue-video-player/src/custom-theme.css'
import { videoPlayer } from 'vue-video-player'
export default {
name: 'VideoPlayer',
props: {
src: {
type: String,
// default: 'http://cctvalih5ca.v.myalicdn.com/live/cctv6_1/index.m3u8',
required: true
}
},
components: {
videoPlayer
},
data() {
return {
timer: null, //
currentTime: 0, //
showVideo: true,
isPlay: false, //
playerOptions: {
sources: [{
type: 'application/x-mpegURL',
withCredentials: false,
src: this.src
}],
height: '100%',
language: 'zh-CN',
preload: 'auto', // <video>auto,
techOrder: ['html5'],
flash: { hls: { withCredentials: false }},
html5: { hls: { withCredentials: false }},
autoplay: true, //
muted: true, //
controls: true,
notSupportedMessage: '不支持的视频格式',
controlBar: {
timeDivider: false, //
durationDisplay: false, //
remainingTimeDisplay: false, //
fullscreenToggle: true //
}
}
}
},
mounted() {
this.$nextTick(()=> {
const videoRef = this.$refs['video-player'];
// videoRef.player.play();
console.log(videoRef);
})
},
methods: {
//
onPlayerPause() {
this.isPlay && this.$emit('showModel');
// this.isPlay = false;
console.log('onPlayerPause');
},
//
onPlayerPlaying(...args) {
this.isPlay = true;
console.log('onPlayerPlaying');
},
//
onPlayerEnded($event) {
this.isPlay = false;
console.log('onPlayerEnded');
},
onTimer() {
this.timer && clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.onloadVideo();
}, 8 * 1000)
},
onloadVideo() {
console.log('重新加载了');
const videoRef = this.$refs['video-player'];
console.log(videoRef);
this.showVideo = false;
this.$nextTick(() => {
this.showVideo = true;
})
},
onError(data) {
console.log('onError');
console.log(data);
},
onEmptied(data) {
console.log('onEmptied');
console.log(data);
},
onPlayerLoadeddata($event) {
console.log('onPlayerLoadeddata')
},
playerStateChanged(playerCurrentState) {
//
if(playerCurrentState.waiting) {
// this.onTimer();
}else {
this.timer && clearTimeout(this.timer);
}
// console.log('player current update state', playerCurrentState)
},
//
onPlayerTimeupdate($event) {
//
const bufferedEnd = $event.bufferedEnd();
//
const currentTime = $event.currentTime();
this.currentTime = currentTime;
// this.onTimer();
//
const differTime = bufferedEnd - currentTime;
}
}
}
</script>
<style lang="scss" scoped>
.vjs-custom-skin /deep/{
width: 100%;
height: 100%;
cursor: pointer;
.video-player, .video-js {
height: 100% !important;
}
//
.vjs-control-bar {
display: none !important;
}
//
.vjs-loading-spinner {
// display: none;
}
}
</style>

@ -11,6 +11,7 @@
:key="index" :key="index"
:style="{ :style="{
height: videoHeight, height: videoHeight,
marginBottom: ((selectTab.videoStyleRow * selectTab.videoStyleColumn - index - 1) >= selectTab.videoStyleColumn) ? '20px': 0 marginBottom: ((selectTab.videoStyleRow * selectTab.videoStyleColumn - index - 1) >= selectTab.videoStyleColumn) ? '20px': 0
}" }"
> >
@ -18,7 +19,7 @@
:style="{ :style="{
height: videoHeight, height: videoHeight,
}" }"
style="width: 100%;object-fit: cover;"
:id="`camera${item.id}`" :id="`camera${item.id}`"
autoplay muted ></video> autoplay muted ></video>
</a-col> </a-col>
@ -100,7 +101,10 @@ export default {
tabsChange(key) { tabsChange(key) {
sessionStorage.setItem('tabKey', key) sessionStorage.setItem('tabKey', key)
this.$nextTick(() => {
this.autoPlay() this.autoPlay()
})
}, },
showModel(item) { showModel(item) {
this.$nextTick(() => { this.$nextTick(() => {

@ -55,12 +55,10 @@ class WebRtcPlayer {
this.webrtc.onconnectionstatechange = () => { this.webrtc.onconnectionstatechange = () => {
if(this.webrtc.connectionState == 'connected' || this.webrtc.connectionState == 'connecting'){ if(this.webrtc.connectionState == 'connected' || this.webrtc.connectionState == 'connecting'){
}else{ }else{
console.log(this.webrtc.connectionState) console.log(this.webrtc.connectionState)
this.load(this.uuid); this.load(this.uuid);
} }
} }
} }

Loading…
Cancel
Save