1 |
- import{d as O,h as T,r as d,e as z,o as _,v as p,w as r,f as s,a,n as f,x as L,c as P,F as I,q as R,t as j,O as G,V as H,A as J,aT as K,ah as Q,ai as W,D as X,C as Y,I as Z,_ as $,__tla as aa}from"./index-6d7b82ba.js";import{_ as ea,__tla as la}from"./Dialog-78181bae.js";import{_ as ta,__tla as ra}from"./UploadImg-f5f3b1db.js";import{a as sa,D as ua,__tla as oa}from"./dict-efb5f3b6.js";import{C as U}from"./constants-a3c69b57.js";import{a as ia,c as da,u as ma,__tla as na}from"./brand-627164f1.js";import{u as _a,__tla as ca}from"./useMessage-be161634.js";import{__tla as pa}from"./index-8e19be94.js";import{__tla as fa}from"./el-image-viewer-4a19ded4.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=$(O({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ya,{expose:w,emit:x}){const{t:c}=T(),v=_a(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),k=z({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 q=x,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,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,e)=>{const h=H,m=J,C=ta,E=K,F=Q,S=W,D=X,b=Y,M=ea,N=Z;return _(),p(M,{title:a(y),modelValue:a(o),"onUpdate:modelValue":e[6]||(e[6]=l=>G(o)?o.value=l:null)},{footer:r(()=>[s(b,{onClick:A,type:"primary",disabled:a(i)},{default:r(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(b,{onClick:e[5]||(e[5]=l=>o.value=!1)},{default:r(()=>[f("\u53D6 \u6D88")]),_:1})]),default:r(()=>[L((_(),p(D,{ref_key:"formRef",ref:n,model:a(t),rules:a(k),"label-width":"80px"},{default:r(()=>[s(m,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:r(()=>[s(h,{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(E,{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(S,{modelValue:a(t).status,"onUpdate:modelValue":e[3]||(e[3]=l=>a(t).status=l)},{default:r(()=>[(_(!0),P(I,null,R(a(sa)(a(ua).COMMON_STATUS),l=>(_(),p(F,{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(h,{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"])),[[N,a(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/brand/BrandForm.vue"]])});export{va as __tla,g as default};
|