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