import{d as t}from"./libs-51817cd7.js";import{g as C}from"./charts-5f1fa1ee.js";import{p as x}from"./global-0d825ba6.js";import{u as Y,n as _}from"./index-8db2df2c.js";import{L as M}from"./date-20546ee0.js";import{k,v as K,w as S,a as T,b as V}from"./ui-ba7aaa7e.js";import{e as B,r,o as L,d as A,P as N,a3 as R,a4 as e,a7 as i,f as o,I as l,ab as f}from"./vue-bf422dc1.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const U=[{title:"支付方式",align:"left",width:"20%",colKey:"title"},{title:"	提交订单数",width:"20%",colKey:"count"},{title:"已付订单数",colKey:"paid",width:"20%"},{title:"未付订单数",colKey:"unpaid",width:"20%"},{title:"订单总金额",colKey:"sum_money",width:"20%"},{title:"订单实收金额",colKey:"sum_actual_money",width:"20%"}],P={class:"category-header c-flex"},j={name:"ChartChartlist"},X=B({...j,setup(I){const y=Y(),h=r({"60天前-120天前":[t().subtract(119,"day").toDate(),t().subtract(59,"day").toDate()],"30天前-60天前":[t().subtract(59,"day").toDate(),t().subtract(29,"day").toDate()],"1天前-30天前":[t().subtract(29,"day").toDate(),t().subtract(1,"day").toDate()],"今天-300天前":[t().subtract(299,"day").toDate(),t().toDate()]}),s=r({range:[t().subtract(120,"day").format("YYYY-MM-DD"),t().format("YYYY-MM-DD")],action:""}),d=r([]),c=r(!1),m=async()=>{c.value=!0;const p={start_time:s.value.range[0],end_time:s.value.range[1],action:s.value.action};try{const{data:a}=await C(p);d.value=a.list}catch(a){console.log(a)}finally{c.value=!1}};L(()=>{m()});const g=A(()=>({offsetTop:y.isUseTabsRouter?48:0,container:`.${x}-layout`}));return(p,a)=>{const v=k,u=K,D=S,b=T,w=V;return N(),R(w,{title:"渠道分析",class:"basic-container",bordered:!1},{default:e(()=>[i("div",P,[o(D,null,{default:e(()=>[o(u,{span:8},{default:e(()=>[o(u,{flex:1,span:3},{default:e(()=>[o(v,{modelValue:s.value.range,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value.range=n),theme:"primary",mode:"date","default-value":l(M),separator:"至",presets:h.value,onChange:m},null,8,["modelValue","default-value","presets"])]),_:1})]),_:1}),o(u,{span:4})]),_:1})]),o(b,{data:d.value,columns:l(U),stripe:!0,"row-key":"title",hover:!0,loading:c.value,"header-affixed-top":g.value},{sum_money:e(({row:n})=>[i("span",null,f(l(_)(n.sum_money)),1)]),sum_actual_money:e(({row:n})=>[i("span",null,f(l(_)(n.sum_actual_money)),1)]),_:1},8,["data","columns","loading","header-affixed-top"])]),_:1})}}});export{X as default};
