"use strict";(self.webpackChunkwu_vue_zone_ecology_net=self.webpackChunkwu_vue_zone_ecology_net||[]).push([[890],{20890:function(e,l,a){a.r(l),a.d(l,{default:function(){return d}});var t=a(67759),u=a(76364),o=a(38874);const r={style:{float:"left"}};var d={__name:"ServerPermeateClientNetWorkMappingEdit",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"}]},d=e,i=l,{title:n,rowData:c}=(0,u.BK)(d),p=()=>{i("closeDialog",!1)},s=(0,u.iH)(null),v=(0,u.iH)(null),m=(0,u.iH)(null),w=(0,u.qj)({clientId:"",clientTargetIp:"0.0.0.0",clientTargetPort:"",visitorPort:"",describe:""}),{clientId:b,clientTargetIp:g,clientTargetPort:f,visitorPort:_,describe:I}=(0,u.BK)(w);c.value&&(b.value=c.value.clientId,g.value=c.value.clientTargetIp,f.value=c.value.clientTargetPort,_.value=c.value.visitorPort,I.value=c.value.describe);(0,t.bv)((async()=>{VE_API.cloudNetwork.cloudClientFindListGroupByClient().then((e=>{0===e.code&&e.data&&(e.data.map((e=>{e.label=e.clientId,e.value=e.clientId})),v.value=e.data?e.data:[])})),P()}));const P=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})),m.value=e.data?e.data:[])};return(l,d)=>{const i=(0,t.up)("el-option"),P=(0,t.up)("el-select"),V=(0,t.up)("el-form-item"),k=(0,t.up)("el-input"),h=(0,t.up)("el-form"),y=(0,t.up)("el-button"),U=(0,t.up)("el-dialog");return(0,t.wg)(),(0,t.j4)(U,{title:(0,u.SU)(n),"append-to-body":"","destroy-on-close":"","model-value":e.showDialog,onClose:d[7]||(d[7]=e=>p())},{footer:(0,t.w5)((()=>[(0,t._)("span",null,[(0,t.Wm)(y,{onClick:d[5]||(d[5]=e=>p())},{default:(0,t.w5)((()=>d[8]||(d[8]=[(0,t.Uk)("取消")]))),_:1}),(0,t.Wm)(y,{type:"primary",onClick:d[6]||(d[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(w):await VE_API.cloudNetwork.networkMappingUpdate({clientTargetPort:c.value.clientTargetPort,...w});const{code:l}=e;0===l&&p()}}))})},{default:(0,t.w5)((()=>d[9]||(d[9]=[(0,t.Uk)("确定")]))),_:1})])])),default:(0,t.w5)((()=>[(0,t.Wm)(h,{model:w,ref_key:"formRef",ref:s,rules:a,"label-width":"80px",inline:!1},{default:(0,t.w5)((()=>[(0,t.Wm)(V,{label:"客户端ID","label-width":"140px",prop:"clientId"},{default:(0,t.w5)((()=>[(0,t.Wm)(P,{modelValue:(0,u.SU)(b),"onUpdate:modelValue":d[0]||(d[0]=e=>(0,u.dq)(b)?b.value=e:null),placeholder:"客户端ID",clearable:""},{default:(0,t.w5)((()=>[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)(v.value,(e=>((0,t.wg)(),(0,t.j4)(i,{key:e.value,label:e.label,value:e.value,serverId:e},null,8,["label","value","serverId"])))),128))])),_:1},8,["modelValue"])])),_:1}),(0,t.Wm)(V,{label:"访问端口","label-width":"140px",prop:"visitorPort"},{default:(0,t.w5)((()=>[(0,t.Wm)(P,{modelValue:(0,u.SU)(_),"onUpdate:modelValue":d[1]||(d[1]=e=>(0,u.dq)(_)?_.value=e:null),placeholder:"访问端口",clearable:""},{default:(0,t.w5)((()=>[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)(m.value,(e=>((0,t.wg)(),(0,t.j4)(i,{key:e.value,label:e.label,value:e.value},{default:(0,t.w5)((()=>[(0,t._)("span",r," 端口:【"+(0,o.zw)(e.value)+"】"+(0,o.zw)(e.label),1)])),_:2},1032,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),(0,t.Wm)(V,{label:"客户端目标地址","label-width":"140px",prop:"clientTargetIp"},{default:(0,t.w5)((()=>[(0,t.Wm)(k,{modelValue:(0,u.SU)(g),"onUpdate:modelValue":d[2]||(d[2]=e=>(0,u.dq)(g)?g.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.Wm)(V,{label:"客户端目标端口","label-width":"140px",prop:"clientTargetPort"},{default:(0,t.w5)((()=>[(0,t.Wm)(k,{modelValue:(0,u.SU)(f),"onUpdate:modelValue":d[3]||(d[3]=e=>(0,u.dq)(f)?f.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.Wm)(V,{label:"描述","label-width":"140px",prop:"describe"},{default:(0,t.w5)((()=>[(0,t.Wm)(k,{modelValue:(0,u.SU)(I),"onUpdate:modelValue":d[4]||(d[4]=e=>(0,u.dq)(I)?I.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1},8,["title","model-value"])}}}}}]);