{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\components\\DHVideoPlayPlugin.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\components\\DHVideoPlayPlugin.vue","mtime":1687831404002},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from '@/hotent-ui-util';\nexport default {\n components: {},\n props: {},\n data: function data() {\n return {\n domId: 'playWnd',\n text: '视频插件加载中......',\n showSetting: false,\n isLogin: false,\n https: window.context.DHVideoHttps,\n loginIp: window.context.DHVideoIp,\n loginPort: window.context.DHVideoPort,\n userName: window.context.DHVideoAccount,\n userPwd: window.context.DHVideoPsd,\n downloadUrl32: './../static/plugin/DSS_LightWeight_Client32.zip',\n downloadUrl64: './../static/plugin/DSS_LightWeight_Client.zip',\n displayMode: 1,\n //1:实时视频; 2:视频回放\n splitNum: 4,\n ctrl: 'ctrl1',\n // 可生成多个控件\n ctrlType: 'playerWin',\n // 'playerWin': 播放控件';'realMonitorUI':'带设备树实时预览控件';'playbackUI':'带设备树视频回放控件';'TVWallUI':'视频上墙'\n crtPosX: 0,\n crtPosY: 0,\n crtWidth: 700,\n crtHeight: 400,\n channelId: '',\n // 插件对象实例,初始化为null,需要创建多个插件窗口时,需要定义多个插件对象实例变量,各个变量唯一标志对应的插件实例\n ws: null,\n bIE: !!window.ActiveXObject || 'ActiveXObject' in window // 是否为IE浏览器\n //\n\n };\n },\n beforeCreate: function beforeCreate() {},\n created: function created() {},\n methods: {\n realTimeVideo: function realTimeVideo(channelId) {\n this.channelId = channelId;\n\n if (this.ws.ctrls.length === 0) {\n this.$message.info('请先创建控件!');\n }\n\n var params = {\n ctrlCode: this.ctrl,\n channelIds: [this.channelId]\n };\n this.ws.openCtrlPreview(params);\n },\n createVideoPlayer: function createVideoPlayer() {\n var _this = this;\n\n console.log(this.crtPosX, this.crtPosY, 'this.cutPosX');\n var params = [{\n ctrlType: this.ctrlType,\n ctrlCode: this.ctrl,\n ctrlProperty: {\n displayMode: this.displayMode,\n splitNum: this.splitNum // channelList: [{channelId: this.channelId}],\n\n },\n visible: true,\n domId: this.domId\n }];\n this.setPos();\n\n _this.ws.createCtrl(params).then(function (res) {\n console.log(res);\n }).catch(function (e) {\n console.log(e);\n });\n\n _this.ws.on('createCtrlResult', function (res) {\n console.warn(res);\n });\n },\n // 设置窗口大小\n setPos: function setPos() {\n var target = document.getElementById(this.domId);\n console.log(target, 'target');\n target.style.right = \"\".concat(this.crtPosX, \"px\");\n target.style.top = \"\".concat(this.crtPosY, \"px\"); // target.style.width = `${this.crtWidth}px`\n // target.style.height = `${this.crtHeight}px`\n\n if (document.createEvent) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent('resize', true, true);\n window.dispatchEvent(event);\n } else if (document.createEventObject) {\n window.fireEvent('onresize');\n }\n },\n // 登录视频插件\n login: function login() {\n var _this2 = this;\n\n this.ws.login({\n loginIp: this.loginIp,\n loginPort: this.loginPort,\n userName: this.userName,\n userPwd: this.userPwd,\n https: this.https,\n token: ''\n });\n console.log('登录中...');\n this.$message.info('登录中');\n this.ws.on('loginState', function (res) {\n _this2.isLogin = res;\n\n if (res) {\n console.log('登录成功');\n\n _this2.$message.info('登录成功');\n\n _this2.$nextTick(function () {\n setTimeout(function () {\n _this2.createVideoPlayer(); // 创建视频插件\n\n }, 1000);\n });\n } else {\n _this2.text = '视频插件登录失败,请联系管理员!';\n }\n });\n },\n logout: function logout() {\n // 调用登出接口\n this.ws.logout({\n loginIp: this.loginIp\n });\n },\n // 获取窗口宽高\n getWindowSize: function getWindowSize() {\n this.width = this.$refs.playerContainer.clientWidth;\n this.height = this.$refs.playerContainer.clientHeight;\n }\n },\n mounted: function mounted() {\n var _this3 = this;\n\n var path = this.$route.path;\n\n if (path.indexOf('frontPlat') !== -1) {\n this.crtPosY = 0;\n } else {\n this.crtPosY = 80;\n }\n\n console.log('创建组件');\n var DHWsInstance = DHWs.getInstance();\n this.ws = DHWsInstance;\n console.log(this.ws, 'chajian');\n this.ws.detectConnectQt().then(function (res) {\n if (res) {\n _this3.ws.detectLoginClient().then(function (res) {\n if (!res) {\n _this3.login();\n }\n });\n } else {\n _this3.$message.info('连接失败,下载客户端');\n }\n });\n this.ws.addEventListener('connectStateChange', function (data) {\n if (data) {\n _this3.$message.info('连接成功');\n\n _this3.ws.detectLoginClient().then(function (res) {\n if (!res) {\n _this3.login();\n }\n });\n } else {\n _this3.$message.info('连接失败,下载客户端');\n\n console.log('连接失败,下载客户端');\n _this3.showSetting = true;\n _this3.text = '';\n }\n });\n window.addEventListener('onunload', function () {\n _this3.$ws.logout();\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.ws.logout();\n }\n};",null]}