1 |
- import{d as R,P as z,r as c,x as O,o as _,C as V,A as l,f as e,a,D as b,k as T,c as H,F as J,R as K,E as Q,a2 as W,a9 as j,V as I,H as Z,bQ as G,K as X,at as Y,au as $,W as ee,J as le,Z as ae,_ as te,__tla as re}from"./index-286756b9.js";import{_ as se,__tla as ue}from"./Dialog-4c2de357.js";import{_ as oe,__tla as de}from"./UploadImg-d2713eac.js";import{a as ne,D as ie,__tla as ce}from"./dict-82dca549.js";import{g as me,c as _e,u as pe,__tla as fe}from"./index-d885c280.js";import{C as w}from"./constants-637baed6.js";import{u as ve,__tla as Ve}from"./useMessage-084b1e70.js";import{__tla as be}from"./index-5a40c383.js";import{__tla as ge}from"./el-image-viewer-e0e5d3be.js";let k,ye=Promise.all([(()=>{try{return re}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return ge}catch{}})()]).then(async()=>{k=te(R({name:"MemberLevelForm",__name:"LevelForm",emits:["success"],setup(xe,{expose:P,emit:F}){const{t:p}=z(),g=ve(),d=c(!1),y=c(""),n=c(!1),x=c(""),s=c({id:void 0,name:void 0,experience:void 0,level:void 0,discountPercent:void 0,icon:void 0,backgroundUrl:void 0,status:w.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),x.value=u,C(),t){n.value=!0;try{s.value=await me(t)}finally{n.value=!1}}}});const q=F,A=async()=>{if(m&&await m.value.validate()){n.value=!0;try{const u=s.value;x.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}}},C=()=>{var u;s.value={id:void 0,name:void 0,experience:void 0,level:void 0,discountPercent:void 0,icon:void 0,backgroundUrl:void 0,status:w.ENABLE},(u=m.value)==null||u.resetFields()};return(u,t)=>{const E=j,o=I,i=Z,f=G,v=X,h=oe,S=Y,D=$,M=ee,U=le,N=se,B=ae;return _(),V(N,{title:a(y),modelValue:a(d),"onUpdate:modelValue":t[8]||(t[8]=r=>W(d)?d.value=r:null),width:"800"},{footer:l(()=>[e(U,{onClick:A,type:"primary",disabled:a(n)},{default:l(()=>[b("\u786E \u5B9A")]),_:1},8,["disabled"]),e(U,{onClick:t[7]||(t[7]=r=>d.value=!1)},{default:l(()=>[b("\u53D6 \u6D88")]),_:1})]),default:l(()=>[T((_(),V(M,{ref_key:"formRef",ref:m,model:a(s),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(E,{modelValue:a(s).name,"onUpdate:modelValue":t[0]||(t[0]=r=>a(s).name=r),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(s).level,"onUpdate:modelValue":t[1]||(t[1]=r=>a(s).level=r),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(s).experience,"onUpdate:modelValue":t[2]||(t[2]=r=>a(s).experience=r),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(s).discountPercent,"onUpdate:modelValue":t[3]||(t[3]=r=>a(s).discountPercent=r),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(h,{modelValue:a(s).icon,"onUpdate:modelValue":t[4]||(t[4]=r=>a(s).icon=r)},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:12},{default:l(()=>[e(o,{label:"\u80CC\u666F\u56FE"},{default:l(()=>[e(h,{modelValue:a(s).backgroundUrl,"onUpdate:modelValue":t[5]||(t[5]=r=>a(s).backgroundUrl=r)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(o,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[e(D,{modelValue:a(s).status,"onUpdate:modelValue":t[6]||(t[6]=r=>a(s).status=r)},{default:l(()=>[(_(!0),H(J,null,K(a(ne)(a(ie).COMMON_STATUS),r=>(_(),V(S,{key:r.value,label:r.value},{default:l(()=>[b(Q(r.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[B,a(n)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/member/level/LevelForm.vue"]])});export{ye as __tla,k as default};
|