index-9e44d60a.js 4.5 KB

1
  1. import{d as D,z as E,r as c,f as G,x as H,Q as I,o as i,c as S,i as e,w as r,a as t,R as J,F as M,A as L,j as p,m,B as d,V as Q,G as W,C as X,D as Y,_ as Z,q as $,H as ee,I as ae,J as le,K as re}from"./index-df709923.js";import{_ as te}from"./DictTag.vue_vue_type_script_lang-6753827b.js";import{E as se}from"./el-image-29d644a2.js";import"./el-image-viewer-90ad41b7.js";import{_ as ie}from"./ContentWrap.vue_vue_type_script_setup_true_lang-e908c5dd.js";import{a as oe,D as O}from"./dict-017bf708.js";import{d as ne}from"./formatTime-c6262bd7.js";import{b as pe,d as me}from"./index-581f6d06.js";import{_ as ue}from"./LevelForm.vue_vue_type_script_setup_true_lang-054e840b.js";import{u as ce}from"./useMessage-89e9d1aa.js";import"./color-6e929987.js";import"./el-card-91c2276d.js";import"./Dialog-2f8bd685.js";import"./_plugin-vue_export-helper-1b428a4d.js";import"./UploadImg-15376c0d.js";import"./index-54511734.js";import"./constants-e43f22dd.js";const de=D({name:"MemberLevel",__name:"index",setup(fe){const v=ce(),{t:T}=E(),f=c(!0),x=c([]),o=G({name:null,status:null}),y=c(),u=async()=>{f.value=!0;try{x.value=await pe(o)}finally{f.value=!1}},w=()=>{u()},q=()=>{y.value.resetFields(),w()},g=c(),k=(C,l)=>{g.value.open(C,l)};return H(()=>{u()}),(C,l)=>{const A=Q,b=W,F=X,R=Y,_=Z,n=$,B=ee,U=ie,s=ae,V=se,K=te,N=le,h=I("hasPermi"),P=re;return i(),S(M,null,[e(U,null,{default:r(()=>[e(B,{class:"-mb-15px",model:t(o),ref_key:"queryFormRef",ref:y,inline:!0,"label-width":"68px"},{default:r(()=>[e(b,{label:"\u7B49\u7EA7\u540D\u79F0",prop:"name"},{default:r(()=>[e(A,{modelValue:t(o).name,"onUpdate:modelValue":l[0]||(l[0]=a=>t(o).name=a),placeholder:"\u8BF7\u8F93\u5165\u7B49\u7EA7\u540D\u79F0",clearable:"",onKeyup:J(w,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),e(b,{label:"\u72B6\u6001",prop:"status"},{default:r(()=>[e(R,{modelValue:t(o).status,"onUpdate:modelValue":l[1]||(l[1]=a=>t(o).status=a),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",clearable:"",class:"!w-240px"},{default:r(()=>[(i(!0),S(M,null,L(t(oe)(t(O).COMMON_STATUS),a=>(i(),p(F,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(b,null,{default:r(()=>[e(n,{onClick:w},{default:r(()=>[e(_,{icon:"ep:search",class:"mr-5px"}),l[3]||(l[3]=m(" \u641C\u7D22"))]),_:1}),e(n,{onClick:q},{default:r(()=>[e(_,{icon:"ep:refresh",class:"mr-5px"}),l[4]||(l[4]=m(" \u91CD\u7F6E"))]),_:1}),d((i(),p(n,{type:"primary",onClick:l[2]||(l[2]=a=>k("create"))},{default:r(()=>[e(_,{icon:"ep:plus",class:"mr-5px"}),l[5]||(l[5]=m(" \u65B0\u589E "))]),_:1})),[[h,["member:level:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(U,null,{default:r(()=>[d((i(),p(N,{data:t(x),stripe:!0,"show-overflow-tooltip":!0},{default:r(()=>[e(s,{label:"\u7F16\u53F7",align:"center",prop:"id","min-width":"60"}),e(s,{label:"\u7B49\u7EA7\u56FE\u6807",align:"center",prop:"icon","min-width":"80"},{default:r(a=>[e(V,{src:a.row.icon,class:"h-30px w-30px","preview-src-list":[a.row.icon]},null,8,["src","preview-src-list"])]),_:1}),e(s,{label:"\u7B49\u7EA7\u80CC\u666F\u56FE",align:"center",prop:"backgroundUrl","min-width":"100"},{default:r(a=>[e(V,{src:a.row.backgroundUrl,class:"h-30px w-30px","preview-src-list":[a.row.backgroundUrl]},null,8,["src","preview-src-list"])]),_:1}),e(s,{label:"\u7B49\u7EA7\u540D\u79F0",align:"center",prop:"name","min-width":"100"}),e(s,{label:"\u7B49\u7EA7",align:"center",prop:"level","min-width":"60"}),e(s,{label:"\u5347\u7EA7\u7ECF\u9A8C",align:"center",prop:"experience","min-width":"80"}),e(s,{label:"\u4EAB\u53D7\u6298\u6263(%)",align:"center",prop:"discountPercent","min-width":"110"}),e(s,{label:"\u72B6\u6001",align:"center",prop:"status","min-width":"70"},{default:r(a=>[e(K,{type:t(O).COMMON_STATUS,value:a.row.status},null,8,["type","value"])]),_:1}),e(s,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",formatter:t(ne),"min-width":"170"},null,8,["formatter"]),e(s,{label:"\u64CD\u4F5C",align:"center","min-width":"110px",fixed:"right"},{default:r(a=>[d((i(),p(n,{link:"",type:"primary",onClick:j=>k("update",a.row.id)},{default:r(()=>l[6]||(l[6]=[m(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[h,["member:level:update"]]]),d((i(),p(n,{link:"",type:"danger",onClick:j=>(async z=>{try{await v.delConfirm(),await me(z),v.success(T("common.delSuccess")),await u()}catch{}})(a.row.id)},{default:r(()=>l[7]||(l[7]=[m(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[h,["member:level:delete"]]])]),_:1})]),_:1},8,["data"])),[[P,t(f)]])]),_:1}),e(ue,{ref_key:"formRef",ref:g,onSuccess:u},null,512)],64)}}});export{de as default};