lcny-vue3-antd-admin/dist/assets/JK.8a5dada4.js

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 z=(t,e,s)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,V=(t,e)=>{for(var s in e||(e={}))oe.call(e,s)&&z(t,s,e[s]);if(U)for(var s of U(e))ae.call(e,s)&&z(t,s,e[s]);return t},$=(t,e)=>ne(t,se(e));var D=(t,e,s)=>new Promise((M,i)=>{var _=a=>{try{p(s.next(a))}catch(r){i(r)}},h=a=>{try{p(s.throw(a))}catch(r){i(r)}},p=a=>a.done?M(a.value):Promise.resolve(a.value).then(_,h);p((s=s.apply(t,e)).next())});import{a as le,cX as ie,cY as re,b9 as K,s as ce,r as m,f as L,br as ue,ah as de,be as pe,J as fe,al as me,fm as ve,aC as v,o as u,j as O,x as g,i as d,h as x,t as j,p as y,F as q,aF as P,l as E,n as X}from"./index.87f5651e.js";import{r as be,f as ge,s as _e}from"./other.17b9a127.js";import he from"./Box.cbf91f8c.js";import we from"./VideoFlv.f6c1b761.js";import xe from"./LinkModal.ba3f6d91.js";import"./index.ed19faba.js";import"./model-close-icon.706a0490.js";var Y="/assets/v01.fb45fe6a.png",ye="/assets/v02.5305abb9.png",Me="/assets/v03.03878ed0.png";const ke=le({components:{Box:he,Dropdown:ie,DownOutlined:re,Menu:K,MenuItem:K.Item,VideoFlv:we,LinkModal:xe},props:["baseId"],setup(t){t.baseId;const e=ce({tabList:m([]),currentTab:m(""),list:m([])}),s=m(!1),M=m(null),i=m(null),_=m(null),h=L(()=>e.list.slice(1,4)),p=L(()=>e.list.slice(0,1)),a=L(()=>{var n,f;return(f=(n=e.tabList.find(c=>c.id==e.currentTab))==null?void 0:n.name)!=null?f:""});function r({key:n}){e.currentTab!=n&&(e.currentTab=n,w())}function k(){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),w()})}function w(){return D(this,null,function*(){var A;const{ip:n,port:f,change_time:c}=yield ge(),l=yield _e({base_id:(A=t.baseId)!=null?A:e.currentTab,type:1,status:1,is_recommend:1});e.list=[],i.value=null;const C=l.splice(0,4),N=[];for(let b=0;b<C.length;b++){const R=C[b],Q=me(R),{supplier:S,extends:B,sn:W}=Q,{rtsp_url:Z}=B,ee=Z;let J=`ws://${n}:${f}/rtsp?url=${window.btoa(ee)}`;if((S==null?void 0:S.id)=="device-supplier-biang")try{J=yield F({username:B.username,password:B.password,equipmentCode:W,channelNo:B.passage})}catch($e){}N.push(Object.assign({},$(V({},R),{img:b==0?Y:b==1?ye:b==2?Me:Y,url:J})))}e.list=N,e.list[0],e.list.length>0&&(i.value=e.list[0]),T.value||I(c)})}function F(n){return new Promise((f,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?f(l.data):c(l)}catch(l){c(l)}}))}let o=null;function I(n){o&&clearInterval(o),n!=0&&(o=setInterval(()=>{const c=e.tabList.findIndex(C=>C.id==e.currentTab)+1,l=e.tabList[c%e.tabList.length];r(V({key:l.id},l))},1e3*n))}function G(n){i.value.url!=n.url&&(i.value=n)}function H(n){_.value=n,s.value=!0}const T=L(()=>!!t.baseId);return ue(()=>{T.value?w():k()}),de(()=>{o&&clearInterval(o)}),$(V({isBase:T,listBig:p,listSmall:h,onChangeVideo:G,currentVido:i,currentModelVideo:_},pe(e)),{chartRef:M,currentTabValue:a,onMenuClick:r,visibleModal:s,onScreenClick:H})}}),Ce={class:"h-full flex flex-col"},Be={key:0,class:"py-10px relative"},Ve={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"},Fe=d("span",{class:"text-white text-12px"},"\u66F4\u591A",-1),Ie={class:"flex-1"},Te={class:"w-full"};function Se(t,e,s,M,i,_){const h=v("DownOutlined"),p=v("menu-item"),a=v("Menu"),r=v("Dropdown"),k=v("VideoFlv"),w=v("LinkModal"),F=v("Box");return u(),O(F,{title:"\u76D1\u63A7"},{default:g(()=>[d("div",Ce,[t.isBase?E("",!0):(u(),x("div",Be,[d("div",Ve,j(t.currentTabValue),1),t.tabList.length>1?(u(),x("div",De,[y(r,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:g(()=>[y(a,{onClick:t.onMenuClick},{default:g(()=>[(u(!0),x(q,null,P(t.tabList,o=>(u(),O(p,{key:o.id},{default:g(()=>[d("div",null,j(o.name),1)]),_:2},1024))),128))]),_:1},8,["onClick"])]),default:g(()=>[d("div",Le,[Fe,y(h,{style:{fontSize:"12px",color:"#FFF"}})])]),_:1})])):E("",!0)])),d("div",{class:X(["flex-1 flex flex-col py-0px box-content",{"pt-0":!t.isBase}])},[d("div",Ie,[(u(!0),x(q,null,P(t.listBig,(o,I)=>(u(),x("div",{class:X(["h-130px",{"h-140px":t.isBase}]),key:o.url+I},[y(k,{onOnScreen:t.onScreenClick,class:"cursor-pointer",url:o.url,name:o.base_name},null,8,["onOnScreen","url","name"])],2))),128))])],2)]),y(w,{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(k,{key:0,url:t.currentModelVideo.url,screen:!1,name:t.currentModelVideo.name},null,8,["url","name"])):E("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var Ke=fe(ke,[["render",Se]]);export{Ke as default};