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