1 |
- import{d as H,h as z,r as c,e as B,o as _,x as b,w as l,f as e,a,y as V,z as O,c as T,F as G,v as K,t as X,l as j,R as I,C as W,E as J,bw as Q,i as Y,ad as Z,ae as $,H as ee,G as le,K as ae,_ as te,__tla as se}from"./index-8dc1e40a.js";import{_ as ue,__tla as re}from"./Dialog-41802231.js";import{_ as oe,__tla as de}from"./UploadImg-c2c75279.js";import{a as ne,D as ie,__tla as ce}from"./dict-f13a3c8f.js";import{g as me,c as _e,u as pe,__tla as fe}from"./index-facc3340.js";import{C as U}from"./constants-a1da293a.js";import{u as ve,__tla as be}from"./useMessage-7a27dd80.js";import{__tla as Ve}from"./index-519182c1.js";import{__tla as ge}from"./el-image-viewer-3b8905e6.js";let k,ye=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return re}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(H({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(""),u=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=B({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(r,t)=>{if(d.value=!0,y.value=p("action."+r),h.value=r,E(),t){n.value=!0;try{u.value=await me(t)}finally{n.value=!1}}}});const q=F,C=async()=>{if(m&&await m.value.validate()){n.value=!0;try{const r=u.value;h.value==="create"?(await _e(r),g.success(p("common.createSuccess"))):(await pe(r),g.success(p("common.updateSuccess"))),d.value=!1,q("success")}finally{n.value=!1}}},E=()=>{var r;u.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},(r=m.value)==null||r.resetFields()};return(r,t)=>{const S=I,o=W,i=J,f=Q,v=Y,x=oe,A=Z,M=$,N=ee,w=le,R=ue,D=ae;return _(),b(R,{title:a(y),modelValue:a(d),"onUpdate:modelValue":t[8]||(t[8]=s=>j(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(()=>[O((_(),b(N,{ref_key:"formRef",ref:m,model:a(u),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(S,{modelValue:a(u).name,"onUpdate:modelValue":t[0]||(t[0]=s=>a(u).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(u).level,"onUpdate:modelValue":t[1]||(t[1]=s=>a(u).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(u).experience,"onUpdate:modelValue":t[2]||(t[2]=s=>a(u).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(u).discountPercent,"onUpdate:modelValue":t[3]||(t[3]=s=>a(u).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(u).icon,"onUpdate:modelValue":t[4]||(t[4]=s=>a(u).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(u).backgroundUrl,"onUpdate:modelValue":t[5]||(t[5]=s=>a(u).backgroundUrl=s)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(o,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[e(M,{modelValue:a(u).status,"onUpdate:modelValue":t[6]||(t[6]=s=>a(u).status=s)},{default:l(()=>[(_(!0),T(G,null,K(a(ne)(a(ie).COMMON_STATUS),s=>(_(),b(A,{key:s.value,label:s.value},{default:l(()=>[V(X(s.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[D,a(n)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/member/level/LevelForm.vue"]])});export{ye as __tla,k as default};
|