video - 副本.77f41f8d.js 6.7 KB

1
  1. import{u as ee,r as u,ad as le,a as ae,_ as ne,P as te,g as b,ac as oe,Y as T,o as w,h as x,i as o,w as r,m as i,z as B,B as q,q as se,t as L,n as R,Z as I,X as ce}from"./vendor.0bc3c1d4.js";import{e as ie}from"./allReq.9756076a.js";import{E as ue}from"./ezuikit.e07c3a91.js";import{_ as re}from"./index.fceaba64.js";const de={class:"padding-lr-sm",style:{height:"calc(100vh - 84px)"}},pe={class:"head-container"},ve={class:"head-container",style:{height:"calc(100vh - 126px)","overflow-y":"auto"}},_e=["onClick"],fe={style:{height:"calc(100vh - 84px)",width:"100%"}},he={class:"noBg"},ye=["id"],me={class:"videoTitle"},ge={class:"videoTool"},We={class:"Tool"},Se={setup(ke){const O=ee(),{proxy:k}=ce(),j=u(!1),y=u({}),_=u({}),p=u({}),f=u({});var n={},N=[],$=[];const E=u(null),m=u([]),C=u({}),v=u({}),V=u(""),g=u(2),U=le({queryParams:{deviceSerial:"",accessToken:ae.get("Open-Token")}}),{queryParams:W}=ne(U),Z=function(e){if(e=="")m.value=N;else{let l=[];N.forEach(a=>{JSON.stringify(a).indexOf(e)!=-1&&l.push(a)}),m.value=l}},K=function(e){m.value.forEach(l=>{if(l.deviceSerial+""+l.channelNo==e)if(l.status==0)k.$modal.msgError("\u6444\u50CF\u5934\u79BB\u7EBF\uFF01\uFF01\uFF01");else{let a=!0,s=n;for(let c in s)if(s[c]==null){C.value[l.deviceSerial+""+l.channelNo]=l,v.value[c]=l,F(c,l.deviceSerial+""+l.channelNo),a=!1;break}a&&k.$modal.msgError("\u6682\u65E0\u53EF\u7528\u901A\u9053\uFF01\uFF01")}})},z=function(){m.value=[],N=[],$=[],W.value.deviceSerial!=""&&W.value.deviceSerial!=null&&(j.value=!0,ie(W.value).then(e=>{e.code==200&&($=e.data),A(),j.value=!1}))},A=function(){let e=[];$.forEach(l=>{l.channelName.indexOf("@")==-1&&e.push(l)}),N=e,m.value=e},F=function(e,l){let a=C.value[l];n[e]==null?n[e]=new ue.EZUIKitPlayer({id:e,accessToken:W.value.accessToken,url:"ezopen://open.ys7.com/"+a.deviceSerial+"/"+a.channelNo+".live",plugin:["talk"],width:E.value.clientWidth/g.value,height:E.value.clientHeight/g.value,autoplay:!0,audio:!1,handleError:function(){P(e,l),k.$modal.msgError("\u89C6\u9891\u64AD\u653E\u5931\u8D25\uFF01\uFF01\uFF01")},handleSuccess:function(){y.value[e]=!0}}):n.stop().then(()=>{n.play({url:"ezopen://open.ys7.com/"+a.deviceSerial+"/"+a.channelNo+".live"})})},P=function(e,l){if(l!=null)n[e]!=null&&(n[e].stop(),n[e]=null,y.value[e]=!1,_.value[e]=!0,f.value[e]=!1,p.value[e]=!1),v.value[_key]=null,delete C.value[l];else{for(let a in n)n[a]!=null&&(n[a].stop(),n[a]=null,v.value[_key]=null,y.value[a]=!1,_.value[a]=!0,f.value[a]=!1,p.value[a]=!1);D(),C.value={}}},G=function(e){if(n["playWind_"+e]!=null){var l=n["playWind_"+e].capturePicture(new Date().getTime());l.then(a=>{})}},H=function(e){n["playWind_"+e]!=null&&(_.value["playWind_"+e]?(n["playWind_"+e].stop(),_.value["playWind_"+e]=!1):(n["playWind_"+e].play(),_.value["playWind_"+e]=!0))},J=function(e){n["playWind_"+e]!=null&&(p.value["playWind_"+e]?n["playWind_"+e].stopSave().then(a=>{k.$modal.msgSuccess("\u5F55\u5236\u7ED3\u675F\uFF01\uFF01\uFF01"),p.value["playWind_"+e]=!1}):n["playWind_"+e].startSave(new Date().getTime()+".mp4").then(a=>{k.$modal.msgSuccess("\u5F00\u59CB\u5F55\u5236\uFF01\uFF01\uFF01"),p.value["playWind_"+e]=!0}))},X=function(e){n["playWind_"+e]!=null&&(f.value["playWind_"+e]?(n["playWind_"+e].closeSound(),f.value["playWind_"+e]=!1):(n["playWind_"+e].openSound(),f.value["playWind_"+e]=!0))},Y=function(e){n["playWind_"+e]!=null&&n["playWind_"+e].fullScreen()},D=function(){let e=parseInt(g.value)*parseInt(g.value);var l={},a={},s={};for(let c=0;c<e;c++)n["playWind_"+c]=null,l["playWind_"+c]=null,a["playWind_"+c]=!1,s["playWind_"+c]=!0;v.value=l,y.value=a,p.value=a,f.value=a,_.value=s};return te(()=>O.state.data.curShipDevice,e=>{W.value.deviceSerial=e,z()}),W.value.deviceSerial=O.state.data.curShipDevice,z(),D(),(e,l)=>{const a=b("el-input"),s=b("svg-icon"),c=b("el-col"),h=b("el-tooltip"),M=b("el-row"),Q=oe("loading");return T((w(),x("div",de,[o(M,{gutter:20},{default:r(()=>[o(c,{span:3,xs:24},{default:r(()=>[i("div",pe,[o(a,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD",onInput:Z,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=d=>V.value=d),clearable:"","prefix-icon":"Search",style:{"margin-top":"10px"}},null,8,["modelValue"])]),i("div",ve,[(w(!0),x(B,null,q(m.value,(d,t)=>(w(),x("div",{key:t,onClick:S=>K(d.deviceSerial+""+d.channelNo),class:se(["padding-tb-xs padding-lr-sm text-sm pointer",C.value[d.deviceSerial+""+d.channelNo]!=null?"text-blue":""])},[o(s,{"icon-class":d.status==1?"shexiangtou":"shexiangtounot",class:"margin-right-xs text-bold text-lg",style:{color:"#409eff"}},null,8,["icon-class"]),i("span",null,L(d.channelName),1)],10,_e))),128))])]),_:1}),o(c,{span:21,xs:24},{default:r(()=>[i("div",fe,[i("div",{style:{height:"calc(100% - 40px)",width:"100%"},class:"flex flex-wrap",ref_key:"videoRef",ref:E},[(w(!0),x(B,null,q(g.value*g.value,(d,t)=>(w(),x("div",{class:"videobox",key:t,style:R("width: "+100/2+"%;height:"+100/2+"%;")},[T(i("div",he,null,512),[[I,!y.value["playWind_"+t]]]),i("div",{id:"playWind_"+t},null,8,ye),i("div",me,[i("div",null,L(v.value["playWind_"+t]!=null?v.value["playWind_"+t].channelName:"\u9A7E\u9A76\u5BA4"),1),o(h,{class:"item",effect:"dark",content:"\u5173\u95ED",placement:"top"},{default:r(()=>[o(s,{"icon-class":"guanji",style:{color:"red"},onClick:S=>P("playWind_"+t,v.value["playWind_"+t].deviceSerial+""+v.value["playWind_"+t].channelNo)},null,8,["onClick"])]),_:2},1024)]),i("div",ge,[o(h,{class:"item",effect:"dark",content:"\u6682\u505C/\u64AD\u653E",placement:"top"},{default:r(()=>[T(o(s,{"icon-class":_.value["playWind_"+t]?"pause":"bofang",onClick:S=>H(t)},null,8,["icon-class","onClick"]),[[I,y.value["playWind_"+t]]])]),_:2},1024),o(h,{class:"item",effect:"dark",content:"\u622A\u56FE",placement:"top"},{default:r(()=>[o(s,{"icon-class":"camerafull",onClick:S=>G(t)},null,8,["onClick"])]),_:2},1024),o(h,{class:"item",effect:"dark",content:"\u58F0\u97F3",placement:"top"},{default:r(()=>[o(s,{"icon-class":f.value["playWind_"+t]?"shengyin_kai":"shengyin_guan",onClick:S=>X(t)},null,8,["icon-class","onClick"])]),_:2},1024),o(h,{class:"item",effect:"dark",content:"\u5F55\u50CF",placement:"top"},{default:r(()=>[o(s,{"icon-class":p.value["playWind_"+t]?"radio":"luxiang",style:R("color:"+(p.value["playWind_"+t]?"red":"")),onClick:S=>J(t)},null,8,["icon-class","style","onClick"])]),_:2},1024),o(h,{class:"item",effect:"dark",content:"\u5168\u5C4F",placement:"top"},{default:r(()=>[o(s,{"icon-class":"fullscreen",style:{"font-size":"0.9em"},onClick:S=>Y(t)},null,8,["onClick"])]),_:2},1024)])],4))),128))],512),i("div",We,[i("div",null,[o(h,{class:"item",effect:"dark",content:"\u5173\u95ED",placement:"top"},{default:r(()=>[o(s,{"icon-class":"guanji",style:{color:"red"},onClick:P})]),_:1})])])])]),_:1})]),_:1})])),[[Q,j.value]])}}};var Ne=re(Se,[["__scopeId","data-v-354748b2"]]);export{Ne as default};