2 lines
5.5 KiB
JavaScript
2 lines
5.5 KiB
JavaScript
var ne=Object.defineProperty,se=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var H=(e,t,s)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,L=(e,t)=>{for(var s in t||(t={}))ae.call(t,s)&&H(e,s,t[s]);if(z)for(var s of z(t))ie.call(t,s)&&H(e,s,t[s]);return e},R=(e,t)=>se(e,oe(t));var I=(e,t,s)=>new Promise((B,d)=>{var w=l=>{try{v(s.next(l))}catch(m){d(m)}},x=l=>{try{v(s.throw(l))}catch(m){d(m)}},v=l=>l.done?B(l.value):Promise.resolve(l.value).then(w,x);v((s=s.apply(e,t)).next())});import{a as le,cX as re,cY as ce,ba as P,w as ue,v as b,f as S,x as de,aj as pe,bf as me,q as fe,an as ve,fm as be,aE as g,o as i,j as U,B as _,i as f,h as u,t as X,p as y,F,aH as T,l as O,n as Y}from"./index.d39002cd.js";import{s as ge,f as he,t as _e}from"./other.843cde05.js";import ye from"./Box.baa6569d.js";import we from"./VideoFlv.2b51c165.js";import{v as G,a as xe,b as ke}from"./v03.26c01bf5.js";import Me from"./LinkModal.ee92a844.js";import"./index.f900ed07.js";import"./model-close-icon.706a0490.js";const Be=le({components:{Box:ye,Dropdown:re,DownOutlined:ce,Menu:P,MenuItem:P.Item,VideoFlv:we,LinkModal:Me},props:["baseId"],setup(e){e.baseId;const t=ue({tabList:b([]),currentTab:b(""),list:b([])}),s=b(!1),B=b(null),d=b(null),w=b(null),x=S(()=>{var n,a;return k((a=(n=t.list)==null?void 0:n.slice(1,t.list.length))!=null?a:[],3)}),v=S(()=>t.list.slice(0,1)),l=S(()=>{var n,a;return(a=(n=t.tabList.find(c=>c.id==t.currentTab))==null?void 0:n.name)!=null?a:""});function m({key:n}){t.currentTab!=n&&(t.currentTab=n,M())}function k(n,a){const c=[];for(let o=0;o<n.length;o+=a)c.push(n.slice(o,o+a));return c}function $(){return I(this,null,function*(){const n=yield ge({device_type:1,is_recommended:e.baseId?null:1});t.tabList=n,n.length&&(t.currentTab=n[0].id),M()})}function M(){return I(this,null,function*(){var q;const{ip:n,port:a,change_time:c}=yield he(),o=yield _e({base_id:(q=e.baseId)!=null?q:t.currentTab,type:1,status:1,is_recommend:e.baseId?null:1});t.list=[],d.value=null;const V=o,j=[];for(let h=0;h<V.length;h++){const J=V[h],W=ve(J),{supplier:N,extends:D,sn:Z}=W,{rtsp_url:ee}=D,te=ee;let K=`ws://${n}:${a}/rtsp?url=${window.btoa(te)}`;if((N==null?void 0:N.id)=="device-supplier-biang")try{K=yield r({username:D.username,password:D.password,equipmentCode:Z,channelNo:D.passage})}catch(Ee){}j.push(Object.assign({},R(L({},J),{img:h==0?G:h==1?xe:h==2?ke:G,url:K})))}t.list=j,t.list.length>0&&(d.value=t.list[0]),A.value||C(c)})}function r(n){return new Promise((a,c)=>I(this,null,function*(){try{const{data:o}=yield be.get("https://yun.bigdata5s.com/api/open-api/open/getSeedingLive",{params:n});o.code==200?a(o.data):c(o)}catch(o){c(o)}}))}let p=null;function C(n){p&&clearInterval(p),n!=0&&(p=setInterval(()=>{const c=t.tabList.findIndex(V=>V.id==t.currentTab)+1,o=t.tabList[c%t.tabList.length];m(L({key:o.id},o))},1e3*n))}function E(n){d.value.url!=n.url&&(d.value=n)}function Q(n){w.value=n,s.value=!0}const A=S(()=>!!e.baseId);return de(()=>{A.value?M():$()}),pe(()=>{p&&clearInterval(p)}),R(L({isBase:A,listBig:v,listSmall:x,onChangeVideo:E,currentVido:d,currentModelVideo:w},me(t)),{chartRef:B,currentTabValue:l,onMenuClick:m,visibleModal:s,onScreenClick:Q})}}),Ce={class:"h-full flex flex-col"},Ve={key:0,class:"py-10px relative"},De={class:"text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"},Le={key:0,class:"absolute right-18px top-1/2 transform -translate-y-1/2"},Ie={class:"cursor-pointer"},Se=f("span",{class:"text-white text-12px"},"\u66F4\u591A",-1),Fe={class:"flex-1"},Te={key:0,class:"overflow-y-auto h-80px"},Oe={class:"w-full"};function $e(e,t,s,B,d,w){const x=g("DownOutlined"),v=g("menu-item"),l=g("Menu"),m=g("Dropdown"),k=g("VideoFlv"),$=g("LinkModal"),M=g("Box");return i(),U(M,{title:"\u76D1\u63A7"},{default:_(()=>[f("div",Ce,[e.isBase?O("",!0):(i(),u("div",Ve,[f("div",De,X(e.currentTabValue),1),e.tabList.length>1?(i(),u("div",Le,[y(m,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:_(()=>[y(l,{onClick:e.onMenuClick},{default:_(()=>[(i(!0),u(F,null,T(e.tabList,r=>(i(),U(v,{key:r.id},{default:_(()=>[f("div",null,X(r.name),1)]),_:2},1024))),128))]),_:1},8,["onClick"])]),default:_(()=>[f("div",Ie,[Se,y(x,{style:{fontSize:"12px",color:"#FFF"}})])]),_:1})])):O("",!0)])),f("div",{class:Y(["flex-1 flex flex-col py-0px box-content",{"pt-0":!e.isBase}])},[f("div",Fe,[(i(!0),u(F,null,T(e.listBig,(r,p)=>(i(),u("div",{class:Y(["h-130px",{"!h-160px":e.isBase}]),key:p},[y(k,{onOnScreen:e.onScreenClick,class:"cursor-pointer",id:r.id,name:r.base_name},null,8,["onOnScreen","id","name"])],2))),128))]),e.isBase?(i(),u("div",Te,[(i(!0),u(F,null,T(e.listSmall,(r,p)=>(i(),u("div",{class:"grid grid-cols-3 gap-x-6px pt-10px",key:p},[(i(!0),u(F,null,T(r,(C,E)=>(i(),u("div",{class:"h-66px",key:E},[y(k,{onOnScreen:e.onScreenClick,class:"cursor-pointer",id:C.id,name:C.base_name,screen:!0},null,8,["onOnScreen","id","name"])]))),128))]))),128))])):O("",!0)],2)]),y($,{visible:e.visibleModal,"onUpdate:visible":t[0]||(t[0]=r=>e.visibleModal=r),footer:null,title1:e.currentModelVideo&&e.currentModelVideo.name,width:1100},{content:_(()=>[f("div",Oe,[e.currentModelVideo.id?(i(),U(k,{key:0,id:e.currentModelVideo.id,screen:!1,name:e.currentModelVideo.name},null,8,["id","name"])):O("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var He=fe(Be,[["render",$e]]);export{He as default};
|