"use strict";(self.webpackChunkwu_vue_zone_ecology=self.webpackChunkwu_vue_zone_ecology||[]).push([[626],{51626:function(e,l,a){a.r(l),a.d(l,{default:function(){return t}});var o=a(20641),u=a(50953);var t={__name:"ApplicationEdit",props:{showDialog:{type:Boolean,default:!0},title:{type:String,default:"添加"},rowData:{type:Object,default:null}},emits:["closeDialog"],setup(e,{emit:l}){const a=e,t=l,{title:n,rowData:i}=(0,u.QW)(a),d=()=>{t("closeDialog",!1)},r=(0,u.Kh)({code:"",icon:"",name:"",isStation:!0,openNewWindow:!0,url:""}),{code:p,icon:c,name:s,isStation:m,openNewWindow:b,url:_}=(0,u.QW)(r),f=(0,u.KR)(null),v={name:[{required:!0,message:"请输入应用名称",trigger:"blur"}],code:[{required:!0,message:"请输入应用编码",trigger:"blur"}],isStation:[{required:!0,message:"请选择是否站内",trigger:"blur"}],openNewWindow:[{required:!0,message:"请选择是否新窗口打开",trigger:"blur"}]};i.value&&(s.value=i.value.name,p.value=i.value.code,c.value=i.value.icon,m.value=i.value.isStation,b.value=i.value.openNewWindow,_.value=i.value.url);return(0,o.sV)((async()=>{})),(l,a)=>{const t=(0,o.g2)("el-input"),g=(0,o.g2)("el-form-item"),w=(0,o.g2)("el-radio-button"),k=(0,o.g2)("el-radio-group"),V=(0,o.g2)("el-form"),F=(0,o.g2)("el-button"),W=(0,o.g2)("el-dialog");return(0,o.uX)(),(0,o.Wv)(W,{title:(0,u.R1)(n),"append-to-body":"","destroy-on-close":"","model-value":e.showDialog,onClose:a[8]||(a[8]=e=>d())},{footer:(0,o.k6)((()=>[(0,o.Lk)("span",null,[(0,o.bF)(F,{onClick:a[6]||(a[6]=e=>d())},{default:(0,o.k6)((()=>[(0,o.eW)("取消")])),_:1}),(0,o.bF)(F,{type:"primary",onClick:a[7]||(a[7]=e=>{f.value.validate((async e=>{if(!e)return console.log("error submit!!"),!1;{let e,l=new FormData;l.append("name",r.name),l.append("code",r.code),l.append("icon",r.icon),l.append("isStation",r.isStation),l.append("openNewWindow",r.openNewWindow),l.append("url",r.url),e="添加"===n.value?await VE_API.application.applicationStory(r):await VE_API.application.applicationStory({id:i.value.id,...r});const{code:a}=e;0===a&&d()}}))})},{default:(0,o.k6)((()=>[(0,o.eW)("确定")])),_:1})])])),default:(0,o.k6)((()=>[(0,o.bF)(V,{model:r,ref_key:"formRef",ref:f,rules:v,inline:!1,"label-width":"120px"},{default:(0,o.k6)((()=>[(0,o.bF)(g,{label:"应用名称",prop:"name",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(t,{modelValue:(0,u.R1)(s),"onUpdate:modelValue":a[0]||(a[0]=e=>(0,u.i9)(s)?s.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,o.bF)(g,{label:"应用编码",prop:"code",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(t,{modelValue:(0,u.R1)(p),"onUpdate:modelValue":a[1]||(a[1]=e=>(0,u.i9)(p)?p.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,o.bF)(g,{label:"应用图标",prop:"icon",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(t,{modelValue:(0,u.R1)(c),"onUpdate:modelValue":a[2]||(a[2]=e=>(0,u.i9)(c)?c.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,o.bF)(g,{label:"是否站内",prop:"isStation",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(k,{modelValue:(0,u.R1)(m),"onUpdate:modelValue":a[3]||(a[3]=e=>(0,u.i9)(m)?m.value=e:null)},{default:(0,o.k6)((()=>[(0,o.bF)(w,{label:!0},{default:(0,o.k6)((()=>[(0,o.eW)("站内")])),_:1}),(0,o.bF)(w,{label:!1},{default:(0,o.k6)((()=>[(0,o.eW)("站外")])),_:1})])),_:1},8,["modelValue"])])),_:1}),(0,o.bF)(g,{label:"应用地址",prop:"url",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(t,{modelValue:(0,u.R1)(_),"onUpdate:modelValue":a[4]||(a[4]=e=>(0,u.i9)(_)?_.value=e:null),placeholder:"",clearable:""},null,8,["modelValue"])])),_:1}),(0,o.bF)(g,{label:"是否新窗口打开",prop:"openNewWindow",class:"role_edit_item"},{default:(0,o.k6)((()=>[(0,o.bF)(k,{modelValue:(0,u.R1)(b),"onUpdate:modelValue":a[5]||(a[5]=e=>(0,u.i9)(b)?b.value=e:null)},{default:(0,o.k6)((()=>[(0,o.bF)(w,{label:!0},{default:(0,o.k6)((()=>[(0,o.eW)("新窗口打开")])),_:1}),(0,o.bF)(w,{label:!1},{default:(0,o.k6)((()=>[(0,o.eW)("当前页面跳转")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1},8,["title","model-value"])}}}}}]);