logo更换

This commit is contained in:
打豆豆 2024-03-26 21:27:26 +08:00
parent 029d57ad8e
commit ddea834325
8 changed files with 601 additions and 367 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -316,7 +316,7 @@
:options="machineryTypeOptions"
:normalizer="normalizer"
placeholder="请选择设备类型"
@select="handleNodeClick"
@select="handleNode"
/>
</el-form-item>
</el-col>
@ -721,7 +721,7 @@ export default {
this.handleQuery();
},
//
handleNodeClick(data) {
handleNode(data) {
console.log(data);
this.form.machineryTypeName = data.machineryTypeName;
this.form.machineryTypeCode = data.code;

View File

@ -0,0 +1,91 @@
import { getPubKey, setEncrypt } from './pubKey'
var initCount = 0;
var oWebControl;
/**
*
* @param {*} id :组件容器id
* @param {*} iWidth :组件容器宽
* @param {*} iHeight :组件容器高
* @param {*}cbIntegrationCallBack消息推送回调函数
* @param {*} argument:初始化api参数
* @param {*} completeCallBack初始化成功回调函数
* @param {*} plugErrorCallBack插件启动失败回调函数
*/
const initPlugin = (id, iWidth, iHeight, argument, cbIntegrationCallBack = () => { }, completeCallBack = () => { }, plugErrorCallBack = () => { }) => {
// eslint-disable-next-line no-undef
oWebControl = new WebControl({
szPluginContainer: id, // 指定容器id
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
iServicePortEnd: 15909,
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
cbConnectSuccess: function () { // 创建WebControl实例成功
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
}).then(function () { // 启动插件服务成功
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
cbIntegrationCallBack: cbIntegrationCallBack
});
oWebControl.JS_CreateWnd(id, iWidth, iHeight).then(function () { //JS_CreateWnd创建视频播放窗口宽高可设定
init(argument, iWidth, iHeight,completeCallBack()); // 创建播放实例成功后初始化
});
}, function () { // 启动插件服务失败
});
},
// eslint-disable-next-line no-unused-vars
cbConnectError: function (e) { // 创建WebControl实例失败
oWebControl = null;
// eslint-disable-next-line no-undef
// $(id).html("插件未启动,正在尝试启动,请稍候...");
// eslint-disable-next-line no-undef
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数采用wakeup来启动程序
initCount++;
if (initCount < 2) {
setTimeout(function () {
initPlugin(id, iWidth, iHeight, argument, cbIntegrationCallBack,completeCallBack,plugErrorCallBack);
}, 1000)
} else {
// eslint-disable-next-line no-undef
// $(id).html("插件启动失败,请检查插件是否安装!");
plugErrorCallBack()
}
},
// eslint-disable-next-line no-unused-vars
cbConnectClose: function (bNormalClose) {
// 异常断开bNormalClose = false
// JS_Disconnect正常断开bNormalClose = true
console.log("cbConnectClose");
oWebControl = null;
}
});
return oWebControl
}
//初始化
function init(argument, iWidth, iHeight,callback=()=>{}) {
getPubKey(oWebControl, function () {
oWebControl.JS_RequestInterface({
funcName: "init",
argument: JSON.stringify({
...argument,
secret: setEncrypt(argument.secret)
})
// eslint-disable-next-line no-unused-vars
}).then(function (oData) {
callback()
//oWebControl.JS_Resize(iWidth, iHeight); // 初始化后resize一次规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
});
})
}
export default initPlugin

View File

@ -0,0 +1,24 @@
var pubKey;
//获取公钥
export function getPubKey(oWebControl,callback) {
// eslint-disable-next-line no-undef
oWebControl.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024
})
}).then(function (oData) {
if (oData.responseMsg.data) {
pubKey = oData.responseMsg.data;
callback()
}
})
}
//RSA加密
export function setEncrypt(value) {
// eslint-disable-next-line no-undef
var encrypt = new JSEncrypt();
encrypt.setPublicKey(pubKey);
return encrypt.encrypt(value);
}

View File

