1 |
- import{f as t,E as s,d as w,X as D,a6 as E,Z as n,u as o,F}from"./vue-fae2b924.js";import{a0 as r,aa as P,aV as f,aW as B,aG as M,U as m,M as A}from"./radical-24ede98f.js";import{V as x,k as L,x as R}from"./index-bad227d6.js";import{u as V}from"./index-ac72395e.js";import{q as $,a as T,e as z}from"./schema-13fcd6d1.js";import{u as h}from"./useAddPushForm-9aac2b23.js";import{u as H}from"./global-d3aa2cdf.js";import{u as I}from"./usePlay-a8635f7c.js";import"./index-b7a6e0fa.js";import"./jb4-5a340080.js";import"./canvas-14fb4930.js";import"./gb28181-e318e8a2.js";const U={0:t("span",null,[t(r,{icon:"mdi:lan-disconnect",class:"v-text-bottom mr-8px"},null),s("离线")]),1:t("span",null,[t(r,{icon:"mdi:lan-connect",class:"v-text-bottom mr-8px"},null),s("在线")]),2:t("span",null,[t(r,{icon:"svg-spinners:3-dots-fade",class:"v-text-bottom mr-8px"},null),s("推流")]),3:t("span",null,[t(r,{icon:"nimbus:forbidden",class:"v-text-bottom mr-8px"},null),s("禁用")])},y={0:t("span",null,[t(r,{icon:"line-md:beer-loop",class:"v-text-bottom mr-8px"},null),s("等待发布后转推")]),1:t("span",null,[t(r,{icon:"line-md:compass-loop",class:"v-text-bottom mr-8px"},null),s("按需拉流后转推")])},W=u=>U[u],q=u=>u?y[1]:y[0],K=w({name:"StreamProxy"}),st=w({...K,setup(u){x.renderer.add("DeviceStatus",{renderDefault(e,l){const{row:a}=l;return W(a.status)}}),x.renderer.add("PushOnStart",{renderDefault(e,l){const{row:a}=l;return q(a.pushOnStart)}});const{pause:d,resume:p}=H(i),v=()=>{h({updateList:i,pause:d,resume:p})},{FormilyForm:g}=P({schema:$(v,"添加推流代理")}),b={toggleRowExpand:({expanded:e})=>{e?d():p()}},c=V(),_=e=>{c.tableRef.reloadData(e||[])};function i(){return T().then(e=>{_(e)}).catch(e=>{console.error(`stream-proxy-getList-error: ${e}`)})}i();const S=e=>{A.confirm({title:"提示",content:"确定要删除吗?",onOk:()=>{z(e).then(i)}})},C=e=>{h({updateList:i,pause:d,resume:p,row:e})},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:"pushURL",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:"pushOnStart",title:"推流模式",showOverflow:"tooltip",width:"120px",cellRender:{name:"PushOnStart"}},{field:"createTime",title:"创建时间",width:"200px",formatter:({cellValue:e})=>R.toDateString(new Date(e),"yyyy-MM-dd HH:mm:ss")},{field:"operate",title:"操作",width:"180px",fixed:"right",align:"center",slots:{default:"operate"}}],data:[]};return(e,l)=>(D(),E(F,null,[t(o(f),{bordered:!1,bodyStyle:{padding:"10px",marginBottom:"8px"}},{default:n(()=>[t(o(g))]),_:1}),t(o(f),{bordered:!1,bodyStyle:{padding:"10px",height:"calc(100% - 50px)"},style:{height:"calc(100% - 100px)"}},{default:n(()=>[t(o(B),{windowWidth:1716}),t(o(L),{uid:o(c).uid,gridOptions:O,gridEvent:b},{operate:n(({row:a})=>[t(o(M),null,{default:n(()=>[t(o(m),{size:"small",type:"link",onClick:()=>(o(I)({path:a.streamPath},{onClose:o(p)}),o(d)())},{default:n(()=>l[0]||(l[0]=[s(" 播放 ")])),_:2},1032,["onClick"]),t(o(m),{size:"small",type:"link",onClick:k=>C(a)},{default:n(()=>l[1]||(l[1]=[s(" 编辑 ")])),_:2},1032,["onClick"]),t(o(m),{size:"small",type:"link",onClick:k=>S(a)},{default:n(()=>l[2]||(l[2]=[s(" 删除 ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"])]),_:1})],64))}});export{st as default};
|