1 |
- import{d as P,P as z,r as d,x as L,o as n,C as p,A as r,f as s,a,D as f,k as O,c as R,F as T,R as J,E as Q,a2 as W,a9 as j,V as I,bQ as Z,at as G,au as H,W as K,J as X,Z as Y,_ as $,__tla as aa}from"./index-286756b9.js";import{_ as ea,__tla as la}from"./Dialog-4c2de357.js";import{_ as ta,__tla as ra}from"./UploadImg-d2713eac.js";import{a as sa,D as ua,__tla as oa}from"./dict-82dca549.js";import{C as U}from"./constants-637baed6.js";import{a as ia,c as da,u as ma,__tla as _a}from"./brand-93287a10.js";import{u as na,__tla as ca}from"./useMessage-084b1e70.js";import{__tla as pa}from"./index-5a40c383.js";import{__tla as fa}from"./el-image-viewer-e0e5d3be.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=$(P({name:"ProductBrandForm",__name:"BrandForm",emits:["success"],setup(ya,{expose:w,emit:x}){const{t:c}=z(),v=na(),o=d(!1),y=d(""),i=d(!1),V=d(""),t=d({id:void 0,name:"",picUrl:"",status:U.ENABLE,description:""}),E=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"}]}),_=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 F=x,k=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,F("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 b=j,m=I,B=ta,C=Z,S=G,q=H,D=K,h=X,M=ea,N=Y;return n(),p(M,{title:a(y),modelValue:a(o),"onUpdate:modelValue":e[6]||(e[6]=l=>W(o)?o.value=l:null)},{footer:r(()=>[s(h,{onClick:k,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((n(),p(D,{ref_key:"formRef",ref:_,model:a(t),rules:a(E),"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(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(q,{modelValue:a(t).status,"onUpdate:modelValue":e[3]||(e[3]=l=>a(t).status=l)},{default:r(()=>[(n(!0),R(T,null,J(a(sa)(a(ua).COMMON_STATUS),l=>(n(),p(S,{key:l.value,label:l.value},{default:r(()=>[f(Q(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};
|