lcny-vue3-antd-admin/dist/assets/JK.e9808d7f.js

2 lines
5.5 KiB
JavaScript

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