import{d as L,Q as O,r as i,x as R,o as n,A as p,B as s,f as r,a as e,E as f,k as T,c as D,F as G,R as K,G as Q,a2 as Z,a8 as j,V as I,bP as W,as as z,at as H,W as J,K as X,Z as Y,__tla as $}from"./index-92ad187a.js";import{_ as ee,__tla as ae}from"./Dialog-44c9fa34.js";import{_ as le,__tla as te}from"./UploadImg-fb5c909e.js";import{a as se,D as re,__tla as ue}from"./dict-221f3e01.js";import{C as h}from"./constants-c811e5ff.js";import{a as oe,c as de,u as ie,__tla as me}from"./brand-5f2742fe.js";import{u as ce,__tla as ne}from"./useMessage-d9788660.js";let g,_e=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ne}catch{}})()]).then(async()=>{g=L({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(pe,{expose:w,emit:E}){const{t:_}=O(),v=ce(),o=i(!1),V=i(""),d=i(!1),y=i(""),t=i({id:void 0,name:"",picUrl:"",status:h.ENABLE,description:""}),k=R({name:[{required:!0,message:"\u54C1\u724C\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],picUrl:[{required:!0,message:"\u54C1\u724C\u56FE\u7247\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sort:[{required:!0,message:"\u54C1\u724C\u6392\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=i();w({open:async(u,a)=>{if(o.value=!0,V.value=_("action."+u),y.value=u,B(),a){d.value=!0;try{t.value=await oe(a)}finally{d.value=!1}}}});const x=E,A=async()=>{if(c&&await c.value.validate()){d.value=!0;try{const u=t.value;y.value==="create"?(await de(u),v.success(_("common.createSuccess"))):(await ie(u),v.success(_("common.updateSuccess"))),o.value=!1,x("success")}finally{d.value=!1}}},B=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:h.ENABLE,description:""},(u=c.value)==null||u.resetFields()};return(u,a)=>{const b=j,m=I,C=le,F=W,S=z,q=H,M=J,U=X,N=ee,P=Y;return n(),p(N,{title:e(V),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>Z(o)?o.value=l:null)},{footer:s(()=>[r(U,{onClick:A,type:"primary",disabled:e(d)},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),r(U,{onClick:a[5]||(a[5]=l=>o.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[T((n(),p(M,{ref_key:"formRef",ref:c,model:e(t),rules:e(k),"label-width":"80px"},{default:s(()=>[r(m,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:s(()=>[r(b,{modelValue:e(t).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).name=l),placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(m,{label:"\u54C1\u724C\u56FE\u7247",prop:"picUrl"},{default:s(()=>[r(C,{modelValue:e(t).picUrl,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).picUrl=l),limit:1,"is-show-tip":!1},null,8,["modelValue"])]),_:1}),r(m,{label:"\u54C1\u724C\u6392\u5E8F",prop:"sort"},{default:s(()=>[r(F,{modelValue:e(t).sort,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).sort=l),"controls-position":"right",min:0},null,8,["modelValue"])]),_:1}),r(m,{label:"\u54C1\u724C\u72B6\u6001",prop:"status"},{default:s(()=>[r(q,{modelValue:e(t).status,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).status=l)},{default:s(()=>[(n(!0),D(G,null,K(e(se)(e(re).COMMON_STATUS),l=>(n(),p(S,{key:l.value,label:l.value},{default:s(()=>[f(Q(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(m,{label:"\u54C1\u724C\u63CF\u8FF0"},{default:s(()=>[r(b,{modelValue:e(t).description,"onUpdate:modelValue":a[4]||(a[4]=l=>e(t).description=l),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u63CF\u8FF0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[P,e(d)]])]),_:1},8,["title","modelValue"])}}})});export{g as _,_e as __tla};
