import{q as D,z as B,h as u}from"./elementPlus.CSBdF9Zt.js";import{u as O,a as S}from"./useTableData.BPSaK1qx.js";import{O as m}from"./Columns.D73v9WtN.js";import{g as R,_ as T,e as H}from"./DataTableSlot.vue_vue_type_script_setup_true_lang.B6VgRajw.js";import{u as I}from"./useDownload.CyT3E054.js";import{d as L,r as U,Z as j,E,j as N,ai as g,o as C,M as h,aa as $,a8 as F,O as s,u as t,K,B as V,U as i}from"./vue.1RczIYhx.js";import{_ as Z}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"./useResponse.DqThFJSa.js";/* empty css                   */const A=L({__name:"DataTable",setup(G,{expose:b}){const o=V("query-parameter"),{tableOptions:d,handlePageChange:v}=O(c),f=U(),n=j({id:"online-merchandise-table",keepSource:!0,size:"small",border:!1,round:!0,stripe:!0,currentRowHighLight:!0,height:"100%",customConfig:{storage:{visible:!0}},toolbarConfig:{size:"large",slots:{tools:"toolbar_tools"}},rowConfig:{isHover:!0},columnConfig:{resizable:!0},pagerConfig:{total:d.value.total,page:d.value.page,limit:d.value.limit},loading:!1,loadingConfig:{icon:"vxe-icon-indicator roll",text:"正在拼命加载中..."},columns:"",data:""});E(()=>{n.pagerConfig.limit=20}),N(()=>{c()});async function c(_=!1){var l,p;_&&(n.pagerConfig.page=1),n.data=[],n.columns=[];const e={asin:o==null?void 0:o.asin,sku:o==null?void 0:o.sku,country_code:o==null?void 0:o.country,shop_id:o==null?void 0:o.shop,region:o==null?void 0:o.region,delivery:o==null?void 0:o.delivery,status:o==null?void 0:o.status,platform_number:o==null?void 0:o.platformId};await S(R,e,n),n&&((l=n.data)!=null&&l.length)&&await f.value.loadColumn(m),n.showHeader=!!((p=n.data)!=null&&p.length)}function x(){c()}async function k(){n.loading=!0;try{await I({apiMethod:H,queryParams:{asin:o==null?void 0:o.asin,sku:o==null?void 0:o.sku,country_code:o==null?void 0:o.country,shop_id:o==null?void 0:o.shop,region:o==null?void 0:o.region,delivery:o==null?void 0:o.delivery,status:o==null?void 0:o.status,platform_number:o==null?void 0:o.platformId},fileName:"在线商品数据.xlsx",successMessage:()=>u.success("数据导出成功！"),errorMessage:()=>u.error("数据导出失败，请重试！")})}finally{n.loading=!1}}return b({fetchList:c}),(_,e)=>{const l=g("el-icon"),p=g("el-button"),w=g("vxe-pager"),M=g("el-empty"),z=g("vxe-grid");return C(),h(z,K({ref_key:"gridRef",ref:f},t(n)),$({toolbar_tools:s(()=>[i(p,{circle:"",class:"toolbar-btn",onClick:x},{default:s(()=>[i(l,null,{default:s(()=>[i(t(D))]),_:1})]),_:1}),i(p,{circle:"",class:"toolbar-btn",onClick:k},{default:s(()=>[i(l,null,{default:s(()=>[i(t(B))]),_:1})]),_:1})]),pager:s(()=>[i(w,{currentPage:t(n).pagerConfig.page,"onUpdate:currentPage":e[0]||(e[0]=a=>t(n).pagerConfig.page=a),pageSize:t(n).pagerConfig.limit,"onUpdate:pageSize":e[1]||(e[1]=a=>t(n).pagerConfig.limit=a),total:t(n).pagerConfig.total,class:"mt-1.5",onPageChange:t(v)},null,8,["currentPage","pageSize","total","onPageChange"])]),empty:s(()=>[i(M,{description:"暂无数据"})]),_:2},[F(t(m),a=>({name:`${a.field}`,fn:s(({row:r})=>[(C(),h(T,{key:r.id,field:a.field,row:r},null,8,["field","row"]))])}))]),1040)}}}),ao=Z(A,[["__scopeId","data-v-8588cd9b"]]);export{ao as default};
