BrandForm-dcf66941.js 3.8 KB

1
  1. import{d as N,h as z,r as d,e as L,o as _,v as p,w as r,f as s,a as e,n as f,x as P,c as T,F as I,q as R,t as j,O as G,V as K,A as $,bb as H,ah as J,ai as Q,D as W,C as X,I as Y,_ as Z,__tla as ee}from"./index-8e30b17f.js";import{_ as ae,__tla as le}from"./Dialog-9917188a.js";import{_ as te,__tla as re}from"./UploadImg-1c51a097.js";import{a as se,D as ue,__tla as oe}from"./dict-500f7ec9.js";import{C as U}from"./constants-40f13f5e.js";import{a as ie,c as de,u as me,__tla as ne}from"./brand-6fcb1407.js";import{u as _e,__tla as ce}from"./useMessage-ee50bd51.js";import{__tla as pe}from"./index-7d9ab767.js";import{__tla as fe}from"./el-image-viewer-fb97741c.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=Z(N({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ye,{expose:w,emit:x}){const{t:c}=z(),v=_e(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),k=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,a)=>{if(o.value=!0,y.value=c("action."+u),V.value=u,B(),a){i.value=!0;try{t.value=await ie(a)}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 de(u),v.success(c("common.createSuccess"))):(await me(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,a)=>{const b=K,m=$,C=te,E=H,F=J,D=Q,O=W,h=X,S=ae,M=Y;return _(),p(S,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[6]||(a[6]=l=>G(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:A,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(()=>[P((_(),p(O,{ref_key:"formRef",ref:n,model:e(t),rules:e(k),"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(C,{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(E,{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(D,{modelValue:e(t).status,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).status=l)},{default:r(()=>[(_(!0),T(I,null,R(e(se)(e(ue).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(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"])),[[M,e(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/brand/BrandForm.vue"]])});export{ve as __tla,g as default};