Demo01ContactForm-1d76aa95.js 4.2 KB

1
  1. import{ap as n,d as I,n as J,r as c,f as N,o as _,l as y,w as r,i as o,a as e,j as b,C as Y,c as A,F as B,k as G,t as L,y as Q,U as W,H as Z,ag as $,ah as aa,I as ea,K as la,J as ta,N as ra,_ as oa,__tla as sa}from"./index-af173888.js";import{_ as da,__tla as ua}from"./Dialog-987c90a1.js";import{_ as ia,__tla as na}from"./UploadImg-adf73e38.js";import{_ as ca,__tla as ma}from"./Editor-c9f3a63b.js";import{a as _a,D as pa,__tla as fa}from"./dict-093d1dfa.js";import{u as va,__tla as ya}from"./useMessage-170c1b43.js";let g,U,S,k,C,ba=Promise.all([(()=>{try{return sa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return ya}catch{}})()]).then(async()=>{C=async d=>await n.get({url:"/infra/demo01-contact/page",params:d}),S=async d=>await n.delete({url:"/infra/demo01-contact/delete?id="+d}),k=async d=>await n.download({url:"/infra/demo01-contact/export-excel",params:d}),g=oa(I({__name:"Demo01ContactForm",emits:["success"],setup(d,{expose:D,emit:F}){const{t:p}=J(),h=va(),u=c(!1),V=c(""),i=c(!1),w=c(""),t=c({id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0,avatar:void 0}),R=N({name:[{required:!0,message:"\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sex:[{required:!0,message:"\u6027\u522B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],birthday:[{required:!0,message:"\u51FA\u751F\u5E74\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],description:[{required:!0,message:"\u7B80\u4ECB\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),f=c();D({open:async(s,a)=>{if(u.value=!0,V.value=p("action."+s),w.value=s,E(),a){i.value=!0;try{t.value=await(async v=>await n.get({url:"/infra/demo01-contact/get?id="+v}))(a)}finally{i.value=!1}}}});const j=F,q=async()=>{await f.value.validate(),i.value=!0;try{const s=t.value;w.value==="create"?(await(async a=>await n.post({url:"/infra/demo01-contact/create",data:a}))(s),h.success(p("common.createSuccess"))):(await(async a=>await n.put({url:"/infra/demo01-contact/update",data:a}))(s),h.success(p("common.updateSuccess"))),u.value=!1,j("success")}finally{i.value=!1}},E=()=>{var s;t.value={id:void 0,name:void 0,sex:void 0,birthday:void 0,description:void 0,avatar:void 0},(s=f.value)==null||s.resetFields()};return(s,a)=>{const v=W,m=Z,M=$,z=aa,H=ea,O=ca,P=ia,K=la,x=ta,T=da,X=ra;return _(),y(T,{title:e(V),modelValue:e(u),"onUpdate:modelValue":a[6]||(a[6]=l=>Q(u)?u.value=l:null)},{footer:r(()=>[o(x,{onClick:q,type:"primary",disabled:e(i)},{default:r(()=>[b("\u786E \u5B9A")]),_:1},8,["disabled"]),o(x,{onClick:a[5]||(a[5]=l=>u.value=!1)},{default:r(()=>[b("\u53D6 \u6D88")]),_:1})]),default:r(()=>[Y((_(),y(K,{ref_key:"formRef",ref:f,model:e(t),rules:e(R),"label-width":"100px"},{default:r(()=>[o(m,{label:"\u540D\u5B57",prop:"name"},{default:r(()=>[o(v,{modelValue:e(t).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u5B57"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u6027\u522B",prop:"sex"},{default:r(()=>[o(z,{modelValue:e(t).sex,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).sex=l)},{default:r(()=>[(_(!0),A(B,null,G(e(_a)(e(pa).SYSTEM_USER_SEX),l=>(_(),y(M,{key:l.value,label:l.value},{default:r(()=>[b(L(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"\u51FA\u751F\u5E74",prop:"birthday"},{default:r(()=>[o(H,{modelValue:e(t).birthday,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).birthday=l),type:"date","value-format":"x",placeholder:"\u9009\u62E9\u51FA\u751F\u5E74"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u7B80\u4ECB",prop:"description"},{default:r(()=>[o(O,{modelValue:e(t).description,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).description=l),height:"150px"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u5934\u50CF",prop:"avatar"},{default:r(()=>[o(P,{modelValue:e(t).avatar,"onUpdate:modelValue":a[4]||(a[4]=l=>e(t).avatar=l)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[X,e(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/demo/demo01/Demo01ContactForm.vue"]]),U=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))});export{g as D,ba as __tla,U as a,S as d,k as e,C as g};