2 lines
4.7 KiB
JavaScript
2 lines
4.7 KiB
JavaScript
var G=Object.defineProperty,H=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var E=(t,e,n)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,C=(t,e)=>{for(var n in e||(e={}))Q.call(e,n)&&E(t,n,e[n]);if(A)for(var n of A(e))X.call(e,n)&&E(t,n,e[n]);return t},S=(t,e)=>H(t,P(e));var F=(t,e,n)=>new Promise((w,l)=>{var _=a=>{try{u(n.next(a))}catch(c){l(c)}},g=a=>{try{u(n.throw(a))}catch(c){l(c)}},u=a=>a.done?w(a.value):Promise.resolve(a.value).then(_,g);u((n=n.apply(t,e)).next())});import{a as Y,cV as Z,cW as ee,b7 as N,s as te,r as p,f as V,bp as ne,af as se,bc as oe,J as ae,aA as f,o as r,j as J,x as b,i,h as m,t as R,p as v,F as T,aD as $,l as z,n as K}from"./index.7121daea.js";import{r as le,f as re,s as ie}from"./other.33952326.js";import ce from"./Box.29d0996e.js";import ue from"./VideoFlv.17105b5d.js";import de from"./LinkModal.8e656d6a.js";import"./flv.f094888f.js";import"./model-close-icon.706a0490.js";var U="/assets/v01.fb45fe6a.png",pe="/assets/v02.5305abb9.png",fe="/assets/v03.03878ed0.png";const me=Y({components:{Box:ce,Dropdown:Z,DownOutlined:ee,Menu:N,MenuItem:N.Item,VideoFlv:ue,LinkModal:de},props:["baseId"],setup(t){t.baseId;const e=te({tabList:p([]),currentTab:p(""),list:p([])}),n=p(!1),w=p(null),l=p(null),_=p(null),g=V(()=>e.list.slice(1,4)),u=V(()=>e.list.slice(0,1)),a=V(()=>{var s,k;return(k=(s=e.tabList.find(M=>M.id==e.currentTab))==null?void 0:s.name)!=null?k:""});function c({key:s}){e.currentTab!=s&&(e.currentTab=s,x())}function h(){return F(this,null,function*(){const s=yield le({device_type:1});e.tabList=s,s.length&&(e.currentTab=s[0].id),x()})}function x(){return F(this,null,function*(){var B;const{ip:s,port:k,change_time:M}=yield re(),y=yield ie({base_id:(B=t.baseId)!=null?B:e.currentTab,type:1,status:1,is_recommend:1});l.value=null,e.list=y.splice(0,4).map((O,I)=>{const{rtsp_url:W}=O.extends,q=W;return S(C({},O),{img:I==0?U:I==1?pe:I==2?fe:U,url:`ws://${s}:${k}/rtsp?url=${window.btoa(q)}`})}),e.list.length>0&&(l.value=e.list[0]),L.value||o(M)})}let d=null;function o(s){d&&clearInterval(d),s!=0&&(d=setInterval(()=>{const M=e.tabList.findIndex(B=>B.id==e.currentTab)+1,y=e.tabList[M%e.tabList.length];c(C({key:y.id},y))},1e3*s))}function D(s){l.value.url!=s.url&&(l.value=s)}function j(s){_.value=s,n.value=!0}const L=V(()=>!!t.baseId);return ne(()=>{L.value?x():h()}),se(()=>{d&&clearInterval(d)}),S(C({isBase:L,listBig:u,listSmall:g,onChangeVideo:D,currentVido:l,currentModelVideo:_},oe(e)),{chartRef:w,currentTabValue:a,onMenuClick:c,visibleModal:n,onScreenClick:j})}}),ve={class:"h-full flex flex-col"},be={key:0,class:"py-10px relative"},_e={class:"text-center bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-14px font-bold"},ge={key:0,class:"absolute right-18px top-1/2 transform -translate-y-1/2"},he={class:"cursor-pointer"},xe=i("span",{class:"text-white text-12px"},"\u66F4\u591A",-1),ke={class:"flex-1"},Me={class:"grid grid-cols-3 gap-x-6px pt-10px"},we={class:"w-full"};function ye(t,e,n,w,l,_){const g=f("DownOutlined"),u=f("menu-item"),a=f("Menu"),c=f("Dropdown"),h=f("VideoFlv"),x=f("LinkModal"),d=f("Box");return r(),J(d,{title:"\u76D1\u63A7"},{default:b(()=>[i("div",ve,[t.isBase?z("",!0):(r(),m("div",be,[i("div",_e,R(t.currentTabValue),1),t.tabList.length>1?(r(),m("div",ge,[v(c,{overlayClassName:"dropdownClass",placement:"bottomRight",trigger:"click",style:{height:"300px"}},{overlay:b(()=>[v(a,{onClick:t.onMenuClick},{default:b(()=>[(r(!0),m(T,null,$(t.tabList,o=>(r(),J(u,{key:o.id},{default:b(()=>[i("div",null,R(o.name),1)]),_:2},1024))),128))]),_:1},8,["onClick"])]),default:b(()=>[i("div",he,[xe,v(g,{style:{fontSize:"12px",color:"#FFF"}})])]),_:1})])):z("",!0)])),i("div",{class:K(["flex-1 px-11px flex flex-col py-10px box-content",{"pt-0":!t.isBase}])},[i("div",ke,[(r(!0),m(T,null,$(t.listBig,(o,D)=>(r(),m("div",{class:K(["h-full",{"h-140px":t.isBase}]),key:D},[v(h,{onOnScreen:t.onScreenClick,class:"cursor-pointer",url:o.url,name:o.base_name},null,8,["onOnScreen","url","name"])],2))),128))]),i("div",Me,[(r(!0),m(T,null,$(t.listSmall,o=>(r(),m("div",{class:"h-66px",key:o.id},[v(h,{onOnScreen:t.onScreenClick,class:"cursor-pointer",url:o.url,name:o.base_name,screen:!0},null,8,["onOnScreen","url","name"])]))),128))])],2)]),v(x,{visible:t.visibleModal,"onUpdate:visible":e[0]||(e[0]=o=>t.visibleModal=o),footer:null,title1:t.currentModelVideo&&t.currentModelVideo.name,width:1100},{content:b(()=>[i("div",we,[v(h,{url:t.currentModelVideo.url,screen:!1,name:t.currentModelVideo.name},null,8,["url","name"])])]),_:1},8,["visible","title1"])]),_:1})}var Te=ae(me,[["render",ye]]);export{Te as default};
|