lcny-vue3-antd-admin/dist/assets/JK.c9f7d47b.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 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((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,cV as ie,cW as re,b7 as z,s as ce,r as m,f as L,bp as ue,af as de,bc as pe,J as fe,aj as me,fl as ve,aA as v,o as u,j as O,x as g,i as d,h as x,t as K,p as y,F as q,aD as P,l as A,n as W}from"./index.274e5454.js";import{r as be,f as ge,s as _e}from"./other.2f03f1c6.js";import he from"./Box.c9b778f3.js";import we from"./VideoFlv.0262a54e.js";import xe from"./LinkModal.e9b8cfeb.js";import"./index.db05de8c.js";import"./model-close-icon.706a0490.js";var G="/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:z,MenuItem:z.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 N;const{ip:n,port:f,change_time:c}=yield ge(),l=yield _e({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=me(R),{supplier:S,extends:B,sn:Y}=X,{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 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?ye:b==2?Me: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((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 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){_.value=n,s.value=!0}const T=L(()=>!!t.baseId);return ue(()=>{T.value?w():k()}),de(()=>{o&&clearInterval(o)}),$(C({isBase:T,listBig:p,listSmall:h,onChangeVideo:H,currentVido:i,currentModelVideo:_},pe(e)),{chartRef:M,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,M,i,_){const h=v("DownOutlined"),p=v("menu-item"),a=v("Menu"),r=v("Dropdown"),k=v("VideoFlv"),w=v("LinkModal"),I=v("Box");return u(),O(I,{title:"\u76D1\u63A7"},{default:g(()=>[d("div",Ve,[t.isBase?A("",!0):(u(),x("div",Be,[d("div",Ce,K(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,K(o.name),1)]),_:2},1024))),128))]),_:1},8,["onClick"])]),default:g(()=>[d("div",Le,[Ie,y(h,{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),x(q,null,P(t.listBig,(o,F)=>(u(),x("div",{class:W(["h-130px",{"h-140px":t.isBase}]),key:o.url+F},[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"])):A("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var ze=fe(ke,[["render",Se]]);export{ze as default};