7 lines
6.3 KiB
JavaScript
7 lines
6.3 KiB
JavaScript
/*!
|
|
* build: vue-admin-beautiful
|
|
* vue-admin-beautiful author: chuzhixin 1204505056@qq.com
|
|
* vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756
|
|
* time: 2024-10-10 11:14:28
|
|
*/
|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3c65a26a"],{4543:function(e,t,o){"use strict";o.r(t);var i=o("f2bf");const c={key:0,class:"play"},d={key:1,class:"hello-ezuikit-js"},n={key:2,class:"hello-ezuikit-js"},a={style:{"text-align":"center"}};function r(e,t,o,r,l,s){const u=Object(i["resolveComponent"])("el-button");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[l.isplay?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[Object(i["createVNode"])(u,{size:"mini",type:"primary",onClick:s.start},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.$t("defalult.bf")),1)]),_:1},8,["onClick"])])):Object(i["createCommentVNode"])("",!0),l.showVideo?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",d,[t[0]||(t[0]=Object(i["createElementVNode"])("div",{id:"video-container",style:{width:"600px",height:"400px"}},null,-1)),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(u,{size:"mini",type:"primary",onClick:s.stop},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.$t("defalult.tz")),1)]),_:1},8,["onClick"]),Object(i["createVNode"])(u,{size:"mini",type:"primary",onClick:s.play},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.$t("defalult.bf")),1)]),_:1},8,["onClick"]),Object(i["createVNode"])(u,{size:"mini",type:"primary",onClick:s.capturePicture},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.$t("defalult.bhtp")),1)]),_:1},8,["onClick"]),Object(i["createVNode"])(u,{size:"mini",type:"primary",onClick:s.fullScreen},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.$t("defalult.qpxs")),1)]),_:1},8,["onClick"])])])):Object(i["createCommentVNode"])("",!0),l.isplay||l.showVideo?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",n,[Object(i["createElementVNode"])("p",a,Object(i["toDisplayString"])(l.msg),1)]))],64)}var l=o("7cf8"),s=o("c38d"),u=o.n(s);let p=null;var m={props:{deviceCode:{type:String,default:""}},data(){return{videoData:[],queryForm:{deviceCode:""},showVideo:!0,isplay:!0,msg:""}},watch:{deviceCode:function(e,t){this.queryForm.deviceCode=e,this.isplay=!0,this.showVideo=!0,this.getVideoPath()}},created(){},methods:{showData(e){this.queryForm.deviceCode=e.deviceCode,this.isplay=!0,this.showVideo=!0,this.getVideoPath()},start(){this.isplay=!1,this.showVideo=!0,this.getVideo()},async getVideoPath(){const{data:e,code:t,msg:o}=await Object(l["getLiveAddr"])(this.queryForm);-1==t?(this.showVideo=!1,this.isplay=!1,this.msg=o):(this.videoData=e,this.showVideo=!1,this.isplay=!0)},getVideo(){const e=this;p=new u.a.EZUIKitPlayer({id:"video-container",autoplay:!1,accessToken:e.videoData.accessToken,url:e.videoData.url,template:"simple",plugin:["talk"],width:700,height:400}),window.player=p},play(){const e=p.play();e.then(e=>{console.log("promise 获取 数据",e)})},stop(){const e=p.stop();e.then(e=>{console.log("promise 获取 数据",e)})},getOSDTime(){const e=p.getOSDTime();e.then(e=>{console.log("promise 获取 数据",e)})},capturePicture(){const e=p.capturePicture(""+(new Date).getTime());e.then(e=>{console.log("promise 获取 数据",e)})},openSound(){const e=p.openSound();e.then(e=>{console.log("promise 获取 数据",e)})},closeSound(){const e=p.closeSound();e.then(e=>{console.log("promise 获取 数据",e)})},startSave(){const e=p.startSave(""+(new Date).getTime());e.then(e=>{console.log("promise 获取 数据",e)})},stopSave(){const e=p.stopSave();e.then(e=>{console.log("promise 获取 数据",e)})},ezopenStartTalk(){p.startTalk()},ezopenStopTalk(){p.stopTalk()},fullScreen(){p.fullScreen()},destroy(){const e=p.destroy();e.then(e=>{console.log("promise 获取 数据",e)})}}},h=(o("4771"),o("d959")),f=o.n(h);const v=f()(m,[["render",r]]);t["default"]=v},4771:function(e,t,o){"use strict";o("d93d")},"7cf8":function(e,t,o){"use strict";o.r(t),o.d(t,"getSiteList",(function(){return d})),o.d(t,"getDeviceInfo",(function(){return n})),o.d(t,"getDeviceList",(function(){return a})),o.d(t,"getDeviceInfos",(function(){return r})),o.d(t,"getLiveAddr",(function(){return l})),o.d(t,"getWaterRate",(function(){return s})),o.d(t,"getCaptureImg",(function(){return u})),o.d(t,"deviceCode",(function(){return p})),o.d(t,"sensorsOfWrite",(function(){return m})),o.d(t,"writeData",(function(){return h}));var i=o("b775"),c=o("2ef0");const d=()=>Object(i["default"])({url:"/map/devices?projectId="+sessionStorage.getItem("projectId"),method:"get"}).then(e=>((null===e||void 0===e?void 0:e.data)||[]).map(e=>({...e,label:e.townName,id:Object(c["uniqueId"])("mo"),iconType:"folder",type:"town",children:(e.communities||[]).map(t=>({...e,...t,label:t.communityName,id:Object(c["uniqueId"])("co"),ids:t.id,iconType:"folder",type:"community",children:(t.devices||[]).map(o=>({...e,...t,...o,iconType:"device",type:"device",label:o.name,id:Object(c["uniqueId"])("de"),ids:o.id}))}))})));function n(e){return Object(i["default"])({url:"/map/deviceInfo?deviceCode="+e.deviceCode,method:"get",data:e})}function a(e){return Object(i["default"])({url:"/device/list?projectId="+e.projectId,method:"get",data:e})}function r(e){return Object(i["default"])({url:"/device/deviceInfo?deviceCode="+e.deviceCode,method:"get",data:e})}function l(e){return Object(i["default"])({url:"/device/liveAddr?deviceCode="+e.deviceCode,method:"get",data:e})}function s(e){return Object(i["default"])({url:"/device/waterRate?deviceCode="+e.deviceCode,method:"get",data:e})}function u(e){return Object(i["default"])({url:"/device/captureImg?deviceCode="+e.deviceCode+"&page="+e.page,method:"get",data:e})}function p(e){return Object(i["default"])({url:"/device/sensors?deviceCode="+e.deviceCode+"&page="+e.page+"&size="+e.size,method:"get",data:e})}function m(e){return Object(i["default"])({url:"/device/sensorsOfWrite?deviceCode="+e.deviceCode+"&page="+e.page+"&size="+e.size,method:"get",data:e})}function h(e){return Object(i["default"])({url:"/deviceSensor/write?deviceCode="+e.deviceCode+"&dataKey="+e.dataKey+"&dataValue="+e.dataValue,method:"post",data:e})}},d93d:function(e,t,o){}}]); |