SocialStatusForm-da9c170c.js 3.3 KB

1
  1. import{aq as c,d as R,h as A,r as n,e as H,o as b,v as h,w as u,f as i,a as t,n as x,x as I,O as M,V as T,A as X,D as B,C as E,I as G,_ as J,__tla as K}from"./index-11e4820e.js";import{_ as L,__tla as N}from"./Dialog-bbfaf85c.js";import{u as Q,__tla as W}from"./useMessage-06ddf735.js";let f,m,U,Y=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{m={getSocialStatusPage:async e=>await c.get({url:"/distri/social-status/page",params:e}),getSocialStatus:async e=>await c.get({url:"/distri/social-status/get?id="+e}),createSocialStatus:async e=>await c.post({url:"/distri/social-status/create",data:e}),updateSocialStatus:async e=>await c.put({url:"/distri/social-status/update",data:e}),deleteSocialStatus:async e=>await c.delete({url:"/distri/social-status/delete?id="+e}),exportSocialStatus:async e=>await c.download({url:"/distri/social-status/export-excel",params:e})},f=J(R({name:"SocialStatusForm",__name:"SocialStatusForm",emits:["success"],setup(e,{expose:k,emit:F}){const{t:p}=A(),y=Q(),r=n(!1),w=n(""),d=n(!1),V=n(""),l=n({id:void 0,level:void 0,name:void 0,point:void 0}),C=H({name:[{required:!0,message:"\u8EAB\u4EF7\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),_=n();k({open:async(s,a)=>{if(r.value=!0,w.value=p("action."+s),V.value=s,q(),a){d.value=!0;try{l.value=await m.getSocialStatus(a)}finally{d.value=!1}}}});const O=F,j=async()=>{await _.value.validate(),d.value=!0;try{const s=l.value;V.value==="create"?(await m.createSocialStatus(s),y.success(p("common.createSuccess"))):(await m.updateSocialStatus(s),y.success(p("common.updateSuccess"))),r.value=!1,O("success")}finally{d.value=!1}},q=()=>{var s;l.value={id:void 0,level:void 0,name:void 0,point:void 0},(s=_.value)==null||s.resetFields()};return(s,a)=>{const v=T,S=X,z=B,g=E,D=L,P=G;return b(),h(D,{title:t(w),modelValue:t(r),"onUpdate:modelValue":a[4]||(a[4]=o=>M(r)?r.value=o:null)},{footer:u(()=>[i(g,{onClick:j,type:"primary",disabled:t(d)},{default:u(()=>[x("\u786E \u5B9A")]),_:1},8,["disabled"]),i(g,{onClick:a[3]||(a[3]=o=>r.value=!1)},{default:u(()=>[x("\u53D6 \u6D88")]),_:1})]),default:u(()=>[I((b(),h(z,{ref_key:"formRef",ref:_,model:t(l),rules:t(C),"label-width":"100px"},{default:u(()=>[i(S,{label:"\u8EAB\u4EF7\u7B49\u7EA7",prop:"level"},{default:u(()=>[i(v,{modelValue:t(l).level,"onUpdate:modelValue":a[0]||(a[0]=o=>t(l).level=o),placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EF7\u7B49\u7EA7"},null,8,["modelValue"])]),_:1}),i(S,{label:"\u8EAB\u4EF7\u540D\u79F0",prop:"name"},{default:u(()=>[i(v,{modelValue:t(l).name,"onUpdate:modelValue":a[1]||(a[1]=o=>t(l).name=o),placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EF7\u540D\u79F0"},null,8,["modelValue"])]),_:1}),i(S,{label:"\u5347\u7EA7\u6240\u9700\u70B9\u6570",prop:"point"},{default:u(()=>[i(v,{modelValue:t(l).point,"onUpdate:modelValue":a[2]||(a[2]=o=>t(l).point=o),placeholder:"\u8BF7\u8F93\u5165\u5347\u7EA7\u6240\u9700\u70B9\u6570"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[P,t(d)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/distri/socialstatus/SocialStatusForm.vue"]]),U=Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"}))});export{f as S,Y as __tla,m as a,U as b};