import{d as T,O as V,k as _,p as j,r as M,o as p,c,a as C,b,u as t,x as P,z as F,B as g,F as A}from"./vue.1703796278973.js";import{aB as z,aA as I}from"./index.17037962789732.js";import"./index.1703796278973303.js";import"./index.1703796278973308.js";import"./index.170379627897334.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import L from"./index.1703796278973196.js";import R from"./index.1703796278973198.js";import $ from"./index.1703796278973195.js";import G from"./index.1703796278973192.js";import H from"./index.1703796278973194.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_name_AccessCloud_lang.1703796278973.js";import K from"./index.1703796278973197.js";import{b as O,d as Q}from"./accessConfig.1703796278973.js";import{a as q}from"./setting.1703796278973.js";import{_ as U}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"./index.170379627897315.js";import"./index.1703796278973305.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.170379627897318.js";import"./index.17037962789739.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897333.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./index.1703796278973316.js";import"./index.170379627897330.js";import"./data.17037962789734.js";import"./index.1703796278973191.js";import"./index.170379627897310.js";import"./index.17037962789737.js";import"./GB28181.1703796278973.js";import"./index.1703796278973309.js";import"./index.170379627897325.js";import"./Ctwing.1703796278973.js";import"./index.1703796278973315.js";import"./utils.1703796278973.js";import"./moment.1703796278973.js";import"./OneNet.1703796278973.js";import"./index.1703796278973310.js";import"./index.vue_vue_type_script_setup_true_name_ValueItem_lang.1703796278973.js";import"./index.170379627897337.js";import"./index.170379627897338.js";import"./index.170379627897329.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897324.js";import"./style.1703796278973.js";import"./rules.1703796278973.js";const W={key:0},X={key:0,class:"go-back"},Y=T({name:"AccessConfigDetail"}),Z=T({...Y,setup(tt){const y=V(),h=y.params.id,k=_([]),v=_(!1),w=_(!0),n=_({}),u=_({}),m=_(""),B=r=>{m.value=r.type,n.value=r,v.value=!1},D=()=>{n.value={},v.value=!0},x=new Map([["fixed-media","media"],["gb28181-2016","media"],["OneNet","cloud"],["Ctwing","cloud"],["modbus-tcp","channel"],["opc-ua","channel"],["official-edge-gateway","edge"],["edge-child-device","edge"],["network","network"]]),s=new Map;s.set("fixed-media",{type:"media",title:"视频类设备接入"}),s.set("gb28181-2016",{type:"media",title:"视频类设备接入"}),s.set("OneNet",{type:"cloud",title:"云平台接入"}),s.set("Ctwing",{type:"cloud",title:"云平台接入"}),s.set("modbus-tcp",{type:"channel",title:"通道类设备接入"}),s.set("opc-ua",{type:"channel",title:"通道类设备接入"}),s.set("official-edge-gateway",{type:"edge",title:"官方接入"}),s.set("edge-child-device",{type:"edge",title:"官方接入"}),s.set("network",{type:"network",title:"自定义设备接入"});const N=r=>{const a=[],d=[],e=[],l=[],i=[],f=[];return r.map(o=>{o.id==="fixed-media"||o.id==="gb28181-2016"?(o.type="media",d.push(o)):o.id==="OneNet"||o.id==="Ctwing"?(o.type="cloud",l.push(o)):o.id==="modbus-tcp"||o.id==="opc-ua"?(o.type="channel",i.push(o)):o.id==="official-edge-gateway"||o.id==="edge-child-device"?(o.type="edge",f.push(o)):(o.type="network",e.push(o))}),e.length&&a.push({list:[...e],title:"自定义设备接入"}),d.length&&a.push({list:[...d],title:"视频类设备接入"}),l.length&&a.push({list:[...l],title:"云平台接入"}),i.length&&a.push({list:[...i],title:"通道类设备接入"}),f.length&&a.push({list:[...f],title:"官方接入"}),a},E=async()=>{var a,d,e;const r=await O();if(r.status===200){const l=r.result||[];if(k.value=N(q(l)),y.query.save&&((a=y.query)!=null&&a.type)){const i=y.query.type;B((e=(d=k.value.find(f=>f.title===s.get(i).title))==null?void 0:d.list)==null?void 0:e.find(f=>f.id===i))}}},S=async()=>{h!==":id"?O().then(r=>{if(r.status===200){const a=r.result||[],d=N(q(a));k.value=d.filter(e=>e.channel==="network"||e.channel==="child-device"),Q(h).then(e=>{if(e.status===200){const l=r.result.find(i=>(i==null?void 0:i.id)===e.result.provider);r.result.forEach(i=>{i.id===e.result.provider&&(e.result.type=x.has(i.id)?x.get(i.id):x.get("network"),m.value=e.result.type)}),n.value=l,u.value=e.result,v.value=!1}})}w.value=!1}):(v.value=!0,E(),w.value=!1)};return j(()=>{w.value=!0,S()}),(r,a)=>{const d=z,e=M("FullPage"),l=I,i=M("page-container");return p(),c(i,null,{default:C(()=>[b(l,{spinning:t(w)},{default:C(()=>[t(v)&&t(h)===":id"?(p(),P("div",W,[b(R,{onOnClick:B,dataSource:t(k)},null,8,["dataSource"])])):(p(),c(e,{key:1},{default:C(()=>[b(d,{bordered:!1},{default:C(()=>[F("div",null,[t(h)===":id"?(p(),P("div",X,[F("a",{onClick:D},"返回")])):g("",!0),t(m)==="network"?(p(),P(A,{key:1},[t(n).id!=="plugin_gateway"?(p(),c(L,{key:0,provider:t(n),data:t(u)},null,8,["provider","data"])):(p(),c(K,{key:1,provider:t(n),data:t(u)},null,8,["provider","data"]))],64)):g("",!0),t(m)==="media"?(p(),c($,{key:2,provider:t(n),data:t(u)},null,8,["provider","data"])):g("",!0),t(m)==="channel"?(p(),c(G,{key:3,provider:t(n),data:t(u)},null,8,["provider","data"])):g("",!0),t(m)==="edge"?(p(),c(H,{key:4,provider:t(n),data:t(u)},null,8,["provider","data"])):g("",!0),t(m)==="cloud"?(p(),c(J,{key:5,provider:t(n),data:t(u)},null,8,["provider","data"])):g("",!0)])]),_:1})]),_:1}))]),_:1},8,["spinning"])]),_:1})}}});const ge=U(Z,[["__scopeId","data-v-a50af343"]]);export{ge as default};