import{d as K,r as u,x as U,w as j,o as p,A as c,B as s,f as n,E as f,a as l,k as q,a2 as B,Q as D,a8 as E,V as Q,W as R,K as S,Z as W,__tla as Z}from"./index-92ad187a.js";import{_ as z,__tla as G}from"./Dialog-44c9fa34.js";import{b as H,__tla as I}from"./property-d6fc9ca9.js";import{u as J,__tla as M}from"./useMessage-d9788660.js";let y,N=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return M}catch{}})()]).then(async()=>{y=K({name:"ProductPropertyForm",__name:"ProductPropertyAddForm",props:{propertyList:{type:Array,default:()=>{}}},setup(v,{expose:h}){const{t:V}=D(),b=J(),t=u(!1),o=u(!1),r=u({name:""}),x=U({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),m=u(),_=u([]),P=v;j(()=>P.propertyList,e=>{e&&(_.value=e)},{deep:!0,immediate:!0}),h({open:async()=>{t.value=!0,k()}});const g=async()=>{if(m&&await m.value.validate()){o.value=!0;try{const e=r.value,a=await H(e);_.value.push({id:a,...r.value,values:[]}),b.success(V("common.createSuccess")),t.value=!1}finally{o.value=!1}}},k=()=>{var e;r.value={name:""},(e=m.value)==null||e.resetFields()};return(e,a)=>{const w=E,A=Q,F=R,i=S,C=z,L=W;return p(),c(C,{modelValue:l(t),"onUpdate:modelValue":a[2]||(a[2]=d=>B(t)?t.value=d:null),title:"\u6DFB\u52A0\u5546\u54C1\u5C5E\u6027"},{footer:s(()=>[n(i,{disabled:l(o),type:"primary",onClick:g},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),n(i,{onClick:a[1]||(a[1]=d=>t.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[q((p(),c(F,{ref_key:"formRef",ref:m,model:l(r),rules:l(x),"label-width":"80px"},{default:s(()=>[n(A,{label:"\u5C5E\u6027\u540D\u79F0",prop:"name"},{default:s(()=>[n(w,{modelValue:l(r).name,"onUpdate:modelValue":a[0]||(a[0]=d=>l(r).name=d),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[L,l(o)]])]),_:1},8,["modelValue"])}}})});export{y as _,N as __tla};
