import{P as f}from"./index.a9e38e26.js";import{_ as y}from"./oa-menu-form.vue_vue_type_script_setup_true_lang.499cd765.js";import{d as g,s as d,k as F,o as k,J as v,K as m,G as R,T as P}from"./@vue.108c970a.js";const C=g({__name:"oa-menu-form-edit",props:{modular:{default:"edit"},subItem:{default:{}}},emits:["add","edit"],setup(s,{emit:r}){const p=s,n=d(),u=d(),e={name:"",type:"view",url:"",appid:"",pagepath:""};F(()=>{if(Object.keys(p.subItem).length!=0)for(const o in e)e[o]=p.subItem[o]});const l=async()=>{await n.value.menuFormRef.validate(),p.modular==="edit"?r("edit",{...e}):r("add",{...e}),u.value.close(),n.value.menuFormRef.resetFields()};return(o,t)=>{const i=f;return k(),v(i,{ref_key:"menuFromPopupRef",ref:u,async:"",clickModalClose:!1,title:`${s.modular==="add"?"\u65B0\u589E":"\u7F16\u8F91"}\u5B50\u83DC\u5355`,onConfirm:l},{trigger:m(()=>[R(o.$slots,"default")]),default:m(()=>[P(y,{ref_key:"menuFormEditRef",ref:n,modular:"secondary",name:e.name,"onUpdate:name":t[0]||(t[0]=a=>e.name=a),visitType:e.type,"onUpdate:visitType":t[1]||(t[1]=a=>e.type=a),url:e.url,"onUpdate:url":t[2]||(t[2]=a=>e.url=a),appId:e.appid,"onUpdate:appId":t[3]||(t[3]=a=>e.appid=a),pagePath:e.pagepath,"onUpdate:pagePath":t[4]||(t[4]=a=>e.pagepath=a)},null,8,["name","visitType","url","appId","pagePath"])]),_:3},8,["title"])}}});export{C as _};
