import{d as E,n as R,r as c,f as Z,b as D,o as g,l as V,w as n,i as l,a as t,j as p,C as G,y as b,U as I,H as J,bZ as K,ag as N,ah as O,K as S,J as z,N as B,_ as L,__tla as M}from"./index-2c56227b.js";import{_ as Q,__tla as W}from"./Dialog-1050d437.js";import{g as X,b as Y,__tla as $}from"./index-852641f9.js";import{u as ee,__tla as ae}from"./useMessage-96878a4a.js";let P,le=Promise.all([(()=>{try{return M}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{P=L(E({name:"UpdatePointForm",__name:"UserPointUpdateForm",emits:["success"],setup(te,{expose:U,emit:w}){const{t:k}=R(),_=ee(),u=c(!1),d=c(!1),e=c({id:void 0,nickname:void 0,point:0,changePoint:0,changeType:1}),x=Z({changePoint:[{required:!0,message:"\u53D8\u52A8\u79EF\u5206\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),r=c();U({open:async s=>{if(u.value=!0,C(),s){d.value=!0;try{e.value=await X(s),e.value.changeType=1,e.value.changePoint=0}finally{d.value=!1}}}});const T=w,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{d.value=!0;try{await Y({id:e.value.id,point:e.value.changePoint*e.value.changeType}),_.success(k("common.updateSuccess")),u.value=!1,T("success")}finally{d.value=!1}}},C=()=>{var s;e.value={id:void 0,nickname:void 0,levelId:void 0,reason:void 0},(s=r.value)==null||s.resetFields()},m=D(()=>e.value.point+e.value.changePoint*e.value.changeType);return(s,a)=>{const v=I,i=J,f=K,h=N,H=O,j=S,y=z,q=Q,A=B;return g(),V(q,{title:"\u4FEE\u6539\u7528\u6237\u79EF\u5206",modelValue:t(u),"onUpdate:modelValue":a[7]||(a[7]=o=>b(u)?u.value=o:null),width:"600"},{footer:n(()=>[l(y,{onClick:F,type:"primary",disabled:t(d)},{default:n(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),l(y,{onClick:a[6]||(a[6]=o=>u.value=!1)},{default:n(()=>[p("\u53D6 \u6D88")]),_:1})]),default:n(()=>[G((g(),V(j,{ref_key:"formRef",ref:r,model:t(e),rules:t(x),"label-width":"100px"},{default:n(()=>[l(i,{label:"\u7528\u6237\u7F16\u53F7",prop:"id"},{default:n(()=>[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:n(()=>[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:n(()=>[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:n(()=>[l(H,{modelValue:t(e).changeType,"onUpdate:modelValue":a[3]||(a[3]=o=>t(e).changeType=o)},{default:n(()=>[l(h,{label:1},{default:n(()=>[p("\u589E\u52A0")]),_:1}),l(h,{label:-1},{default:n(()=>[p("\u51CF\u5C11")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(i,{label:"\u53D8\u52A8\u79EF\u5206",prop:"changePoint"},{default:n(()=>[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:n(()=>[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"])),[[A,t(d)]])]),_:1},8,["modelValue"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/member/user/UserPointUpdateForm.vue"]])});export{le as __tla,P as default};
