import{d as H,r as u,f as L,aP as j,o as p,l as c,w as s,i as n,j as f,a as l,C as q,y as E,n as G,U as J,H as K,K as N,J as O,N as R,_ as S,__tla as z}from"./index-2c56227b.js";import{_ as B,__tla as D}from"./Dialog-1050d437.js";import{b as I,__tla as M}from"./property-c77cd070.js";import{u as Q,__tla as T}from"./useMessage-96878a4a.js";let y,W=Promise.all([(()=>{try{return z}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return M}catch{}})(),(()=>{try{return T}catch{}})()]).then(async()=>{y=S(H({name:"ProductPropertyForm",__name:"ProductPropertyAddForm",props:{propertyList:{type:Array,default:()=>{}}},setup(v,{expose:P}){const{t:h}=G(),w=Q(),t=u(!1),o=u(!1),r=u({name:""}),V=L({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=u(),_=u([]),b=v;j(()=>b.propertyList,e=>{e&&(_.value=e)},{deep:!0,immediate:!0}),P({open:async()=>{t.value=!0,A()}});const g=async()=>{if(d&&await d.value.validate()){o.value=!0;try{const e=r.value,a=await I(e);_.value.push({id:a,...r.value,values:[]}),w.success(h("common.createSuccess")),t.value=!1}finally{o.value=!1}}},A=()=>{var e;r.value={name:""},(e=d.value)==null||e.resetFields()};return(e,a)=>{const F=J,k=K,x=N,i=O,C=B,U=R;return p(),c(C,{modelValue:l(t),"onUpdate:modelValue":a[2]||(a[2]=m=>E(t)?t.value=m: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]=m=>t.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[q((p(),c(x,{ref_key:"formRef",ref:d,model:l(r),rules:l(V),"label-width":"80px"},{default:s(()=>[n(k,{label:"\u5C5E\u6027\u540D\u79F0",prop:"name"},{default:s(()=>[n(F,{modelValue:l(r).name,"onUpdate:modelValue":a[0]||(a[0]=m=>l(r).name=m),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[U,l(o)]])]),_:1},8,["modelValue"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/mall/product/spu/form/ProductPropertyAddForm.vue"]])});export{W as __tla,y as default};
