1 |
- import{d as P,i as z,r as d,f as L,o as _,x as p,w as r,g as s,a,n as f,y as O,c as T,F as j,v as G,t as J,P as R,W,B as I,aY as Y,ai as H,aj as K,G as Q,D as X,J as Z,_ as $,__tla as aa}from"./index-52b99925.js";import{_ as ea,__tla as la}from"./Dialog-01a79427.js";import{_ as ta,__tla as ra}from"./UploadImg-63fa00ce.js";import{a as sa,D as ua,__tla as oa}from"./dict-954b1420.js";import{C as U}from"./constants-637baed6.js";import{a as ia,c as da,u as ma,__tla as na}from"./brand-dee5a8c5.js";import{u as _a,__tla as ca}from"./useMessage-c41e583e.js";import{__tla as pa}from"./index-2375ba8a.js";import{__tla as fa}from"./el-image-viewer-8d62bae1.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:x}){const{t:c}=z(),v=_a(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),B=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,F(),e){i.value=!0;try{t.value=await ia(e)}finally{i.value=!1}}}});const k=x,C=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}}},F=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""},(u=n.value)==null||u.resetFields()};return(u,e)=>{const b=W,m=I,S=ta,q=Y,A=H,D=K,E=Q,h=X,M=ea,N=Z;return _(),p(M,{title:a(y),modelValue:a(o),"onUpdate:modelValue":e[6]||(e[6]=l=>R(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:C,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(()=>[O((_(),p(E,{ref_key:"formRef",ref:n,model:a(t),rules:a(B),"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(S,{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(q,{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(()=>[(_(!0),T(j,null,G(a(sa)(a(ua).COMMON_STATUS),l=>(_(),p(A,{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"])),[[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};
|