|
@@ -85,9 +85,9 @@ interface ActionType {
|
|
// 路况信息刷新间隔
|
|
// 路况信息刷新间隔
|
|
const REFRESH_TRAFFIC_TIME = 60000;
|
|
const REFRESH_TRAFFIC_TIME = 60000;
|
|
|
|
|
|
-let theSocket = null;
|
|
|
|
|
|
+// let theSocket = null;
|
|
|
|
|
|
-let vPlayArea =null;
|
|
|
|
|
|
+// let vPlayArea =null;
|
|
|
|
|
|
const getIncidentImage = (status: MarkerType['status']) =>
|
|
const getIncidentImage = (status: MarkerType['status']) =>
|
|
status?.toString() === '1'
|
|
status?.toString() === '1'
|
|
@@ -204,6 +204,7 @@ export default defineComponent({
|
|
console.log(marker["deviceCode"])
|
|
console.log(marker["deviceCode"])
|
|
console.log(marker["userId"])
|
|
console.log(marker["userId"])
|
|
const self = this;
|
|
const self = this;
|
|
|
|
+
|
|
daHuaStore.DAHUAUserObj(marker["userId"]).then(deviceUser=>{
|
|
daHuaStore.DAHUAUserObj(marker["userId"]).then(deviceUser=>{
|
|
console.log(deviceUser);
|
|
console.log(deviceUser);
|
|
let memberObj = {
|
|
let memberObj = {
|
|
@@ -224,8 +225,11 @@ export default defineComponent({
|
|
console.log(meetObj);
|
|
console.log(meetObj);
|
|
daHuaStore.DAHUAMeetingMember(meetObj).then(data=>{
|
|
daHuaStore.DAHUAMeetingMember(meetObj).then(data=>{
|
|
// console.log(11111111)
|
|
// console.log(11111111)
|
|
- // daHuaStore.DAHUAMeetingUser(meetObj.meetId);
|
|
|
|
- initSocket(meetObj.user.userCode);
|
|
|
|
|
|
+ daHuaStore.DAHUAMeetingUser(meetObj.meetId);
|
|
|
|
+ daHuaStore.DAHUAUserInfo().then(u => {
|
|
|
|
+ console.log(u,'+++++++');
|
|
|
|
+ initSocket(u.userCode,memberObj);
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
|
|
// console.log(memberObj);
|
|
// console.log(memberObj);
|
|
@@ -289,11 +293,41 @@ export default defineComponent({
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
- const initSocket =(userCode) => {
|
|
|
|
|
|
+ const videoplay =(item)=>{
|
|
|
|
+ console.log('播放视频');
|
|
|
|
+ console.log(item);
|
|
|
|
+ if (!theSocket.websocket) {
|
|
|
|
+ this.$Message.warning("请先打开视频插件");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (item.type == "client") {
|
|
|
|
+ this.slectOptionmini(item.userId).then((arr) => {
|
|
|
|
+ if (arr) {
|
|
|
|
+ this.vPlayArea.openAppVideo(arr);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else if (item.type == "single") { //播放单兵视频
|
|
|
|
+ pullFlow(item.channelId);
|
|
|
|
+ } else if (item.type == "vehicle") { //播放车载视频
|
|
|
|
+ pullFlow(item.channelId);
|
|
|
|
+ } else if (item.type == "uav_dev") { //播放无人机视频
|
|
|
|
+ pullFlow(item.channelId);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const pullFlow = (chinnelId) => {
|
|
|
|
+ if (chinnelId) {
|
|
|
|
+ window.vPlayArea&&window.vPlayArea.realTimeVideo([{"channelId": chinnelId}]);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const initSocket =(userCode,memberObj) => {
|
|
const self = this;
|
|
const self = this;
|
|
console.log(userCode);
|
|
console.log(userCode);
|
|
|
|
+ localStorage.setItem("userId",userCode);
|
|
//初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
|
|
//初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
|
|
- window.theSocket = theSocket = new InitWebSocketClass(
|
|
|
|
|
|
+ window.theSocket = new InitWebSocketClass(
|
|
userCode,localStorage.getItem("DAHUA_token"), {
|
|
userCode,localStorage.getItem("DAHUA_token"), {
|
|
//客户端登陆成功通知;
|
|
//客户端登陆成功通知;
|
|
loginSuccess: (v)=> {
|
|
loginSuccess: (v)=> {
|
|
@@ -312,8 +346,9 @@ export default defineComponent({
|
|
if (
|
|
if (
|
|
data.params.handleName === "#vPlayArea") {
|
|
data.params.handleName === "#vPlayArea") {
|
|
//客户端窗口创建好后,界面显示窗口;
|
|
//客户端窗口创建好后,界面显示窗口;
|
|
- vPlayArea.resize();
|
|
|
|
- this.$Message.warning("视频窗口创建成功!");
|
|
|
|
|
|
+ window.vPlayArea.resize();
|
|
|
|
+ ElMessage.warning("视频窗口创建成功!");
|
|
|
|
+ videoplay(memberObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -321,16 +356,16 @@ export default defineComponent({
|
|
);
|
|
);
|
|
console.log(theSocket);
|
|
console.log(theSocket);
|
|
//socket实例初始化websocket回调方法;
|
|
//socket实例初始化websocket回调方法;
|
|
- theSocket
|
|
|
|
|
|
+ window.theSocket
|
|
.initWebSocket()
|
|
.initWebSocket()
|
|
.then(v => {
|
|
.then(v => {
|
|
console.log();
|
|
console.log();
|
|
if (v) {
|
|
if (v) {
|
|
- this.$Message.warning("视频插件登陆完成!");
|
|
|
|
|
|
+ ElMessage.warning("视频插件登陆完成!");
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(v => {
|
|
.catch(v => {
|
|
- this.$Message.warning("若要观看实时视频,请先安装视频插件");
|
|
|
|
|
|
+ ElMessage.warning("若要观看实时视频,请先安装视频插件");
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -348,14 +383,14 @@ export default defineComponent({
|
|
playParams: {}
|
|
playParams: {}
|
|
};
|
|
};
|
|
//左边窗口实例
|
|
//左边窗口实例
|
|
- window.vPlayArea = vPlayArea = new VideoPlay(
|
|
|
|
|
|
+ window.vPlayArea = new window.VideoPlay(
|
|
"#vPlayArea",
|
|
"#vPlayArea",
|
|
window.theSocket.websocket,//一个浏览器tab页面公用一个
|
|
window.theSocket.websocket,//一个浏览器tab页面公用一个
|
|
window.theSocket.socketCode,//一个浏览器tab页面公用一个
|
|
window.theSocket.socketCode,//一个浏览器tab页面公用一个
|
|
typeObj
|
|
typeObj
|
|
);
|
|
);
|
|
//左边窗口初始化
|
|
//左边窗口初始化
|
|
- vPlayArea.init();
|
|
|
|
|
|
+ window.vPlayArea.init();
|
|
}
|
|
}
|
|
|
|
|
|
const updateTrafficSource = () => {
|
|
const updateTrafficSource = () => {
|
|
@@ -608,6 +643,9 @@ export default defineComponent({
|
|
// 如果存在id
|
|
// 如果存在id
|
|
await incidentStore.getIncidentItem(route.query.id as string);
|
|
await incidentStore.getIncidentItem(route.query.id as string);
|
|
handleSetDetailMarker(incidentStore.incidentDetail.baseInfo ?? {});
|
|
handleSetDetailMarker(incidentStore.incidentDetail.baseInfo ?? {});
|
|
|
|
+
|
|
|
|
+ document.getElementById("vPlayArea").style.height = (window.innerHeight - 20) + "px";
|
|
|
|
+ window.theSocket && window.theSocket.resize();
|
|
});
|
|
});
|
|
|
|
|
|
watch(
|
|
watch(
|
|
@@ -659,6 +697,7 @@ export default defineComponent({
|
|
return () => (
|
|
return () => (
|
|
<div class="task-map-container">
|
|
<div class="task-map-container">
|
|
<MapView v-model:map={state.map} />
|
|
<MapView v-model:map={state.map} />
|
|
|
|
+ <div id='vPlayArea' />
|
|
<div
|
|
<div
|
|
class={clsx('address-type-card-container', {
|
|
class={clsx('address-type-card-container', {
|
|
['in-detail']: props.readonly,
|
|
['in-detail']: props.readonly,
|