From 6564593ef44090cca74582d7b32ac979c262b908 Mon Sep 17 00:00:00 2001 From: 艺术家 <10819716+q100102@user.noreply.gitee.com> Date: 星期六, 24 五月 2025 23:53:34 +0800 Subject: [PATCH] 优化 --- 项目代码/伸缩杆/client/src/views/tts/PickAndDrop/Manualcontrol.vue | 150 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 148 insertions(+), 2 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/Manualcontrol.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/Manualcontrol.vue" index 93d1536..fc310a1 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/Manualcontrol.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/Manualcontrol.vue" @@ -492,7 +492,16 @@ <span style="color: #fff; font-size: 1.25rem; font-weight: bold" >瑙嗛鐩戞帶鍙充晶</span > - <img src="@/assets/imgs/left.png" alt="" /> + <div + id="playWnd" + class="playWnd" + style="left: 109px; top: 133px" + ></div> + <!-- <iframe + src="http://192.168.2.168/doc/pageview.asp" + id="childFrame" + style="height: 100%" + ></iframe> --> </div> </div> </div> @@ -509,7 +518,7 @@ AutoPickAndDrop, Pouse, } from "@/api/newapi/Parameters.js"; - +// import { WebVideoCtrl } from "@/assets/webControl/webVideoCtrl.js"; const router = useRouter(); const isMobile = ref(false); const Position = ref({ @@ -584,7 +593,144 @@ } }); }; +// const WebVideoCtrl = new WebControl(); +// 鍒涘缓鎾斁瀹炰緥 +function initPlugin() { + console.log("initPlugin",new WebControl()); + + oWebControl = new WebControl({ + szPluginContainer: "playWnd", // 鎸囧畾瀹瑰櫒id + iServicePortStart: 15900, // 鎸囧畾璧锋绔彛鍙凤紝寤鸿浣跨敤璇ュ�� + iServicePortEnd: 15900, + szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 鐢ㄤ簬IE10浣跨敤ActiveX鐨刢lsid + cbConnectSuccess: function () { + // 鍒涘缓WebControl瀹炰緥鎴愬姛 + oWebControl + .JS_StartService("window", { + // WebControl瀹炰緥鍒涘缓鎴愬姛鍚庨渶瑕佸惎鍔ㄦ湇鍔� + dllPath: "./VideoPluginConnect.dll", // 鍊�"./VideoPluginConnect.dll"鍐欐 + }) + .then( + function () { + // 鍚姩鎻掍欢鏈嶅姟鎴愬姛 + oWebControl.JS_SetWindowControlCallback({ + // 璁剧疆娑堟伅鍥炶皟 + cbIntegrationCallBack: cbIntegrationCallBack, + }); + + oWebControl.JS_CreateWnd("playWnd", 1000, 600).then(function () { + //JS_CreateWnd鍒涘缓瑙嗛鎾斁绐楀彛锛屽楂樺彲璁惧畾 + init(); // 鍒涘缓鎾斁瀹炰緥鎴愬姛鍚庡垵濮嬪寲 + }); + }, + function () { + // 鍚姩鎻掍欢鏈嶅姟澶辫触 + } + ); + }, + cbConnectError: function () { + // 鍒涘缓WebControl瀹炰緥澶辫触 + oWebControl = null; + $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��..."); + WebControl.JS_WakeUp("VideoWebPlugin://"); // 绋嬪簭鏈惎鍔ㄦ椂鎵цerror鍑芥暟锛岄噰鐢╳akeup鏉ュ惎鍔ㄧ▼搴� + initCount++; + if (initCount < 3) { + setTimeout(function () { + initPlugin(); + }, 3000); + } else { + $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒"); + } + }, + cbConnectClose: function (bNormalClose) { + // 寮傚父鏂紑锛歜NormalClose = false + // JS_Disconnect姝e父鏂紑锛歜NormalClose = true + console.log("cbConnectClose"); + oWebControl = null; + $("#playWnd").html("鎻掍欢鏈惎鍔紝姝e湪灏濊瘯鍚姩锛岃绋嶅��..."); + WebControl.JS_WakeUp("VideoWebPlugin://"); + initCount++; + if (initCount < 3) { + setTimeout(function () { + initPlugin(); + }, 3000); + } else { + $("#playWnd").html("鎻掍欢鍚姩澶辫触锛岃妫�鏌ユ彃浠舵槸鍚﹀畨瑁咃紒"); + } + }, + }); + +} + +// const initWebVideoCtrl = () => { +// if (!WebVideoCtrl) { +// console.error("WebControl 鏈纭姞杞斤紝璇锋鏌ョ浉鍏宠剼鏈��"); +// ElMessage.error("WebControl 鏈纭姞杞斤紝璇锋鏌ョ浉鍏宠剼鏈��"); +// return; +// } + +// try { +// // 鍒濆鍖栨彃浠� +// WebVideoCtrl.I_InitPlugin(800, 600, { +// bWndFull: true, // 鏄惁鏀寔鍗曠獥鍙e叏灞� +// iPackageType: 2, // 2 琛ㄧず HLS 鍗忚 +// }); +// // 鎻掑叆鎻掍欢鍒版寚瀹� DOM 鍏冪礌 +// WebVideoCtrl.I_InsertOBJECTPlugin("videoDiv"); + +// // 璁惧淇℃伅 +// const deviceInfo = { +// sIP: "192.168.2.168", // 璁惧 IP 鍦板潃 +// iPort: 80, // 璁惧绔彛鍙� +// sUsername: "admin", // 鐢ㄦ埛鍚� +// sPassword: "123456", // 瀵嗙爜 +// }; + +// // 璋冪敤鐧诲綍璁惧鍑芥暟 +// loginDevice(deviceInfo); +// } catch (error) { +// console.error("鍒濆鍖� WebVideoCtrl 鎻掍欢鏃跺嚭閿�:", error); +// ElMessage.error("鍒濆鍖� WebVideoCtrl 鎻掍欢鏃跺嚭閿欙紝璇锋鏌ラ厤缃��"); +// } +// }; + +// 鐧诲綍璁惧 +// const loginDevice = (deviceInfo) => { +// WebVideoCtrl.I_Login( +// deviceInfo.sIP, +// 1, +// deviceInfo.iPort, +// deviceInfo.sUsername, +// deviceInfo.sPassword, +// { +// success: () => { +// console.log("鐧诲綍鎴愬姛"); +// ElMessage.success("璁惧鐧诲綍鎴愬姛"); +// // 寮�濮嬮瑙� +// startRealPlay(); +// }, +// error: () => { +// console.error("鐧诲綍澶辫触锛岃妫�鏌ヨ澶囦俊鎭拰缃戠粶杩炴帴銆�"); +// ElMessage.error("璁惧鐧诲綍澶辫触锛岃妫�鏌ヨ澶囦俊鎭拰缃戠粶杩炴帴銆�"); +// }, +// } +// ); +// }; +// // 寮�濮嬪疄鏃堕瑙堝嚱鏁� +// const startRealPlay = () => { +// try { +// WebVideoCtrl.I_StartRealPlay(1, { +// iStreamType: 0, // 涓荤爜娴� +// }); +// console.log("寮�濮嬪疄鏃堕瑙�"); +// } catch (error) { +// console.error("寮�濮嬪疄鏃堕瑙堟椂鍑洪敊:", error); +// ElMessage.error("寮�濮嬪疄鏃堕瑙堟椂鍑洪敊锛岃妫�鏌ヨ澶囩姸鎬併��"); +// } +// }; onMounted(() => { + initPlugin(); + // initWebVideoCtrl(); // 鐩戝惉绐楀彛澶у皬鍙樺寲 window.addEventListener("resize", () => { nextTick(() => { -- Gitblit v1.9.3