2024-11-13 履带吊 汽车吊

This commit is contained in:
Rain 2024-11-13 14:57:42 +08:00
parent 0816714f75
commit 7c65b49bdd
47 changed files with 3379 additions and 3 deletions

View File

@ -3,8 +3,8 @@ NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用)
# 后端本地
# VITE_API_URL = 'http://192.168.34.155:19111'
VITE_API_URL = 'http://192.168.34.221:19112' #雄哥本地
VITE_API_URL = 'http://192.168.34.155:19111'
# VITE_API_URL = 'http://192.168.34.221:19112' #雄哥本地
# VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
# VITE_API_URL = 'http://192.168.34.221:28889'

BIN
dist.rar Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -67,6 +67,16 @@ export const staticRouter: RouteRecordRaw[] = [
name: "塔吊监测",
component: () => import("@/views/sevenLargeScreen/towerCraneMonitoring/index.vue")
},
{
path: "/cathangCrane",
name: "汽车吊监测",
component: () => import("@/views/sevenLargeScreen/cathangCrane/index.vue")
},
{
path: "/trackCrane",
name: "履带吊监测",
component: () => import("@/views/sevenLargeScreen/trackCrane/index.vue")
},
{
path: "/elevatorMonitoring",
name: "升降机监测",

View File

@ -0,0 +1,223 @@
<template>
<div id="charttrackContainer"></div>
</template>
<script setup lang="ts">
import * as echarts from "echarts";
import { onMounted, ref } from "vue";
import { getExceedSpeedTrend } from "@/api/modules/vehicle";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
let y = ref([150, 230, 224, 218, 135, 147, 260]);
let x = ref(["09.24", "09.25", "09.26", "09.27", "09.28", "09.29", "09.30"]);
onMounted(async () => {
await ongetExceedSpeedTrend();
const chartContainer = echarts.init(document.getElementById("charttrackContainer"));
const option = {
//
tooltip: {
//
trigger: "axis",
//
backgroundColor: "#2561d7",
//
borderWidth: 0,
//
borderColor: "#ccc",
formatter: function (params) {
console.log("params", params);
// params
let result = "";
params.forEach(function (item) {
console.log("item", item);
result += "日期" + item.axisValue + "<br/>" + item.seriesName + ": " + item.value;
});
return result;
},
//
textStyle: {
color: "#fff"
},
// x-y
axisPointer: {
type: "cross",
//
label: {
//
backgroundColor: "#6a7985"
// backgroundColor: '#e10602'
//
// color: '#e10602'
}
}
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
legend: {
// data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
//
textStyle: {
// color: '#E0E0E0',
color: "#42b2f1",
fontSize: 12
},
//
icon: "roundRect",
orient: "horizontal",
itemWidth: 13,
itemHeight: 3,
right: "10%",
top: 0
},
xAxis: {
type: "category",
data: x,
boundaryGap: false,
axisTick: {
show: false
// length:7
},
axisLine: {
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
axisLabel: {
color: "#fff",
margin: 10
},
nameTextStyle: {
color: "#7AADFF ",
fontSize: 8
},
splitLine: {
lineStyle: {
color: "rgba(255,255,255,0.08)"
}
}
},
yAxis: {
type: "value",
splitNumber: 5,
axisLine: {
show: false,
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
axisTick: {
show: false
},
axisLabel: {
color: "#fff",
margin: 10
},
splitLine: {
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
splitArea: {
areaStyle: {
color: "rgba(2, 29, 159, 0.7)"
}
}
},
series: [
{
name: "履带吊",
type: "line",
stack: "Total",
areaStyle: {},
emphasis: {
// focus: 'series'
},
data: y,
// 线
smooth: true,
//
showSymbol: true,
lineStyle: {
width: 3,
color: "#42b2f1"
},
itemStyle: {
color: "#0368FF"
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(32, 102, 179, 0.4)"
},
{
offset: 1,
color: "rgba(55, 167, 232, 0.4)"
}
])
}
},
{
name: "履带吊测试",
type: "line",
stack: "Total",
areaStyle: {},
emphasis: {
// focus: 'series'
},
data: y,
// 线
smooth: true,
//
showSymbol: true,
lineStyle: {
width: 3,
color: "#42b2f1"
},
itemStyle: {
color: "#0368FF"
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(32, 102, 179, 0.4)"
},
{
offset: 1,
color: "rgba(55, 167, 232, 0.4)"
}
])
}
}
]
};
chartContainer.setOption(option);
});
const ongetExceedSpeedTrend = async () => {
const res: any = await getExceedSpeedTrend({
projectSn: store.sn
});
console.log("一周内统计", res);
y = res.result.map(item => item.y);
x = res.result.map(item => item.x);
};
</script>
<style>
#charttrackContainer {
width: 100%;
height: 100%;
}
</style>

