1 |
- import{d as S,P as q,r as _,x as j,o as U,C as V,A as o,f as u,a,D as P,k as A,a2 as I,a9 as J,V as M,W as R,J as W,Z,_ as B,__tla as E}from"./index-286756b9.js";import{_ as G,__tla as H}from"./Dialog-4c2de357.js";import{_ as K,__tla as L}from"./UploadImgs-b8116d2f.js";import{a as N,c as O,b as Q,__tla as X}from"./template-6ba93929.js";import{u as Y,__tla as $}from"./useMessage-084b1e70.js";import{__tla as ee}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-a65d467a.js";import{__tla as ae}from"./el-image-viewer-e0e5d3be.js";let h,le=Promise.all([(()=>{try{return E}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{h=B(S({name:"DiyTemplateForm",__name:"DiyTemplateForm",emits:["success"],setup(re,{expose:b,emit:k}){const{t:n}=q(),v=Y(),m=_(!1),f=_(""),c=_(!1),y=_(""),l=_({id:void 0,name:void 0,remark:void 0,previewPicUrls:[]}),x=j({name:[{required:!0,message:"\u6A21\u677F\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=_();b({open:async(s,e)=>{var t;if(m.value=!0,f.value=n("action."+s),y.value=s,F(),e){c.value=!0;try{const r=await N(e);((t=r==null?void 0:r.previewPicUrls)==null?void 0:t.length)>0&&(r.previewPicUrls=r.previewPicUrls.map(p=>({url:p}))),l.value=r}finally{c.value=!1}}}});const g=k,D=async()=>{if(d&&await d.value.validate()){c.value=!0;try{const s=l.value.previewPicUrls.map(t=>t.url?t.url:t),e={...l.value,previewPicUrls:s};y.value==="create"?(await O(e),v.success(n("common.createSuccess"))):(await Q(e),v.success(n("common.updateSuccess"))),m.value=!1,g("success")}finally{c.value=!1}}},F=()=>{var s;l.value={id:void 0,name:void 0,remark:void 0,previewPicUrls:[]},(s=d.value)==null||s.resetFields()};return(s,e)=>{const t=J,r=M,p=K,C=R,w=W,T=G,z=Z;return U(),V(T,{title:a(f),modelValue:a(m),"onUpdate:modelValue":e[4]||(e[4]=i=>I(m)?m.value=i:null)},{footer:o(()=>[u(w,{onClick:D,type:"primary",disabled:a(c)},{default:o(()=>[P("\u786E \u5B9A")]),_:1},8,["disabled"]),u(w,{onClick:e[3]||(e[3]=i=>m.value=!1)},{default:o(()=>[P("\u53D6 \u6D88")]),_:1})]),default:o(()=>[A((U(),V(C,{ref_key:"formRef",ref:d,model:a(l),rules:a(x),"label-width":"100px"},{default:o(()=>[u(r,{label:"\u6A21\u677F\u540D\u79F0",prop:"name"},{default:o(()=>[u(t,{modelValue:a(l).name,"onUpdate:modelValue":e[0]||(e[0]=i=>a(l).name=i),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u5907\u6CE8",prop:"remark"},{default:o(()=>[u(t,{modelValue:a(l).remark,"onUpdate:modelValue":e[1]||(e[1]=i=>a(l).remark=i),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",type:"textarea"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u9884\u89C8\u56FE",prop:"previewPicUrls"},{default:o(()=>[u(p,{modelValue:a(l).previewPicUrls,"onUpdate:modelValue":e[2]||(e[2]=i=>a(l).previewPicUrls=i)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,a(c)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/diy/template/DiyTemplateForm.vue"]])});export{le as __tla,h as default};
|