"use strict";(self.webpackChunkwu_vue_zone_ecology_net=self.webpackChunkwu_vue_zone_ecology_net||[]).push([[534],{44534:function(e,l,a){a.r(l),a.d(l,{default:function(){return d}});var t=a(67759),r=a(76364),u=a(38874);const o={style:{float:"left"}};var d={__name:"ClientPermeateServerNetworkMappingEdit",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"}],visitorPort:[{required:!0,message:"请选择访客端口",trigger:"blur"}],permeateTargetIp:[{required:!0,message:"请输入客户端目标IP",trigger:"blur"}],permeateTargetPort:[{required:!0,message:"请输入客户端目标端口",trigger:"blur"}]},d=e,i=l,{title:n,rowData:p}=(0,r.BK)(d),m=()=>{i("closeDialog",!1)},v=(0,r.iH)(null),c=(0,r.iH)(null),s=(0,r.iH)(null),w=(0,r.qj)({permeateTargetIp:"0.0.0.0",permeateTargetPort:"",visitorPort:"",clientId:"",describe:"",id:""}),{permeateTargetIp:g,permeateTargetPort:b,visitorPort:f,clientId:_,describe:P,id:I}=(0,r.BK)(w);p.value&&(g.value=p.value.permeateTargetIp,_.value=p.value.clientId,b.value=p.value.permeateTargetPort,f.value=p.value.visitorPort,P.value=p.value.describe,I.value=p.value.id);(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})),s.value=e.data?e.data:[])}))}));return(l,d)=>{const i=(0,t.up)("el-option"),I=(0,t.up)("el-select"),y=(0,t.up)("el-form-item"),V=(0,t.up)("el-input"),h=(0,t.up)("el-form"),k=(0,t.up)("el-button"),S=(0,t.up)("el-dialog");return(0,t.wg)(),(0,t.j4)(S,{title:(0,r.SU)(n),"append-to-body":"","destroy-on-close":"","model-value":e.showDialog,onClose:d[8]||(d[8]=e=>m())},{footer:(0,t.w5)((()=>[(0,t._)("span",null,[(0,t.Wm)(k,{onClick:d[6]||(d[6]=e=>m())},{default:(0,t.w5)((()=>d[9]||(d[9]=[(0,t.Uk)("取消")]))),_:1}),(0,t.Wm)(k,{type:"primary",onClick:d[7]||(d[7]=e=>{v.value.validate((async e=>{if(!e)return console.log("error submit!!"),!1;{let e;e="添加"===n.value?await VE_API.cloudNetworkServerPerMeate.lazyInternalNetworkClientPermeateServerMappingSave(w):await VE_API.cloudNetworkServerPerMeate.lazyInternalNetworkClientPermeateServerMappingUpdate({permeateTargetPort:p.value.permeateTargetPort,...w});const{code:l}=e;0===l&&m()}}))})},{default:(0,t.w5)((()=>d[10]||(d[10]=[(0,t.Uk)("确定")]))),_:1})])])),default:(0,t.w5)((()=>[(0,t.Wm)(h,{model:w,ref_key:"formRef",ref:v,rules:a,"label-width":"80px",inline:!1},{default:(0,t.w5)((()=>[(0,t.Wm)(y,{label:"客户端ID","label-width":"140px",prop:"clientId"},{default:(0,t.w5)((()=>[(0,t.Wm)(I,{modelValue:(0,r.SU)(_),"onUpdate:modelValue":d[0]||(d[0]=e=>(0,r.dq)(_)?_.value=e:null),placeholder:"客户端ID",clearable:"",onChange:d[1]||(d[1]=e=>(async e=>{let l=await VE_API.cloudNetworkServerPerMeate.lazyNettyClientPermeatePortPoolList({clientId:e});const{code:a}=l;0===a&&l.data&&(l.data.map((e=>{e.label=e.describe,e.value=e.visitorPort})),c.value=l.data?l.data:[])})((0,r.SU)(_)))},{default:(0,t.w5)((()=>[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)(s.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)(y,{label:"客户端访问端口","label-width":"140px",prop:"visitorPort"},{default:(0,t.w5)((()=>[(0,t.Wm)(I,{modelValue:(0,r.SU)(f),"onUpdate:modelValue":d[2]||(d[2]=e=>(0,r.dq)(f)?f.value=e:null),placeholder:"客户端访问端口",clearable:""},{default:(0,t.w5)((()=>[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)(c.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",o," 端口:【"+(0,u.zw)(e.value)+"】"+(0,u.zw)(e.label),1)])),_:2},1032,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),(0,t.Wm)(y,{label:"服务端目标地址","label-width":"140px",prop:"permeateTargetIp"},{default:(0,t.w5)((()=>[(0,t.Wm)(V,{modelValue:(0,r.SU)(g),"onUpdate:modelValue":d[3]||(d[3]=e=>(0,r.dq)(g)?g.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.Wm)(y,{label:"服务端目标端口","label-width":"140px",prop:"permeateTargetPort"},{default:(0,t.w5)((()=>[(0,t.Wm)(V,{modelValue:(0,r.SU)(b),"onUpdate:modelValue":d[4]||(d[4]=e=>(0,r.dq)(b)?b.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,t.Wm)(y,{label:"描述","label-width":"140px",prop:"describe"},{default:(0,t.w5)((()=>[(0,t.Wm)(V,{modelValue:(0,r.SU)(P),"onUpdate:modelValue":d[5]||(d[5]=e=>(0,r.dq)(P)?P.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1},8,["title","model-value"])}}}}}]);