lcny-vue3-antd-admin/dist/assets/LiveBroadcastItem.9c19ecfa.js

2 lines
2.8 KiB
JavaScript

var p=(e,s,i)=>new Promise((r,c)=>{var m=t=>{try{a(i.next(t))}catch(o){c(o)}},d=t=>{try{a(i.throw(t))}catch(o){c(o)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(m,d);a((i=i.apply(e,s)).next())});import{a as C,bk as V,r as v,G as B,J as L,aj as S,fl as $,aA as u,o as _,j as g,x as h,i as l,h as U,l as y,p as N,y as k,t as f}from"./index.e8334860.js";import{C as A}from"./index.a270b4aa.js";import"./index.a6c93adc.js";import"./index.42fbabf5.js";import{S as b}from"./index.4526dbe2.js";import{h as T}from"./other.c802c5e4.js";import{_ as j}from"./index.7d14de81.js";import"./index.111d9261.js";import"./index.8e80d52e.js";import"./useRefs.b991dc76.js";import"./PlusOutlined.dfc75c0d.js";const I=C({components:{Card:A,[b.name]:b,Tooltip:V,LiveVideo:j},props:{item:{type:Object,default:()=>{}},url:{type:String},recommend:{type:Boolean,default:!0}},setup(e){const s=v(null),i=v(e.item.is_recommend==1),r=v("");function c(){return p(this,null,function*(){const a=S(e.item),{supplier:t,extends:o,sn:n}=a,x=o.rtsp_url;let w=`ws://${e.url}/rtsp?url=${window.btoa(x)}`;if((t==null?void 0:t.id)=="device-supplier-biang")try{w=yield m({username:o.username,password:o.password,equipmentCode:n,channelNo:o.passage})}catch(J){}r.value=w})}function m(a){return new Promise((t,o)=>p(this,null,function*(){try{const{data:n}=yield $.get("https://yun.bigdata5s.com/api/open-api/open/getSeedingLive",{params:a});n.code==200?t(n.data):o(n)}catch(n){o(n)}}))}function d(a){return p(this,null,function*(){const t=a?1:0;yield T({id:e.item.id,is_recommend:t}),e.item.is_recommend=t})}return B(()=>{c()}),{videoRef:s,checked:i,onChange:d,liveUrl:r,data:e.item}}}),R={class:"bg-gray-200 pt-220/386 relative"},q={key:0,class:"absolute text-white px-6px py-2px rounded-2px z-99 text-12px bg-black bg-opacity-20 top-6px right-6px"},z={class:"absolute left-0 w-full top-0 h-full"},D={class:"px-10px"},E={class:"flex justify-end py-4px"},F={class:"line-clamp-2 h-48px"};function G(e,s,i,r,c,m){const d=u("LiveVideo"),a=u("a-switch"),t=u("Tooltip"),o=u("Card");return _(),g(o,{hoverable:!0,class:"card",bodyStyle:{padding:0}},{cover:h(()=>[l("div",R,[e.item.is_recommend==1?(_(),U("div",q,"\u63A8\u8350")):y("",!0),l("div",z,[e.liveUrl?(_(),g(d,{key:0,class:"w-full h-full",url:e.liveUrl},null,8,["url"])):y("",!0)])])]),default:h(()=>[l("div",D,[l("div",E,[e.recommend?(_(),g(a,{key:0,"checked-children":"\u63A8\u8350\u5F00","un-checked-children":"\u63A8\u8350\u5173",checked:e.checked,"onUpdate:checked":s[0]||(s[0]=n=>e.checked=n),onChange:e.onChange},null,8,["checked","onChange"])):y("",!0)]),l("div",F,[N(t,{placement:"top"},{title:h(()=>[k(f(e.item.base_name)+"-"+f(e.item.monitoring_point),1)]),default:h(()=>[k(" "+f(e.item.base_name)+"-"+f(e.item.monitoring_point),1)]),_:1})])])]),_:1})}var oe=L(I,[["render",G],["__scopeId","data-v-56ae9f23"]]);export{oe as default};