lcny-vue3-antd-admin/dist/assets/JK.99520dbf.js

2 lines
5.5 KiB
JavaScript

var ne=Object.defineProperty,se=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var z=(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)&&z(e,s,t[s]);if(j)for(var s of j(t))le.call(t,s)&&z(e,s,t[s]);return e},N=(e,t)=>se(e,oe(t));var I=(e,t,s)=>new Promise((B,d)=>{var w=i=>{try{v(s.next(i))}catch(m){d(m)}},x=i=>{try{v(s.throw(i))}catch(m){d(m)}},v=i=>i.done?B(i.value):Promise.resolve(i.value).then(w,x);v((s=s.apply(e,t)).next())});import{a as re,cX as ie,cY as ce,b9 as P,v as ue,s as b,f as S,br as de,ah as pe,be as me,q as fe,al as ve,fm as be,aC as g,o as l,j as R,y as _,i as f,h as u,t as X,p as y,F,aF as T,l as O,n as Y}from"./index.2cdbaad0.js";import{r as ge,f as he,s as _e}from"./other.581e80b4.js";import ye from"./Box.814c1299.js";import we from"./VideoFlv.89a68d57.js";import{v as G,a as xe,b as ke}from"./v03.26c01bf5.js";import Me from"./LinkModal.759d4bce.js";import"./index.5897d526.js";import"./model-close-icon.706a0490.js";const Ce=re({components:{Box:ye,Dropdown:ie,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)),i=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,U=[];for(let h=0;h<V.length;h++){const J=V[h],W=ve(J),{supplier:E,extends:D,sn:Z}=W,{rtsp_url:ee}=D,te=ee;let K=`ws://${n}:${a}/rtsp?url=${window.btoa(te)}`;if((E==null?void 0:E.id)=="device-supplier-biang")try{K=yield r({username:D.username,password:D.password,equipmentCode:Z,channelNo:D.passage})}catch(Ae){}U.push(Object.assign({},N(L({},J),{img:h==0?G:h==1?xe:h==2?ke:G,url:K})))}t.list=U,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 H(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)}),N(L({isBase:A,listBig:v,listSmall:x,onChangeVideo:H,currentVido:d,currentModelVideo:w},me(t)),{chartRef:B,currentTabValue:i,onMenuClick:m,visibleModal:s,onScreenClick:Q})}}),Be={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"),i=g("Menu"),m=g("Dropdown"),k=g("VideoFlv"),$=g("LinkModal"),M=g("Box");return l(),R(M,{title:"\u76D1\u63A7"},{default:_(()=>[f("div",Be,[e.isBase?O("",!0):(l(),u("div",Ve,[f("div",De,X(e.currentTabValue),1),e.tabList.length>1?(l(),u("div",Le,[y(m,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:_(()=>[y(i,{onClick:e.onMenuClick},{default:_(()=>[(l(!0),u(F,null,T(e.tabList,r=>(l(),R(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,[(l(!0),u(F,null,T(e.listBig,(r,p)=>(l(),u("div",{class:Y(["h-130px",{"!h-160px":e.isBase}]),key:r.url+p},[y(k,{onOnScreen:e.onScreenClick,class:"cursor-pointer",url:r.url,name:r.base_name},null,8,["onOnScreen","url","name"])],2))),128))]),e.isBase?(l(),u("div",Te,[(l(!0),u(F,null,T(e.listSmall,(r,p)=>(l(),u("div",{class:"grid grid-cols-3 gap-x-6px pt-10px",key:p},[(l(!0),u(F,null,T(r,C=>(l(),u("div",{class:"h-66px",key:C.id},[y(k,{onOnScreen:e.onScreenClick,class:"cursor-pointer",url:C.url,name:C.base_name,screen:!0},null,8,["onOnScreen","url","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.url?(l(),R(k,{key:0,url:e.currentModelVideo.url,screen:!1,name:e.currentModelVideo.name},null,8,["url","name"])):O("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var Pe=fe(Ce,[["render",$e]]);export{Pe as default};