| | |
| | | <template> |
| | | <div class="Manualcontrol"> |
| | | <div class="button"> |
| | | <div class="button_l"> |
| | | <el-button |
| | | @click="handleAutoPickAndDrop('伸åº')" |
| | | type="primary" |
| | | size="small" |
| | | style=" |
| | | width: 14.69rem; |
| | | height: 5.06rem; |
| | | color: rgba(64, 253, 240, 1); |
| | | background-color: rgba(6, 229, 231, 0.3); |
| | | border: none; |
| | | border-top: 0.25rem solid rgba(6, 229, 231, 1); |
| | | " |
| | | > |
| | | <div class="btnicon"> |
| | | <span |
| | | style=" |
| | | width: 1rem; |
| | | height: 1rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 50% 50%; |
| | | border: 0.1rem solid rgb(0, 0, 0); |
| | | color: rgb(0, 0, 0); |
| | | font-size: 0.75rem; |
| | | margin-left: 0.1rem; |
| | | " |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">å®ä½ä¼¸æé®</span> |
| | | </el-button> |
| | | <el-button |
| | | @click="handleAutoPickAndDrop('缩å')" |
| | | type="primary" |
| | | size="small" |
| | | style=" |
| | | width: 14.69rem; |
| | | height: 5.06rem; |
| | | color: rgba(64, 253, 240, 1); |
| | | background-color: rgba(6, 229, 231, 0.3); |
| | | border: none; |
| | | border-top: 0.25rem solid rgba(6, 229, 231, 1); |
| | | " |
| | | > |
| | | <div class="btnicon"> |
| | | <span |
| | | style=" |
| | | width: 1rem; |
| | | height: 1rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 50% 50%; |
| | | border: 0.1rem solid rgb(0, 0, 0); |
| | | color: rgb(0, 0, 0); |
| | | font-size: 0.75rem; |
| | | margin-left: 0.1rem; |
| | | " |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">å®ä½ç¼©æé®</span> |
| | | </el-button> |
| | | <el-button |
| | | @click="handlePouse" |
| | | type="primary" |
| | | size="small" |
| | | style=" |
| | | width: 14.69rem; |
| | | height: 5.06rem; |
| | | color: rgba(64, 253, 240, 1); |
| | | background-color: rgba(6, 229, 231, 0.3); |
| | | border: none; |
| | | border-top: 0.25rem solid rgba(6, 229, 231, 1); |
| | | " |
| | | > |
| | | <div class="btnicon"> |
| | | <span |
| | | style=" |
| | | width: 1rem; |
| | | height: 1rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 50% 50%; |
| | | border: 0.1rem solid rgb(0, 0, 0); |
| | | color: rgb(0, 0, 0); |
| | | font-size: 0.75rem; |
| | | margin-left: 0.1rem; |
| | | " |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">æå</span> |
| | | </el-button> |
| | | </div> |
| | | <el-button |
| | | @click="jumpRouter('/PickAndDrop')" |
| | | class="btn" |
| | |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">缩å</span> |
| | | </el-button> |
| | | <div style="color: #fff; font-size: 2rem; margin-left: 15rem"> |
| | | å³ä¾§ä¼¸ç¼©æ |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="operate"> |
| | |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">缩å</span> |
| | | </el-button> |
| | | <div style="color: #fff; font-size: 2rem; margin-left: 15rem"> |
| | | 左侧伸缩æ |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="operate"> |
| | |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">伸åº</span> |
| | | <span style="font-size: 2.25rem; text-align: center">ç¹å¨ä¼¸</span> |
| | | </el-button> |
| | | <el-button |
| | | @click="handManualOperation('å·¦', '缩å')" |
| | |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">缩å</span> |
| | | <span style="font-size: 2.25rem; text-align: center">ç¹å¨ç¼©</span> |
| | | </el-button> |
| | | </div> |
| | | <div style="color: #fff; font-size: 2rem; margin-left: 20rem"> |
| | | 左侧伸缩æ |
| | | </div> |
| | | <div style="color: #fff; font-size: 2rem">左侧伸缩æ</div> |
| | | <span style="color: #fff; font-size: 2rem" |
| | | >å½å伸缩æä½ç½®ï¼{{ Position.right }}</span |
| | | > |
| | | </div> |
| | | <div class="operate"> |
| | | <div class="item">伸å°ä½</div> |
| | |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">伸åº</span> |
| | | <span style="font-size: 2.25rem; text-align: center">ç¹å¨ä¼¸</span> |
| | | </el-button> |
| | | <el-button |
| | | @click="handManualOperation('å³', '缩å')" |
| | |
| | | >i</span |
| | | > |
| | | </div> |
| | | <span style="font-size: 2.25rem; text-align: center">缩å</span> |
| | | <span style="font-size: 2.25rem; text-align: center">ç¹å¨ç¼©</span> |
| | | </el-button> |
| | | </div> |
| | | <div style="color: #fff; font-size: 2rem; margin-left: 20rem"> |
| | | å³ä¾§ä¼¸ç¼©æ |
| | | </div> |
| | | <div style="color: #fff; font-size: 2rem">å³ä¾§ä¼¸ç¼©æ</div> |
| | | <span style="color: #fff; font-size: 2rem" |
| | | >å½å伸缩æä½ç½®ï¼{{ Position.right }}</span |
| | | > |
| | | </div> |
| | | <div class="operate"> |
| | | <div class="item">伸å°ä½</div> |
| | |
| | | <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> |
| | |
| | | import { ref, onMounted, nextTick } from "vue"; |
| | | import { useRouter } from "vue-router"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { ManualOperation } from "@/api/newapi/Parameters.js"; |
| | | |
| | | import { |
| | | ManualOperation, |
| | | GetPosition, |
| | | AutoPickAndDrop, |
| | | Pouse, |
| | | } from "@/api/newapi/Parameters.js"; |
| | | // import { WebVideoCtrl } from "@/assets/webControl/webVideoCtrl.js"; |
| | | const router = useRouter(); |
| | | const isMobile = ref(false); |
| | | const Position = ref({ |
| | | left: 0, |
| | | right: 0, |
| | | }); |
| | | |
| | | const jumpRouter = (path) => { |
| | | router.push(path); |
| | | }; |
| | |
| | | |
| | | console.log(res); |
| | | }; |
| | | const handleAutoPickAndDrop = async (val) => { |
| | | try { |
| | | const response = await AutoPickAndDrop({ |
| | | ExtendedState: val, |
| | | }); |
| | | if (response.code === 0) { |
| | | ElMessage.success(`${val}æå`); |
| | | } else { |
| | | ElMessage.error(`${val}失败`); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | ElMessage.error("æä½å¤±è´¥"); |
| | | } |
| | | }; |
| | | const handlePouse = async () => { |
| | | try { |
| | | const response = await Pouse(); |
| | | if (response.code === 0) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | ElMessage.error(error); |
| | | } |
| | | }; |
| | | |
| | | //è·åå½åä½ç½® |
| | | const getPosition = () => { |
| | | GetPosition().then((res) => { |
| | | if (res.code == 0) { |
| | | Position.value.left = res.data.left; |
| | | Position.value.right = res.data.right; |
| | | } |
| | | }); |
| | | }; |
| | | // 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çclsid |
| | | 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("æä»¶æªå¯å¨ï¼æ£å¨å°è¯å¯å¨ï¼è¯·ç¨å..."); |
| | | WebControl.JS_WakeUp("VideoWebPlugin://"); // ç¨åºæªå¯å¨æ¶æ§è¡error彿°ï¼éç¨wakeupæ¥å¯å¨ç¨åº |
| | | initCount++; |
| | | if (initCount < 3) { |
| | | setTimeout(function () { |
| | | initPlugin(); |
| | | }, 3000); |
| | | } else { |
| | | $("#playWnd").html("æä»¶å¯å¨å¤±è´¥ï¼è¯·æ£æ¥æä»¶æ¯å¦å®è£
ï¼"); |
| | | } |
| | | }, |
| | | cbConnectClose: function (bNormalClose) { |
| | | // å¼å¸¸æå¼ï¼bNormalClose = false |
| | | // JS_Disconnectæ£å¸¸æå¼ï¼bNormalClose = true |
| | | console.log("cbConnectClose"); |
| | | oWebControl = null; |
| | | $("#playWnd").html("æä»¶æªå¯å¨ï¼æ£å¨å°è¯å¯å¨ï¼è¯·ç¨å..."); |
| | | 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, // æ¯å¦æ¯æåçªå£å
¨å± |
| | | // 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(() => { |
| | |
| | | // 妿çªå£å®½åº¦å°äºçäº1080pxï¼æ§è¡ç¸åºçæä½ |
| | | isMobile.value = false; |
| | | } |
| | | getPosition(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | |
| | | .button { |
| | | height: 7.83rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | justify-content: space-between; |
| | | |
| | | .btn { |
| | | position: relative; |
| | |
| | | |
| | | .model { |
| | | display: flex; |
| | | |
| | | justify-content: space-between; |
| | | .model_btn { |
| | | display: flex; |
| | | |
| | |
| | | |
| | | .model { |
| | | display: flex; |
| | | |
| | | justify-content: space-between; |
| | | .model_btn { |
| | | display: flex; |
| | | |