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