lcny-vue3-antd-admin/dist/assets/JK.e043d737.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=(t,e,s)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,L=(t,e)=>{for(var s in e||(e={}))ae.call(e,s)&&z(t,s,e[s]);if(j)for(var s of j(e))le.call(e,s)&&z(t,s,e[s]);return t},N=(t,e)=>se(t,oe(e));var I=(t,e,s)=>new Promise((B,d)=>{var w=i=>{try{v(s.next(i))}catch(f){d(f)}},x=i=>{try{v(s.throw(i))}catch(f){d(f)}},v=i=>i.done?B(i.value):Promise.resolve(i.value).then(w,x);v((s=s.apply(t,e)).next())});import{a as re,cX as ie,cY as ce,b9 as P,v as ue,s as g,f as S,br as de,ah as pe,be as fe,q as me,al as ve,fm as ge,aC as b,o as l,j as R,y as _,i as m,h as u,t as X,p as y,F,aF as T,l as O,n as Y}from"./index.2ba75b20.js";import{r as be,f as he,s as _e}from"./other.097c81be.js";import ye from"./Box.90a52c1d.js";import we from"./VideoFlv.06cd4cd6.js";import xe from"./LinkModal.24219a28.js";import"./index.40d2ba6c.js";import"./model-close-icon.706a0490.js";var G="/assets/v01.fb45fe6a.png",ke="/assets/v02.5305abb9.png",Me="/assets/v03.03878ed0.png";const Ce=re({components:{Box:ye,Dropdown:ie,DownOutlined:ce,Menu:P,MenuItem:P.Item,VideoFlv:we,LinkModal:xe},props:["baseId"],setup(t){t.baseId;const e=ue({tabList:g([]),currentTab:g(""),list:g([])}),s=g(!1),B=g(null),d=g(null),w=g(null),x=S(()=>{var n,a;return k((a=(n=e.list)==null?void 0:n.slice(1,e.list.length))!=null?a:[],3)}),v=S(()=>e.list.slice(0,1)),i=S(()=>{var n,a;return(a=(n=e.tabList.find(c=>c.id==e.currentTab))==null?void 0:n.name)!=null?a:""});function f({key:n}){e.currentTab!=n&&(e.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 be({device_type:1,is_recommended:t.baseId?null:1});e.tabList=n,n.length&&(e.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=t.baseId)!=null?q:e.currentTab,type:1,status:1,is_recommend:t.baseId?null:1});e.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?ke:h==2?Me:G,url:K})))}e.list=U,e.list.length,e.list.length>0&&(d.value=e.list[0]),A.value||C(c)})}function r(n){return new Promise((a,c)=>I(this,null,function*(){try{const{data:o}=yield ge.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=e.tabList.findIndex(V=>V.id==e.currentTab)+1,o=e.tabList[c%e.tabList.length];f(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(()=>!!t.baseId);return de(()=>{A.value?M():$()}),pe(()=>{p&&clearInterval(p)}),N(L({isBase:A,listBig:v,listSmall:x,onChangeVideo:H,currentVido:d,currentModelVideo:w},fe(e)),{chartRef:B,currentTabValue:i,onMenuClick:f,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=m("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(t,e,s,B,d,w){const x=b("DownOutlined"),v=b("menu-item"),i=b("Menu"),f=b("Dropdown"),k=b("VideoFlv"),$=b("LinkModal"),M=b("Box");return l(),R(M,{title:"\u76D1\u63A7"},{default:_(()=>[m("div",Be,[t.isBase?O("",!0):(l(),u("div",Ve,[m("div",De,X(t.currentTabValue),1),t.tabList.length>1?(l(),u("div",Le,[y(f,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:_(()=>[y(i,{onClick:t.onMenuClick},{default:_(()=>[(l(!0),u(F,null,T(t.tabList,r=>(l(),R(v,{key:r.id},{default:_(()=>[m("div",null,X(r.name),1)]),_:2},1024))),128))]),_:1},8,["onClick"])]),default:_(()=>[m("div",Ie,[Se,y(x,{style:{fontSize:"12px",color:"#FFF"}})])]),_:1})])):O("",!0)])),m("div",{class:Y(["flex-1 flex flex-col py-0px box-content",{"pt-0":!t.isBase}])},[m("div",Fe,[(l(!0),u(F,null,T(t.listBig,(r,p)=>(l(),u("div",{class:Y(["h-130px",{"!h-160px":t.isBase}]),key:r.url+p},[y(k,{onOnScreen:t.onScreenClick,class:"cursor-pointer",url:r.url,name:r.base_name},null,8,["onOnScreen","url","name"])],2))),128))]),t.isBase?(l(),u("div",Te,[(l(!0),u(F,null,T(t.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:t.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:t.visibleModal,"onUpdate:visible":e[0]||(e[0]=r=>t.visibleModal=r),footer:null,title1:t.currentModelVideo&&t.currentModelVideo.name,width:1100},{content:_(()=>[m("div",Oe,[t.currentModelVideo.url?(l(),R(k,{key:0,url:t.currentModelVideo.url,screen:!1,name:t.currentModelVideo.name},null,8,["url","name"])):O("",!0)])]),_:1},8,["visible","title1"])]),_:1})}var ze=me(Ce,[["render",$e]]);export{ze as default};