import{q as E}from"./elementPlus.CSBdF9Zt.js";import{u as M,a as T}from"./useTableData.BPSaK1qx.js";import{M as x}from"./Columns.D73v9WtN.js";import{_ as U}from"./DataTableSlot.vue_vue_type_script_setup_true_lang.DHMvDv9u.js";import{g as O}from"./api.CLbmRPvq.js";import H from"./storeAuthorization.dlc6pPEi.js";import L from"./EditDrawer.CVxPrkAD.js";import{d as N,r as f,Z as j,E as A,j as F,ai as p,o as _,c as I,U as l,aa as $,a8 as K,O as r,u as o,K as P,M as k,D as w,R as Z,F as G,B as J,S as Q}from"./vue.1RczIYhx.js";import{_ as W}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./countryInfo.Df1X6FZ-.js";import"./useTagColor.B-JXlmrE.js";import"./index.vue_vue_type_script_setup_true_lang.Q_8XCONs.js";import"./hasPermission.BaNF3kc2.js";import"./index.K_MFulpu.js";import"./index.DzdxavGI.js";import"./useResponse.DqThFJSa.js";const X=N({__name:"DataTable",setup(Y,{expose:V}){const t=J("query-parameter"),{tableOptions:c,handlePageChange:S}=M(u),C=f(),e=j({id:"market-store-table",keepSource:!0,size:"small",border:!1,round:!0,stripe:!0,currentRowHighLight:!0,height:"100%",customConfig:{storage:{visible:!0}},toolbarConfig:{size:"large",slots:{buttons:"toolbar_buttons",tools:"toolbar_tools"}},rowConfig:{isHover:!0},columnConfig:{},pagerConfig:{total:c.value.total,page:c.value.page,limit:c.value.limit},loading:!1,loadingConfig:{icon:"vxe-icon-indicator roll",text:"正在拼命加载中..."},columns:"",data:""});A(()=>{e.pagerConfig.limit=20}),F(()=>{u()});async function u(m=!1){var s,d;m&&(e.pagerConfig.page=1),e.data=[],e.columns=[];const a={country_code:t==null?void 0:t.country,region:t==null?void 0:t.region,shop:t==null?void 0:t.shop,platform_number:t==null?void 0:t.platformId};await T(O,a,e),e&&((s=e.data)!=null&&s.length)&&await C.value.loadColumn(x),e.showHeader=!!((d=e.data)!=null&&d.length)}function b(){u()}V({fetchList:u});const g=f(!1);function D(){g.value=!0}const i=f(!1),v=f({});function R(m){i.value=!0,v.value=m}return(m,a)=>{const s=p("el-button"),d=p("el-icon"),z=p("vxe-pager"),y=p("el-empty"),B=p("vxe-grid");return _(),I(G,null,[l(B,P({ref_key:"gridRef",ref:C},o(e)),$({toolbar_buttons:r(()=>[l(s,{type:"primary",onClick:D},{default:r(()=>a[4]||(a[4]=[Q("新增店铺授权")])),_:1})]),toolbar_tools:r(()=>[l(s,{circle:"",class:"toolbar-btn",onClick:b},{default:r(()=>[l(d,null,{default:r(()=>[l(o(E))]),_:1})]),_:1})]),pager:r(()=>[l(z,{currentPage:o(e).pagerConfig.page,"onUpdate:currentPage":a[0]||(a[0]=n=>o(e).pagerConfig.page=n),pageSize:o(e).pagerConfig.limit,"onUpdate:pageSize":a[1]||(a[1]=n=>o(e).pagerConfig.limit=n),total:o(e).pagerConfig.total,class:"mt-1.5",onPageChange:o(S)},null,8,["currentPage","pageSize","total","onPageChange"])]),empty:r(()=>[l(y,{description:"暂无数据"})]),_:2},[K(o(x),n=>({name:`${n.field}`,fn:r(({row:h})=>[(_(),k(U,{key:h.id,field:n.field,row:h,onEditRow:R},null,8,["field","row"]))])}))]),1040),o(i)?(_(),k(L,{key:0,modelValue:o(i),"onUpdate:modelValue":a[2]||(a[2]=n=>w(i)?i.value=n:null),"row-data":o(v),onRefresh:b},null,8,["modelValue","row-data"])):Z("",!0),l(H,{modelValue:o(g),"onUpdate:modelValue":a[3]||(a[3]=n=>w(g)?g.value=n:null)},null,8,["modelValue"])],64)}}}),ce=W(X,[["__scopeId","data-v-c14cac84"]]);export{ce as default};