View File

@ -0,0 +1,328 @@
<!-- 视频播放组件 -->
<template>
<div id="playWndspeed" class="playWnd" ref="playWndBox" style="width: 100%; height: 100%"></div>
<!-- :style="{
height: playWndHeight + 'px',
width: playWndWidth + 'px',-->
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, onBeforeMount, watch } from "vue";
import { carMeasureItemList } from "@/api/modules/vehicle";
// sn
import { GlobalStore } from "@/stores";
import { log } from "console";
const store = GlobalStore();
const playWndBox = ref(null);
let playWndHeight = ref("");
let playWndWidth = ref("");
let pubKey = ref("");
let oWebControl = ref(null);
const objData = ref({
appkey: "", //appkey
ip: "", //
secret: "", //secret
port: 0,
playMode: 0, // 0 1
layout: "1x1" //16
// appkey: "24017757", //appkey
// ip: "182.101.141.23", //
// secret: "VJz0FbzmE6drPQ7egsBi", //secret
// port: 18443,
// playMode: 0, // 0 1
// layout: "1x1" //16
});
const getvideodataer = async () => {
const res: any = await carMeasureItemList({
projectSn: store.sn
});
console.log("测速-视频列表", res);
console.log("res.result.projectVideoConfig.appId", res.result.projectVideoConfig.appId);
if (res.result.projectVideoConfig.videoType !== 1) {
objData.value.ip = res.result.projectVideoConfig.account;
objData.value.appkey = res.result.projectVideoConfig.appId;
objData.value.secret = res.result.projectVideoConfig.appSecret;
objData.value.port = Number(res.result.projectVideoConfig.password);
console.log("海康插件配置", objData.value);
// onplayvideo();
}
};
// objData.value.port
// watch(
// () => objData.value.port,
// (newPort, oldPort) => {
// if (newPort !== oldPort) {
// setTimeout(() => {
// onplayvideo();
// }, 5000); // 5000 = 5
// }
// }
// );
onBeforeMount(() => {});
onMounted(async () => {
await getvideodataer()
await onplayvideo();
});
const onplayvideo = async () => {
//
// const pageInstance = getCurrentInstance();
// dom
// const tagDomObj = pageInstance.refs.playWndBox;
const tagDomObj = document.querySelector("#playWndspeed");
console.log("tagDomObj", tagDomObj);
console.log("tagDomObj", tagDomObj.clientHeight);
console.log("tagDomObj", tagDomObj.clientWidth);
playWndHeight.value = tagDomObj.clientHeight - 30;
playWndWidth.value = tagDomObj.clientWidth - 50;
// playWndWidth.value = tagDomObj.clientWidth;
// scroll使DIV
window.addEventListener("scroll", () => {
console.log(5);
// return
if (oWebControl.value != null) {
oWebControl.JS_Resize(tagDomObj.clientWidth, tagDomObj.clientHeight);
this.setWndCover();
}
});
// resize使DIV
window.addEventListener("resize", e => {
console.log(0);
if (oWebControl.value != null) {
oWebControl.JS_Resize(tagDomObj.clientWidth, tagDomObj.clientHeight);
this.setWndCover();
}
});
//
nextTick(() => {
initPlugin();
});
};
onBeforeUnmount(() => {
// if (oWebControl.value != null) {
console.log("执行销毁视频");
//
oWebControl.JS_HideWnd();
//
oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
//
oWebControl.JS_Disconnect();
// }
});
const onclose = () => {
console.log("执行海康插件销毁");
console.log("执行销毁视频");
//
oWebControl.JS_HideWnd();
//
oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
//
oWebControl.JS_Disconnect();
};
const initPlugin = () => {
console.log("2=========================");
oWebControl = new WebControl({
szPluginContainer: "playWndspeed", // id
iServicePortStart: 15900, // 使
iServicePortEnd: 15900,
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // IE10使ActiveXclsid
cbConnectSuccess: () => {
// WebControl
oWebControl
.JS_StartService("window", {
// WebControl
// "./VideoPluginConnect.dll"
dllPath: "./VideoPluginConnect.dll"
})
.then(
function () {
//
oWebControl.JS_SetWindowControlCallback({
// cbIntegrationCallBack: cbIntegrationCallBack,
});
//JS_CreateWnd
oWebControl
.JS_CreateWnd("playWndspeed", 300, 250, { bEmbed: true }) //bEmbed: true
.then(function () {
//
init();
});
},
function () {
//
}
);
},
// WebControl
cbConnectError: function () {
// WebControl,
// console.log(0);
// oWebControl.value = null;
// // errorwakeup
// window.WebControl.JS_WakeUp("VideoWebPlugin://");
// initCount++;
// if (initCount < 3) {
// setTimeout(function () {
// initPlugin();
// }, 3000);
// } else {
// setTimeout(function () {
// setTimeout(function () {
// $router.push('/home/PlugDown')
// }, 4000)
// }, 4000)
// }
},
cbConnectClose: () => {
// bNormalClose = false
// JS_DisconnectbNormalClose = true
// console.log("cbConnectClose");
oWebControl.value = null;
}
});
// oWebControl.JS_CuttingPartWindow(500, 500, 500, 500);
};
//
const init = callback => {
console.log(objData.value, "我的视频服务器");
getPubKey(() => {
let appkey = objData.value.appkey; //appkey
let secret = setEncrypt(objData.value.secret); //secret
let ip = objData.value.ip; //IP
let playMode = objData.value.playMode; //0-1-
let port = objData.value.port; //HTTPS443
let snapDir = "D:\\SnapDir"; //
let videoDir = "D:\\VideoDir"; //
let layout = objData.value.layout; //playMode
let enableHTTPS = 1; //HTTPS1
let encryptedFields = "secret"; //secret
let showToolbar = 1; //0-0-
let showSmart = 0; //线0-0-
let buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //
// var toolBarButtonIDs = "2049,2304" //
oWebControl
.JS_RequestInterface({
funcName: "init",
argument: JSON.stringify({
appkey: appkey, //APIappkey
secret: secret, //APIsecret
ip: ip, //APIIP
playMode: playMode, //
port: port, //
snapDir: snapDir, //
videoDir: videoDir, //
layout: layout, //
enableHTTPS: enableHTTPS, //HTTPS
encryptedFields: encryptedFields, //
showToolbar: showToolbar, //
showSmart: showSmart, //
buttonIDs //
})
})
.then(function (oData) {
oWebControl.JS_Resize(playWndWidth.value, playWndHeight.value); // resizefirefoxDIV
if (callback) {
callback();
}
//
// oWebControl.JS_HideWnd()
});
});
};
// RSA
let setEncrypt = value => {
let encrypt = new window.JSEncrypt();
encrypt.setPublicKey(pubKey);
return encrypt.encrypt(value);
};
//
const getPubKey = callback => {
oWebControl
.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024
})
})
.then(function (oData) {
if (oData.responseMsg.data) {
pubKey = oData.responseMsg.data;
callback();
}
});
};
//
//
const previewVideo = data => {
console.log("播放data", data);
let cameraIndexCode = data; //
let streamMode = 0; // 0-1-
let transMode = 1; // 0-UDP1-TCP
let gpuMode = 0; // GPU0-1-
let wndId = -1; // 2x2
oWebControl
.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: cameraIndexCode, //
streamMode: streamMode, //
transMode: transMode, //
gpuMode: gpuMode, // GPU
wndId: wndId //
})
})
.then(function () {
oWebControl.JS_SetWindowControlCallback({});
});
};
const handleHide = () => {
console.log("执行隐藏");
oWebControl.JS_HideWnd();
};
const handleShow = () => {
console.log("执行显示");
//
oWebControl.JS_ShowWnd();
};
// 便访
defineExpose({
handleHide,
handleShow,
onclose,
objData,
previewVideo
});
</script>
<style lang="scss" scoped>
</style>

