IntegralForm-27abbbed.js 3.4 KB

1
  1. import{aq as n,d as P,h as R,r as c,e as q,o as b,v as Q,w as d,f as u,a,n as h,x as A,O as H,V as M,A as T,D as X,C as B,I as E,_ as G,__tla as J}from"./index-11e4820e.js";import{_ as K,__tla as L}from"./Dialog-bbfaf85c.js";import{u as N,__tla as W}from"./useMessage-06ddf735.js";let v,m,x,Y=Promise.all([(()=>{try{return J}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{m={getIntegralPage:async l=>await n.get({url:"/distri/integral/page",params:l}),getIntegral:async l=>await n.get({url:"/distri/integral/get?id="+l}),createIntegral:async l=>await n.post({url:"/distri/integral/create",data:l}),updateIntegral:async l=>await n.put({url:"/distri/integral/update",data:l}),deleteIntegral:async l=>await n.delete({url:"/distri/integral/delete?id="+l}),exportIntegral:async l=>await n.download({url:"/distri/integral/export-excel",params:l})},v=G(P({name:"IntegralForm",__name:"IntegralForm",emits:["success"],setup(l,{expose:z,emit:U}){const{t:g}=R(),y=N(),s=c(!1),I=c(""),i=c(!1),V=c(""),t=c({id:void 0,userId:void 0,currentQuota:void 0,freezeQuota:void 0,categoryId:void 0}),k=q({}),f=c();z({open:async(o,e)=>{if(s.value=!0,I.value=g("action."+o),V.value=o,S(),e){i.value=!0;try{t.value=await m.getIntegral(e)}finally{i.value=!1}}}});const D=U,F=async()=>{await f.value.validate(),i.value=!0;try{const o=t.value;V.value==="create"?(await m.createIntegral(o),y.success(g("common.createSuccess"))):(await m.updateIntegral(o),y.success(g("common.updateSuccess"))),s.value=!1,D("success")}finally{i.value=!1}},S=()=>{var o;t.value={id:void 0,userId:void 0,currentQuota:void 0,freezeQuota:void 0,categoryId:void 0},(o=f.value)==null||o.resetFields()};return(o,e)=>{const p=M,_=T,C=X,w=B,j=K,O=E;return b(),Q(j,{title:a(I),modelValue:a(s),"onUpdate:modelValue":e[5]||(e[5]=r=>H(s)?s.value=r:null)},{footer:d(()=>[u(w,{onClick:F,type:"primary",disabled:a(i)},{default:d(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),u(w,{onClick:e[4]||(e[4]=r=>s.value=!1)},{default:d(()=>[h("\u53D6 \u6D88")]),_:1})]),default:d(()=>[A((b(),Q(C,{ref_key:"formRef",ref:f,model:a(t),rules:a(k),"label-width":"100px"},{default:d(()=>[u(_,{label:"\u7528\u6237ID",prop:"userId"},{default:d(()=>[u(p,{modelValue:a(t).userId,"onUpdate:modelValue":e[0]||(e[0]=r=>a(t).userId=r),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),u(_,{label:"\u5F53\u524D\u79EF\u5206",prop:"currentQuota"},{default:d(()=>[u(p,{modelValue:a(t).currentQuota,"onUpdate:modelValue":e[1]||(e[1]=r=>a(t).currentQuota=r),placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u79EF\u5206"},null,8,["modelValue"])]),_:1}),u(_,{label:"\u51BB\u7ED3\u79EF\u5206",prop:"freezeQuota"},{default:d(()=>[u(p,{modelValue:a(t).freezeQuota,"onUpdate:modelValue":e[2]||(e[2]=r=>a(t).freezeQuota=r),placeholder:"\u8BF7\u8F93\u5165\u51BB\u7ED3\u79EF\u5206"},null,8,["modelValue"])]),_:1}),u(_,{label:"\u7528\u6237\u7C7B\u578B",prop:"categoryId"},{default:d(()=>[u(p,{modelValue:a(t).categoryId,"onUpdate:modelValue":e[3]||(e[3]=r=>a(t).categoryId=r),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u7C7B\u578B"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[O,a(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/distri/integral/IntegralForm.vue"]]),x=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"}))});export{v as I,Y as __tla,m as a,x as b};