2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
var p=(e,s,i)=>new Promise((c,d)=>{var l=t=>{try{a(i.next(t))}catch(o){d(o)}},r=t=>{try{a(i.throw(t))}catch(o){d(o)}},a=t=>t.done?c(t.value):Promise.resolve(t.value).then(l,r);a((i=i.apply(e,s)).next())});import{a as B,bn as V,v as f,K as L,q as S,an as $,fm as N,aE as u,o as v,j as y,B as _,i as m,h as T,l as w,p as b,D as k,t as h}from"./index.203f4f59.js";import{C as U}from"./index.9f194c97.js";import"./index.6791ddaa.js";import"./index.71283b4e.js";import{S as x}from"./index.7d012f39.js";import{h as A}from"./other.d43d2a78.js";import{_ as I}from"./index.4b37ed3f.js";import"./index.0a5a9dd5.js";import"./index.886f9be4.js";import"./useRefs.432b35dd.js";import"./PlusOutlined.8a2c9f9f.js";const R=B({components:{Card:U,[x.name]:x,Tooltip:V,LiveVideo:I},props:{item:{type:Object,default:()=>{}},url:{type:String},recommend:{type:Boolean,default:!0}},setup(e){const s=f(null),i=f(e.item.is_recommend==1),c=f("");function d(){return p(this,null,function*(){const a=$(e.item),{supplier:t,extends:o,sn:n}=a,C=o.rtsp_url;let g=`ws://${e.url}/rtsp?url=${window.btoa(C)}`;if((t==null?void 0:t.id)=="device-supplier-biang")try{g=yield l({username:o.username,password:o.password,equipmentCode:n,channelNo:o.passage})}catch(M){}c.value=g})}function l(a){return new Promise((t,o)=>p(this,null,function*(){try{const{data:n}=yield N.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 r(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 L(()=>{d()}),{videoRef:s,checked:i,onChange:r,liveUrl:c,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"},D={class:"absolute left-0 w-full top-0 h-full"},E={class:"px-10px"},z={class:"flex justify-end py-4px"},F={class:"line-clamp-2 h-48px"};function K(e,s,i,c,d,l){const r=u("LiveVideo"),a=u("a-switch"),t=u("Tooltip"),o=u("Card");return v(),y(o,{hoverable:!0,class:"card",bodyStyle:{padding:0}},{cover:_(()=>[m("div",j,[e.item.is_recommend==1?(v(),T("div",q,"\u63A8\u8350")):w("",!0),m("div",D,[b(r,{id:e.item.id,class:"w-full h-full"},null,8,["id"])])])]),default:_(()=>[m("div",E,[m("div",z,[e.recommend?(v(),y(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"])):w("",!0)]),m("div",F,[b(t,{placement:"top"},{title:_(()=>[k(h(e.item.base_name)+"-"+h(e.item.monitoring_point),1)]),default:_(()=>[k(" "+h(e.item.base_name)+"-"+h(e.item.monitoring_point),1)]),_:1})])])]),_:1})}var oe=S(R,[["render",K],["__scopeId","data-v-175d9004"]]);export{oe as default};
|