import{d as P,h as z,r as d,e as L,o as _,v as p,w as r,f as s,a as e,n as f,x as O,c as T,F as j,q as I,t as R,P as W,W as J,A as Q,bb as G,ai as H,aj as K,D as X,C as Y,I as Z,_ as $,__tla as ee}from"./index-04f8d540.js";import{_ as ae,__tla as le}from"./Dialog-9afb5ba5.js";import{_ as te,__tla as re}from"./UploadImg-e5f21efb.js";import{a as se,D as ue,__tla as oe}from"./dict-ef06f7f7.js";import{C as U}from"./constants-40f13f5e.js";import{a as ie,c as de,u as me,__tla as ne}from"./brand-a2a263a2.js";import{u as _e,__tla as ce}from"./useMessage-9c37e840.js";import{__tla as pe}from"./index-ef33124b.js";import{__tla as fe}from"./el-image-viewer-5878bd7a.js";let g,ve=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return fe}catch{}})()]).then(async()=>{g=$(P({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ye,{expose:w,emit:x}){const{t:c}=z(),v=_e(),o=d(!1),y=d(""),i=d(!1),b=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),k=L({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"}]}),n=d();w({open:async(u,a)=>{if(o.value=!0,y.value=c("action."+u),b.value=u,B(),a){i.value=!0;try{t.value=await ie(a)}finally{i.value=!1}}}});const q=x,A=async()=>{if(n&&await n.value.validate()){i.value=!0;try{const u=t.value;b.value==="create"?(await de(u),v.success(c("common.createSuccess"))):(await me(u),v.success(c("common.updateSuccess"))),o.value=!1,q("success")}finally{i.value=!1}}},B=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""},(u=n.value)==null||u.resetFields()};return(u,a)=>{const V=J,m=Q,C=te,E=G,F=H,S=K,D=X,h=Y,M=ae,N=Z;return _(),p(M,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>W(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:A,type:"primary",disabled:e(i)},{default:r(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(h,{onClick:a[5]||(a[5]=l=>o.value=!1)},{default:r(()=>[f("\u53D6 \u6D88")]),_:1})]),default:r(()=>[O((_(),p(D,{ref_key:"formRef",ref:n,model:e(t),rules:e(k),"label-width":"80px"},{default:r(()=>[s(m,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:r(()=>[s(V,{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}),s(m,{label:"\u54C1\u724C\u56FE\u7247",prop:"picUrl"},{default:r(()=>[s(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}),s(m,{label:"\u54C1\u724C\u6392\u5E8F",prop:"sort"},{default:r(()=>[s(E,{modelValue:e(t).sort,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).sort=l),"controls-position":"right",min:0},null,8,["modelValue"])]),_:1}),s(m,{label:"\u54C1\u724C\u72B6\u6001",prop:"status"},{default:r(()=>[s(S,{modelValue:e(t).status,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).status=l)},{default:r(()=>[(_(!0),T(j,null,I(e(se)(e(ue).COMMON_STATUS),l=>(_(),p(F,{key:l.value,label:l.value},{default:r(()=>[f(R(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(m,{label:"\u54C1\u724C\u63CF\u8FF0"},{default:r(()=>[s(V,{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"])),[[N,e(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/brand/BrandForm.vue"]])});export{ve as __tla,g as default};
