|
|
|
@ -32,6 +32,10 @@
|
|
|
|
:key="pane.key"
|
|
|
|
:key="pane.key"
|
|
|
|
:tab="pane.title"
|
|
|
|
:tab="pane.title"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<a-row
|
|
|
|
<a-row
|
|
|
|
v-for='rowIndex in row'
|
|
|
|
v-for='rowIndex in row'
|
|
|
|
:key='rowIndex'
|
|
|
|
:key='rowIndex'
|
|
|
|
@ -51,9 +55,6 @@
|
|
|
|
></video>
|
|
|
|
></video>
|
|
|
|
</a-col>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-row>
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
@ -88,7 +89,7 @@ export default {
|
|
|
|
//watch: {},
|
|
|
|
//watch: {},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
videoHeight() {
|
|
|
|
videoHeight() {
|
|
|
|
return this.clientHeight / this.row + "px";
|
|
|
|
return (this.clientHeight / this.row )+ "px";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
destroyed() {
|
|
|
|
destroyed() {
|
|
|
|
@ -96,10 +97,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.getWallStyle();
|
|
|
|
this.getWallStyle();
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
console.log("DOM已更新完成");
|
|
|
|
|
|
|
|
|
|
|
|
this.playPageCameras();
|
|
|
|
this.playPageCameras();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
let isFullscreen =
|
|
|
|
let isFullscreen =
|
|
|
|
document.fullscreenElement ||
|
|
|
|
document.fullscreenElement ||
|
|
|
|
document.mozFullScreenElement ||
|
|
|
|
document.mozFullScreenElement ||
|
|
|
|
@ -123,6 +126,7 @@ export default {
|
|
|
|
that.isFullscreen = !that.isFullscreen;
|
|
|
|
that.isFullscreen = !that.isFullscreen;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
updated() {},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
getWallStyle() {
|
|
|
|
getWallStyle() {
|
|
|
|
this.$api.httpApi
|
|
|
|
this.$api.httpApi
|
|
|
|
@ -150,52 +154,15 @@ export default {
|
|
|
|
console.log("clientHeight:" + this.clientHeight);
|
|
|
|
console.log("clientHeight:" + this.clientHeight);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onEdit(targetKey, action) {
|
|
|
|
onEdit(targetKey, action) {
|
|
|
|
const index = this.panes.findIndex((pane) => pane.key === targetKey);
|
|
|
|
const index = this.panes.findIndex(
|
|
|
|
|
|
|
|
(pane) => pane.key === targetKey
|
|
|
|
|
|
|
|
);
|
|
|
|
if (index !== -1) {
|
|
|
|
if (index !== -1) {
|
|
|
|
this.panes.splice(index, 1);
|
|
|
|
this.panes.splice(index, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getAllCameras() {
|
|
|
|
|
|
|
|
this.$api.httpApi
|
|
|
|
|
|
|
|
.getAllCameras1({
|
|
|
|
|
|
|
|
data: {},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
|
|
let cameras = res.data;
|
|
|
|
|
|
|
|
for (let i = 1; i <= cameras.length; i++) {
|
|
|
|
|
|
|
|
let rowIndex =
|
|
|
|
|
|
|
|
Math.floor((i - 1) / this.column) + 1;
|
|
|
|
|
|
|
|
if (rowIndex > this.row) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let columnIndex = i % this.column;
|
|
|
|
|
|
|
|
if (columnIndex == 0) {
|
|
|
|
|
|
|
|
columnIndex = this.column;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let idName = rowIndex + "-" + columnIndex;
|
|
|
|
|
|
|
|
console.log("idName:" + idName);
|
|
|
|
|
|
|
|
let server =
|
|
|
|
|
|
|
|
cameras[i - 1].rtcServer +
|
|
|
|
|
|
|
|
":" +
|
|
|
|
|
|
|
|
cameras[i - 1].rtcServerPort;
|
|
|
|
|
|
|
|
let video = document.getElementById(idName);
|
|
|
|
|
|
|
|
let player = new WebRtcPlayer(
|
|
|
|
|
|
|
|
server,
|
|
|
|
|
|
|
|
video,
|
|
|
|
|
|
|
|
"camera" + cameras[i - 1].id
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
this.players.push(player);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
console.log(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//一页个数
|
|
|
|
//一页个数
|
|
|
|
countVideo(i) {
|
|
|
|
countVideo(i) {
|
|
|
|
|
|
|
|
|
|
|
|
this.row = i;
|
|
|
|
this.row = i;
|
|
|
|
this.column = i;
|
|
|
|
this.column = i;
|
|
|
|
|
|
|
|
|
|
|
|
@ -207,23 +174,26 @@ export default {
|
|
|
|
var page = Math.ceil(cameras.length / (this.row * this.column));
|
|
|
|
var page = Math.ceil(cameras.length / (this.row * this.column));
|
|
|
|
this.panes = [];
|
|
|
|
this.panes = [];
|
|
|
|
for (var i = 1; i <= page; i++) {
|
|
|
|
for (var i = 1; i <= page; i++) {
|
|
|
|
this.panes.push({ title: "视频墙 "+i, content: "Content of Tab "+i, key: i-1 });
|
|
|
|
this.panes.push({
|
|
|
|
|
|
|
|
title: "视频墙 " + i,
|
|
|
|
|
|
|
|
content: "Content of Tab " + i,
|
|
|
|
|
|
|
|
key: i - 1,
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
changeTab(key) {
|
|
|
|
changeTab(key) {
|
|
|
|
console.log(key);
|
|
|
|
console.log(key);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onTabClick(key) {
|
|
|
|
onTabClick(key) {
|
|
|
|
this.destory()
|
|
|
|
this.destory();
|
|
|
|
|
|
|
|
|
|
|
|
console.log(key);
|
|
|
|
console.log(key);
|
|
|
|
this.activeKey = key;
|
|
|
|
this.activeKey = key;
|
|
|
|
this.playPageCameras();
|
|
|
|
this.playPageCameras();
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
playPageCameras() {
|
|
|
|
playPageCameras() {
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$api.httpApi
|
|
|
|
this.$api.httpApi
|
|
|
|
.getAllCameras({
|
|
|
|
.getAllCameras({
|
|
|
|
data: {},
|
|
|
|
data: {},
|
|
|
|
@ -231,9 +201,12 @@ export default {
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
if (res.code == 200) {
|
|
|
|
if (res.code == 200) {
|
|
|
|
let cameras = res.data;
|
|
|
|
let cameras = res.data;
|
|
|
|
this.pageInfo(cameras)
|
|
|
|
this.pageInfo(cameras);
|
|
|
|
var pageSize = (this.row*this.column);
|
|
|
|
var pageSize = this.row * this.column;
|
|
|
|
var camerasPage = cameras.slice(this.activeKey*pageSize,(this.activeKey+1)*pageSize);
|
|
|
|
var camerasPage = cameras.slice(
|
|
|
|
|
|
|
|
this.activeKey * pageSize,
|
|
|
|
|
|
|
|
(this.activeKey + 1) * pageSize
|
|
|
|
|
|
|
|
);
|
|
|
|
console.log(camerasPage);
|
|
|
|
console.log(camerasPage);
|
|
|
|
this.players = [];
|
|
|
|
this.players = [];
|
|
|
|
for (let i = 1; i <= camerasPage.length; i++) {
|
|
|
|
for (let i = 1; i <= camerasPage.length; i++) {
|
|
|
|
@ -253,6 +226,7 @@ export default {
|
|
|
|
":" +
|
|
|
|
":" +
|
|
|
|
camerasPage[i - 1].rtcServerPort;
|
|
|
|
camerasPage[i - 1].rtcServerPort;
|
|
|
|
let video = document.getElementById(idName);
|
|
|
|
let video = document.getElementById(idName);
|
|
|
|
|
|
|
|
console.log(video);
|
|
|
|
let player = new WebRtcPlayer(
|
|
|
|
let player = new WebRtcPlayer(
|
|
|
|
server,
|
|
|
|
server,
|
|
|
|
video,
|
|
|
|
video,
|
|
|
|
@ -265,6 +239,7 @@ export default {
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
console.log(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
destory() {
|
|
|
|
destory() {
|
|
|
|
for (let player of this.players) {
|
|
|
|
for (let player of this.players) {
|
|
|
|
|