pull-65acac80.js 3.1 KB

1
  1. import{d as h,X as S,a6 as C,f as o,Z as i,u as e,E as d,F as P}from"./vue-fae2b924.js";import{aa as b,aV as f,aW as D,aG as E,U as p,M as F}from"./radical-e583b742.js";import{V as m,k as R,x as T}from"./index-7a259168.js";import{u as L}from"./index-ac72395e.js";import{q as V,g as $,d as B}from"./schema-ef6bcc49.js";import{d as M,p as z,u as c}from"./pullOnStart-b6f24016.js";import{u as H}from"./global-f6e5c3a3.js";import{u as U}from"./usePlay-2edeeb77.js";import"./index-3ee11f11.js";import"./jb4-52644b2c.js";import"./canvas-14fb4930.js";import"./gb28181-c1c04a54.js";const W=h({name:"StreamProxy"}),et=h({...W,setup(q){m.renderer.add("DeviceStatus",{renderDefault(t,l){const{row:a}=l;return M(a.status)}}),m.renderer.add("PullOnStart",{renderDefault(t,l){const{row:a}=l;return z(a.pullOnStart)}});const{pause:s,resume:n}=H(r),x=()=>{c({updateList:r,pause:s,resume:n})},{FormilyForm:y}=b({schema:V(x,"添加拉流代理")}),w={toggleRowExpand:({expanded:t})=>{t?s():n()}},u=L(),g=t=>{u.tableRef.reloadData(t||[])};function r(){return $().then(t=>{g(t)}).catch(t=>{console.error(`stream-proxy-getList-error: ${t}`)})}r();const _=t=>{F.confirm({title:"提示",content:"确定要删除吗?",onOk:()=>{B(t).then(r)}})},v=t=>{c({updateList:r,pause:s,resume:n,row:t})},O={maxHeight:"100%",rowConfig:{keyField:"ID",useKey:!0},columnConfig:{useKey:!0},columns:[{field:"name",title:"名称",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"streamPath",title:"流标识",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"pullURL",title:"源地址",showOverflow:"tooltip",minWidth:"250px",type:"html"},{field:"type",title:"类型",showOverflow:"tooltip",width:"80px",fixed:"left",type:"html"},{field:"status",title:"状态",showOverflow:"tooltip",width:"80px",fixed:"left",cellRender:{name:"DeviceStatus"}},{field:"rtt",title:"RTT",showOverflow:"tooltip",width:"60px",fixed:"left"},{field:"pullOnStart",title:"拉流模式",showOverflow:"tooltip",width:"120px",cellRender:{name:"PullOnStart"}},{field:"createTime",title:"创建时间",width:"200px",formatter:({cellValue:t})=>T.toDateString(new Date(t),"yyyy-MM-dd HH:mm:ss")},{field:"operate",title:"操作",width:"180px",fixed:"right",align:"center",slots:{default:"operate"}}],data:[]};return(t,l)=>(S(),C(P,null,[o(e(f),{bordered:!1,bodyStyle:{padding:"10px",marginBottom:"8px"}},{default:i(()=>[o(e(y))]),_:1}),o(e(f),{bordered:!1,bodyStyle:{padding:"10px",height:"calc(100% - 50px)"},style:{height:"calc(100% - 100px)"}},{default:i(()=>[o(e(D),{windowWidth:1716}),o(e(R),{uid:e(u).uid,gridOptions:O,gridEvent:w},{operate:i(({row:a})=>[o(e(E),null,{default:i(()=>[o(e(p),{size:"small",type:"link",disabled:![1,2].includes(a.status),onClick:()=>(e(U)({path:a.streamPath},{onClose:e(n)}),e(s)())},{default:i(()=>l[0]||(l[0]=[d(" 播放 ")])),_:2},1032,["disabled","onClick"]),o(e(p),{size:"small",type:"link",onClick:k=>v(a)},{default:i(()=>l[1]||(l[1]=[d(" 编辑 ")])),_:2},1032,["onClick"]),o(e(p),{size:"small",type:"link",onClick:k=>_(a)},{default:i(()=>l[2]||(l[2]=[d(" 删除 ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"])]),_:1})],64))}});export{et as default};