File diff suppressed because it is too large Load Diff

View File

@ -271,8 +271,17 @@ let adminName = ref("" as any);
let menuList = ref([
{
moduleName: "综合管理",
modulePath: "/projectOverview",
// modulePath: "/projectOverview",
modulePath: "/trackCrane",
menuList: [
{
menuName: "汽车吊监测",
companyPath: "/cathangCrane"
},
{
menuName: "履带吊监测",
companyPath: "/trackCrane"
},
{
menuName: "工程概况",
companyPath: "/projectOverview"

View File

@ -0,0 +1,223 @@
<template>
<div id="charttrackContainer"></div>
</template>
<script setup lang="ts">
import * as echarts from "echarts";
import { onMounted, ref } from "vue";
import { getExceedSpeedTrend } from "@/api/modules/vehicle";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
let y = ref([150, 230, 224, 218, 135, 147, 260]);
let x = ref(["09.24", "09.25", "09.26", "09.27", "09.28", "09.29", "09.30"]);
onMounted(async () => {
await ongetExceedSpeedTrend();
const chartContainer = echarts.init(document.getElementById("charttrackContainer"));
const option = {
//
tooltip: {
//
trigger: "axis",
//
backgroundColor: "#2561d7",
//
borderWidth: 0,
//
borderColor: "#ccc",
formatter: function (params) {
console.log("params", params);
// params
let result = "";
params.forEach(function (item) {
console.log("item", item);
result += "日期" + item.axisValue + "<br/>" + item.seriesName + ": " + item.value;
});
return result;
},
//
textStyle: {
color: "#fff"
},
// x-y
axisPointer: {
type: "cross",
//
label: {
//
backgroundColor: "#6a7985"
// backgroundColor: '#e10602'
//
// color: '#e10602'
}
}
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
legend: {
// data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
//
textStyle: {
// color: '#E0E0E0',
color: "#42b2f1",
fontSize: 12
},
//
icon: "roundRect",
orient: "horizontal",
itemWidth: 13,
itemHeight: 3,
right: "10%",
top: 0
},
xAxis: {
type: "category",
data: x,
boundaryGap: false,
axisTick: {
show: false
// length:7
},
axisLine: {
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
axisLabel: {
color: "#fff",
margin: 10
},
nameTextStyle: {
color: "#7AADFF ",
fontSize: 8
},
splitLine: {
lineStyle: {
color: "rgba(255,255,255,0.08)"
}
}
},
yAxis: {
type: "value",
splitNumber: 5,
axisLine: {
show: false,
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
axisTick: {
show: false
},
axisLabel: {
color: "#fff",
margin: 10
},
splitLine: {
lineStyle: {
color: "rgba(32, 121, 160, 0.3)"
}
},
splitArea: {
areaStyle: {
color: "rgba(2, 29, 159, 0.7)"
}
}
},
series: [
{
name: "履带吊",
type: "line",
stack: "Total",
areaStyle: {},
emphasis: {
// focus: 'series'
},
data: y,
// 线
smooth: true,
//
showSymbol: true,
lineStyle: {
width: 3,
color: "#42b2f1"
},
itemStyle: {
color: "#0368FF"
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(32, 102, 179, 0.4)"
},
{
offset: 1,
color: "rgba(55, 167, 232, 0.4)"
}
])
}
},
{
name: "履带吊测试",
type: "line",
stack: "Total",
areaStyle: {},
emphasis: {
// focus: 'series'
},
data: y,
// 线
smooth: true,
//
showSymbol: true,
lineStyle: {
width: 3,
color: "#42b2f1"
},
itemStyle: {
color: "#0368FF"
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(32, 102, 179, 0.4)"
},
{
offset: 1,
color: "rgba(55, 167, 232, 0.4)"
}
])
}
}
]
};
chartContainer.setOption(option);
});
const ongetExceedSpeedTrend = async () => {
const res: any = await getExceedSpeedTrend({
projectSn: store.sn
});
console.log("一周内统计", res);
y = res.result.map(item => item.y);
x = res.result.map(item => item.x);
};
</script>
<style>
#charttrackContainer {
width: 100%;
height: 100%;
}
</style>

View File

@ -0,0 +1,328 @@
<!-- 视频播放组件 -->
<template>
<div id="playWndspeed" class="playWnd" ref="playWndBox" style="width: 100%; height: 100%"></div>
<!-- :style="{
height: playWndHeight + 'px',
width: playWndWidth + 'px',-->
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, onBeforeMount, watch } from "vue";
import { carMeasureItemList } from "@/api/modules/vehicle";
// sn
import { GlobalStore } from "@/stores";
import { log } from "console";
const store = GlobalStore();
const playWndBox = ref(null);
let playWndHeight = ref("");
let playWndWidth = ref("");
let pubKey = ref("");
let oWebControl = ref(null);
const objData = ref({
appkey: "", //appkey
ip: "", //
secret: "", //secret
port: 0,
playMode: 0, // 0 1
layout: "1x1" //16
// appkey: "24017757", //appkey
// ip: "182.101.141.23", //
// secret: "VJz0FbzmE6drPQ7egsBi", //secret
// port: 18443,
// playMode: 0, // 0 1
// layout: "1x1" //16
});
const getvideodataer = async () => {
const res: any = await carMeasureItemList({
projectSn: store.sn
});
console.log("测速-视频列表", res);
console.log("res.result.projectVideoConfig.appId", res.result.projectVideoConfig.appId);
if (res.result.projectVideoConfig.videoType !== 1) {
objData.value.ip = res.result.projectVideoConfig.account;
objData.value.appkey = res.result.projectVideoConfig.appId;
objData.value.secret = res.result.projectVideoConfig.appSecret;
objData.value.port = Number(res.result.projectVideoConfig.password);
console.log("海康插件配置", objData.value);
// onplayvideo();
}
};
// objData.value.port
// watch(
// () => objData.value.port,
// (newPort, oldPort) => {
// if (newPort !== oldPort) {
// setTimeout(() => {
// onplayvideo();
// }, 5000); // 5000 = 5
// }
// }
// );
onBeforeMount(() => {});
onMounted(async () => {
await getvideodataer()
await onplayvideo();
});
const onplayvideo = async () => {
//
// const pageInstance = getCurrentInstance();
// dom
// const tagDomObj = pageInstance.refs.playWndBox;
const tagDomObj = document.querySelector("#playWndspeed");
console.log("tagDomObj", tagDomObj);
console.log("tagDomObj", tagDomObj.clientHeight);
console.log("tagDomObj", tagDomObj.clientWidth);
playWndHeight.value = tagDomObj.clientHeight - 50;
playWndWidth.value = tagDomObj.clientWidth - 50;
// playWndWidth.value = tagDomObj.clientWidth;
// scroll使DIV
window.addEventListener("scroll", () => {
console.log(5);
// return
if (oWebControl.value != null) {
oWebControl.JS_Resize(tagDomObj.clientWidth, tagDomObj.clientHeight);
this.setWndCover();
}
});
// resize使DIV
window.addEventListener("resize", e => {
console.log(0);
if (oWebControl.value != null) {
oWebControl.JS_Resize(tagDomObj.clientWidth, tagDomObj.clientHeight);
this.setWndCover();
}
});
//
nextTick(() => {
initPlugin();
});
};
onBeforeUnmount(() => {
// if (oWebControl.value != null) {
console.log("执行销毁视频");
//
oWebControl.JS_HideWnd();
//
oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
//
oWebControl.JS_Disconnect();
// }
});
const onclose = () => {
console.log("执行海康插件销毁");
console.log("执行销毁视频");
//
oWebControl.JS_HideWnd();
//
oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
//
oWebControl.JS_Disconnect();
};
const initPlugin = () => {
console.log("2=========================");
oWebControl = new WebControl({
szPluginContainer: "playWndspeed", // id
iServicePortStart: 15900, // 使
iServicePortEnd: 15900,
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // IE10使ActiveXclsid
cbConnectSuccess: () => {
// WebControl
oWebControl
.JS_StartService("window", {
// WebControl
// "./VideoPluginConnect.dll"
dllPath: "./VideoPluginConnect.dll"
})
.then(
function () {
//
oWebControl.JS_SetWindowControlCallback({
// cbIntegrationCallBack: cbIntegrationCallBack,
});
//JS_CreateWnd
oWebControl
.JS_CreateWnd("playWndspeed", 300, 250, { bEmbed: true }) //bEmbed: true
.then(function () {
//
init();
});
},
function () {
//
}
);
},
// WebControl
cbConnectError: function () {
// WebControl,
// console.log(0);
// oWebControl.value = null;
// // errorwakeup
// window.WebControl.JS_WakeUp("VideoWebPlugin://");
// initCount++;
// if (initCount < 3) {
// setTimeout(function () {
// initPlugin();
// }, 3000);
// } else {
// setTimeout(function () {
// setTimeout(function () {
// $router.push('/home/PlugDown')
// }, 4000)
// }, 4000)
// }
},
cbConnectClose: () => {
// bNormalClose = false
// JS_DisconnectbNormalClose = true
// console.log("cbConnectClose");
oWebControl.value = null;
}
});
// oWebControl.JS_CuttingPartWindow(500, 500, 500, 500);
};
//
const init = callback => {
console.log(objData.value, "我的视频服务器");
getPubKey(() => {
let appkey = objData.value.appkey; //appkey
let secret = setEncrypt(objData.value.secret); //secret
let ip = objData.value.ip; //IP
let playMode = objData.value.playMode; //0-1-
let port = objData.value.port; //HTTPS443
let snapDir = "D:\\SnapDir"; //
let videoDir = "D:\\VideoDir"; //
let layout = objData.value.layout; //playMode
let enableHTTPS = 1; //HTTPS1
let encryptedFields = "secret"; //secret
let showToolbar = 1; //0-0-
let showSmart = 0; //线0-0-
let buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //
// var toolBarButtonIDs = "2049,2304" //
oWebControl
.JS_RequestInterface({
funcName: "init",
argument: JSON.stringify({
appkey: appkey, //APIappkey
secret: secret, //APIsecret
ip: ip, //APIIP
playMode: playMode, //
port: port, //
snapDir: snapDir, //
videoDir: videoDir, //
layout: layout, //
enableHTTPS: enableHTTPS, //HTTPS
encryptedFields: encryptedFields, //
showToolbar: showToolbar, //
showSmart: showSmart, //
buttonIDs //
})
})
.then(function (oData) {
oWebControl.JS_Resize(playWndWidth.value, playWndHeight.value); // resizefirefoxDIV
if (callback) {
callback();
}
//
// oWebControl.JS_HideWnd()
});
});
};
// RSA
let setEncrypt = value => {
let encrypt = new window.JSEncrypt();
encrypt.setPublicKey(pubKey);
return encrypt.encrypt(value);
};
//
const getPubKey = callback => {
oWebControl
.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024
})
})
.then(function (oData) {
if (oData.responseMsg.data) {
pubKey = oData.responseMsg.data;
callback();
}
});
};
//
//
const previewVideo = data => {
console.log("播放data", data);
let cameraIndexCode = data; //
let streamMode = 0; // 0-1-
let transMode = 1; // 0-UDP1-TCP
let gpuMode = 0; // GPU0-1-
let wndId = -1; // 2x2
oWebControl
.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: cameraIndexCode, //
streamMode: streamMode, //
transMode: transMode, //
gpuMode: gpuMode, // GPU
wndId: wndId //
})
})
.then(function () {
oWebControl.JS_SetWindowControlCallback({});
});
};
const handleHide = () => {
console.log("执行隐藏");
oWebControl.JS_HideWnd();
};
const handleShow = () => {
console.log("执行显示");
//
oWebControl.JS_ShowWnd();
};
// 便访
defineExpose({
handleHide,
handleShow,
onclose,
objData,
previewVideo
});
</script>
<style lang="scss" scoped>
</style>

File diff suppressed because it is too large Load Diff