import{v as L}from"./elementPlus.c5b0e04f.js";import{e as N}from"./api.fdd93efb.js";import{s as A}from"./columns.24ea4a2e.js";import{e as h}from"./emitter.ca07dcc1.js";import{d as O,q as S,r as u,Q as T,w as q,j as R,a9 as m,af as V,H as j,o as i,c as l,M as a,a2 as z,a0 as F,G as n,a as s,u as I,L as c,K as k,F as K,a3 as M,a4 as E}from"./vue.65d9dadc.js";import{_ as G}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.373e4c1e.js";import"./echarts.72dc8373.js";const H={class:"outer-container"},Q={key:0,class:"list-content"},U={class:"image-item"},$=["src"],J={key:1},W={class:"image-slot"},X={class:"item-title"},Y={class:"item-font"},Z={class:"item-font"},w={class:"black-color"},ee={class:"item-font display-line"},te={class:"black-color"},se=O({__name:"SalesOverview",setup(ae){const x=S("profile"),p=S("dateRange"),r=u(""),f=u(""),b=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,b.value=e.selectedSku,o()});const v=u(!1),g=T({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:b.value};try{const d=await N(e);g.columns=A,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"),C=m("el-image"),y=m("el-tooltip"),P=m("vxe-grid"),B=V("loading");return j((i(),l("div",H,[a(P,M(E(g)),z({toolbar_buttons:n(()=>[]),_:2},[F(I(A),_=>({name:`${_.field}_default`,fn:n(({row:t})=>[s("div",null,[_.field=="sku"?(i(),l("div",Q,[s("div",U,[t.Image?(i(),l("img",{key:0,src:t.Image},null,8,$)):(i(),l("div",J,[a(C,null,{error:n(()=>[s("div",W,[a(D,null,{default:n(()=>[a(I(L))]),_:1})])]),_:1})]))]),s("div",null,[a(y,{effect:"dark",content:t.Title,placement:"top-start"},{default:n(()=>[s("span",X,c(t.Title?t.Title:"--"),1)]),_:2},1032,["content"]),s("div",null,[s("span",Y,c(t.quantity?"有库存":"缺货"),1)]),s("span",Z,[k(" ASIN: "),s("span",w,c(t.Asin),1)]),a(y,{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(K,{key:1},[k(c(t[_.field]?t[_.field]:"-"),1)],64))])])}))]),1040)])),[[B,v.value]])}}});const ue=G(se,[["__scopeId","data-v-0af2123b"]]);export{ue as default};
