修改看板

IOT
夜笙歌 1 year ago
parent 23cc2e63b3
commit 0d94fbb97a

@ -5485,7 +5485,7 @@
try { try {
p = false; p = false;
f.send(a, u) f.send(a, u)
console.log('5488',a,u) console.log('5488', a, u)
} catch (e) { } catch (e) {
if (p) { if (p) {
throw e throw e
@ -5734,7 +5734,7 @@
o = o("abort"); o = o("abort");
try { try {
n.send(r.hasContent && r.data || null) n.send(r.hasContent && r.data || null)
console.log('5737',(r.hasContent && r.data || null)) console.log('5737', (r.hasContent && r.data || null))
} catch (e) { } catch (e) {
if (o) { if (o) {
throw e throw e
@ -6238,12 +6238,18 @@
g = w[S].szId g = w[S].szId
} }
var u = '<div class="parent-wnd" style="overflow:hidden;width:100%; height:100%; position: relative;">'; var u = '<div class="parent-wnd" style="overflow:hidden;width:100%; height:100%; position: relative;">';
for (var f = 0; f < 1; f++) { for (var f = 0; f < w[_]; f++) {
e = r + (f % l === l - 1 ? i : 0); e = r + (f % l === l - 1 ? i : 0);
t = o + (f + l >= Math.pow(l, 2) ? n : 0); t = o + (f + l >= Math.pow(l, 2) ? n : 0);
var h = a + (f % l === l - 1 ? i : 0); var h = a + (f % l === l - 1 ? i : 0);
var c = s + (f + l >= Math.pow(l, 2) ? n : 0); var c = s + (f + l >= Math.pow(l, 2) ? n : 0);
if (f === 1) {
u += '<div style="float:left; background-color: ' + w[S].oStyle.background + "; position: absolute;top:0;left:-100%; width: " + h + "px; height: " + c + 'px;">' + '<canvas id="canvas' + f + '" class="play-window" wid="' + f + '" width="' + h + '" height="' + c + '"></canvas>' + (f === 0 ? '<img style="display:none;" id="playImg' + f + '" src="">' : "") + '<canvas id="canvas_draw' + f + '" class="draw-window" style="border:1px solid ' + w[S].oStyle.border + ';position:absolute; top:0; left:0;" wid="' + f + '" width=' + e + " height=" + t + "></canvas>" + "</div>"
} else {
u += '<div style="float:left; background-color: ' + w[S].oStyle.background + "; position: relative; width: " + h + "px; height: " + c + 'px;">' + '<canvas id="canvas' + f + '" class="play-window" wid="' + f + '" width="' + h + '" height="' + c + '"></canvas>' + (f === 0 ? '<img style="display:none;" id="playImg' + f + '" src="">' : "") + '<canvas id="canvas_draw' + f + '" class="draw-window" style="border:1px solid ' + w[S].oStyle.border + ';position:absolute; top:0; left:0;" wid="' + f + '" width=' + e + " height=" + t + "></canvas>" + "</div>" u += '<div style="float:left; background-color: ' + w[S].oStyle.background + "; position: relative; width: " + h + "px; height: " + c + 'px;">' + '<canvas id="canvas' + f + '" class="play-window" wid="' + f + '" width="' + h + '" height="' + c + '"></canvas>' + (f === 0 ? '<img style="display:none;" id="playImg' + f + '" src="">' : "") + '<canvas id="canvas_draw' + f + '" class="draw-window" style="border:1px solid ' + w[S].oStyle.border + ';position:absolute; top:0; left:0;" wid="' + f + '" width=' + e + " height=" + t + "></canvas>" + "</div>"
}
} }
u += "</div>"; u += "</div>";
g.html(u); g.html(u);
@ -6343,6 +6349,9 @@
}() }()
} }
setTimeout(()=>{
w.EventCallback.windowEventSelect(1)
},1000)
function L() { function L() {
e(); e();
g.find(".parent-wnd").eq(0).children().each(function (n) { g.find(".parent-wnd").eq(0).children().each(function (n) {
@ -8162,7 +8171,7 @@
a.open("put", t, false); a.open("put", t, false);
a.setRequestHeader("Content-Type", r); a.setRequestHeader("Content-Type", r);
a.send(w[D]); a.send(w[D]);
console.log('8165',(w[D])) console.log('8165', (w[D]))
return o return o
} }
}, { }, {
@ -8175,7 +8184,7 @@
}; };
i.open("put", t, true); i.open("put", t, true);
i.send(w[D]); i.send(w[D]);
console.log('8178',(w[D])) console.log('8178', (w[D]))
return 0 return 0
} }
}, { }, {
@ -8220,7 +8229,7 @@
}; };
n.open("put", r, true); n.open("put", r, true);
n.send(w[D]); n.send(w[D]);
console.log('8222',(w[D])) console.log('8222', (w[D]))
w[R] = o; w[R] = o;
setTimeout(function () { setTimeout(function () {
t() t()
@ -8248,7 +8257,7 @@
}; };
i.open("get", w[R], false); i.open("get", w[R], false);
i.send(null); i.send(null);
console.log('8251',(null)) console.log('8251', (null))
if (w[M] === 100) { if (w[M] === 100) {
return 100 return 100
} }
@ -8542,7 +8551,8 @@
} }
} }
n(e, [{ key: "openStream", value: function e(t, p, v, i) { n(e, [{
key: "openStream", value: function e(t, p, v, i) {
var n = false; var n = false;
if (t.indexOf("[") > -1) { if (t.indexOf("[") > -1) {
n = true n = true
@ -8726,7 +8736,7 @@
} }
} }
o[C][a].socket.send(i); o[C][a].socket.send(i);
console.log('8730',(i)) console.log('8730', (i))
if (o[T] === "0.1") { if (o[T] === "0.1") {
e() e()
} }
@ -8750,7 +8760,7 @@
if (l[T] === "0.1") { if (l[T] === "0.1") {
var r = h.playRateCmd(s); var r = h.playRateCmd(s);
l[C][i].socket.send(r); l[C][i].socket.send(r);
console.log('8754',(r)) console.log('8754', (r))
e(); e();
break break
} else { } else {
@ -8758,7 +8768,7 @@
l[C][i].reject = t; l[C][i].reject = t;
var o = D.playRateCmd(s); var o = D.playRateCmd(s);
l[C][i].socket.send(o) l[C][i].socket.send(o)
console.log('8762',(o)) console.log('8762', (o))
} }
} }
} }
@ -8775,7 +8785,7 @@
l[C][i].reject = t; l[C][i].reject = t;
var r = M.seekCmd(a, s); var r = M.seekCmd(a, s);
l[C][i].socket.send(r) l[C][i].socket.send(r)
console.log('8779',(r)) console.log('8779', (r))
} }
} }
}); });
@ -8790,7 +8800,7 @@
if (s[T] === "0.1") { if (s[T] === "0.1") {
var r = h.pauseCmd(); var r = h.pauseCmd();
s[C][i].socket.send(r); s[C][i].socket.send(r);
console.log('8794',(r)) console.log('8794', (r))
e(); e();
break break
} else { } else {
@ -8798,7 +8808,7 @@
s[C][i].reject = t; s[C][i].reject = t;
var o = D.pauseCmd(); var o = D.pauseCmd();
s[C][i].socket.send(o) s[C][i].socket.send(o)
console.log('8802',(0)) console.log('8802', (0))
} }
} }
} }
@ -8814,7 +8824,7 @@
a[C][i].resolve = e; a[C][i].resolve = e;
a[C][i].reject = t; a[C][i].reject = t;
a[C][i].socket.send(o) a[C][i].socket.send(o)
console.log('8818',(o)) console.log('8818', (o))
} }
} }
}); });
@ -8829,7 +8839,7 @@
if (s[T] === "0.1") { if (s[T] === "0.1") {
var r = h.resumeCmd(); var r = h.resumeCmd();
s[C][i].socket.send(r); s[C][i].socket.send(r);
console.log('8833',(r)) console.log('8833', (r))
e(); e();
break break
} else { } else {
@ -8837,7 +8847,7 @@
s[C][i].reject = t; s[C][i].reject = t;
var o = D.resumeCmd(); var o = D.resumeCmd();
s[C][i].socket.send(o) s[C][i].socket.send(o)
console.log('8841',(o)) console.log('8841', (o))
} }
} }
} }

