import{e as A,r as u,a8 as M,d as N,M as V,P as o,a3 as i,a4 as t,A as f,H as l,f as h,I as E,ab as I,a9 as L}from"./vue-bf422dc1.js";import{l as O,d as U}from"./collection-1a561a8a.js";import{p as F,b as H}from"./pay_type-08065387.js";import{p as j}from"./global-0d825ba6.js";import{u as q}from"./index-c2dd6a24.js";import G from"./edit-3fa59599.js";import{M as J,B as Q,T as W,L as X,S as Y,a as Z,b as ee}from"./ui-ba7aaa7e.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const te=[{colKey:"id",title:"通道ID"},{colKey:"title",title:"名称"},{colKey:"paytype",title:"分类"},{colKey:"code",title:"接口代码"},{colKey:"show_name",title:"显示名称"},{colKey:"lowrate",title:"费率",cell:(C,{row:y})=>`${(y.lowrate*1e3).toFixed(2)}‰`},{colKey:"status",title:"状态"},{colKey:"is_available",title:"平台"},{colKey:"sort",title:"排序"},{colKey:"operate",title:"操作",fixed:"right"}],fe=A({__name:"index",setup(C){const y=u(0),x=M(),S=(e=0)=>{x.push(`/admin/channel/collection/account?id=${e}`)},n=u({defaultPageSize:20,total:0,defaultCurrent:1}),_=u([]),p=async()=>{const{data:e}=await O({page:n.value.defaultCurrent,limit:n.value.defaultPageSize,is_custom:y.value});_.value=e.list,n.value={defaultPageSize:e.limit,total:e.total,defaultCurrent:e.page},w()};p();const T=e=>{n.value.defaultCurrent=e.current,n.value.defaultPageSize=e.pageSize,p()},K=q(),P=N(()=>({offsetTop:K.isUseTabsRouter?48:0,container:`.${j}-layout`})),g=u(),k=(e=0)=>{g.value.init(e)},z=async e=>{(await U({id:e})).code===1&&(J.success("删除成功"),p())},d=u(),w=async()=>{const{data:e}=await F();e.forEach((s,c)=>{e[c].ico=H+s.ico}),d.value=e},R=e=>{if(!d.value)return"";const s=d.value.find(c=>c.value===e);return s?s.label:""};return(e,s)=>{const c=Q,r=W,v=X,$=Y,B=Z,D=ee,m=V("perms");return o(),i(D,{title:"收款通道管理",class:"basic-container",bordered:!1},{actions:t(()=>[f((o(),i(c,{theme:"primary",onClick:s[0]||(s[0]=a=>k())},{default:t(()=>[l("添加通道")]),_:1})),[[m,["adminapi/channel/collection/add"]]])]),default:t(()=>[h(B,{ref:"tableRef","row-key":"id",data:_.value,columns:E(te),hover:_.value.length>0,"header-affixed-top":P.value,"max-height":"auto","table-layout":"auto",pagination:n.value,"lazy-load":"",onPageChange:T},{paytype:t(({row:a})=>[l(I(R(a.paytype)),1)]),status:t(({row:a})=>[a.status===1?(o(),i(r,{key:0,variant:"light",theme:"success"},{default:t(()=>[l("启用")]),_:1})):(o(),i(r,{key:1,variant:"light",theme:"danger"},{default:t(()=>[l("禁用")]),_:1}))]),is_available:t(({row:a})=>[a.is_available===1?(o(),i(r,{key:0,variant:"light",theme:"success"},{default:t(()=>[l("手机")]),_:1})):a.is_available===2?(o(),i(r,{key:1,variant:"light",theme:"success"},{default:t(()=>[l("电脑")]),_:1})):(o(),i(r,{key:2,variant:"light",theme:"success"},{default:t(()=>[l("通用")]),_:1}))]),operate:t(({row:a})=>[h($,null,{default:t(()=>[f((o(),i(v,{theme:"primary",size:"small",onClick:b=>k(a.id)},{default:t(()=>[l("编辑")]),_:2},1032,["onClick"])),[[m,["adminapi/channel/collection/edit"]]]),f((o(),i(v,{theme:"primary",size:"small",onClick:b=>S(a.id)},{default:t(()=>[l("账号管理")]),_:2},1032,["onClick"])),[[m,["adminapi/channel/collectionAccount/list"]]]),a.id!=1?f((o(),i(v,{key:0,theme:"danger",size:"small",onClick:b=>z(a.id)},{default:t(()=>[l("删除")]),_:2},1032,["onClick"])),[[m,["adminapi/channel/collection/del"]]]):L("",!0)]),_:2},1024)]),_:1},8,["data","columns","hover","header-affixed-top","pagination"]),h(G,{ref_key:"editRef",ref:g,"pay-type-options":d.value,onSuccess:p},null,8,["pay-type-options"])]),_:1})}}});export{fe as default};
