1 |
- import{d as z,h as L,r as d,e as M,o as n,v as p,w as r,f as s,a,m as f,x as P,c as T,F as j,q as I,t as R,O as Y,V as G,A as J,aY as H,ah as K,ai as Q,D as W,C as X,I as Z,_ as $,__tla as aa}from"./index-430b3151.js";import{_ as ea,__tla as la}from"./Dialog-cd42c639.js";import{_ as ta,__tla as ra}from"./UploadImg-2f818d4f.js";import{a as sa,D as ua,__tla as oa}from"./dict-603b6a58.js";import{C as U}from"./constants-637baed6.js";import{a as ia,c as da,u as ma,__tla as _a}from"./brand-a7961bee.js";import{u as na,__tla as ca}from"./useMessage-d226ba89.js";import{__tla as pa}from"./index-255e3b1c.js";import{__tla as fa}from"./el-image-viewer-467ebe35.js";let g,va=Promise.all([(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return ra}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return fa}catch{}})()]).then(async()=>{g=$(z({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ya,{expose:w,emit:x}){const{t:c}=L(),v=na(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),F=M({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"}]}),_=d();w({open:async(u,e)=>{if(o.value=!0,y.value=c("action."+u),V.value=u,A(),e){i.value=!0;try{t.value=await ia(e)}finally{i.value=!1}}}});const k=x,q=async()=>{if(_&&await _.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}}},A=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""},(u=_.value)==null||u.resetFields()};return(u,e)=>{const h=G,m=J,B=ta,C=H,S=K,D=Q,E=W,b=X,O=ea,N=Z;return n(),p(O,{title:a(y),modelValue:a(o),"onUpdate:modelValue":e[6]||(e[6]=l=>Y(o)?o.value=l:null)},{footer:r(()=>[s(b,{onClick:q,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(()=>[P((n(),p(E,{ref_key:"formRef",ref:_,model:a(t),rules:a(F),"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(B,{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(C,{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(D,{modelValue:a(t).status,"onUpdate:modelValue":e[3]||(e[3]=l=>a(t).status=l)},{default:r(()=>[(n(!0),T(j,null,I(a(sa)(a(ua).COMMON_STATUS),l=>(n(),p(S,{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(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};
|