Commit 3db2e857 authored by 张伯涛's avatar 张伯涛

修改

parent 78d34d0e
import http from './http'
export const getLoginTgc = params => {
var url = "/api/HIK/getLoginTgc";
return http.post(url).then(res => res).catch(function (error) {
console.log(error);
})
}
...@@ -1011,6 +1011,7 @@ export default defineComponent({ ...@@ -1011,6 +1011,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');
console.log('ggggggggggggggggggggggggggggggggggggggggggggggggggggggg') console.log('ggggggggggggggggggggggggggggggggggggggggggggggggggggggg')
} }
}) })
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<!-- 点击此处前往海康平台下载视频播放插件--> <!-- 点击此处前往海康平台下载视频播放插件-->
<!--</div> &ndash;&gt;--> <!--</div> &ndash;&gt;-->
<!-- </el-card>--> <!-- </el-card>-->
<div class="videoPlayerDialog" id="playWndDialog"> <div className="videoPlayerDialog" id="playWndDialog">
</div> </div>
</template> </template>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<script setup> <script setup>
// ../OutputFile/VideoWebPlugin.zip // ../OutputFile/VideoWebPlugin.zip
import {ref, reactive, onMounted,defineEmits, onUnmounted, provide, computed, handleError, watch} from 'vue' import { ref, reactive, onMounted, defineEmits, onUnmounted, provide, computed, handleError, watch, toRefs } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import http from '../api/http' import http from '../api/http'
import store from "../store/index"; import store from "../store/index";
...@@ -67,9 +67,10 @@ import $ from 'jquery' ...@@ -67,9 +67,10 @@ import $ from 'jquery'
import { JSEncrypt } from 'jsencrypt' import { JSEncrypt } from 'jsencrypt'
import { WebControl } from '../assets/script/video/web-control.esm.min.js' import { WebControl } from '../assets/script/video/web-control.esm.min.js'
import { onActivated, onDeactivated } from 'vue' import { onActivated, onDeactivated } from 'vue'
onActivated(()=>{
if(route.query.id){ onActivated(() => {
VideoInfo.value=route.query.id; if (route.query.id) {
VideoInfo.value = route.query.id;
getVideoFromVideoList(route.query.id); getVideoFromVideoList(route.query.id);
} }
// showPlay(); // showPlay();
...@@ -81,11 +82,11 @@ onDeactivated(() => { ...@@ -81,11 +82,11 @@ onDeactivated(() => {
const route = useRoute(); const route = useRoute();
onBeforeRouteUpdate((to, from) => { onBeforeRouteUpdate((to, from) => {
var r=useRoute(); var r = useRoute();
console.log('update') console.log('update')
console.log(r.query.id); console.log(r.query.id);
if(r.query.id){ if (r.query.id) {
VideoInfo.value=r.query.id; VideoInfo.value = r.query.id;
getVideoFromVideoList(r.query.id); getVideoFromVideoList(r.query.id);
} }
}) })
...@@ -108,17 +109,24 @@ const pProps = defineProps({ ...@@ -108,17 +109,24 @@ const pProps = defineProps({
stopParams: { stopParams: {
type: Number, type: Number,
required: true, required: true,
},
videoShow:{
type:Boolean,
required:true
} }
}); });
const VideoCon=toRefs(pProps);
//声明公用变量 //声明公用变量
var initCount = 0; var initCount = 0;
var pubKey = ''; var pubKey = '';
var playWnd_width = pProps.divWidth; var playWnd_width = pProps.divWidth;
var playWnd_height = pProps.divHeight; var playWnd_height = pProps.divHeight;
var oWebControl; var oWebControl;
var videoIp="218.69.97.198";; var videoIp = "218.69.97.198";
var videoPort=1443; ;
var videoPort = 1443;
const enterpriseId = ref(null); const enterpriseId = ref(null);
enterpriseId.value = store.getters.getEnterpriseId(); enterpriseId.value = store.getters.getEnterpriseId();
var VideoInfo = reactive({ var VideoInfo = reactive({
...@@ -130,14 +138,16 @@ var VideoInfo = reactive({ ...@@ -130,14 +138,16 @@ var VideoInfo = reactive({
const props = { multiple: false, emitPath: false } const props = { multiple: false, emitPath: false }
initPage(); initPage();
function down(){
function down() {
//下载插件 //下载插件
const filepath='/OutputFile/VideoWebPlugin.zip'; const filepath = '/OutputFile/VideoWebPlugin.zip';
window.open(filepath); window.open(filepath);
} }
function resetVideoWidth(){
console.log('playVW',playWnd_width); function resetVideoWidth() {
console.log('playVW', playWnd_width);
} }
//获取服务中心->供热站->换热站,三级列表 //获取服务中心->供热站->换热站,三级列表
...@@ -217,10 +227,10 @@ function getVideoInfo() { ...@@ -217,10 +227,10 @@ function getVideoInfo() {
function initPage() { function initPage() {
getVideoInfo();//视频信息 getVideoInfo();//视频信息
getStats();//下拉列表 getStats();//下拉列表
console.log('VideoInfo.selectOptions',VideoInfo.selectOptions) console.log('VideoInfo.selectOptions', VideoInfo.selectOptions)
if(route.query.id){ if (route.query.id) {
//设置选择框 //设置选择框
VideoInfo.value=route.query.id; VideoInfo.value = route.query.id;
//播放视频 //播放视频
getVideoFromVideoList(route.query.id); getVideoFromVideoList(route.query.id);
} }
...@@ -241,6 +251,7 @@ function getVideoFromVideoList(value) { ...@@ -241,6 +251,7 @@ function getVideoFromVideoList(value) {
playVideoByVideoList(VideoInfo.playVideoList) playVideoByVideoList(VideoInfo.playVideoList)
} }
} }
// function visibleCascader(isshow) { // function visibleCascader(isshow) {
// if (!oWebControl) { // if (!oWebControl) {
// return; // return;
...@@ -275,8 +286,27 @@ onUnmounted(() => { ...@@ -275,8 +286,27 @@ onUnmounted(() => {
hidePlay(); hidePlay();
}) })
const emit = defineEmits(['initSuccess']) const emit = defineEmits(['initSuccess'])
// 创建播放实例 // 创建播放实例
function initPlugin() { function initPlugin() {
try {
if (oWebControl != null) {
var tmp = oWebControl;
tmp.JS_Disconnect().then(function () { // oWebControl 为 WebControl 的对象
// 断开与插件服务的连接成功
console.log("销毁成功")
}, function () {
// 断开与插件服务的连接失败
console.log("销毁失败")
});
}
} catch (e) {
oWebControl = null;
}
oWebControl = new WebControl({ oWebControl = new WebControl({
szPluginContainer: "playWndDialog", // 指定容器id szPluginContainer: "playWndDialog", // 指定容器id
iServicePortStart: 15900, // 指定起止端口号,建议使用该值 iServicePortStart: 15900, // 指定起止端口号,建议使用该值
...@@ -345,31 +375,30 @@ function cbIntegrationCallBack(oData) { ...@@ -345,31 +375,30 @@ function cbIntegrationCallBack(oData) {
} }
//初始化ip //初始化ip
async function initIp(){ async function initIp() {
var res; var res;
try{ try {
res = await fetch('https://api.ipify.org?format=json'); res = await fetch('https://api.ipify.org?format=json');
const data = await res.json(); const data = await res.json();
var serverIP = data.ip; var serverIP = data.ip;
if(serverIP === "111.160.132.74" || serverIP === "218.69.97.198"){ if (serverIP === "111.160.132.74" || serverIP === "218.69.97.198") {
videoIp="192.168.1.130"; videoIp = "192.168.1.130";
}else{ } else {
videoIp="218.69.97.198"; videoIp = "218.69.97.198";
} }
}catch(e){ } catch (e) {
videoIp="218.69.97.198"; videoIp = "218.69.97.198";
} }
videoPort = 1443;
videoPort=1443;
} }
//初始化插件 //初始化插件
function init() { function init() {
getPubKey(function () { getPubKey(function () {
console.log("ip:"+videoIp); console.log("ip:" + videoIp);
////////////////////////////////// 请自行修改以下变量值 //////////////////////////////////// ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
var appkey = "27337031"; //综合安防管理平台提供的appkey,必填 var appkey = "27337031"; //综合安防管理平台提供的appkey,必填
var secret = setEncrypt("MI9Q4eAHC0Ip7bVX2Sov"); //综合安防管理平台提供的secret,必填 var secret = setEncrypt("MI9Q4eAHC0Ip7bVX2Sov"); //综合安防管理平台提供的secret,必填
...@@ -556,6 +585,7 @@ function playVideo(videoCode) { ...@@ -556,6 +585,7 @@ function playVideo(videoCode) {
function playVideoByVideoList(videoList) { function playVideoByVideoList(videoList) {
if (!videoList || videoList.length === 0) { if (!videoList || videoList.length === 0) {
VideoCon.value = false;
return; return;
} }
var streamMode = 0; //主子码流标识:0-主码流,1-子码流 var streamMode = 0; //主子码流标识:0-主码流,1-子码流
...@@ -635,20 +665,21 @@ function playVideotest(cameraIndexCode) { ...@@ -635,20 +665,21 @@ function playVideotest(cameraIndexCode) {
}) })
} }
watch( watch(
() => pProps.queryParams, () => pProps.queryParams,
async (newData) => { async (newData) => {
if(pProps.queryParams) { if (pProps.queryParams) {
const params = JSON.parse(pProps.queryParams) const params = JSON.parse(pProps.queryParams)
// const params = ['31c0d567dd1944d5b4ea3eddf94f740b'] // const params = ['31c0d567dd1944d5b4ea3eddf94f740b']
if(params && params.length > 0) { if (params && params.length > 0) {
hidePlay(); hidePlay();
await initIp();//ip await initIp();//ip
initPlugin(); initPlugin();
showPlay() showPlay()
getVideoFromVideoList(params) getVideoFromVideoList(params)
} }
}else { } else {
hidePlay(); hidePlay();
} }
} }
......
...@@ -575,6 +575,14 @@ const routes = [ ...@@ -575,6 +575,14 @@ const routes = [
title: "地图", title: "地图",
}, },
}, },
{
path: "/GisAr",
name: "/GisAr",
component: () => import("@/views/Gis/arDisplay.vue"),
meta: {
title: "ar实景",
},
},
//捕获404路由 //捕获404路由
{ {
path: "/:pathMatch(.*)*", path: "/:pathMatch(.*)*",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<script> <script>
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 { getClientInfo } from "@/api/index"; import { getLoginTgc } from "@/api/ar";
export default { export default {
name: "OpenClient", name: "OpenClient",
...@@ -89,16 +89,16 @@ export default { ...@@ -89,16 +89,16 @@ export default {
const domainId = this.domainId; const domainId = this.domainId;
const protocolType = this.protocolType const protocolType = this.protocolType
this.control = new ARWebControl( this.control = new ARWebControl(
"ar-div", "ar-div",
loginType, loginType,
ip, ip,
port, port,
userName, userName,
credential, credential,
indexCode, indexCode,
wsPort, wsPort,
domainId, domainId,
protocolType protocolType
); );
console.log("params--", { console.log("params--", {
loginType, loginType,
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
}, },
async getClientInfo() { async getClientInfo() {
try { try {
const { code, data } = await getClientInfo(); const { code, data } = await getLoginTgc();
if (code === "0") { if (code === "0") {
this.userInfo = data.currentUser || {}; this.userInfo = data.currentUser || {};
this.domainId = data.domainId; this.domainId = data.domainId;
......
/* eslint-disable */ /* eslint-disable */
import store from "@/store/index.js";
;(function(global, factory) { ;(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory()) ? (module.exports = factory())
...@@ -497,7 +499,7 @@ ...@@ -497,7 +499,7 @@
WEBSOCKET_URL: 'ws://127.0.0.1' WEBSOCKET_URL: 'ws://127.0.0.1'
} }
var ARWebControl = const ARWebControl =
/*#__PURE__*/ /*#__PURE__*/
(function() { (function() {
/** /**
...@@ -1167,3 +1169,4 @@ ...@@ -1167,3 +1169,4 @@
return ARWebControl return ARWebControl
}) })
//# sourceMappingURL=arWebControl.js.map //# sourceMappingURL=arWebControl.js.map
export default ARWebControl
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