gb28181-7f29a90e.js 12 KB

12
  1. import{a$ as S,bm as P,n as t,bb as v,d as w,c as T,Z as D,a1 as A,T as e,a0 as f,a2 as V,bn as G,aP as E,a5 as I,b8 as M,e as N,b6 as U,ax as z,bo as $,b3 as R,a7 as L,a6 as O,b9 as j,bp as k}from"./index-8a67e3df.js";import{u as B}from"./index-c6560d80.js";import"./dayjs-919e6097.js";import{_ as K}from"./scroll-tip.vue_vue_type_script_setup_true_lang-ad39136f.js";import{u as X}from"./usePlay-e0a28163.js";import{u as Y,a as Z,r as J,d as Q,b as ee}from"./gb28181-a8ace5d9.js";import{_ as te}from"./index-66456a53.js";import"./index-6c00bb26.js";import"./index-82d2c624.js";import"./index-1e695827.js";import"./jb4-5138f1a1.js";import"./canvas-2aaf4e1d.js";import"./index-6a257713.js";import"./index-4c0c9569.js";import"./index-a5661619.js";const oe=({streamMode:i,name:s,subscribeCatalog:r,subscribeAlarm:y,subscribePosition:p})=>({type:"object",properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"horizontal",labelAlign:"right",labelWidth:180,wrapperWidth:300},properties:{name:{type:"string",title:"设备名称","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"请输入设备名称,",allowClear:!0},default:s},streamMode:{type:"string",title:"流传输模式","x-decorator":"FormItem","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:i},subscribeCatalog:{type:"boolean",title:"是否订阅目录","x-decorator":"FormItem","x-component":"Switch",default:r},subscribeAlarm:{type:"boolean",title:"是否订阅报警","x-decorator":"FormItem","x-component":"Switch",default:y},subscribePosition:{type:"boolean",title:"是否订阅位置","x-decorator":"FormItem","x-component":"Switch",default:p}}}}}),ae=({channelId:i,name:s})=>({type:"object",properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"horizontal"},properties:{name:{type:"string",title:"设备名称","x-decorator":"FormItem","x-decorator-props":{labelWidth:120,wrapperWidth:240},"x-component":"Input","x-component-props":{placeholder:"请输入设备名称",allowClear:!0},default:s},channelId:{type:"string",title:"设备ID","x-decorator":"FormItem","x-decorator-props":{labelWidth:120,wrapperWidth:240},"x-component":"Input","x-component-props":{placeholder:"请输入设备ID",allowClear:!0},default:i}}}}}),le=({handleSubmit:i,handleReset:s})=>({type:"object",properties:{layout:{type:"void","x-component":"FormLayout","x-component-props":{layout:"inline",style:"marginTop: 22px"},properties:{query:{type:"string",title:"设备ID/名称","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"请输入设备ID或名称,支持按 Enter 搜索",allowClear:!0,style:{width:"300px",marginRight:"8px"},"@pressEnter":()=>i()}},status:{type:"number",title:"信令传输",enum:[{label:"全部",value:-1},{label:"在线",value:1},{label:"离线",value:0}],"x-decorator":"FormItem","x-component":"Select","x-component-props":{style:{width:"160px",marginRight:"8px"},"@inputKeyDown":r=>r.key==="Enter"&&i()},default:-1},btns:{type:"void","x-component":"FormButtonGroup","x-component-props":{style:"marginLeft: 8px"},properties:{submit:{type:"void","x-component":"Button","x-component-props":{type:"primary","@click":()=>i(),style:"width: 70px;"},"x-content":"查询"},reset:{type:"void","x-component":"Button","x-component-props":{"@click":()=>s(),style:"width: 70px"},"x-content":"重置"}}}}}}}),ne=({row:i,pause:s,resume:r,updatList:y})=>{s();const{streamMode:p,deviceId:c,name:b,subscribeCatalog:C,subscribeAlarm:_,subscribePosition:l}=i,{FormilyForm:n,submit:o}=S({schema:oe({streamMode:p,name:b,subscribeCatalog:C,subscribeAlarm:_,subscribePosition:l})});P({content:t(n,null,null),modalConfig:{width:"500px",title:"设备编辑",onOk:async()=>{const u=await o();if(u){const{streamMode:g,name:m,subscribeCatalog:h,subscribeAlarm:a,subscribePosition:d}=u;return await Y({deviceId:c,streamMode:g,name:m,subscribeCatalog:h,subscribeAlarm:a,subscribePosition:d}),v.success("设备信息修改成功"),y(),r(),Promise.resolve(!0)}return Promise.reject(!1)},cancelText:"取消",maskClosable:!1,onCancel:()=>r()}})},ie=({row:i,updatList:s})=>{const{id:r,name:y,_name:p,channelId:c,_channelId:b}=i,{FormilyForm:C,submit:_}=S({schema:ae({name:i.name.includes('<span class="text-primary">')?p:y,channelId:i.channelId.includes('<span class="text-primary">')?b:c})});P({content:t(C,null,null),modalConfig:{width:"500px",title:"自定义通道",onOk:async()=>{const l=await _();if(l){const{name:n,channelId:o}=l;return await Z({id:r,name:n,channelId:o}),v.success("修改成功"),s({id:r,name:n,channelId:o}),Promise.resolve(!0)}return Promise.reject(!1)},cancelText:"取消",maskClosable:!1}})},se=w({name:"Channel"}),re=w({...se,props:{detail:{},parent:{}},setup(i){const s=i,r=T(""),y=B(),p=T(s.detail),c=T(s.detail),b={maxHeight:"530px",rowConfig:{keyField:"deviceId",useKey:!0},columnConfig:{useKey:!0},columns:[{field:"channelId",title:"编号",showOverflow:"tooltip",width:"200px",type:"html",fixed:"left"},{field:"name",title:"名称",showOverflow:"tooltip",width:"120px",type:"html",fixed:"left"},{field:"address",title:"地址",type:"html",width:"180px"},{field:"port",title:"端口",width:"70px"},{field:"status",title:"状态",minWidth:"100px"},{field:"manufacturer",title:"厂商",width:"120px"},{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:"120px",slots:{default:"operate"},align:"center",fixed:"right"}]},C=()=>{const l=c.value,n=String(r.value).trim().toLowerCase();if(n){const o=new RegExp(n,"gi"),u=["channelId","name","address"],g=l.filter(m=>u.some(h=>String(m[h]).toLowerCase().indexOf(n)>-1)).sort((m,h)=>m?.deviceId.localeCompare(h?.deviceId));p.value=g.map(m=>{const h=Object.assign({},m,{_channelId:m.channelId,_name:m.name});return u.forEach(a=>{h[a]=String(h[a]).replace(o,d=>`<span class="text-primary">${d}</span>`)}),h})}else p.value=l.sort((o,u)=>o?.deviceId.localeCompare(u?.deviceId))},_=({id:l,channelId:n,name:o})=>{const u=s.detail.findIndex(m=>m.id===l),g=[...s.detail];g[u]={...g[u],name:o,channelId:n},c.value=g,C()};return(l,n)=>(D(),A(V,null,[t(e(G),{class:"w-300px m-b-4px",allowClear:"",value:r.value,"onUpdate:value":n[0]||(n[0]=o=>r.value=o),placeholder:"试试搜索: 编号/名称/地址等",onChange:C},null,8,["value"]),t(e(M),{uid:e(y).uid,gridOptions:b,data:p.value},{operate:f(({row:o})=>[t(e(E),{size:"small",type:"link",disabled:o.status==="OFF",onClick:()=>e(X)({id:l.parent.deviceId,deviceName:l.parent.name,deviceId:o.deviceId,channelName:o.name,isGbRecord:!1})},{default:f(()=>n[1]||(n[1]=[I(" 播放 ")])),_:2},1032,["disabled","onClick"]),t(e(E),{size:"small",type:"text",disabled:o.status==="OFF",onClick:()=>e(ie)({row:o,updatList:_})},{default:f(()=>n[2]||(n[2]=[I(" 编辑 ")])),_:2},1032,["disabled","onClick"])]),_:1},8,["uid","data"])],64))}}),de=({row:i,appContext:s,pause:r,resume:y})=>{r();const{name:p,deviceId:c,channels:b}=i;P({content:t(re,{detail:b||[],parent:{name:p,deviceId:c}},null),modalConfig:{appContext:s,width:"78%",title:`${p} 通道详情`,okButtonProps:{style:{display:"none"}},cancelText:"关闭",maskClosable:!1,onCancel:()=>y()}})},pe=w({name:"Device"}),Te=w({...pe,setup(i){const s=N()?.appContext,r=async()=>{c.submit(),!(c.errors.length>0)&&l.tableRef.commitProxy("query")},y=()=>{c.reset(),l.tableRef.commitProxy("query")},{FormilyForm:p,form:c}=S({schema:le({handleSubmit:r,handleReset:()=>y()})}),b=async a=>{await J(a),v.success(`${a} 设备通道已更新!`)},C=a=>{j.confirm({title:"确定删除设备?",cancelText:"取消",okText:"确定",content:"删除后设备将无法使用!",onOk:()=>{Q(a).then(()=>{v.success("设备已删除!"),l.tableRef.commitProxy("query")})}})};U.renderer.add("moreFields",{renderExpand(a,d){const{row:x}=d;return t("p",{class:"flex flex-col p-10px m-0"},[t("span",null,[t("b",null,[I("型号(Model):  ")]),x.Model||"--"]),t("span",null,[t("b",null,[I("纬度(Latitude):  ")]),x.Latitude||"--"]),t("span",null,[t("b",null,[I("经度(Longitude):  ")]),x.Longitude||"--"])])}});const _={toggleRowExpand:({expanded:a})=>{a?o():u()}},l=B(),{gbHttpRefreshTime:n}=z({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_GLOB_GB_HTTP_REFRESH_TIME:"60000",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:o,resume:u}=$(()=>{l.tableRef.commitProxy("query")},n),g=()=>{l.tableRef.commitProxy("query")},m=(a,d)=>new Promise(async x=>{const{data:F,total:W}=await ee({query:c.values.query,status:c.values.status,page:a,count:d});F.sort((q,H)=>q?.deviceId.localeCompare(H?.deviceId)),x({total:W,data:F})}),h={pagerConfig:{pageSize:10},proxyConfig:{seq:!0,props:{result:"data",total:"total"},ajax:{query:({page:a})=>m(a.currentPage,a.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"},{field:"name",title:"设备名称",showOverflow:"tooltip",width:"140px"},{field:"channelCount",title:"通道数",width:"70px"},{field:"status",title:"状态",minWidth:"120px"},{field:"streamMode",title:"流传输模式",width:"120px"},{field:"transport",title:"信令传输模式",minWidth:"110px"},{field:"deviceAddress",title:"设备地址",width:"180px",slots:{default:"deviceAddress"}},{field:"manufacturer",title:"厂商",width:"120px"},{field:"keepAliveTime",title:"最后保活时间",minWidth:"180px",formatter:({cellValue:a})=>k.toDateString(new Date(a),"yyyy-MM-dd HH:mm:ss")},{field:"registerTime",title:"注册时间",minWidth:"180px",formatter:({cellValue:a})=>k.toDateString(new Date(a),"yyyy-MM-dd HH:mm:ss")},{field:"operate",title:"操作",width:"250px",fixed:"right",align:"center",slots:{default:"operate"}}]};return(a,d)=>(D(),A(V,null,[t(e(R),{bordered:!1,bodyStyle:{padding:"10px",marginBottom:"8px"}},{default:f(()=>[t(e(p))]),_:1}),t(e(R),{bordered:!1,bodyStyle:{padding:"10px",height:"100%"},style:{height:"calc(100% - 110px)"}},{default:f(()=>[t(e(K),{windowWidth:1716}),t(e(M),{uid:e(l).uid,gridOptions:h,gridEvent:_},{deviceAddress:f(({row:x})=>[L("span",null,O(x.ip)+":",1),L("span",null,O(x.port),1)]),operate:f(({row:x})=>[t(e(te),null,{default:f(()=>[t(e(E),{size:"small",type:"link",onClick:()=>e(de)({row:x,appContext:e(s),pause:e(o),resume:e(u)})},{default:f(()=>d[0]||(d[0]=[I(" 通道详情 ")])),_:2},1032,["onClick"]),t(e(E),{size:"small",type:"text",onClick:()=>e(ne)({row:x,pause:e(o),resume:e(u),updatList:g})},{default:f(()=>d[1]||(d[1]=[I(" 编辑 ")])),_:2},1032,["onClick"]),t(e(E),{size:"small",type:"text",onClick:()=>b(x.deviceId)},{default:f(()=>d[2]||(d[2]=[I(" 刷新 ")])),_:2},1032,["onClick"]),t(e(E),{size:"small",type:"link",danger:"",onClick:()=>C(x.deviceId)},{default:f(()=>d[3]||(d[3]=[I(" 删除 ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"])]),_:1})],64))}});export{Te as default};
  2. //# sourceMappingURL=gb28181-7f29a90e.js.map