import{az as n,d as S,Q as j,r as c,x as A,o as w,A as Q,B as d,f as u,a,E as h,k as B,a2 as E,a8 as R,V as W,W as Z,K as q,Z as G,__tla as H}from"./index-92ad187a.js";import{_ as J,__tla as L}from"./Dialog-44c9fa34.js";import{u as M,__tla as N}from"./useMessage-d9788660.js";let m,b,O=Promise.all([(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return N}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})},b=S({name:"IntegralForm",__name:"IntegralForm",emits:["success"],setup(l,{expose:x,emit:z}){const{t:g}=j(),f=M(),s=c(!1),y=c(""),i=c(!1),I=c(""),t=c({id:void 0,userId:void 0,currentQuota:void 0,freezeQuota:void 0,categoryId:void 0}),U=A({}),v=c();x({open:async(o,e)=>{if(s.value=!0,y.value=g("action."+o),I.value=o,C(),e){i.value=!0;try{t.value=await m.getIntegral(e)}finally{i.value=!1}}}});const k=z,F=async()=>{await v.value.validate(),i.value=!0;try{const o=t.value;I.value==="create"?(await m.createIntegral(o),f.success(g("common.createSuccess"))):(await m.updateIntegral(o),f.success(g("common.updateSuccess"))),s.value=!1,k("success")}finally{i.value=!1}},C=()=>{var o;t.value={id:void 0,userId:void 0,currentQuota:void 0,freezeQuota:void 0,categoryId:void 0},(o=v.value)==null||o.resetFields()};return(o,e)=>{const p=R,_=W,D=Z,V=q,K=J,P=G;return w(),Q(K,{title:a(y),modelValue:a(s),"onUpdate:modelValue":e[5]||(e[5]=r=>E(s)?s.value=r:null)},{footer:d(()=>[u(V,{onClick:F,type:"primary",disabled:a(i)},{default:d(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),u(V,{onClick:e[4]||(e[4]=r=>s.value=!1)},{default:d(()=>[h("\u53D6 \u6D88")]),_:1})]),default:d(()=>[B((w(),Q(D,{ref_key:"formRef",ref:v,model:a(t),rules:a(U),"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\u4F63\u91D1",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\u4F63\u91D1"},null,8,["modelValue"])]),_:1}),u(_,{label:"\u51BB\u7ED3\u4F63\u91D1",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\u4F63\u91D1"},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"])),[[P,a(i)]])]),_:1},8,["title","modelValue"])}}})});export{m as I,b as _,O as __tla};
