import{d as D,h as G,r as c,e as I,Y as j,o as V,x as g,w as u,f as l,a as t,y as p,z as K,l as b,R as S,C as X,bw as Y,ad as A,ae as B,H as E,G as J,K as L,_ as M,__tla as N}from"./index-8dc1e40a.js";import{_ as O,__tla as Q}from"./Dialog-41802231.js";import{g as W,b as Z,__tla as $}from"./index-1d236810.js";import{u as ee,__tla as ae}from"./useMessage-7a27dd80.js";let w,le=Promise.all([(()=>{try{return N}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{w=M(D({name:"UpdatePointForm",__name:"UserPointUpdateForm",emits:["success"],setup(te,{expose:P,emit:U}){const{t:x}=G(),_=ee(),s=c(!1),n=c(!1),e=c({id:void 0,nickname:void 0,point:0,changePoint:0,changeType:1}),k=I({changePoint:[{required:!0,message:"\u53D8\u52A8\u79EF\u5206\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),r=c();P({open:async d=>{if(s.value=!0,C(),d){n.value=!0;try{e.value=await W(d),e.value.changeType=1,e.value.changePoint=0}finally{n.value=!1}}}});const T=U,F=async()=>{if(r&&await r.value.validate())if(e.value.changePoint<1)_.error("\u53D8\u52A8\u79EF\u5206\u4E0D\u80FD\u5C0F\u4E8E 1");else if(m.value<0)_.error("\u53D8\u52A8\u540E\u7684\u79EF\u5206\u4E0D\u80FD\u5C0F\u4E8E 0");else{n.value=!0;try{await Z({id:e.value.id,point:e.value.changePoint*e.value.changeType}),_.success(x("common.updateSuccess")),s.value=!1,T("success")}finally{n.value=!1}}},C=()=>{var d;e.value={id:void 0,nickname:void 0,levelId:void 0,reason:void 0},(d=r.value)==null||d.resetFields()},m=j(()=>e.value.point+e.value.changePoint*e.value.changeType);return(d,a)=>{const v=S,i=X,f=Y,h=A,R=B,z=E,y=J,H=O,q=L;return V(),g(H,{title:"\u4FEE\u6539\u7528\u6237\u79EF\u5206",modelValue:t(s),"onUpdate:modelValue":a[7]||(a[7]=o=>b(s)?s.value=o:null),width:"600"},{footer:u(()=>[l(y,{onClick:F,type:"primary",disabled:t(n)},{default:u(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),l(y,{onClick:a[6]||(a[6]=o=>s.value=!1)},{default:u(()=>[p("\u53D6 \u6D88")]),_:1})]),default:u(()=>[K((V(),g(z,{ref_key:"formRef",ref:r,model:t(e),rules:t(k),"label-width":"100px"},{default:u(()=>[l(i,{label:"\u7528\u6237\u7F16\u53F7",prop:"id"},{default:u(()=>[l(v,{modelValue:t(e).id,"onUpdate:modelValue":a[0]||(a[0]=o=>t(e).id=o),class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1}),l(i,{label:"\u7528\u6237\u6635\u79F0",prop:"nickname"},{default:u(()=>[l(v,{modelValue:t(e).nickname,"onUpdate:modelValue":a[1]||(a[1]=o=>t(e).nickname=o),class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1}),l(i,{label:"\u53D8\u52A8\u524D\u79EF\u5206",prop:"point"},{default:u(()=>[l(f,{modelValue:t(e).point,"onUpdate:modelValue":a[2]||(a[2]=o=>t(e).point=o),class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1}),l(i,{label:"\u53D8\u52A8\u7C7B\u578B",prop:"changeType"},{default:u(()=>[l(R,{modelValue:t(e).changeType,"onUpdate:modelValue":a[3]||(a[3]=o=>t(e).changeType=o)},{default:u(()=>[l(h,{label:1},{default:u(()=>[p("\u589E\u52A0")]),_:1}),l(h,{label:-1},{default:u(()=>[p("\u51CF\u5C11")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(i,{label:"\u53D8\u52A8\u79EF\u5206",prop:"changePoint"},{default:u(()=>[l(f,{modelValue:t(e).changePoint,"onUpdate:modelValue":a[4]||(a[4]=o=>t(e).changePoint=o),class:"!w-240px",min:0,precision:0},null,8,["modelValue"])]),_:1}),l(i,{label:"\u53D8\u52A8\u540E\u79EF\u5206"},{default:u(()=>[l(f,{modelValue:t(m),"onUpdate:modelValue":a[5]||(a[5]=o=>b(m)?m.value=o:null),class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,t(n)]])]),_:1},8,["modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/member/user/UserPointUpdateForm.vue"]])});export{le as __tla,w as default};