@ -1,351 +1,495 @@
<template>
<div>
<div>
<div id="playWnd" class="playWnd"></div>
<div v-show="lodingshow" style="margin: -17px 0">
<a-spin tip="Loading...">
<div class="spin-content">插件未启动正在尝试启动请稍候...</div>
</a-spin>
</div>
<div v-show="lodingres" class="example">
<p style="margin: 0; display: inline-block">
没有检测到插件请安装插件后重启浏览器
</p>
<a-button class="buttonDetails-class" @click="downloadFile()"
>下载</a-button
>
</div>
</div>
<div class="hk-video-container" id="playWnd">
<!-- 下载插件提示框 -->
<el-dialog
v-if="downloadDialog"
title="提示"
:visible.sync="dialogVisible"
width="30%"
>
<span
>{{downloadText}}</span
>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleDownloadExe">下载</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import initPlugin from "./lib/initPlugin";
export default {
name: "monitor",
name: "hkVideo",
props: {
width: {
type: Number,
default: 500,
},
height: {
type: Number,
default: 300,
},
//
// 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: buttonIDs //
argument: {
type: Object,
default: () => {},
},
//01
playMode: {
type: Number,
default: 0,
},
//
autoResize: {
type: Boolean,
default: true,
},
//
downloadDialog: {
type: Boolean,
default: false,
},
//url
downloadUrl: {
type: String,
default: "",
},
downloadText:{
type:String,
default:'插件启动失败,请检查插件是否安装,如果未安装请点击下载安装,安装后刷新页面'
}
},
data() {
return {
//
camlength: "1x1",
//
lodingshow: false,
lodingres: false,
curWindIndex: 1, //1
oWebControl: null, //
iWidth: "", //
iHeight: "", //
options: {
appkey: "admin", //APIappkey
secret: "mygymygy.", //APIsecret
ip: "192.168.2.107", //APIIP
playMode: 0, //
port: 443, //
snapDir: "D:\\SnapDir", //
videoDir: "D:\\VideoDir", //
layout: "3x3", //
enableHTTPS: 1, //HTTPS
encryptedFields: "secret", //
showToolbar: 1,
showSmart: 1,
buttonIDs:
"0,1,16,256,257,258,259,260,512,513,514,515,516,517,768,769,770", //
},
rate: 0, //
isInitComolete: false, //
dialogVisible: false,
};
},
created() {
//
this.initPlugin();
// resize使DIV
// vue onresize
$(window).resize(() => {
if (oWebControl != null) {
oWebControl.JS_Resize( $('.map').width(), $('.map').height() - 60);
}
});
},
//
destroyed() {
if (oWebControl != null) {
oWebControl.JS_HideWnd(); //
oWebControl.JS_Disconnect().then(() => { //
},
() => { //
});
}
},
methods: {
//
refusePlay() {
//
SubordinateCam({
pageNo: 1,
pageSize: 1000,
regionIndexCode: this.$route.params.id
}).then(res => {
if (res.data.code == 0) {
let shuliang = res.data.data.list.length;
if (shuliang == 1 || shuliang == 0) {
this.camlength = "1x1"
} else if (shuliang > 1 && shuliang <= 4) {
this.camlength = "2x2"
} else if (shuliang > 4 && shuliang <= 9) {
this.camlength = "3x3"
} else if (shuliang > 9 && shuliang <= 16) {
this.camlength = "4x4"
} else if (shuliang > 16 && shuliang <= 25) {
this.camlength = "5x5"
}
//
oWebControl.JS_RequestInterface({
funcName: "setLayout",
argument: {layout: this.camlength}
}).then(() => {
//
if (res.data.data.list.length > 0) {
this.$message.success('获取成功 监控点数量为' + res.data.data.list.length)
res.data.data.list.forEach((item, index) => {
oWebControl.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
cameraIndexCode: item.cameraIndexCode, //
streamMode: 0, //
transMode: 1, //
gpuMode: 0, //GPU
wndId: index + 1 //
})
})
})
} else {
this.$message.warning('当前区域无直属监控点区域')
//
let result = JSON.stringify({
"funcName": "stopAllPreview"
}, null, 2)
this.requestInterface(result);
}
})
} else {
this.$message.error('获取失败')
}
})
},
// $('.map').width(), $('.map').height() - 60)
//
initPlugin() {
// eslint-disable-next-line no-undef
oWebControl = new WebControl({
szPluginContainer: "playWnd", // id
iServicePortStart: 15900, // 使
iServicePortEnd: 15909,
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // IE10使ActiveXclsid
cbConnectSuccess: () => { // WebControl
oWebControl.JS_StartService("window", { // WebControl
dllPath: "./VideoPluginConnect.dll" // "./VideoPluginConnect.dll"
}).then(() => { //
oWebControl.JS_SetWindowControlCallback({ //
cbIntegrationCallBack: this.cbIntegrationCallBack
});
oWebControl.JS_CreateWnd("playWnd", $('.map').width(), $('.map').height() - 60).then(() => { //JS_CreateWnd
this.init(); //
});
}, () => { //
});
},
cbConnectError: () => { // WebControl
oWebControl = null;
// $("#playWnd").html("...");
this.lodingshow = true;
// eslint-disable-next-line no-undef
WebControl.JS_WakeUp("VideoWebPlugin://"); // errorwakeup
initCount++;
if (initCount < 3) {
setTimeout(() => {
this.initPlugin();
}, 3000)
} else {
this.lodingshow = false;
this.lodingres = true;
// $("#playWnd").html("");
}
},
cbConnectClose: () => {
// bNormalClose = false
// JS_DisconnectbNormalClose = true
oWebControl = null;
}
});
},
//
init() {
//
this.getPubKey(() => {
////////////////////////////////// ////////////////////////////////////
let appkey = admin; //appkey
//
let secret = "mygymygy."; //secret
let ip = "192.168.2.107"; //IP
let port = "443"; //HTTPS443
let playMode = 0; //0-1-
let snapDir = "D:\\SnapDir"; //
let videoDir = "D:\\VideoDir"; //
let layout = "1x1"; //playMode
let enableHTTPS = 1; //HTTPS1
let encryptedFields = 'secret'; //secret
let showToolbar = 1; //0-0-
let showSmart = 1; //线0-0-
let buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,768,769"; //
let toolBarButtonIDs = "2048,2304,2305,2306,2307,2308,2309,4096,4097,4098,4099,4608,4609"
////////////////////////////////// ////////////////////////////////////
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: buttonIDs, //
toolBarButtonIDs:toolBarButtonIDs //
})
}).then(() => {
oWebControl.JS_Resize( $('.map').width(), $('.map').height() - 60); // resizefirefoxDIV
//
this.refusePlay();
});
});
},
//
getPubKey(callback) {
oWebControl.JS_RequestInterface({
funcName: "getRSAPubKey",
argument: JSON.stringify({
keyLength: 1024
})
}).then((oData) => {
console.log(oData);
if (oData.responseMsg.data) {
pubKey = oData.responseMsg.data;
callback()
}
})
},
//RSA
setEncrypt(value) {
// eslint-disable-next-line no-undef
let encrypt = new JSEncrypt();
encrypt.setPublicKey(pubKey);
return encrypt.encrypt(value);
},
//
cbIntegrationCallBack(oData) {
// if (oData.responseMsg.msg.cameraIndexCode != '') {
// this.$router.push({name: 'playbackDetails', params: {id: oData.responseMsg.msg.cameraIndexCode}})
// }
this.showCBInfo(JSON.stringify(oData.responseMsg));
},
// JS_CuttingPartWindow
setWndCover() {
let iWidth = $('.map').width();
let iHeight = $('.map').height() - 60;
let oDivRect = $("#playWnd").get(0).getBoundingClientRect();
let iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left) : 0;
let iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top) : 0;
let iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
let iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
iCoverLeft = (iCoverLeft > 1200) ? 1200 : iCoverLeft;
iCoverTop = (iCoverTop > 600) ? 600 : iCoverTop;
iCoverRight = (iCoverRight > 1200) ? 1200 : iCoverRight;
iCoverBottom = (iCoverBottom > 600) ? 600 : iCoverBottom;
oWebControl.JS_RepairPartWindow(0, 0, $('.map').width(), $('.map').height() - 60); // 1
if (iCoverLeft != 0) {
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 600);
}
if (iCoverTop != 0) {
oWebControl.JS_CuttingPartWindow(0, 0, $('.map').width(), iCoverTop); //
}
if (iCoverRight != 0) {
oWebControl.JS_CuttingPartWindow($('.map').width() - iCoverRight, 0, iCoverRight, 600);
}
if (iCoverBottom != 0) {
oWebControl.JS_CuttingPartWindow(0, 600 - iCoverBottom, $('.map').width(), iCoverBottom);
}
},
//
// valueJS_RequestInterfacejsonargumentargument
requestInterface(value) {
this.isJSON(value);
let JsonParam = JSON.parse(value);
let JsonArgument = JsonParam.argument;
JsonParam.argument = JSON.stringify(JsonArgument);
oWebControl.JS_RequestInterface(JsonParam).then((oData) => {
this.showCBInfo(JSON.stringify(oData ? oData.responseMsg : ''));
});
},
//
showCBInfo(szInfo, type) {
if (type === 'error') {
szInfo = "<div style='color: red;'>" + this.dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
} else {
szInfo = "<div>" + this.dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "</div>";
}
$("#cbInfo").html(szInfo + $("#cbInfo").html());
},
// json
isJSON(str) {
if (typeof str == 'string') {
try {
let obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
this.showCBInfo("param is not the correct JSON message");
return false;
}
} catch (e) {
this.showCBInfo("param is not the correct JSON message");
return false;
}
}
},
//
dateFormat(oDate, fmt) {
let o = {
"M+": oDate.getMonth() + 1, //
"d+": oDate.getDate(), //
"h+": oDate.getHours(), //
"m+": oDate.getMinutes(), //
"s+": oDate.getSeconds(), //
"q+": Math.floor((oDate.getMonth() + 3) / 3), //
"S": oDate.getMilliseconds()//
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (let k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
},
//
downloadFile() {
var a = document.createElement('a')
// var blob = new Blob([content])
// var url = window.URL.createObjectURL(blob)
a.href = '控件下载地址'
a.download = '视频插件'
a.click()
// window.URL.revokeObjectURL(url)
},
watch: {
width: {
handler(val) {
this.iWidth = val;
if (this.isInitComolete) {
this.setRate();
this.setResize(this.iWidth, this.iHeight);
}
},
immediate: true,
},
height: {
handler(val) {
this.iHeight = val;
if (this.isInitComolete) {
this.setRate();
this.setResize(this.iWidth, this.iHeight);
}
},
immediate: true,
},
playMode() {
this.reInit();
},
},
mounted() {
this.init();
this.handleWindEvent();
this.$nextTick(() => {
this.setRate();
});
},
beforeDestroy() {
if (this.oWebControl != null) {
this.oWebControl.JS_HideWnd(); //
this.oWebControl.JS_Disconnect().then(
function () {
//
},
function () {
//
}
);
}
},
methods: {
//
init() {
let argument = {
...this.options,
...this.argument,
};
if (this.playMode > -1 && this.playMode < 2) {
argument.playMode = this.playMode;
}
// eslint-disable-next-line no-undef
this.iWidth = Math.min(this.iWidth, $(window).width());
this.oWebControl = initPlugin(
"playWnd",
this.iWidth,
this.iHeight,
argument,
this.cbIntegrationCallBack,
() => {
this.setRate();
this.setResize(this.iWidth, this.iHeight);
this.isInitComolete = true;
this.$emit("initFinish");
},
() => {
if (this.downloadDialog) {
this.dialogVisible = true;
}
this.$emit("pluginError");
}
);
},
//
reInit() {
if (this.oWebControl) {
this.oWebControl
.JS_RequestInterface({
funcName: "uninit",
})
.then(() => {
this.init();
});
}
},
setRate() {
// eslint-disable-next-line no-undef
var iWidth = $(window).width();
this.rate = this.iWidth / iWidth;
},
//
handleWindEvent() {
// resize使DIV
// eslint-disable-next-line no-undef
if (this.autoResize) {
// eslint-disable-next-line no-undef
$(window).resize(() => {
if (this.oWebControl) {
// eslint-disable-next-line no-undef
var iWidth = $(window).width();
// eslint-disable-next-line no-undef
this.iWidth = iWidth * this.rate;
this.oWebControl.JS_Resize(this.iWidth, this.iHeight);
this.setWndCover();
}
});
}
// scroll使
// eslint-disable-next-line no-undef
$(window).scroll(() => {
if (this.oWebControl) {
this.oWebControl.JS_Resize(this.iWidth, this.iHeight);
this.setWndCover();
}
});
},
//
cbIntegrationCallBack(oData) {
if (oData?.responseMsg?.type) {
let data = oData.responseMsg;
switch (data.type) {
//
case 1:
if (this.curWindIndex !== data.msg.wndId) {
this.curWindIndex = data.msg.wndId;
this.$emit("windowChange", this.curWindIndex);
}
break;
//
case 6:
this.$emit("layoutChange", data.msg);
break;
}
}
},
// JS_CuttingPartWindow
setWndCover() {
// eslint-disable-next-line no-undef
var iWidth = $(window).width();
// eslint-disable-next-line no-undef
var iHeight = $(window).height();
// eslint-disable-next-line no-undef
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;
var iCoverTop = oDivRect.top < 0 ? Math.abs(oDivRect.top) : 0;
var iCoverRight =
oDivRect.right - iWidth > 0 ? Math.round(oDivRect.right - iWidth) : 0;
var iCoverBottom =
oDivRect.bottom - iHeight > 0
? Math.round(oDivRect.bottom - iHeight)
: 0;
iCoverLeft = iCoverLeft > this.iWidth ? this.iWidth : iCoverLeft;
iCoverTop = iCoverTop > this.iHeight ? this.iHeight : iCoverTop;
iCoverRight = iCoverRight > this.iWidth ? this.iWidth : iCoverRight;
iCoverBottom = iCoverBottom > this.iHeight ? this.iHeight : iCoverBottom;
this.oWebControl.JS_RepairPartWindow(
0,
0,
this.iWidth + 1,
this.iHeight + 1
); // 1
if (iCoverLeft != 0) {
this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, this.iHeight);
}
if (iCoverTop != 0) {
this.oWebControl.JS_CuttingPartWindow(
0,
0,
this.iWidth + 1,
iCoverTop + 1
); //
}
if (iCoverRight != 0) {
this.oWebControl.JS_CuttingPartWindow(
this.iWidth - iCoverRight,
0,
iCoverRight,
this.iHeight
);
}
if (iCoverBottom != 0) {
this.oWebControl.JS_CuttingPartWindow(
0,
this.iHeight - iCoverBottom,
this.iWidth,
iCoverBottom
);
}
},
/**
* @param {*} cameraIndexCode :获取输入的监控点编号值必填
* @param {*} argument:api参数,
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
*/
startPreview(cameraIndexCode, argument = {}) {
if (this.oWebControl) {
let params = {
cameraIndexCode: cameraIndexCode, //
streamMode: 0, //
transMode: 1, //
gpuMode: 1, //GPU
wndId: -1,
};
this.oWebControl
.JS_RequestInterface({
funcName: "startPreview",
argument: JSON.stringify({
...params,
...argument,
}),
})
.then(() => {});
}
},
//
stopAllPreview() {
this.oWebControl.JS_RequestInterface({
funcName: "stopAllPreview",
});
},
//()
/**
* idArr:播放窗口序号数组
*/
stopListPreview(idArr) {
let list = idArr.map((item) => {
return {
wndId: item,
};
});
this.oWebControl.JS_RequestInterface({
funcName: "stopMultiPlay",
argument: {
list,
},
});
},
/**
* @param {*} cameraIndexCode :获取输入的监控点编号值必填
* @param {*} startTime:开始时间
* @param {*} endTime:结束时间
* @param {*} recordLocation://0-1-
* @param {*} argument:api参数
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
*/
startPlayBack(
cameraIndexCode,
startTime,
endTime,
recordLocation = 0,
argument = {}
) {
var startTimeStamp = new Date(
startTime.replace("-", "/").replace("-", "/")
).getTime(); //
var endTimeStamp = new Date(
endTime.replace("-", "/").replace("-", "/")
).getTime(); //
// var recordLocation = 0; //0-1-
var transMode = 1; //0-UDP1-TCP
var gpuMode = 0; //GPU0-1-
var wndId = -1; //2x2
this.oWebControl.JS_RequestInterface({
funcName: "startPlayback",
argument: JSON.stringify({
cameraIndexCode: cameraIndexCode, //
startTimeStamp: Math.floor(startTimeStamp / 1000).toString(), //
endTimeStamp: Math.floor(endTimeStamp / 1000).toString(), //
recordLocation: recordLocation, //0-1-
transMode: transMode, //0-UDP1-TCP
gpuMode: gpuMode, //GPU0-1-
wndId: wndId, //
...argument,
}),
});
},
//
stopAllPlayBack() {
this.oWebControl.JS_RequestInterface({
funcName: "stopAllPlayback",
});
},
//
//latyou2x2
setLayout(layout) {
this.oWebControl.JS_RequestInterface({
funcName: " setLayout",
argument: {
layout,
},
});
},
/**
* @param {*} text :文字
* @param {*} x:相对播放窗口左上角的横坐标起点
* @param {*} y:相对播放窗口左上角的纵坐标起点
* @param {*} fontSize:字体大小
* @param {*} color:字体颜色默认白色
* @param {*} argument:api参数
* argument属性cameraIndexCode优先级高于函数参数cameraIndexCode
*/
drawText(
text,
x = 5,
y = 5,
fontSize = 20,
color = 16777215,
argument = {}
) {
this.oWebControl.JS_RequestInterface({
funcName: "drawOSD",
argument: {
text,
x,
y,
fontSize,
color,
...argument,
},
});
},
//
setFullScreen() {
this.oWebControl.JS_RequestInterface({
funcName: "setFullScreen",
});
},
//退
exitFullScreen() {
this.oWebControl.JS_RequestInterface({
funcName: "exitFullScreen",
});
},
//
snapShot(argument = {}) {
this.oWebControl.JS_RequestInterface({
funcName: "snapShot",
argument,
});
},
//
hideWindow() {
this.oWebControl.JS_HideWnd();
},
//
showWindow() {
this.oWebControl.JS_ShowWnd();
},
//
setResize(width, height) {
this.oWebControl.JS_Resize(width, height);
this.setWndCover();
},
//
handleDownloadExe() {
this.dialogVisible = false;
if (this.downloadUrl) {
this.downloadFile(this.downloadUrl);
} else {
console.log("下载地址为空");
}
this.$emit("clickDownload");
},
//
downloadFile(url, fileName = "") {
const a = document.createElement("a");
a.style.display = "none";
if (fileName) {
a.setAttribute("download", fileName);
}
a.setAttribute("href", url);
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(a.href);
document.body.removeChild(a);
},
},
};
</script>
<style scoped>
</style>

View File

@ -363,28 +363,6 @@ export default {
},
getList() {
var params = {
pageNo: 1,
pageSize: 9999,
};
axios({
url: "https://190.168.2.104:8077/artemis/api/resource/v1/cameras",
method: "post",
data: params, //data;
headers: {
//
"Content-Type": "application/json",
},
})
.then((res) => {
console.log(res);
})
.catch((error) => {
if (error) {
throw error;
}
});
// listWorkorder(this.queryParams).then((response) => {
// this.workorderList = response.data;
// });

View File

@ -381,7 +381,7 @@
</el-col>
<el-col
:span="12"
v-if="this.form.code == 'CNC' || this.form.code == 'ROBOT'"
v-if="this.form.code == 'CNC'"
>
<el-form-item label="安全门状态" prop="securityDoor">
<el-radio-group v-model="form.securityDoor">
@ -548,9 +548,6 @@ export default {
nextProcessId: [
{ required: true, message: "工序ID不能为空", trigger: "blur" },
],
machineryTypeId: [
{ required: true, message: "设备类型不能为空", trigger: "blur" },
],
keyFlag: [
{
required: true,