import{a0 as J,av as N,aw as O,aG as T,W as $}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.170379627897314.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897336.js";import{B as P,L,T as M}from"./comm.1703796278973.js";import{e as V}from"./eventsource.1703796278973.js";import{a as I}from"./utils.1703796278973.js";import{d as K,l as k,m as R,k as p,o as b,c as U,a as l,b as u,z as c,A as d,u as t,x,B as w,M as B}from"./vue.1703796278973.js";const z={key:0},ee=K({__name:"index",props:{visible:{type:Boolean,default:!1},data:{type:Object,default:()=>({})}},emits:["update:visible"],setup(m,{emit:C}){const g=m,a=k({get:()=>g.visible,set:o=>C("update:visible",o)});R(()=>a.value,o=>{o&&j()});const r=p(0),f=p(0),S=p(!1),i=p([]),v=k(()=>JSON.stringify(i.value)),j=()=>{r.value=0;const o=`${P}/media/gb28181-cascade/${g.data.id}/bindings/publish?:X_Access_Token=${L.get(M)}`,e=new V.EventSourcePolyfill(o);e.onmessage=_=>{const s=JSON.parse(_.data);s.successful?r.value+=1:(f.value+=1,i.value.length<=5&&i.value.push({...s}))},e.onerror=()=>{e.close()},e.onopen=()=>{}};return(o,e)=>{const _=J,s=N,y=O,A=T,E=$;return b(),U(E,{visible:t(a),"onUpdate:visible":e[2]||(e[2]=n=>B(a)?a.value=n:null),title:"推送",cancelText:"取消",okText:"确定",width:"900px",onOk:e[3]||(e[3]=n=>a.value=!1),onCancel:e[4]||(e[4]=n=>a.value=!1)},{default:l(()=>[u(y,{gutter:20},{default:l(()=>[u(s,{span:8},{default:l(()=>[c("p",null,"成功："+d(t(r)),1),u(_,null,{default:l(()=>[c("p",null,"失败："+d(t(f)),1),t(i).length?(b(),x("a",{key:0,onClick:e[0]||(e[0]=n=>t(I)(t(i)||"",m.data.name+"-推送失败"))},"下载")):w("",!0)]),_:1})]),_:1}),u(s,{span:8},{default:l(()=>[c("p",null,"推送通道数量："+d(m.data.count),1)]),_:1}),u(s,{span:8},{default:l(()=>[c("p",null,"已推送通道数量："+d(t(r)+t(f)),1)]),_:1})]),_:1}),t(S)?(b(),x("div",z,[u(A,{rows:10,value:t(v),"onUpdate:value":e[1]||(e[1]=n=>B(v)?v.value=n:null)},null,8,["value"])])):w("",!0)]),_:1},8,["visible"])}}});export{ee as _};
