| 12 |
- import{d as T,b6 as V,b7 as k,r as I,ap as M,cp as H,Z as h,$ as b,a0 as o,T as e,bP as K,aC as W,n as l,bn as G,a5 as d,a6 as n,a7 as m,aG as g,b4 as x,a1 as X,a3 as q,aQ as c,a2 as Q,a9 as Z,b9 as j,bV as A,cf as y,bB as w,ch as v,ba as C,ck as J,bD as Y,cD as ee}from"./index-29ddf794.js";import{u as te}from"./index-51ee3269.js";import"./dayjs-919e6097.js";import{_ as ae}from"./scroll-tip.vue_vue_type_script_setup_true_lang-598d6d52.js";import{s as se}from"./mp4-50686227.js";import{g as S}from"./utils-dcafd0a7.js";import{s as re}from"./state-790a01ee.js";import{u as oe}from"./usePlay-52c7678e.js";import{L as le,a as ie}from"./index-b32ade1c.js";import"./index-f3a4ad50.js";import"./index-bd86f0a6.js";import"./index-0322ba67.js";import"./gb28181-b3e5bc95.js";import"./jb4-84c0b153.js";import"./canvas-b3f2b616.js";import"./index-aadff3b2.js";import"./index-f8d3c14b.js";import"./index-2325dd85.js";const ne={style:{padding:"16px"}},ue=T({name:"StreamPush"}),$e=T({...ue,setup(de){const{t:a}=W(),{pause:D,resume:$}=V(p);k.renderer.add("State",{renderDefault(s,r){const{row:t}=r;return re[t.state]}}),k.renderer.add("BPS",{renderDefault(s,r){const{row:t}=r;let u=0,f=0;return t.audioTrack&&(u=t.audioTrack.bps,f=t.audioTrack.bpsOut),t.videoTrack&&(u+=t.videoTrack.bps,f+=t.videoTrack.bpsOut),`↑${S(u)} ↓${S(f)}`}});const P=te(),O=s=>{s.length>1&&(s=s.sort((r,t)=>Date.parse(r.startTime)-Date.parse(t.startTime))),P.tableRef.reloadData(s)};async function p(){O(await K())}p();const i=I({visible:!1,form:{streamPath:"",filePath:"records",hours:0,minutes:1,seconds:0}});function R(s){P.tableRef.toggleRowExpand(s)}function _(s){i.form.streamPath=s.path,i.visible=!0}async function B(){try{const s=`${i.form.hours}h${i.form.minutes}m${i.form.seconds}s`;await se({streamPath:i.form.streamPath,filePath:i.form.filePath,type:"mp4",fragment:s}),i.visible=!1,p()}catch(s){console.error(a("routes.streamPush.录制失败"),s)}}async function E(s){try{await J(s),p()}catch(r){console.error(a("routes.streamPush.停止录制失败"),r)}}const L={maxHeight:"100%",rowConfig:{keyField:"path",useKey:!0},expandConfig:{expandRowKeys:[],accordion:!1,lazy:!1},columnConfig:{useKey:!0},columns:[{field:"pluginName",get title(){return a("routes.streamPush.所属插件")},fixed:"left",width:"100px"},{field:"path",get title(){return a("routes.streamPush.流标识")},showOverflow:"tooltip",minWidth:"150px"},{field:"audioTrack",get title(){return a("routes.streamPush.音频")},width:"60px",formatter:({cellValue:s})=>s?.codec},{field:"videoTrack",get title(){return a("routes.streamPush.视频")},width:"60px",formatter:({cellValue:s})=>s?.codec},{field:"state",get title(){return a("routes.streamPush.状态")},showOverflow:"tooltip",cellRender:{name:"State"},width:"140px"},{field:"type",get title(){return a("routes.streamPush.类型")},width:"80px",showOverflow:"tooltip"},{field:"subscribers",get title(){return a("routes.streamPush.订阅")},showOverflow:"tooltip",width:"110px"},{field:"startTime",get title(){return a("routes.streamPush.创建时间")},width:"180px",formatter:({cellValue:s})=>Y.toDateString(new Date(s),"yyyy-MM-dd HH:mm:ss")},{field:"BPS",title:"BPS",width:"110px",cellRender:{name:"BPS"}},{field:"recording",get title(){return a("routes.streamPush.录制")},width:"100px",align:"center",slots:{default:"recording",content:"recordingExpand"}},{field:"operate",get title(){return a("routes.streamPush.操作")},width:"170px",align:"center",fixed:"right",slots:{default:"operate"}}],data:[]},U=s=>{C.confirm({title:a("routes.streamPush.提示"),content:`${a("routes.streamPush.此操作将停止")} ${s.path}${a("routes.streamPush.是否继续")}`,onOk:async()=>{await ee(s.path),p()}})},z=M(),F=H(),N=s=>{const r=String(F.name).endsWith("Frame");z({name:r?"StreamPushDetailFrame":"StreamPushDetail",query:{path:s}})};return(s,r)=>(h(),b(e(x),{bordered:!1,bodyStyle:{padding:"10px",height:"100%"},style:{height:"calc(100% - 100px)"}},{default:o(()=>[l(e(ae),{windowWidth:1716}),l(e(j),{uid:e(P).uid,gridOptions:L},{recording:o(({row:t})=>[l(e(G),{color:t.recording.length>0?"blue":"",style:{cursor:"pointer"},onClick:u=>t.recording.length>0?R(t):_(t)},{default:o(()=>[d(n(t.recording.length||0),1)]),_:2},1032,["color","onClick"])]),recordingExpand:o(({row:t})=>[m("div",ne,[l(e(g),{direction:"vertical",style:{width:"100%"}},{default:o(()=>[t.recording.length?(h(),b(e(x),{key:0,size:"small",bordered:!1},{title:o(()=>[d(n(e(a)("routes.streamPush.录制列表")),1)]),default:o(()=>[l(e(le),null,{default:o(()=>[(h(!0),X(Q,null,q(t.recording,(u,f)=>(h(),b(e(ie),{key:f},{default:o(()=>[l(e(g),null,{default:o(()=>[m("span",null,n(e(a)("routes.streamPush.文件路径"))+": "+n(u.filePath),1),m("span",null,n(e(a)("routes.streamPush.片段时长"))+": "+n(u.fragment),1),l(e(c),{type:"link",danger:"",onClick:()=>E(t.pointer)},{default:o(()=>[d(n(e(a)("routes.streamPush.停止")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)):Z("",!0),l(e(c),{type:"primary",onClick:()=>_(t)},{default:o(()=>[d(n(e(a)("routes.streamPush.新增录制")),1)]),_:2},1032,["onClick"])]),_:2},1024)])]),operate:o(({row:t})=>[l(e(g),null,{default:o(()=>[l(e(c),{size:"small",type:"link",onClick:()=>(e(oe)({path:t.path,type:t.type},{onClose:e($)}),e(D)())},{default:o(()=>[d(n(e(a)("routes.streamPush.播放")),1)]),_:2},1032,["onClick"]),l(e(c),{size:"small",type:"link",onClick:()=>N(t.path)},{default:o(()=>[d(n(e(a)("routes.streamPush.详情")),1)]),_:2},1032,["onClick"]),l(e(c),{size:"small",type:"link",onClick:()=>U(t)},{default:o(()=>[d(n(e(a)("routes.streamPush.停止")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"]),l(e(C),{visible:i.visible,"onUpdate:visible":r[5]||(r[5]=t=>i.visible=t),title:e(a)("routes.streamPush.录制设置"),onOk:B,onCancel:r[6]||(r[6]=t=>i.visible=!1)},{default:o(()=>[l(e(A),{model:i.form,layout:"vertical"},{default:o(()=>[l(e(y),{label:e(a)("routes.streamPush.流路径")},{default:o(()=>[l(e(w),{value:i.form.streamPath,"onUpdate:value":r[0]||(r[0]=t=>i.form.streamPath=t),disabled:""},null,8,["value"])]),_:1},8,["label"]),l(e(y),{label:e(a)("routes.streamPush.文件路径")},{default:o(()=>[l(e(w),{value:i.form.filePath,"onUpdate:value":r[1]||(r[1]=t=>i.form.filePath=t),placeholder:e(a)("routes.streamPush.请输入保存文件路径")},null,8,["value","placeholder"])]),_:1},8,["label"]),l(e(y),{label:e(a)("routes.streamPush.片段时长")},{default:o(()=>[l(e(g),null,{default:o(()=>[l(e(v),{value:i.form.hours,"onUpdate:value":r[2]||(r[2]=t=>i.form.hours=t),min:0,max:23,placeholder:e(a)("routes.streamPush.时"),style:{width:"80px"}},null,8,["value","placeholder"]),m("span",null,n(e(a)("routes.streamPush.时")),1),l(e(v),{value:i.form.minutes,"onUpdate:value":r[3]||(r[3]=t=>i.form.minutes=t),min:0,max:59,placeholder:e(a)("routes.streamPush.分"),style:{width:"80px"}},null,8,["value","placeholder"]),m("span",null,n(e(a)("routes.streamPush.分")),1),l(e(v),{value:i.form.seconds,"onUpdate:value":r[4]||(r[4]=t=>i.form.seconds=t),min:0,max:59,placeholder:e(a)("routes.streamPush.秒"),style:{width:"80px"}},null,8,["value","placeholder"]),m("span",null,n(e(a)("routes.streamPush.秒")),1)]),_:1})]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["visible","title"])]),_:1}))}});export{$e as default};
- //# sourceMappingURL=index-42b7cca3.js.map
|