import{r as C,u as S}from"./index-c2dd6a24.js";import{p as b}from"./global-0d825ba6.js";import{f as u}from"./date-20546ee0.js";import{_ as k}from"./detail.vue_vue_type_script_setup_true_lang-352f461c.js";import{T as f,L as K,S as T,a as P,b as R}from"./ui-ba7aaa7e.js";import{e as w,r as i,d as B,P as $,a3 as D,a4 as r,f as o,H as L}from"./vue-bf422dc1.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";function N(s){return C.post({url:"/adminapi/merchant/shop/list",params:s})}const O=w({__name:"index",setup(s){const p=[{colKey:"id",title:"ID"},{colKey:"username",title:"用户名"},{colKey:"shop_name",title:"商铺名"},{colKey:"shop_verify",title:"审核状态",cell:(e,{row:t})=>e(f,{variant:"light",theme:t.shop_verify===1?"primary":"danger"},()=>{switch(t.shop_verify){case 0:return"已拒绝";case 1:return"已审核";case-1:return"审核中";default:return"未知"}})},{colKey:"shop_freeze",title:"冻结状态",cell:(e,{row:t})=>e(f,{variant:"light",theme:t.shop_freeze===1?"danger":"primary"},()=>t.shop_freeze===1?"冻结":"正常")},{colKey:"create_at",title:"添加时间",cell:(e,{row:t})=>u(t.create_at)},{colKey:"merchant_end_time",title:"到期时间",cell:(e,{row:t})=>u(t.merchant_end_time)},{colKey:"operate",title:"操作",fixed:"right"}],a=i({defaultPageSize:20,total:0,defaultCurrent:1}),l=i([]),n=async()=>{const{data:e}=await N({page:a.value.defaultCurrent,limit:a.value.defaultPageSize});l.value=e.list,a.value={defaultPageSize:e.limit,total:e.total,defaultCurrent:e.page}};n();const m=e=>{a.value.defaultCurrent=e.current,a.value.defaultPageSize=e.pageSize,n()},d=S(),_=B(()=>({offsetTop:d.isUseTabsRouter?48:0,container:`.${b}-layout`})),c=i(),h=(e=null)=>{c.value.init(e)};return(e,t)=>{const g=K,y=T,v=P,x=R;return $(),D(x,{title:"商铺管理",class:"basic-container",bordered:!1},{default:r(()=>[o(v,{ref:"tableRef","row-key":"id",data:l.value,columns:p,hover:l.value.length>0,"header-affixed-top":_.value,"max-height":"auto","table-layout":"auto",pagination:a.value,"lazy-load":"",onPageChange:m},{operate:r(({row:z})=>[o(y,null,{default:r(()=>[o(g,{theme:"primary",size:"small",onClick:V=>h(z)},{default:r(()=>[L("详情")]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["data","hover","header-affixed-top","pagination"]),o(k,{ref_key:"detailRef",ref:c,onSuccess:n},null,512)]),_:1})}}});export{O as default};
