视频订阅主题和数据看板主题区分开调用,解决图片主题会有延迟问题
This commit is contained in:
parent
23d8e88274
commit
0445b6a18f
|
@ -165,18 +165,12 @@ window.PubScribe = function (topic, number, _callback, other = false, fromName =
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
console.log("订阅成功1", topic);
|
console.log("订阅成功1", topic);
|
||||||
// setTimeout(function() {
|
|
||||||
console.log("订阅成功1");
|
|
||||||
console.log("订阅成功1-fromName注释:url里的id字符串来于分析index视频页面,videoId来于分析AnalysisMain,融合页面来之融合");
|
console.log("订阅成功1-fromName注释:url里的id字符串来于分析index视频页面,videoId来于分析AnalysisMain,融合页面来之融合");
|
||||||
console.log("订阅成功1-fromName", fromName);
|
console.log("订阅成功1-fromName", fromName);
|
||||||
console.log("订阅成功1-number", number);
|
console.log("订阅成功1-number", number);
|
||||||
client.publish('msg_stream', JSON.stringify({
|
client.publish('msg_stream', JSON.stringify({
|
||||||
"msg_flag": parseInt(number)
|
"msg_flag": parseInt(number)
|
||||||
}))
|
}))
|
||||||
// if(number!= -1 &&number!= '001' ){
|
|
||||||
// client.publish('Custom',JSON.stringify({"type":'getImage',"videoid":videoid}))
|
|
||||||
// }
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('消息订阅失败!')
|
console.log('消息订阅失败!')
|
||||||
}
|
}
|
||||||
|
@ -187,6 +181,7 @@ window.PubScribe = function (topic, number, _callback, other = false, fromName =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.publish = function (topic, message) {
|
window.publish = function (topic, message) {
|
||||||
if (mqtt.mqttClient.connected == true) {
|
if (mqtt.mqttClient.connected == true) {
|
||||||
// console.log("topic",topic)
|
// console.log("topic",topic)
|
||||||
|
|
|
@ -951,18 +951,11 @@ export default {
|
||||||
this.videoAnalysisShow = false;
|
this.videoAnalysisShow = false;
|
||||||
this.trafficAnalysisShow = false;
|
this.trafficAnalysisShow = false;
|
||||||
this.createMqtt();
|
this.createMqtt();
|
||||||
// document.getElementById('mapModule').contentWindow.lixianVideo(JSON.stringify(this.analysis));
|
|
||||||
} else if (this.$route.query.type == '离线视频') {
|
} else if (this.$route.query.type == '离线视频') {
|
||||||
this.videoAnalysisShow = true;
|
this.videoAnalysisShow = true;
|
||||||
this.trafficAnalysisShow = true;
|
this.trafficAnalysisShow = true;
|
||||||
this.getAnalysisStatus();
|
this.getAnalysisStatus();
|
||||||
this.createMqtt();
|
this.createMqtt();
|
||||||
// if(this.$route.query.status=='未分析'){
|
|
||||||
// }
|
|
||||||
// if(this.$route.query.status=='未分析'){
|
|
||||||
// // document.getElementById('mapModule').contentWindow.lixianVideo("实时视频");
|
|
||||||
// }else{
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -1068,19 +1061,21 @@ export default {
|
||||||
},
|
},
|
||||||
// 数据看板的标签点击
|
// 数据看板的标签点击
|
||||||
handleClick: function (tab, event) {
|
handleClick: function (tab, event) {
|
||||||
if (tab._props.name == 'second') {
|
// console.log(tab)
|
||||||
|
if (tab.name == 'first') {
|
||||||
|
if (this.$route.query.type == '实时视频') {
|
||||||
|
//实时视频页面需要订阅的主题
|
||||||
|
this.videoTopicSends();
|
||||||
|
}
|
||||||
|
} else if (tab.name == 'second') {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$route.query.type == '离线视频') {
|
if (this.$route.query.type == '离线视频') {
|
||||||
this.$refs.dataBoardRef.getNew(this.getHistory);
|
this.$refs.dataBoardRef.getNew(this.getHistory);
|
||||||
} else {
|
} else {
|
||||||
|
//数据看板需要订阅的主题
|
||||||
|
this.dataBoardTopicSends();
|
||||||
this.$refs.dataBoardRef.getNew();
|
this.$refs.dataBoardRef.getNew();
|
||||||
}
|
}
|
||||||
// this.$refs.dataBoardRef.getNew(this.getHistory);
|
|
||||||
// setTimeout(() => {
|
|
||||||
// debugger
|
|
||||||
// this.getHistory()
|
|
||||||
// }, 10000);
|
|
||||||
// this.getHistory();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1116,38 +1111,65 @@ export default {
|
||||||
// this.getHistory();
|
// this.getHistory();
|
||||||
// }, 5000);
|
// }, 5000);
|
||||||
} else if (this.$route.query.type == '实时视频') {
|
} else if (this.$route.query.type == '实时视频') {
|
||||||
this.topicSends = [
|
// this.topicSends = [
|
||||||
'stream' + this.number,
|
// 'stream' + this.number,
|
||||||
'trajectory' + this.number,
|
// 'trajectory' + this.number,
|
||||||
'detection' + this.number,
|
// 'detection' + this.number,
|
||||||
'trigger-' + this.$route.query.id,
|
// 'trigger-' + this.$route.query.id,
|
||||||
'cycle_time-' + this.$route.query.id,
|
// 'cycle_time-' + this.$route.query.id,
|
||||||
'cycle_statistics-' + this.$route.query.id,
|
// 'cycle_statistics-' + this.$route.query.id,
|
||||||
'cycle_accumulate-' + this.$route.query.id,
|
// 'cycle_accumulate-' + this.$route.query.id,
|
||||||
'TargetAnalysisStatusData',
|
// 'TargetAnalysisStatusData',
|
||||||
'TrafficAnalysisStatusData',
|
// 'TrafficAnalysisStatusData',
|
||||||
'img' + this.number
|
// 'img' + this.number
|
||||||
// 'hert',
|
// // 'hert',
|
||||||
// 'img0',
|
// // 'img0',
|
||||||
// 'img1',
|
// // 'img1',
|
||||||
// 'img2',
|
// // 'img2',
|
||||||
// 'img3',
|
// // 'img3',
|
||||||
// 'img4',
|
// // 'img4',
|
||||||
// 'img5',
|
// // 'img5',
|
||||||
// 'img6',
|
// // 'img6',
|
||||||
// 'img7',
|
// // 'img7',
|
||||||
// 'Contorl_server'
|
// // 'Contorl_server'
|
||||||
//目标数量
|
// //目标数量
|
||||||
// 'simulator_target-' + this.$route.query.id
|
// // 'simulator_target-' + this.$route.query.id
|
||||||
];
|
// ];
|
||||||
// console.log('在test1/index视频页面number-',this.number)
|
// // console.log('在test1/index视频页面number-',this.number)
|
||||||
window.PubScribe(this.topicSends, this.number, this.realInfo, false, this.$route.query.id);
|
// window.PubScribe(this.topicSends, this.number, this.realInfo, false, this.$route.query.id);
|
||||||
|
//视频页面需要订阅的主题有 img,stream,trajectory,detection,TargetAnalysisStatusDataTraffic,AnalysisStatusData
|
||||||
|
//数据看板需要订阅的主题有 trigger,cycle_time,,cycle_statistics,cycle_accumulate
|
||||||
|
this.videoTopicSends();
|
||||||
}
|
}
|
||||||
this.timer2 = null;
|
this.timer2 = null;
|
||||||
this.timer2 = setTimeout(() => {
|
this.timer2 = setTimeout(() => {
|
||||||
window.publish('Custom', JSON.stringify({ type: 'getImage', videoid: this.$route.query.id }));
|
window.publish('Custom', JSON.stringify({ type: 'getImage', videoid: this.$route.query.id }));
|
||||||
}, 5000);
|
}, 5000);
|
||||||
},
|
},
|
||||||
|
//实时视频页面需要订阅的主题
|
||||||
|
videoTopicSends() {
|
||||||
|
this.topicSends = [
|
||||||
|
'stream' + this.number,
|
||||||
|
'trajectory' + this.number,
|
||||||
|
'detection' + this.number,
|
||||||
|
'TargetAnalysisStatusData',
|
||||||
|
'TrafficAnalysisStatusData',
|
||||||
|
'img' + this.number
|
||||||
|
];
|
||||||
|
// console.log('在test1/index视频页面number-',this.number)
|
||||||
|
window.PubScribe(this.topicSends, this.number, this.realInfo, false, this.$route.query.id);
|
||||||
|
},
|
||||||
|
//数据看板需要订阅的主题
|
||||||
|
dataBoardTopicSends() {
|
||||||
|
this.topicSends = [
|
||||||
|
'trigger-' + this.$route.query.id,
|
||||||
|
'cycle_time-' + this.$route.query.id,
|
||||||
|
'cycle_statistics-' + this.$route.query.id,
|
||||||
|
'cycle_accumulate-' + this.$route.query.id
|
||||||
|
];
|
||||||
|
// console.log('在test1/index视频页面number-',this.number)
|
||||||
|
window.PubScribe(this.topicSends, this.number, this.realInfo, false, this.$route.query.id);
|
||||||
|
},
|
||||||
//获取视频分析,交通分析状态数据
|
//获取视频分析,交通分析状态数据
|
||||||
getAnalysisStatus() {
|
getAnalysisStatus() {
|
||||||
getVideoStatus(this.$route.query.id).then((res) => {
|
getVideoStatus(this.$route.query.id).then((res) => {
|
||||||
|
|
Loading…
Reference in New Issue