import{d as x,O as T,k as g,p as N,u as n,o as h,x as V,b as e,a as s,z as a,c as A,t as F,B as w,A as i,G as M,H as O}from"./vue.1703796278973.js";import{I as $,r as q,aG as G,F as J,av as R,aw as U}from"./index.17037962789732.js";import"./index.170379627897319.js";import{_ as b}from"./index.17037962789739.js";import"./index.170379627897327.js";import"./index.170379627897318.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897314.js";import"./index.170379627897315.js";import{o as D}from"./comm.1703796278973.js";import{s as E,u as H}from"./accessConfig.1703796278973.js";import{P as K}from"./data.17037962789734.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"./index.170379627897332.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const Q=t=>(M("data-v-5af32a4e"),t=t(),O(),t),W={key:0,class:"card-last"},X={class:"doc",style:{height:"600px"}},Y=Q(()=>a("p",null,"4、添加设备，单独为每一个设备进行数据点绑定",-1)),Z=x({name:"AccessChannel"}),ee=x({...Z,props:{provider:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}}},setup(t){const p=t,f=T(),S=f.query.view,c=f.params.id,j=g(p.provider.type||p.data.type),r=g({name:"",description:""}),k=async m=>{const o=p.provider.id,l={...m,provider:o,protocol:o,transport:K.get(o),channel:o==="modbus-tcp"?"modbus":"opc-ua"},d=c===":id"?await E(l):await H({...l,id:c});d.status===200&&(D("操作成功","success"),history.back(),window.onTabSaveSuccess&&(window.onTabSaveSuccess(d),setTimeout(()=>window.close(),300)))};return N(()=>{var m;c!==":id"&&(r.value={name:p.data.name,description:((m=p.data)==null?void 0:m.description)||""})}),(m,o)=>{const l=b,d=$,u=q,C=G,I=z,B=J,v=R,y=b,P=U;return n(j)==="channel"?(h(),V("div",W,[e(P,{gutter:[24,24]},{default:s(()=>[e(v,{span:12},{default:s(()=>[e(l,{data:"基本信息"}),a("div",null,[e(B,{model:n(r),name:"basic",autocomplete:"off",layout:"vertical",onFinish:k},{default:s(()=>[e(u,{label:"名称",name:"name",rules:[{required:!0,message:"请输入名称",trigger:"blur"},{max:64,message:"最多可输入64个字符",trigger:"blur"}]},{default:s(()=>[e(d,{placeholder:"请输入名称",value:n(r).name,"onUpdate:value":o[0]||(o[0]=_=>n(r).name=_)},null,8,["value"])]),_:1}),e(u,{label:"说明",name:"description"},{default:s(()=>[e(C,{placeholder:"请输入说明",rows:4,value:n(r).description,"onUpdate:value":o[1]||(o[1]=_=>n(r).description=_),"show-count":"",maxlength:200},null,8,["value"])]),_:1}),e(u,null,{default:s(()=>[n(S)==="false"?(h(),A(I,{key:0,type:"primary","html-type":"submit",hasPermission:`link/AccessConfig:${n(c)===":id"?"add":"update"}`},{default:s(()=>[F(" 保存 ")]),_:1},8,["hasPermission"])):w("",!0)]),_:1})]),_:1},8,["model"])])]),_:1}),e(v,{span:12},{default:s(()=>[a("div",X,[e(y,{data:"配置概览"}),a("p",null,"接入方式："+i(t.provider.name),1),a("p",null,i(t.provider.description),1),a("p",null,"消息协议："+i(t.provider.id),1),e(y,{data:"设备接入指引"}),a("p",null,"1、配置"+i(t.provider.name)+"通道",1),a("p",null,"2、创建"+i(t.provider.name)+"设备接入网关",1),a("p",null,"3、创建产品，并选中接入方式为"+i(t.provider.name),1),Y])]),_:1})]),_:1})])):w("",!0)}}});const Te=L(ee,[["__scopeId","data-v-5af32a4e"]]);export{Te as default};
