"use strict";(self.webpackChunkwu_vue_zone_ecology=self.webpackChunkwu_vue_zone_ecology||[]).push([[281],{59281:function(e,l,a){a.r(l),a.d(l,{default:function(){return i}});var t=a(20641),u=a(50953),o=a(90033);const r={style:{float:"left"}};var i={__name:"NetWorkMappingEdit",props:{showDialog:{type:Boolean,default:!0},title:{type:String,default:"添加"},rowData:{type:Object,default:null}},emits:["closeDialog"],setup(e,{emit:l}){const a={clientId:[{required:!0,message:"请输入选择客户端",trigger:"blur"}],clientTargetIp:[{required:!0,message:"请输入客户端目标IP",trigger:"blur"}],clientTargetPort:[{required:!0,message:"请输入客户端目标端口",trigger:"blur"}],visitorPort:[{required:!0,message:"请选择访客端口",trigger:"blur"}]},i=e,d=l,{title:n,rowData:c}=(0,u.QW)(i),p=()=>{d("closeDialog",!1)},s=(0,u.KR)(null),v=(0,u.KR)(null),b=(0,u.KR)(null),g=(0,u.Kh)({clientId:"",clientTargetIp:"0.0.0.0",clientTargetPort:"",visitorPort:"",describe:""}),{clientId:m,clientTargetIp:k,clientTargetPort:f,visitorPort:_,describe:w}=(0,u.QW)(g);c.value&&(m.value=c.value.clientId,k.value=c.value.clientTargetIp,f.value=c.value.clientTargetPort,_.value=c.value.visitorPort,w.value=c.value.describe);(0,t.sV)((async()=>{VE_API.cloudNetwork.cloudClientFindList().then((e=>{e.data.map((e=>{e.label=e.clientId,e.value=e.clientId})),v.value=e.data?e.data:[]})),I()}));const I=async()=>{let e=await VE_API.cloudNetwork.visitorList();const{code:l}=e;0===l&&(e.data.map((e=>{e.label=e.describe,e.value=e.visitorPort})),b.value=e.data?e.data:[])};return(l,i)=>{const d=(0,t.g2)("el-option"),I=(0,t.g2)("el-select"),V=(0,t.g2)("el-form-item"),h=(0,t.g2)("el-input"),P=(0,t.g2)("el-form"),y=(0,t.g2)("el-button"),F=(0,t.g2)("el-dialog");return(0,t.uX)(),(0,t.Wv)(F,{title:(0,u.R1)(n),"append-to-body":"","destroy-on-close":"","model-value":e.showDialog,onClose:i[7]||(i[7]=e=>p())},{footer:(0,t.k6)((()=>[(0,t.Lk)("span",null,[(0,t.bF)(y,{onClick:i[5]||(i[5]=e=>p())},{default:(0,t.k6)((()=>[(0,t.eW)("取消")])),_:1}),(0,t.bF)(y,{type:"primary",onClick:i[6]||(i[6]=e=>{s.value.validate((async e=>{if(!e)return console.log("error submit!!"),!1;{let e;e="添加"===n.value?await VE_API.cloudNetwork.networkMappingSave(g):await VE_API.cloudNetwork.networkMappingUpdate({clientTargetPort:c.value.clientTargetPort,...g});const{code:l}=e;0===l&&p()}}))})},{default:(0,t.k6)((()=>[(0,t.eW)("确定")])),_:1})])])),default:(0,t.k6)((()=>[(0,t.bF)(P,{model:g,ref_key:"formRef",ref:s,rules:a,"label-width":"80px",inline:!1},{default:(0,t.k6)((()=>[(0,t.bF)(V,{label:"客户端ID","label-width":"140px",prop:"clientId"},{default:(0,t.k6)((()=>[(0,t.bF)(I,{modelValue:(0,u.R1)(m),"onUpdate:modelValue":i[0]||(i[0]=e=>(0,u.i9)(m)?m.value=e:null),placeholder:"客户端ID",clearable:""},{default:(0,t.k6)((()=>[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(v.value,(e=>((0,t.uX)(),(0,t.Wv)(d,{key:e.value,label:e.label,value:e.value,serverId:e},null,8,["label","value","serverId"])))),128))])),_:1},8,["modelValue"])])),_:1}),(0,t.bF)(V,{label:"访问端口","label-width":"140px",prop:"visitorPort"},{default:(0,t.k6)((()=>[(0,t.bF)(I,{modelValue:(0,u.R1)(_),"onUpdate:modelValue":i[1]||(i[1]=e=>(0,u.i9)(_)?_.value=e:null),placeholder:"访问端口",clearable:""},{default:(0,t.k6)((()=>[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(b.value,(e=>((0,t.uX)(),(0,t.Wv)(d,{key:e.value,label:e.label,value:e.value},{default:(0,t.k6)((()=>[(0,t.Lk)("span",r," 端口:【"+(0,o.v_)(e.value)+"】"+(0,o.v_)(e.label),1)])),_:2},1032,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),(0,t.bF)(V,{label:"客户端目标地址","label-width":"140px",prop:"clientTargetIp"},{default:(0,t.k6)((()=>[(0,t.bF)(h,{modelValue:(0,u.R1)(k),"onUpdate:modelValue":i[2]||(i[2]=e=>(0,u.i9)(k)?k.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.bF)(V,{label:"客户端目标端口","label-width":"140px",prop:"clientTargetPort"},{default:(0,t.k6)((()=>[(0,t.bF)(h,{modelValue:(0,u.R1)(f),"onUpdate:modelValue":i[3]||(i[3]=e=>(0,u.i9)(f)?f.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.bF)(V,{label:"描述","label-width":"140px",prop:"describe"},{default:(0,t.k6)((()=>[(0,t.bF)(h,{modelValue:(0,u.R1)(w),"onUpdate:modelValue":i[4]||(i[4]=e=>(0,u.i9)(w)?w.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1},8,["title","model-value"])}}}}}]);