IntegralForm-6ef7717a.js 3.4 KB

1
  1. import{aA as n,d as A,P as O,r as c,x as J,o as b,C as x,A as d,f as u,a,D as Q,k as M,a2 as R,a9 as T,V as W,W as Z,J as q,Z as B,_ as E,__tla as G}from"./index-286756b9.js";import{_ as H,__tla as K}from"./Dialog-4c2de357.js";import{u as L,__tla as N}from"./useMessage-084b1e70.js";let v,m,h,X=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return K}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})},v=E(A({name:"IntegralForm",__name:"IntegralForm",emits:["success"],setup(l,{expose:z,emit:U}){const{t:g}=O(),y=L(),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=J({}),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=T,_=W,C=Z,w=q,P=H,j=B;return b(),x(P,{title:a(I),modelValue:a(s),"onUpdate:modelValue":e[5]||(e[5]=r=>R(s)?s.value=r:null)},{footer:d(()=>[u(w,{onClick:F,type:"primary",disabled:a(i)},{default:d(()=>[Q("\u786E \u5B9A")]),_:1},8,["disabled"]),u(w,{onClick:e[4]||(e[4]=r=>s.value=!1)},{default:d(()=>[Q("\u53D6 \u6D88")]),_:1})]),default:d(()=>[M((b(),x(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"])),[[j,a(i)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/integral/IntegralForm.vue"]]),h=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"}))});export{v as I,X as __tla,m as a,h as b};