@ -1,39 +1,42 @@
<template> <template>
<div> <div>
<div id="monitorId1" class="plugin"></div> <div class="aaa">
<div id="monitorId2" class="plugin"></div> <el-button @click="aaaa" type="primary">主要按钮</el-button>
</div>
<div id="divPlugin" class="plugin"></div>
</div> </div>
</template> </template>
<script> <script>
var g_iWndIndex = 0;
export default { export default {
data() { data() {
return {} return {}
}, },
props:['iChannelID','monitorId'], props: ['iChannelID', 'monitorId'],
async mounted() { async mounted() {
window.WebVideoCtrl1 = window.WebVideoCtrl const vw = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) / 100
const vh = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) / 100
await this.$nextTick() await this.$nextTick()
const _this = this const _this = this
var g_iWndIndex = 0;
$(function () { $(function () {
// //
var iRet = window.WebVideoCtrl1.I_CheckPluginInstall(); var iRet = WebVideoCtrl.I_CheckPluginInstall();
if (-1 == iRet) { if (-1 == iRet) {
alert("未安装插件"); alert("未安装插件");
return; return;
} }
// //
WebVideoCtrl.I_InitPlugin(500, 300, { WebVideoCtrl.I_InitPlugin(27.3 * vw, 23.5 * vh, {
bWndFull: true, // true: false: bWndFull: true, // true: false:
iPackageType: 2, iPackageType: 2,
iWndowType: 1, iWndowType: 1,
bNoPlugin: true, bNoPlugin: true,
cbSelWnd: function (xmlDoc) { cbSelWnd: function (xmlDoc) {
console.log(xmlDoc) g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
}, },
cbDoubleClickWnd: function (iWndIndex, bFullScreen) { cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
console.log(iWndIndex, bFullScreen) console.log(iWndIndex, bFullScreen)
@ -44,34 +47,9 @@ export default {
console.log("关闭远程配置库!"); console.log("关闭远程配置库!");
}, },
cbInitPluginComplete: function () { cbInitPluginComplete: function () {
WebVideoCtrl1.I_InsertOBJECTPlugin('monitorId1'); WebVideoCtrl.I_InsertOBJECTPlugin('divPlugin');
// //
if (-1 == WebVideoCtrl1.I_CheckPluginVersion()) { if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
alert("检测到新的插件版本");
return;
}
}
});
WebVideoCtrl1.I_InitPlugin(500, 300, {
bWndFull: true, // true: false:
iPackageType: 2,
iWndowType: 1,
bNoPlugin: true,
cbSelWnd: function (xmlDoc) {
console.log(xmlDoc)
},
cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
console.log(iWndIndex, bFullScreen)
},
cbEvent: function (iEventType, iParam1, iParam2) {
},
cbRemoteConfig: function () {
console.log("关闭远程配置库!");
},
cbInitPluginComplete: function () {
WebVideoCtrl1.I_InsertOBJECTPlugin('monitorId2');
//
if (-1 == WebVideoCtrl1.I_CheckPluginVersion()) {
alert("检测到新的插件版本"); alert("检测到新的插件版本");
return; return;
} }
@ -80,6 +58,7 @@ export default {
}); });
// //
function clickLogin() { function clickLogin() {
var szIP = '192.168.2.64', var szIP = '192.168.2.64',
@ -92,17 +71,17 @@ export default {
} }
let iRet = WebVideoCtrl1.I_Login(szIP, 1, szPort, szUsername, szPassword, { let iRet = WebVideoCtrl.I_Login(szIP, 1, szPort, szUsername, szPassword, {
success: function (xmlDoc) { success: function (xmlDoc) {
setTimeout(function () { setTimeout(function () {
getChannelInfo(); getChannelInfo();
getDevicePort(); getDevicePort();
getChannelInfo1(); setTimeout(() => {
getDevicePort1();
setTimeout(()=>{
clickStartRealPlay() clickStartRealPlay()
}, 500)
setTimeout(() => {
clickStartRealPlay1() clickStartRealPlay1()
},2000) }, 1500)
}, 10); }, 10);
}, },
error: function (status, xmlDoc) { error: function (status, xmlDoc) {
@ -119,18 +98,6 @@ export default {
var szDeviceIdentify = '192.168.2.64'; var szDeviceIdentify = '192.168.2.64';
var oPort = WebVideoCtrl1.I_GetDevicePort(szDeviceIdentify);
if (oPort != null) {
console.log(szDeviceIdentify + " 获取端口成功!");
} else {
console.log(szDeviceIdentify + " 获取端口失败!");
}
}
function getDevicePort1() {
var szDeviceIdentify = '192.168.2.64';
var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify); var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify);
if (oPort != null) { if (oPort != null) {
@ -144,41 +111,10 @@ export default {
var szDeviceIdentify = '192.168.2.64' var szDeviceIdentify = '192.168.2.64'
//
WebVideoCtrl1.I_GetAnalogChannelInfo(szDeviceIdentify, {
async: false,
success: function (xmlDoc) {
var oChannels = $(xmlDoc).find("VideoInputChannel");
$.each(oChannels, function (i) {
var id = $(this).find("id").eq(0).text(),
name = $(this).find("name").eq(0).text();
if ("" == name) {
name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
}
});
},
error: function (status, xmlDoc) {
}
});
}
function getChannelInfo1() {
var szDeviceIdentify = '192.168.2.64'
// //
WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, { WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
async: false, async: false,
success: function (xmlDoc) { success: function (xmlDoc) {
var oChannels = $(xmlDoc).find("VideoInputChannel");
$.each(oChannels, function (i) {
var id = $(this).find("id").eq(0).text(),
name = $(this).find("name").eq(0).text();
if ("" == name) {
name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
}
});
}, },
error: function (status, xmlDoc) { error: function (status, xmlDoc) {
} }
@ -188,7 +124,7 @@ export default {
// //
function clickStartRealPlay(iStreamType) { function clickStartRealPlay(iStreamType) {
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), var oWndInfo = WebVideoCtrl.I_GetWindowStatus(0),
szDeviceIdentify = '192.168.2.64', szDeviceIdentify = '192.168.2.64',
iRtspPort = 554, iRtspPort = 554,
iChannelID = 1, iChannelID = 1,
@ -198,13 +134,13 @@ export default {
iStreamType = 1; iStreamType = 1;
var startRealPlay = function () { var startRealPlay = function () {
WebVideoCtrl1.I_StartRealPlay(szDeviceIdentify, { WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
iRtspPort: iRtspPort, iRtspPort: iRtspPort,
iStreamType: iStreamType, iStreamType: iStreamType,
iChannelID: iChannelID, iChannelID: iChannelID,
bZeroChannel: bZeroChannel, bZeroChannel: bZeroChannel,
success: function () { success: function () {
szInfo = "开始预览成功"; szInfo = "开始预览成功1";
console.log(szDeviceIdentify + " " + szInfo); console.log(szDeviceIdentify + " " + szInfo);
}, },
@ -220,7 +156,7 @@ export default {
}; };
if (oWndInfo != null) {// if (oWndInfo != null) {//
WebVideoCtrl1.I_Stop({ WebVideoCtrl.I_Stop({
success: function () { success: function () {
startRealPlay(); startRealPlay();
} }
@ -229,8 +165,9 @@ export default {
startRealPlay(); startRealPlay();
} }
} }
function clickStartRealPlay1(iStreamType) { function clickStartRealPlay1(iStreamType) {
var oWndInfo = WebVideoCtrl1.I_GetWindowStatus(g_iWndIndex), var oWndInfo = WebVideoCtrl.I_GetWindowStatus(1),
szDeviceIdentify = '192.168.2.64', szDeviceIdentify = '192.168.2.64',
iRtspPort = 554, iRtspPort = 554,
iChannelID = 2, iChannelID = 2,
@ -240,13 +177,13 @@ export default {
iStreamType = 1; iStreamType = 1;
var startRealPlay = function () { var startRealPlay = function () {
WebVideoCtrl1.I_StartRealPlay(szDeviceIdentify, { WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
iRtspPort: iRtspPort, iRtspPort: iRtspPort,
iStreamType: iStreamType, iStreamType: iStreamType,
iChannelID: iChannelID, iChannelID: iChannelID,
bZeroChannel: bZeroChannel, bZeroChannel: bZeroChannel,
success: function () { success: function () {
szInfo = "开始预览成功"; szInfo = "开始预览成功2";
console.log(szDeviceIdentify + " " + szInfo); console.log(szDeviceIdentify + " " + szInfo);
}, },
@ -262,7 +199,7 @@ export default {
}; };
if (oWndInfo != null) {// if (oWndInfo != null) {//
WebVideoCtrl1.I_Stop({ WebVideoCtrl.I_Stop({
success: function () { success: function () {
startRealPlay(); startRealPlay();
} }
@ -272,13 +209,70 @@ export default {
} }
} }
setTimeout(()=>{ setTimeout(() => {
clickLogin() clickLogin()
},1000) }, 1000)
}, },
methods: { methods: {
aaaa() {
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
szDeviceIdentify = '192.168.2.64',
iRtspPort = 554,
iChannelID = Math.random() > 0.5 ? 1 : 2,
bZeroChannel = false,
szInfo = "";
let iStreamType = 1;
var startRealPlay = function () {
WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
iRtspPort: iRtspPort,
iStreamType: iStreamType,
iChannelID: iChannelID,
bZeroChannel: bZeroChannel,
success: function () {
szInfo = "开始预览成功1";
console.log(szDeviceIdentify + " " + szInfo);
},
error: function (status, xmlDoc) {
if (403 === status) {
szInfo = "设备不支持Websocket取流";
} else {
szInfo = "开始预览失败!";
}
console.log(szDeviceIdentify + " " + szInfo);
}
});
};
if (oWndInfo != null) {//
WebVideoCtrl.I_Stop({
success: function () {
startRealPlay();
}
});
} else {
startRealPlay();
}
}
} }
} }
</script> </script>
<style> <style scoped>
.plugin {
width: 27.3vw;
height: 23.5vh;
}
.aaa {
position: absolute;
top: -20%;
left: 10%;
}
/deep/ .parent-wnd{
overflow: unset !important;
overflow-y: clip !important;
}
</style> </style>

Loading…
Cancel
Save