Commit fa5a43f7 authored by 张伯涛's avatar 张伯涛

ar问题初步修改

parent 5ec03a67
...@@ -44,6 +44,12 @@ export const getForecast = params => { ...@@ -44,6 +44,12 @@ export const getForecast = params => {
}) })
} }
export const getPlanIdApi = params => {
return http.post(`/api/HIK/getPlanId`,params).then(res => res).catch(function (error) {
console.log(error);
})
}
//获取港益换热站实时能耗数据 //获取港益换热站实时能耗数据
export const getGYTransferRealData = params => { export const getGYTransferRealData = params => {
return http.post(`/api/gis/GYTransferRealData`, params).then(res => res).catch(function (error) { return http.post(`/api/gis/GYTransferRealData`, params).then(res => res).catch(function (error) {
......
...@@ -586,6 +586,7 @@ import { ...@@ -586,6 +586,7 @@ import {
getGYTransferRealData, getGYTransferRealData,
getGYTransferAlarmData, getGYTransferAlarmData,
GYTransferVideo, GYTransferVideo,
getPlanIdApi,
} from "../api/screenDisplay"; } from "../api/screenDisplay";
import moment from 'moment' import moment from 'moment'
import {defineComponent} from "vue"; import {defineComponent} from "vue";
...@@ -755,6 +756,21 @@ export default defineComponent({ ...@@ -755,6 +756,21 @@ export default defineComponent({
}; };
}, },
methods: { methods: {
thirdLevelDblclick(stationId) {
console.log('stationId',stationId)
const params = {
StationId: stationId
}
getPlanIdApi(params).then(res => {
if(res.status === 0) {
const id = res.data.id
window.open('/GisAr?id=' + id, '_blank');
console.log('ggggggggggggggggggggggggggggggggggggggggggggggggggggggg')
}else {
ElMessage.error('此换热站暂无ar监控点');
}
})
},
// 第二级大屏接口 // 第二级大屏接口
async secondPageData() { async secondPageData() {
this.firstCardLoading = true this.firstCardLoading = true
...@@ -1012,8 +1028,7 @@ export default defineComponent({ ...@@ -1012,8 +1028,7 @@ export default defineComponent({
}); });
popupButtons2.addEventListener("dblclick", function (event) { popupButtons2.addEventListener("dblclick", function (event) {
if (markerId.includes("marker3")) { if (markerId.includes("marker3")) {
window.open('/GisAr', '_blank'); _this.thirdLevelDblclick(stationId) // 第三级页面双击
console.log('ggggggggggggggggggggggggggggggggggggggggggggggggggggggg')
} }
}) })
popupButtons2.addEventListener("click", function (event) { popupButtons2.addEventListener("click", function (event) {
......
<template> <template>
<div id="panel"> <div id="panel">
<div v-if="videoLoading" class="videoLoading-overlay">
<div class="videoLoading-spinner"></div>
<p> 视频加载中,请稍后......</p>
</div>
<div id="ar-div" class="panel-child"></div> <div id="ar-div" class="panel-child"></div>
<div v-if="outTime" class="errorContent"> <div v-if="outTime" class="errorContent">
<!-- <h-empty>--> <!-- <h-empty>-->
...@@ -29,13 +33,14 @@ ...@@ -29,13 +33,14 @@
import ARWebControl from "./arWebControl.debug"; import ARWebControl from "./arWebControl.debug";
// 该接口为vlmas组件ui接口,如果是在copas中调用,可以使用vlmas wiki中提供的api接口,如果是组件中使用,需要对应组件参照wiki提供相应接口 // 该接口为vlmas组件ui接口,如果是在copas中调用,可以使用vlmas wiki中提供的api接口,如果是组件中使用,需要对应组件参照wiki提供相应接口
import { getLoginTgc } from "@/api/ar"; import { getLoginTgc } from "@/api/ar";
import { useRoute } from 'vue-router'
export default { export default {
name: "OpenClient", name: "OpenClient",
components: {}, components: {},
props: {}, props: {},
data() { data() {
return { return {
videoLoading: false,
raData: {}, raData: {},
control: null, control: null,
ip: "", ip: "",
...@@ -78,6 +83,9 @@ export default { ...@@ -78,6 +83,9 @@ export default {
next(); next();
}, },
methods: { methods: {
handleBeforeUnload(event) {
console.log('jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj')
},
handleVisibilityChange() { handleVisibilityChange() {
if (document.hidden) { if (document.hidden) {
console.log('隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏') console.log('隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏')
...@@ -100,13 +108,15 @@ export default { ...@@ -100,13 +108,15 @@ export default {
} }
}, },
init() { init() {
console.log('window.innerWidth',window.innerWidth)
console.log('window.innerHeight',window.innerHeight)
// // 初始化 // // 初始化
// if (this.control) { // if (this.control) {
// this.control.setWindowStatus(2); // this.control.setWindowStatus(2);
// this.control = null; // this.control = null;
// } // }
const urlParams = new URLSearchParams(window.location.search);
const arIndexCode = urlParams.get('id');
console.log('id',arIndexCode)
const loginType = 3; const loginType = 3;
const ip = '111.160.132.74'; const ip = '111.160.132.74';
const port = this.raData.port; const port = this.raData.port;
...@@ -133,10 +143,16 @@ export default { ...@@ -133,10 +143,16 @@ export default {
height, height,
protocolType, protocolType,
domainId, domainId,
arIndexCode,
title, title,
); );
console.log('this.control',this.control) // 程序挂载成功
window.addEventListener("ar_start", event => {
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
this.videoLoading = false
});
window.addEventListener("ar_loaded", event => { window.addEventListener("ar_loaded", event => {
console.log('ar_loadedar_loadedar_loadedar_loadedar_loaded')
if (event.detail.loadingStatus) { if (event.detail.loadingStatus) {
this.outTime = 0; this.outTime = 0;
this.connectError = false; this.connectError = false;
...@@ -168,6 +184,7 @@ export default { ...@@ -168,6 +184,7 @@ export default {
this.control.setupControl(); this.control.setupControl();
}, },
async getClientInfo() { async getClientInfo() {
this.videoLoading = true
try { try {
const { status, data } = await getLoginTgc(); const { status, data } = await getLoginTgc();
console.log('data',JSON.parse(data)) console.log('data',JSON.parse(data))
...@@ -189,7 +206,72 @@ export default { ...@@ -189,7 +206,72 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
.videoLoading-overlay {
position: fixed;
top: 5px;
left: 5px;
width: 100%;
height: 100%;
background-color: rgba(230, 253, 260, 0.3);//rgba(0, 0, 0, 0.6);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 1000;
p {
margin-top: 60px;
font-size: 26px;
color: #29d78b;
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.videoLoading-spinner {
position: relative;
width: 106px;
height: 56px;
background-image: linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
radial-gradient(circle 14px, #29d78b 100%, transparent 0);
background-size: 48px 15px, 15px 35px, 15px 35px, 25px 15px, 28px 28px;
background-position: 25px 5px, 58px 20px, 25px 17px, 2px 37px, 76px 0px;
background-repeat: no-repeat;
transform: rotate(-45deg);
&::after,
&::before {
content: "";
position: absolute;
left: -45px;
top: -10px;
width: 56px;
height: 56px;
border: 6px solid #29d78b;
border-radius: 50%;
background-repeat: no-repeat;
background-image: linear-gradient(#29d78b 64px, transparent 0),
linear-gradient(#29d78b 66px, transparent 0),
radial-gradient(circle 4px, #29d78b 100%, transparent 0);
background-size: 40px 1px, 1px 40px, 8px 8px;
background-position: center center;
-webkit-animation: rotation 0.3s linear infinite;
animation: rotation 0.3s linear infinite;
}
&::before {
left: 25px;
top: 60px;
}
}
}
html, html,
body { body {
height: 100%; height: 100%;
......
...@@ -579,11 +579,11 @@ import store from "@/store/index.js"; ...@@ -579,11 +579,11 @@ import store from "@/store/index.js";
} else if (loginType == 2) { } else if (loginType == 2) {
this.controlSetupDom.href = `PCCloudVideoLabel://UP --ip ${ip} --port ${port} --user-name ${userName} --login-key ${loginKey} --start-plan-id ${arIndexCode} --left ${left} --top ${top} --width ${width} --height ${height} --login-method sg --domain-id ${domainId} --protocolType ${protocolType} --title ${title}` this.controlSetupDom.href = `PCCloudVideoLabel://UP --ip ${ip} --port ${port} --user-name ${userName} --login-key ${loginKey} --start-plan-id ${arIndexCode} --left ${left} --top ${top} --width ${width} --height ${height} --login-method sg --domain-id ${domainId} --protocolType ${protocolType} --title ${title}`
} else if (loginType == 3) { } else if (loginType == 3) {
const href = `PCCloudVideoLabel://UP --ip ${ip} --port ${port} --user-name ${userName} --login-key ${loginKey} --left ${left} --top ${top} --width ${width} --height ${height} --login-method tgc --domain-id ${domainId} --protocolType ${protocolType} --title ${title}` const href = `PCCloudVideoLabel://UP --ip ${ip} --port ${port} --user-name ${userName} --login-key ${loginKey} --start-plan-id ${arIndexCode} --left ${left} --top ${top} --width ${width} --height ${height} --login-method tgc --domain-id ${domainId} --protocolType ${protocolType} --title ${title}`
console.log('hrefaaaaaaaaaaaaaaaaaaaaaa',href) console.log('hrefaaaaaaaaaaaaaaaaaaaaaa',href)
this.controlSetupDom.href = encodeURI(href) this.controlSetupDom.href = encodeURI(href)
} }
console.log('href------', this.controlSetupDom.href) // console.log('href------', this.controlSetupDom.href)
this.webSocketPort = '7789' this.webSocketPort = '7789'
this.lastPosition = { this.lastPosition = {
...@@ -887,7 +887,7 @@ import store from "@/store/index.js"; ...@@ -887,7 +887,7 @@ import store from "@/store/index.js";
} }
var msgObejct = JSON.parse(messageString) var msgObejct = JSON.parse(messageString)
console.log('msgObejct',msgObejct)
if (msgObejct && msgObejct.topic) { if (msgObejct && msgObejct.topic) {
if (msgObejct.topic == 'ARToWebKeys') { if (msgObejct.topic == 'ARToWebKeys') {
if (msgObejct.content == 'F11') { if (msgObejct.content == 'F11') {
...@@ -940,7 +940,15 @@ import store from "@/store/index.js"; ...@@ -940,7 +940,15 @@ import store from "@/store/index.js";
} }
}) })
) )
} else if (msgObejct.topic == 'ARWebLoaded' && msgObejct.content == '1') { } else if (msgObejct.topic == 'clientStart' && msgObejct.content == 'ARStarted') {
window.dispatchEvent(
new CustomEvent('ar_start', {
detail: {
loadingStatus: true
}
})
)
} else if (msgObejct.topic == 'ARWebLoaded' && msgObejct.content == '1') {
window.dispatchEvent( window.dispatchEvent(
new CustomEvent('ar_loaded', { new CustomEvent('ar_loaded', {
detail: { detail: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment