import{d as P,n as H,r as d,f as L,o as _,l as p,w as r,i as s,a,j as f,C as T,c as j,F as D,k as G,t as J,y as K,U as Z,H as I,bZ as R,ag as z,ah as Q,K as W,J as X,N as Y,_ as $,__tla as aa}from"./index-2c56227b.js";import{_ as ea,__tla as la}from"./Dialog-1050d437.js";import{_ as ta,__tla as ra}from"./UploadImg-6d25031e.js";import{a as sa,D as ua,__tla as oa}from"./dict-763dd292.js";import{C as U}from"./constants-a1da293a.js";import{a as ia,c as da,u as ma,__tla as na}from"./brand-05d3a833.js";import{u as _a,__tla as ca}from"./useMessage-96878a4a.js";import{__tla as pa}from"./index-8d031f1e.js";import{__tla as fa}from"./el-image-viewer-da1b6008.js";let g,va=Promise.all([(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return ra}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return fa}catch{}})()]).then(async()=>{g=$(P({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ya,{expose:w,emit:E}){const{t:c}=H(),v=_a(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),F=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,e)=>{if(o.value=!0,y.value=c("action."+u),V.value=u,B(),e){i.value=!0;try{t.value=await ia(e)}finally{i.value=!1}}}});const k=E,A=async()=>{if(n&&await n.value.validate()){i.value=!0;try{const u=t.value;V.value==="create"?(await da(u),v.success(c("common.createSuccess"))):(await ma(u),v.success(c("common.updateSuccess"))),o.value=!1,k("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,e)=>{const b=Z,m=I,C=ta,N=R,S=z,q=Q,x=W,h=X,M=ea,O=Y;return _(),p(M,{title:a(y),modelValue:a(o),"onUpdate:modelValue":e[6]||(e[6]=l=>K(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:A,type:"primary",disabled:a(i)},{default:r(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(h,{onClick:e[5]||(e[5]=l=>o.value=!1)},{default:r(()=>[f("\u53D6 \u6D88")]),_:1})]),default:r(()=>[T((_(),p(x,{ref_key:"formRef",ref:n,model:a(t),rules:a(F),"label-width":"80px"},{default:r(()=>[s(m,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:r(()=>[s(b,{modelValue:a(t).name,"onUpdate:modelValue":e[0]||(e[0]=l=>a(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:a(t).picUrl,"onUpdate:modelValue":e[1]||(e[1]=l=>a(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:a(t).sort,"onUpdate:modelValue":e[2]||(e[2]=l=>a(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:a(t).status,"onUpdate:modelValue":e[3]||(e[3]=l=>a(t).status=l)},{default:r(()=>[(_(!0),j(D,null,G(a(sa)(a(ua).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:a(t).description,"onUpdate:modelValue":e[4]||(e[4]=l=>a(t).description=l),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u63CF\u8FF0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[O,a(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/mall/product/brand/BrandForm.vue"]])});export{va as __tla,g as default};
