import{K as N,W as P}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import{_ as S}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{s as w}from"./collector.1703796278973.js";import O from"./Table.1703796278973.js";import V from"./Tree.1703796278973.js";import{d as j,k as n,o as A,c as I,a as i,b as c,t as x,u as l,z as J}from"./vue.1703796278973.js";import{_ as L}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.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897317.js";import"./index.1703796278973305.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.170379627897325.js";import"./data.1703796278973.js";const R={class:"content"},z=j({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(T,{emit:u}){const p=T,B=n(p.data),m=n(!1),f=n(),d=n(),a=new Map,_=n(),K=async()=>{var s;const t=await((s=f.value)==null?void 0:s.validate().catch(()=>{}));if(!t)return;const r=t.map(e=>{var h,y,g,b,C,k;return{name:e.name,provider:"OPC_UA",collectorId:(h=p.data)==null?void 0:h.id,collectorName:(y=p.data)==null?void 0:y.name,pointKey:e.id,configuration:{interval:(b=(g=e.configuration)==null?void 0:g.interval)==null?void 0:b.value},features:(C=e.features)!=null&&C.value?["changedOnly"]:[],accessModes:((k=e.accessModes)==null?void 0:k.value)||[]}});m.value=!0;const o=await w([...r]).catch(()=>{});u("change",(o==null?void 0:o.status)===200),m.value=!1},v=()=>{u("change",!1)},M=(t,r)=>{r?a.set(t.id,t):a.delete(t.id),d.value=[...a.values()]},D=t=>{_.value=t,a.delete(t),d.value=[...a.values()]};return(t,r)=>{const o=N,s=S,e=P;return A(),I(e,{title:"扫描",visible:!0,width:"95%",onCancel:v},{footer:i(()=>[c(o,{key:"back",onClick:v},{default:i(()=>[x("取消")]),_:1}),c(s,{key:"submit",type:"primary",loading:l(m),onClick:K,style:{"margin-left":"8px"},hasPermission:"DataCollect/Collector:update"},{default:i(()=>[x(" 确认 ")]),_:1},8,["loading"])]),default:i(()=>[J("div",R,[c(V,{data:l(B),class:"tree",onChange:M,unSelectKeys:l(_)},null,8,["data","unSelectKeys"]),c(O,{data:l(d),class:"table",onChange:D,ref_key:"formTableRef",ref:f},null,8,["data"])])]),_:1})}}});const Mt=L(z,[["__scopeId","data-v-57eeaaff"]]);export{Mt as default};
