import{d as Q,O as W,k as u,r as g,o as f,c as S,a as e,b as t,u as i,t as w,z as C,A as J,M as R,x as q,B as X,F as ee,h as te,y as A,G as ne,H as ae}from"./vue.1703796278973.js";import{M as p,K as oe,Z as le,a0 as se,Y as ie,I as re,cA as de,L as ce,ax as pe}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897333.js";import"./index.170379627897320.js";import"./index.170379627897336.js";import"./index.170379627897321.js";import{c as b}from"./cascade.1703796278973.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang.170379627897336.js";import{_ as me}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.170379627897337.js";const F=k=>(ne("data-v-1008b660"),k=k(),ae(),k),_e=F(()=>C("h3",null,"通道列表",-1)),fe={class:"header"},ve=F(()=>C("span",null,"编辑国标ID",-1)),ye={class:"simple-form"},he={key:0,class:"error"},ge=Q({__name:"index",setup(k){const V=W(),$=[{title:"设备名称",dataIndex:"deviceName",key:"deviceName",search:{type:"string"}},{title:"通道名称",dataIndex:"name",key:"name",search:{type:"string",first:!0}},{title:"国标ID",dataIndex:"channelId",key:"channelId",scopedSlots:!0,headerCell:"gbChannelIdHeader",search:{type:"string"}},{title:"安装地址",dataIndex:"address",key:"address",search:{type:"string"}},{title:"厂商",dataIndex:"manufacturer",key:"manufacturer",search:{type:"string"}},{title:"在线状态",dataIndex:"status",key:"status",scopedSlots:!0,search:{type:"select",options:[{label:"已连接",value:"online"},{label:"未连接",value:"offline"}],handleValue:o=>o}},{title:"操作",key:"action",scopedSlots:!0}],B=u({}),N=o=>{B.value=o},m=u(),v=u([]),I=u(!1),O=o=>{v.value=[...o]},z=(o,l)=>o?[{key:"delete",text:"解绑",tooltip:{title:"解绑"},icon:"DisconnectOutlined",popConfirm:{title:"确认解绑?",onConfirm:async()=>{var r;(await b.unbindChannel(V.query.id,[o.channelId])).success?(p.success("操作成功!"),(r=m.value)==null||r.reload()):p.error("操作失败!")}}}]:[],E=async()=>{var c,s;if(!v.value.length){p.error("请先选择需要解绑的通道列表");return}const o=(c=m.value)==null?void 0:c._dataSource.filter(r=>v.value.includes(r.id)).map(r=>r.channelId);(await b.unbindChannel(V.query.id,o)).success?(p.success("操作成功!"),(s=m.value)==null||s.reload()):p.error("操作失败!")},d=u(""),D=u(!1),T=async o=>{var c,s;if(d.value||p.error("请输入国标ID"),!((c=_.value)!=null&&c.passed))return;D.value=!0;const l=await b.updateGbChannelId(o.id,{gbChannelId:d.value});D.value=!1,l.success?(p.success("操作成功!"),(s=m.value)==null||s.reload(),_.value=void 0,d.value=""):p.error("操作失败!")},_=u(),U=async o=>{const{result:l}=await b.validateField(o.cascadeId,[d.value]);_.value=l},L=o=>{o.popVis=!1,_.value=void 0,d.value=""};return(o,l)=>{const c=g("pro-search"),s=oe,r=le,y=se,h=g("AIcon"),j=ie,M=g("Ellipsis"),H=re,K=de,G=ce,Y=pe,Z=g("FullPage"),P=g("page-container");return f(),S(P,null,{default:e(()=>[t(c,{columns:$,target:"media",onSearch:N}),t(Z,null,{default:e(()=>[t(Y,{ref_key:"listRef",ref:m,model:"table",columns:$,request:n=>{var a;return i(b).queryBindChannel((a=i(V))==null?void 0:a.query.id,n)},defaultParams:{pageSize:10,sorts:[{name:"name",order:"desc"}]},params:i(B),rowSelection:{selectedRowKeys:i(v),onChange:O},onCancelSelect:l[2]||(l[2]=n=>v.value=[]),pagination:{showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]}},{headerTitle:e(()=>[_e]),rightExtraRender:e(()=>[t(y,null,{default:e(()=>[t(s,{type:"primary",onClick:l[0]||(l[0]=n=>I.value=!0)},{default:e(()=>[w(" 绑定通道 ")]),_:1}),t(r,{title:"确认解绑?",onConfirm:E},{default:e(()=>[t(s,null,{default:e(()=>[w(" 批量解绑 ")]),_:1})]),_:1})]),_:1})]),gbChannelIdHeader:e(n=>[t(j,{title:"国标级联有16位、20位两种格式。在当前页面修改不会修改视频设备-通道页面中的国标ID"},{default:e(()=>[t(y,null,{default:e(()=>[C("span",null,J(n),1),t(h,{type:"InfoCircleOutlined"})]),_:2},1024)]),_:2},1024)]),channelId:e(n=>[t(y,null,{default:e(()=>[t(M,{style:{width:"150px"}},{default:e(()=>[w(J(n.gbChannelId),1)]),_:2},1024),t(K,{visible:n.popVis,"onUpdate:visible":a=>n.popVis=a,trigger:"click"},{title:e(()=>[C("div",fe,[ve,t(h,{type:"CloseOutlined",onClick:a=>L(n)},null,8,["onClick"])])]),content:e(()=>{var a;return[C("div",ye,[t(H,{value:i(d),"onUpdate:value":l[1]||(l[1]=x=>R(d)?d.value=x:null),onChange:x=>U(n),placeholder:"请输入国标ID"},null,8,["value","onChange"]),i(_)&&!((a=i(_))!=null&&a.passed)?(f(),q("div",he," 该国标ID在同一设备下已存在 ")):X("",!0)]),t(s,{type:"primary",onClick:x=>T(n),loading:i(D),style:{width:"100%"}},{default:e(()=>[w(" 保存 ")]),_:2},1032,["onClick","loading"])]}),default:e(()=>[t(s,{type:"link",onClick:a=>n.popVis=!0},{default:e(()=>[t(h,{type:"EditOutlined"})]),_:2},1032,["onClick"])]),_:2},1032,["visible","onUpdate:visible"])]),_:2},1024)]),status:e(n=>[t(y,null,{default:e(()=>[t(G,{status:n.status.value==="online"?"success":"error",text:n.status.text},null,8,["status","text"])]),_:2},1024)]),action:e(n=>[t(y,{size:16},{default:e(()=>[(f(!0),q(ee,null,te(z(n,"table"),a=>(f(),S(j,A({key:a.key},a.tooltip),{default:e(()=>[a.popConfirm?(f(),S(r,A({key:0},a.popConfirm,{disabled:a.disabled}),{default:e(()=>[t(s,{disabled:a.disabled,style:{padding:"0"},type:"link"},{default:e(()=>[t(h,{type:a.icon},null,8,["type"])]),_:2},1032,["disabled"])]),_:2},1040,["disabled"])):(f(),S(s,{key:1,style:{padding:"0"},type:"link",onClick:x=>a.onClick&&a.onClick(n)},{default:e(()=>[t(s,{disabled:a.disabled,style:{padding:"0"},type:"link"},{default:e(()=>[t(h,{type:a.icon},null,8,["type"])]),_:2},1032,["disabled"])]),_:2},1032,["onClick"]))]),_:2},1040))),128))]),_:2},1024)]),_:1},8,["request","params","rowSelection"])]),_:1}),t(ue,{visible:i(I),"onUpdate:visible":l[3]||(l[3]=n=>R(I)?I.value=n:null),onSubmit:l[4]||(l[4]=n=>i(m).reload())},null,8,["visible"])]),_:1})}}});const nt=me(ge,[["__scopeId","data-v-1008b660"]]);export{nt as default};