import{d as L,n as M,r as d,f as O,o as _,l as p,w as r,i as s,a as e,j as f,C as R,c as T,F as j,k as z,t as J,y as P,U as X,H as Z,bZ as I,ag as K,ah as G,K as Q,J as W,N as Y,_ as $,__tla as ee}from"./index-8c6726e5.js";import{_ as ae,__tla as le}from"./Dialog-336bccec.js";import{_ as te,__tla as re}from"./UploadImg-48cb4efb.js";import{a as se,D as ue,__tla as oe}from"./dict-1c98488d.js";import{C as U}from"./constants-a1da293a.js";import{a as ie,c as de,u as me,__tla as ne}from"./brand-3c5b6db0.js";import{u as _e,__tla as ce}from"./useMessage-9f6930df.js";import{__tla as pe}from"./index-bd7c5832.js";import{__tla as fe}from"./el-image-viewer-49715a4b.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=$(L({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ye,{expose:w,emit:k}){const{t:c}=M(),v=_e(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),x=O({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),V.value=u,C(),a){i.value=!0;try{t.value=await ie(a)}finally{i.value=!1}}}});const F=k,B=async()=>{if(n&&await n.value.validate()){i.value=!0;try{const u=t.value;V.value==="create"?(await de(u),v.success(c("common.createSuccess"))):(await me(u),v.success(c("common.updateSuccess"))),o.value=!1,F("success")}finally{i.value=!1}}},C=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""},(u=n.value)==null||u.resetFields()};return(u,a)=>{const b=X,m=Z,E=te,N=I,S=K,q=G,A=Q,h=W,D=ae,H=Y;return _(),p(D,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>P(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:B,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(()=>[R((_(),p(A,{ref_key:"formRef",ref:n,model:e(t),rules:e(x),"label-width":"80px"},{default:r(()=>[s(m,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:r(()=>[s(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}),s(m,{label:"\u54C1\u724C\u56FE\u7247",prop:"picUrl"},{default:r(()=>[s(E,{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(N,{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(q,{modelValue:e(t).status,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).status=l)},{default:r(()=>[(_(!0),T(j,null,z(e(se)(e(ue).COMMON_STATUS),l=>(_(),p(S,{key:l.value,label:l.value},{default:r(()=>[f(J(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(m,{label:"\u54C1\u724C\u63CF\u8FF0"},{default:r(()=>[s(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"])),[[H,e(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/brand/BrandForm.vue"]])});export{ve as __tla,g as default};
