import{l as z,d as D}from"./role-a0a31a82.js";import{p as T}from"./global-0d825ba6.js";import{u as K}from"./index-c2dd6a24.js";import{_ as M}from"./edit.vue_vue_type_script_setup_true_lang-c3164063.js";import{_ as N}from"./rate.vue_vue_type_script_setup_true_lang-fccf75dd.js";import{M as V,B as A,L as I,S as L,a as H,b as U}from"./ui-ba7aaa7e.js";import{e as j,r as i,d as q,M as E,P as r,a3 as l,a4 as a,a7 as k,A as d,H as u,f as m,I as F,a9 as G}from"./vue-bf422dc1.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const J=[{colKey:"id",title:"ID"},{colKey:"name",title:"名称"},{colKey:"remark",title:"备注"},{colKey:"operate",title:"操作"}],O={class:"category-header c-flex"},Q={class:"l"},ce=j({__name:"index",setup(W){const o=i({defaultPageSize:20,total:0,defaultCurrent:1}),f=i([]),_=i(),n=async(t={})=>{_.value=t;const{data:e}=await z({page:o.value.defaultCurrent,limit:o.value.defaultPageSize,...t});f.value=e.list,o.value.total=e.total};n();const C=t=>{o.value.defaultCurrent=t.current,o.value.defaultPageSize=t.pageSize,n(_)},x=K(),R=q(()=>({offsetTop:x.isUseTabsRouter?48:0,container:`.${T}-layout`})),v=i(),h=(t=0)=>{var e;(e=v.value)==null||e.init(t)},g=i(),b=(t=0)=>{var e;(e=g.value)==null||e.init(t)},S=async t=>{const{data:e}=await D({id:t});e.code===1&&(V.success("删除成功"),n())};return(t,e)=>{const $=A,p=I,B=L,P=H,w=U,c=E("perms");return r(),l(w,{title:"商户角色管理",class:"basic-container",bordered:!1},{default:a(()=>[k("div",O,[k("div",Q,[d((r(),l($,{theme:"primary",onClick:e[0]||(e[0]=s=>h())},{default:a(()=>[u("添加")]),_:1})),[[c,["adminapi/merchant/role/add"]]])])]),m(P,{ref:"tableRef","row-key":"id",data:f.value,columns:F(J),hover:f.value.length>0,"header-affixed-top":R.value,pagination:o.value,"lazy-load":"","table-layout":"auto","max-height":"100%",onPageChange:C},{operate:a(({row:s})=>[m(B,null,{default:a(()=>[d((r(),l(p,{theme:"primary",hover:"color",onClick:y=>h(s.id)},{default:a(()=>[u("编辑")]),_:2},1032,["onClick"])),[[c,["adminapi/merchant/role/edit"]]]),d((r(),l(p,{theme:"primary",hover:"color",onClick:y=>b(s.id)},{default:a(()=>[u("角色费率")]),_:2},1032,["onClick"])),[[c,["adminMerchantRoleRule"]]]),s.id!=1?d((r(),l(p,{key:0,theme:"danger",hover:"color",onClick:y=>S(s.id)},{default:a(()=>[u("删除")]),_:2},1032,["onClick"])),[[c,["adminapi/merchant/role/del"]]]):G("",!0)]),_:2},1024)]),_:1},8,["data","columns","hover","header-affixed-top","pagination"]),m(M,{ref_key:"editRef",ref:v,onSuccess:n},null,512),m(N,{ref_key:"rateRef",ref:g,onSuccess:n},null,512)]),_:1})}}});export{ce as default};
