gb28181-92ed7f01.js 6.9 KB

1
  1. import{d as y,X as I,a6 as V,f as t,u as e,Z as n,E as m,F as D,g as R,Y as L,a9 as w,_ as A,a7 as F}from"./vue-fae2b924.js";import{k as T,V as B,x as E}from"./index-137e94ff.js";import{u as S}from"./index-ac72395e.js";import{aW as v,U as _,ab as M,aa as W,G as g,g as H,aX as G,a0 as N,aG as U,aV as z,M as q}from"./radical-3ee02118.js";import{u as $}from"./usePlay-79f7ae72.js";import{u as K,a as X,d as j,b as Y}from"./gb28181-fe7ed9bb.js";import"./index-f7117e22.js";import"./jb4-f3d7ce01.js";import"./canvas-14fb4930.js";import"./global-f242879f.js";const Z=y({name:"Channel"}),J=y({...Z,props:{detail:{},parent:{}},setup(r){const p=r,c=S(),u={maxHeight:"530px",rowConfig:{keyField:"deviceId",useKey:!0},columnConfig:{useKey:!0},columns:[{field:"deviceId",title:"编号",showOverflow:"tooltip",width:"200px",fixed:"left"},{field:"name",title:"名称",showOverflow:"tooltip",width:"120px",fixed:"left"},{field:"status",title:"状态",minWidth:"100px"},{field:"manufacturer",title:"厂商",width:"120px"},{field:"address",title:"地址",showOverflow:"tooltip",width:"180px"},{field:"port",title:"端口",width:"70px"},{field:"model",title:"型号",width:"180px"},{field:"owner",title:"Owner",width:"120px"},{field:"civilCode",title:"CivilCode",width:"120px"},{field:"parental",title:"Parental",width:"120px"},{field:"safetyWay",title:"SafetyWay",width:"120px"},{field:"registerWay",title:"RegisterWay",width:"120px"},{field:"secrecy",title:"Secrecy",width:"120px"},{field:"operate",title:"操作",width:"80px",slots:{default:"operate"},align:"center",fixed:"right"}],data:p.detail};return(s,l)=>(I(),V(D,null,[t(e(v)),t(e(T),{uid:e(c).uid,gridOptions:u},{operate:n(({row:d})=>[t(e(_),{size:"small",type:"link",disabled:d.status==="OFF",onClick:()=>e($)({id:s.parent.deviceId,deviceName:s.parent.name,deviceId:d.deviceId,channelName:d.name,isGbRecord:!1})},{default:n(()=>l[0]||(l[0]=[m(" 播放 ")])),_:2},1032,["disabled","onClick"])]),_:1},8,["uid"])],64))}}),Q=({row:r,appContext:p,pause:c,resume:u})=>{c();const{name:s,deviceId:l,channels:d}=r;M({content:t(J,{detail:d||[],parent:{name:s,deviceId:l}},null),modalConfig:{appContext:p,width:"78%",title:`${s} 通道详情`,okButtonProps:{style:{display:"none"}},cancelText:"关闭",maskClosable:!1,onCancel:()=>u()}})},ee=r=>({type:"object",properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"horizontal"},properties:{streamMode:{type:"string",title:"流传输模式","x-decorator":"FormItem","x-decorator-props":{labelWidth:120,wrapperWidth:200},"x-component":"Select","x-component-props":{placeholder:"请选择流传输模式",allowClear:!0,options:[{label:"UDP",value:"UDP"},{label:"TCP-ACTIVE",value:"TCP-ACTIVE"},{label:"TCP-PASSIVE",value:"TCP-PASSIVE"}],style:{width:"100%"}},required:!0,default:r}}}}}),te=({row:r,appContext:p,pause:c,resume:u,updatList:s})=>{c();const{streamMode:l,deviceId:d}=r,{FormilyForm:f,submit:x}=W({schema:ee(l)});M({content:t(f,null,null),modalConfig:{appContext:p,width:"500px",title:"修改流传输模式",onOk:async()=>{const{streamMode:h}=await x();await K({deviceId:d,streamMode:h}),g.success("流传输模式修改成功"),s(),u()},cancelText:"关闭",maskClosable:!1,onCancel:()=>u()}})},ie={class:"flex items-center"},ae=y({name:"Device"}),fe=y({...ae,setup(r){var C;const p=(C=R())==null?void 0:C.appContext,c=async i=>{await X(i),g.success(`${i} 设备通道已更新!`)},u=i=>{q.confirm({title:"确定删除设备?",cancelText:"取消",okText:"确定",content:"删除后设备将无法使用!",onOk:()=>{j(i).then(()=>{g.success("设备已删除!"),l.tableRef.commitProxy("query")})}})};B.renderer.add("moreFields",{renderExpand(i,o){const{row:a}=o;return t("p",{class:"flex flex-col p-10px m-0"},[t("span",null,[t("b",null,[m("型号(Model):  ")]),a.Model||"--"]),t("span",null,[t("b",null,[m("纬度(Latitude):  ")]),a.Latitude||"--"]),t("span",null,[t("b",null,[m("经度(Longitude):  ")]),a.Longitude||"--"])])}});const s={toggleRowExpand:({expanded:i})=>{i?f():x()}},l=S(),{httpRefreshTime:d}=H({VITE_PORT:"3000",VITE_GLOB_APP_TITLE:"SagooMedia",VITE_GLOB_APP_SHORT_NAME:"SagooMedia",VITE_NEED_LOGIN:"false",VITE_USE_MOCK:"true",VITE_PUBLIC_PATH:"/plugin/media",VITE_DROP_CONSOLE:"true",VITE_BUILD_COMPRESS:"none",VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE:"false",VITE_GLOB_HTTP_REFRESH_TIME:"5000",VITE_USE_IMAGEMIN:"true",VITE_LEGACY:"false",VITE_M7S_SERVER:"/media",VITE_M7S_WS_SERVER:"/media",BASE_URL:"/plugin/media",MODE:"production",DEV:!1,PROD:!0,SSR:!1}),{pause:f,resume:x}=G(()=>{l.tableRef.commitProxy("query")},d),h=()=>{l.tableRef.commitProxy("query")},P=(i,o)=>new Promise(async a=>{const{data:k,total:O}=await Y({page:i,count:o});a({total:O,data:k})}),b={pagerConfig:{pageSize:10},proxyConfig:{seq:!0,props:{result:"data",total:"total"},ajax:{query:({page:i})=>P(i.currentPage,i.pageSize)}},maxHeight:"100%",rowConfig:{keyField:"ID",useKey:!0},columnConfig:{useKey:!0},columns:[{title:"...",width:"30px",type:"expand",contentRender:{name:"moreFields"},fixed:"left"},{field:"deviceId",title:"设备编号",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"name",title:"设备名称",showOverflow:"tooltip",width:"120px",type:"html"},{field:"channelCount",title:"通道数",width:"70px"},{field:"status",title:"状态",minWidth:"120px"},{field:"streamMode",title:"流传输模式",width:"190px",slots:{default:"streamMode"}},{field:"manufacturer",title:"厂商",width:"120px"},{field:"keepAliveTime",title:"最后保活时间",minWidth:"180px",formatter:({cellValue:i})=>E.toDateString(new Date(i),"yyyy-MM-dd HH:mm:ss")},{field:"registerTime",title:"注册时间",minWidth:"180px",formatter:({cellValue:i})=>E.toDateString(new Date(i),"yyyy-MM-dd HH:mm:ss")},{field:"updateTime",title:"更新时间",minWidth:"180px",formatter:({cellValue:i})=>E.toDateString(new Date(i),"yyyy-MM-dd HH:mm:ss")},{field:"operate",title:"操作",width:"250px",fixed:"right",align:"center",slots:{default:"operate"}}]};return(i,o)=>(I(),L(e(z),{bordered:!1,bodyStyle:{padding:"10px",height:"100%"},style:{height:"100%"}},{default:n(()=>[t(e(v),{windowWidth:1716}),t(e(T),{uid:e(l).uid,gridOptions:b,gridEvent:s},{streamMode:n(({row:a})=>[w("div",ie,[w("span",null,A(a.streamMode),1),t(e(_),{type:"link",onClick:()=>e(te)({row:a,appContext:e(p),pause:e(f),resume:e(x),updatList:h})},{default:n(()=>[t(e(N),{icon:"ant-design:edit-outlined",class:F(["v-text-bottom","ml-5px","cursor-pointer"])})]),_:2},1032,["onClick"])])]),operate:n(({row:a})=>[t(e(U),null,{default:n(()=>[t(e(_),{size:"small",type:"link",onClick:()=>e(Q)({row:a,appContext:e(p),pause:e(f),resume:e(x)})},{default:n(()=>o[0]||(o[0]=[m(" 通道详情 ")])),_:2},1032,["onClick"]),t(e(_),{size:"small",type:"text",onClick:()=>c(a.deviceId)},{default:n(()=>o[1]||(o[1]=[m(" 更新通道 ")])),_:2},1032,["onClick"]),t(e(_),{size:"small",type:"link",danger:"",onClick:()=>u(a.deviceId)},{default:n(()=>o[2]||(o[2]=[m(" 删除设备 ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"])]),_:1}))}});export{fe as default};