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

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

@ -193,7 +193,7 @@ export default {
}).then(res => {
this.data = res.data.list;
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.getStockRowColumn();
}).catch(err => {
@ -225,10 +225,10 @@ export default {
leftShelveId,
rightShelveId
};
this.$api.httpNodeApi.getStockRowColumnAPI({params}).then(({data})=>{
this.$set(this, 'stockInfo', data);
// this.stockInfo = data;
});
// this.$api.httpNodeApi.getStockRowColumnAPI({params}).then(({data})=>{
// this.$set(this, 'stockInfo', data);
// // this.stockInfo = data;
// });
}
this.timer && clearInterval(this.timer);
init();
@ -254,23 +254,23 @@ export default {
})
},
//
getStockList(streetId) {
this.$api.httpApi.getStockList({
params: {
streetId: streetId,
}
}).then(res => {
this.checkList = res.data
}).catch(err => {
// getStockList(streetId) {
// this.$api.httpApi.getStockList({
// params: {
// streetId: streetId,
// }
// }).then(res => {
// this.checkList = res.data
// }).catch(err => {
});
},
// });
// },
handleChange(value) {
console.error('handleChange');
console.log(value)
this.select = value
this.getStreetDetail(value)
this.getStockList(value);
//this.getStockList(value);
this.getStockRowColumn()
},
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"
:style="{
height: videoHeight,
marginBottom: ((selectTab.videoStyleRow * selectTab.videoStyleColumn - index - 1) >= selectTab.videoStyleColumn) ? '20px': 0
}"
>
@ -18,7 +19,7 @@
:style="{
height: videoHeight,
}"
style="width: 100%;object-fit: cover;"
:id="`camera${item.id}`"
autoplay muted ></video>
</a-col>
@ -100,7 +101,10 @@ export default {
tabsChange(key) {
sessionStorage.setItem('tabKey', key)
this.$nextTick(() => {
this.autoPlay()
})
},
showModel(item) {
this.$nextTick(() => {

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

Loading…
Cancel
Save