1 |
- import{d as q,h as A,r as _,e as I,o as P,v as U,w as o,f as u,a,m as V,x as j,O as B,V as O,A as R,D as E,C as G,I as H,_ as J,__tla as K}from"./index-430b3151.js";import{_ as L,__tla as M}from"./Dialog-cd42c639.js";import{_ as N,__tla as Q}from"./UploadImgs-6e3d2ca2.js";import{a as T,c as W,b as X,__tla as Y}from"./page-9c0f1ba3.js";import{u as Z,__tla as $}from"./useMessage-d226ba89.js";import{__tla as ee}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-7ba47553.js";import{__tla as ae}from"./el-image-viewer-467ebe35.js";let h,le=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return M}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{h=J(q({name:"DiyPageForm",__name:"DiyPageForm",emits:["success"],setup(re,{expose:b,emit:g}){const{t:n}=A(),v=Z(),m=_(!1),f=_(""),c=_(!1),y=_(""),l=_({id:void 0,name:void 0,remark:void 0,previewPicUrls:[]}),k=I({name:[{required:!0,message:"\u9875\u9762\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 T(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 x=g,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 W(e),v.success(n("common.createSuccess"))):(await X(e),v.success(n("common.updateSuccess"))),m.value=!1,x("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=O,r=R,p=N,C=E,w=G,z=L,S=H;return P(),U(z,{title:a(f),modelValue:a(m),"onUpdate:modelValue":e[4]||(e[4]=i=>B(m)?m.value=i:null)},{footer:o(()=>[u(w,{onClick:D,type:"primary",disabled:a(c)},{default:o(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),u(w,{onClick:e[3]||(e[3]=i=>m.value=!1)},{default:o(()=>[V("\u53D6 \u6D88")]),_:1})]),default:o(()=>[j((P(),U(C,{ref_key:"formRef",ref:d,model:a(l),rules:a(k),"label-width":"100px"},{default:o(()=>[u(r,{label:"\u9875\u9762\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\u9875\u9762\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"},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"])),[[S,a(c)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/diy/page/DiyPageForm.vue"]])});export{le as __tla,h as default};
|