import{v as O}from"./elementPlus.4833989a.js";import{e as T}from"./api.1f097846.js";import{s as y}from"./columns.24ea4a2e.js";import{e as h}from"./emitter.bff31cdd.js";import{d as L,B as A,r as u,Z as N,w as q,j as R,ai as m,aq as V,P as j,o as i,c as l,U as a,aa as z,a8 as F,O as n,a as s,u as I,T as c,S as k,F as U,ac as E,ad as K}from"./vue.adf17aba.js";import{_ as M}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.ad3efb29.js";import"./echarts.72dc8373.js";const Z={class:"outer-container"},$={key:0,class:"list-content"},G={class:"image-item"},H=["src"],J={key:1},Q={class:"image-slot"},W={class:"item-title"},X={class:"item-font"},Y={class:"item-font"},w={class:"black-color"},ee={class:"item-font display-line"},te={class:"black-color"},se=L({__name:"SalesOverview",setup(ae){const x=A("profile"),p=A("dateRange"),r=u(""),f=u(""),S=u("");h.on("useSelectItem-clickParentAsinBtn",e=>{r.value=e.selectedParentAsin,o()}),h.on("useSelectItem-clickAsinBtn",e=>{r.value=e.selectedParentAsin,f.value=e.selectedAsin,o()}),h.on("useSelectItem-clickSkuItem",e=>{r.value=e.selectedParentAsin,f.value=e.selectedAsin,S.value=e.selectedSku,o()});const v=u(!1),g=N({height:"auto",border:!1,round:!0,columnConfig:{resizable:!0},toolbarConfig:{custom:!0,slots:{buttons:"toolbar_buttons"}},columns:[],data:[]});async function o(){v.value=!0;const e={profileId:x.value.profile_id,startDate:p.value[0],endDate:p.value[1],parentAsin:r.value,childAsin:f.value,sku:S.value};try{const d=await T(e);g.columns=y,g.data=d.data}catch(d){console.log("error:",d)}finally{v.value=!1}}return q(p,()=>{o()}),R(()=>{o()}),(e,d)=>{const D=m("el-icon"),P=m("el-image"),b=m("el-tooltip"),B=m("vxe-grid"),C=V("loading");return j((i(),l("div",Z,[a(B,E(K(g)),z({toolbar_buttons:n(()=>[]),_:2},[F(I(y),_=>({name:`${_.field}_default`,fn:n(({row:t})=>[s("div",null,[_.field=="sku"?(i(),l("div",$,[s("div",G,[t.Image?(i(),l("img",{key:0,src:t.Image},null,8,H)):(i(),l("div",J,[a(P,null,{error:n(()=>[s("div",Q,[a(D,null,{default:n(()=>[a(I(O))]),_:1})])]),_:1})]))]),s("div",null,[a(b,{effect:"dark",content:t.Title,placement:"top-start"},{default:n(()=>[s("span",W,c(t.Title?t.Title:"--"),1)]),_:2},1032,["content"]),s("div",null,[s("span",X,c(t.quantity?"有库存":"缺货"),1)]),s("span",Y,[k(" ASIN: "),s("span",w,c(t.Asin),1)]),a(b,{effect:"dark",content:t.sku,placement:"top-start"},{default:n(()=>[s("span",ee,[k(" SKU: "),s("span",te,c(t.sku),1)])]),_:2},1032,["content"])])])):(i(),l(U,{key:1},[k(c(t[_.field]?t[_.field]:"-"),1)],64))])])}))]),1040)])),[[C,v.value]])}}});const ue=M(se,[["__scopeId","data-v-0af2123b"]]);export{ue as default};
