lcny-vue3-antd-admin/dist/assets/JK.3cf809bf.js

2 lines
5.0 KiB
JavaScript

var te=Object.defineProperty,ne=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var q=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(q)for(var s of q(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((x,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?x(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 J,v as ce,s as f,f as L,br as ue,ah as de,be as pe,q as me,al as fe,fm as ve,aC as v,o as u,j as O,y as g,i as d,h as w,t as K,p as k,F as j,aF as P,l as E,n as X}from"./index.0bdee807.js";import{r as be,f as ge,s as he}from"./other.6fc91202.js";import _e from"./Box.c0e6cea6.js";import ye from"./VideoFlv.fb596a16.js";import we from"./LinkModal.404b785d.js";import"./index.2c0fa94a.js";import"./model-close-icon.706a0490.js";var Y="https://lcny.sk797.cn/admin/assets/v01.fb45fe6a.png",ke="https://lcny.sk797.cn/admin/assets/v02.5305abb9.png",xe="https://lcny.sk797.cn/admin/assets/v03.03878ed0.png";const Me=le({components:{Box:_e,Dropdown:ie,DownOutlined:re,Menu:J,MenuItem:J.Item,VideoFlv:ye,LinkModal:we},props:["baseId"],setup(t){t.baseId;const e=ce({tabList:f([]),currentTab:f(""),list:f([])}),s=f(!1),x=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 A;const{ip:n,port:m,change_time:c}=yield ge(),l=yield he({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=fe(R),{supplier:S,extends:B,sn:W}=Q,{rtsp_url:Z}=B,ee=Z;let U=`ws://${n}:${m}/rtsp?url=${window.btoa(ee)}`;if((S==null?void 0:S.id)=="device-supplier-biang")try{U=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?ke:b==2?xe:Y,url:U})))}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((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 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){h.value=n,s.value=!0}const T=L(()=>!!t.baseId);return ue(()=>{T.value?y():M()}),de(()=>{o&&clearInterval(o)}),$(V({isBase:T,listBig:p,listSmall:_,onChangeVideo:G,currentVido:i,currentModelVideo:h},pe(e)),{chartRef:x,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,x,i,h){const _=v("DownOutlined"),p=v("menu-item"),a=v("Menu"),r=v("Dropdown"),M=v("VideoFlv"),y=v("LinkModal"),F=v("Box");return u(),O(F,{title:"\u76D1\u63A7"},{default:g(()=>[d("div",Ce,[t.isBase?E("",!0):(u(),w("div",Be,[d("div",Ve,K(t.currentTabValue),1),t.tabList.length>1?(u(),w("div",De,[k(r,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:g(()=>[k(a,{onClick:t.onMenuClick},{default:g(()=>[(u(!0),w(j,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,[Fe,k(_,{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),w(j,null,P(t.listBig,(o,I)=>(u(),w("div",{class:X(["h-130px",{"h-140px":t.isBase}]),key:o.url+I},[k(M,{onOnScreen:t.onScreenClick,class:"cursor-pointer",url:o.url,name:o.base_name},null,8,["onOnScreen","url","name"])],2))),128))])],2)]),k(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"])):E("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var Je=me(Me,[["render",Se]]);export{Je as default};