1 |
- import{d as R,B as z,r as c,g as O,o as _,k as b,w as l,i as e,a,l as V,D as T,c as j,F as I,C as J,t as W,R as Y,Y as G,I as Z,E as H,aW as K,p as Q,aj as X,ak as $,J as ee,s as le,M as ae,_ as te,__tla as se}from"./index-66208f93.js";import{_ as re,__tla as ue}from"./Dialog-948825d3.js";import{_ as oe,__tla as de}from"./UploadImg-866c0e44.js";import{a as ne,D as ie,__tla as ce}from"./dict-6d253095.js";import{g as me,c as _e,u as pe,__tla as fe}from"./index-73860a72.js";import{C as U}from"./constants-d55a3460.js";import{u as ve,__tla as be}from"./useMessage-798a77de.js";import{__tla as Ve}from"./index-4eee12bb.js";import{__tla as ge}from"./el-image-viewer-3d1b9860.js";let k,ye=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return ge}catch{}})()]).then(async()=>{k=te(R({name:"MemberLevelForm",__name:"LevelForm",emits:["success"],setup(he,{expose:P,emit:F}){const{t:p}=z(),g=ve(),d=c(!1),y=c(""),n=c(!1),h=c(""),r=c({id:void 0,name:void 0,experience:void 0,level:void 0,discountPercent:void 0,icon:void 0,backgroundUrl:void 0,status:U.ENABLE}),L=O({name:[{required:!0,message:"\u7B49\u7EA7\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],experience:[{required:!0,message:"\u5347\u7EA7\u7ECF\u9A8C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],level:[{required:!0,message:"\u7B49\u7EA7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],discountPercent:[{required:!0,message:"\u4EAB\u53D7\u6298\u6263\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),m=c();P({open:async(u,t)=>{if(d.value=!0,y.value=p("action."+u),h.value=u,E(),t){n.value=!0;try{r.value=await me(t)}finally{n.value=!1}}}});const q=F,C=async()=>{if(m&&await m.value.validate()){n.value=!0;try{const u=r.value;h.value==="create"?(await _e(u),g.success(p("common.createSuccess"))):(await pe(u),g.success(p("common.updateSuccess"))),d.value=!1,q("success")}finally{n.value=!1}}},E=()=>{var u;r.value={id:void 0,name:void 0,experience:void 0,level:void 0,discountPercent:void 0,icon:void 0,backgroundUrl:void 0,status:U.ENABLE},(u=m.value)==null||u.resetFields()};return(u,t)=>{const M=G,o=Z,i=H,f=K,v=Q,x=oe,S=X,A=$,B=ee,w=le,D=re,N=ae;return _(),b(D,{title:a(y),modelValue:a(d),"onUpdate:modelValue":t[8]||(t[8]=s=>Y(d)?d.value=s:null),width:"800"},{footer:l(()=>[e(w,{onClick:C,type:"primary",disabled:a(n)},{default:l(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),e(w,{onClick:t[7]||(t[7]=s=>d.value=!1)},{default:l(()=>[V("\u53D6 \u6D88")]),_:1})]),default:l(()=>[T((_(),b(B,{ref_key:"formRef",ref:m,model:a(r),rules:a(L),"label-width":"110px"},{default:l(()=>[e(v,null,{default:l(()=>[e(i,{span:12},{default:l(()=>[e(o,{label:"\u7B49\u7EA7\u540D\u79F0",prop:"name"},{default:l(()=>[e(M,{modelValue:a(r).name,"onUpdate:modelValue":t[0]||(t[0]=s=>a(r).name=s),placeholder:"\u8BF7\u8F93\u5165\u7B49\u7EA7\u540D\u79F0",class:"!w-240px"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:12},{default:l(()=>[e(o,{label:"\u7B49\u7EA7",prop:"level"},{default:l(()=>[e(f,{modelValue:a(r).level,"onUpdate:modelValue":t[1]||(t[1]=s=>a(r).level=s),min:0,precision:0,placeholder:"\u8BF7\u8F93\u5165\u7B49\u7EA7",class:"!w-240px"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,null,{default:l(()=>[e(i,{span:12},{default:l(()=>[e(o,{label:"\u5347\u7EA7\u7ECF\u9A8C",prop:"experience"},{default:l(()=>[e(f,{modelValue:a(r).experience,"onUpdate:modelValue":t[2]||(t[2]=s=>a(r).experience=s),min:0,precision:0,placeholder:"\u8BF7\u8F93\u5165\u5347\u7EA7\u7ECF\u9A8C",class:"!w-240px"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:12},{default:l(()=>[e(o,{label:"\u4EAB\u53D7\u6298\u6263(%)",prop:"discountPercent"},{default:l(()=>[e(f,{modelValue:a(r).discountPercent,"onUpdate:modelValue":t[3]||(t[3]=s=>a(r).discountPercent=s),min:0,max:100,precision:0,placeholder:"\u8BF7\u8F93\u5165\u4EAB\u53D7\u6298\u6263",class:"!w-240px"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,null,{default:l(()=>[e(i,{span:12},{default:l(()=>[e(o,{label:"\u7B49\u7EA7\u56FE\u6807"},{default:l(()=>[e(x,{modelValue:a(r).icon,"onUpdate:modelValue":t[4]||(t[4]=s=>a(r).icon=s)},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:12},{default:l(()=>[e(o,{label:"\u80CC\u666F\u56FE"},{default:l(()=>[e(x,{modelValue:a(r).backgroundUrl,"onUpdate:modelValue":t[5]||(t[5]=s=>a(r).backgroundUrl=s)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(o,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[e(A,{modelValue:a(r).status,"onUpdate:modelValue":t[6]||(t[6]=s=>a(r).status=s)},{default:l(()=>[(_(!0),j(I,null,J(a(ne)(a(ie).COMMON_STATUS),s=>(_(),b(S,{key:s.value,label:s.value},{default:l(()=>[V(W(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[N,a(n)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/member/level/LevelForm.vue"]])});export{ye as __tla,k as default};
|