lcny-vue3-antd-admin/dist/assets/LiveBroadcastItem.65a2a2ec.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 x,bm as V,r as v,G as B,J as L,al as S,fm as $,aC as u,o as _,j as g,x as h,i as l,h as U,l as y,p as N,y as b,t as f}from"./index.caefd1ac.js";import{C as T}from"./index.fd168b73.js";import"./index.e1892962.js";import"./index.1159119f.js";import{S as k}from"./index.4c660ef0.js";import{h as A}from"./other.a9ed122c.js";import{_ as I}from"./index.a075086b.js";import"./index.c58116f5.js";import"./index.f24323fa.js";import"./useRefs.32aa9173.js";import"./PlusOutlined.7d243bc0.js";const R=x({components:{Card:T,[k.name]:k,Tooltip:V,LiveVideo:I},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,C=o.rtsp_url;let w=`ws://${e.url}/rtsp?url=${window.btoa(C)}`;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 A({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}}}),j={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",j,[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(()=>[b(f(e.item.base_name)+"-"+f(e.item.monitoring_point),1)]),default:h(()=>[b(" "+f(e.item.base_name)+"-"+f(e.item.monitoring_point),1)]),_:1})])])]),_:1})}var oe=L(R,[["render",G],["__scopeId","data-v-56ae9f23"]]);export{oe as default};