2 lines
6.6 KiB
JavaScript
2 lines
6.6 KiB
JavaScript
import{m as k,aT as M,r as D,b as T,bg as N,p as g,q as C,t,v as l,x as n,u as c,i as _,a2 as b,V as P,W as G,H as j,G as B,bF as S,bh as m,ae as U,b5 as z,J as H,b6 as q,b7 as I}from"./.pnpm.1b0299fb.js";import{_ as J}from"./index.41edbd86.js";import{a as O,b as W,c as K}from"./workbench.f568dc98.js";import"./index.689cfa31.js";import"./@vueuse.72d44d91.js";import"./lodash.c3b66c05.js";import"./@vue.9d708d7c.js";const Q={class:"workbench"},X={class:"mb-6 flex justify-between items-center"},Z={class:"flex items-center text-sm"},$={class:"flex flex-wrap"},ee={class:"mr-2"},te={class:"text-info"},ne={class:"text-6xl"},ue={class:"mb-6 flex justify-between items-center"},ae={class:"flex items-center text-sm"},oe={class:"mb-6 flex justify-between items-center"},se={class:"flex items-center text-sm"},le=k({name:"product"}),fe=k({...le,setup(re){const F=[{text:"\u8FD1\u4E00\u5468",value:()=>{const u=new Date,e=new Date;return e.setDate(e.getDate()-7),[e,u]}},{text:"\u672C\u6708",value:()=>{const u=new Date,e=new Date;return e.setDate(1),u.setMonth(u.getMonth()+1),u.setDate(0),[e,u]}},{text:"\u8FD1\u4E00\u6708",value:()=>{const u=new Date,e=new Date;return e.setMonth(e.getMonth()-1),[e,u]}},{text:"\u8FD1\u4E09\u6708",value:()=>{const u=new Date,e=new Date;return e.setMonth(e.getMonth()-3),[e,u]}}],d=M({xAxis:{type:"category",data:[0],axisLabel:{rotate:45,color:"#333"}},yAxis:[{type:"value",name:"\u91D1\u989D",position:"right",axisLabel:{formatter:"{value}"}},{type:"value",name:"\u6570\u91CF",position:"left",axisLabel:{formatter:"{value}"}}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},legend:{data:["\u8BBF\u95EE\u91CF"]},itemStyle:{color:"red"},tooltip:{trigger:"axis"},series:[{name:"\u8BBF\u95EE\u91CF",data:[0],type:"line",smooth:!0}]}),A=["#5DB1FF","#4CD384","#FFC46A","#CAA5F1"],h=M([{name:"\u5546\u54C1\u6D4F\u89C8\u91CF",type:"browse",icon:"RectangleCopy21",num:0,percent:0},{name:"\u5546\u54C1\u8BBF\u5BA2\u6570",type:"user",icon:"RectangleCopy5",num:0,percent:0},{name:"\u52A0\u8D2D\u4EF6\u6570",type:"cart",icon:"RectangleCopy13",num:0,percent:0},{name:"\u4E0B\u5355\u4EF6\u6570",type:"order",icon:"RectangleCopy12",num:0,percent:0},{name:"\u652F\u4ED8\u4EF6\u6570",type:"pay",icon:"RectangleCopy15",num:0,percent:0},{name:"\u652F\u4ED8\u91D1\u989D",type:"payPrice",icon:"RectangleCopy14",num:0,percent:0},{name:"\u6210\u672C\u91D1\u989D",type:"cost",icon:"RectangleCopy24",num:0,percent:0},{name:"\u9000\u6B3E\u91D1\u989D",type:"refundPrice",icon:"RectangleCopy32",num:0,percent:0},{name:"\u9000\u6B3E\u4EF6\u6570",type:"refund",icon:"RectangleCopy19",num:0,percent:0},{name:"\u8BBF\u5BA2-\u652F\u4ED8\u8F6C\u5316\u7387",type:"payPercent",icon:"RectangleCopy4",num:0,percent:0}]),r=D([new Date,new Date]),i=D([]),p=D([]),f=()=>{let u="";r.value[0]&&r.value[1]&&(u=m(r.value[0]).format("YYYY/MM/DD")+"-"+m(r.value[1]).format("YYYY/MM/DD")),O({date:u}).then(e=>{h.forEach(a=>{a.num=e[a.type].num,a.percent=e[a.type].percent})})},y=()=>{let u="";i.value[0]&&i.value[1]&&(u=m(i.value[0]).format("YYYY/MM/DD")+"-"+m(i.value[1]).format("YYYY/MM/DD")),W({date:u}).then(e=>{d.xAxis.data=[],d.series=[],d.legend.data=e.series.map(a=>a.name),e.xAxis.forEach(a=>{d.xAxis.data.push(a)}),d.series=e.series.map(a=>({...a,yAxis:a.type=="line"?0:1}))})},w=D([]),E=()=>{let u="";p.value[0]&&p.value[1]&&(u=m(p.value[0]).format("YYYY/MM/DD")+"-"+m(p.value[1]).format("YYYY/MM/DD")),K({date:u}).then(e=>{w.value=e})};return T(()=>{f(),y(),E()}),(u,e)=>{const a=N,v=U,V=J,x=z,R=H,s=q,L=I;return g(),C("div",Q,[t(x,{shadow:"never",class:"!border-none"},{default:l(()=>[n("div",X,[e[5]||(e[5]=n("span",{class:"text-2xl"},"\u5546\u54C1\u6982\u51B5",-1)),n("div",Z,[e[4]||(e[4]=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1)),t(a,{modelValue:c(r),"onUpdate:modelValue":e[0]||(e[0]=o=>_(r)?r.value=o:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:F,onChange:f},null,8,["modelValue"]),t(v,{type:"primary",class:"ml-4",onClick:f},{default:l(()=>e[3]||(e[3]=[b("\u67E5\u8BE2")])),_:1})])]),n("div",$,[(g(!0),C(P,null,G(c(h),(o,Y)=>(g(),C("div",{class:"w-1/5 flex mb-6",key:Y},[n("div",ee,[n("div",{class:"rounded-full p-2",style:j({"background-color":A[Y%4]})},[t(V,{iconName:o.icon,white:"",className:"text-6xl"},null,8,["iconName"])],4)]),n("div",null,[n("div",te,B(o.name),1),n("div",ne,B(o.num),1)])]))),128))])]),_:1}),t(x,{shadow:"never",class:"mt-4 !border-none"},{default:l(()=>[n("div",ue,[e[8]||(e[8]=n("span",{class:"text-2xl"},"\u5546\u54C1\u8D8B\u52BF",-1)),n("div",ae,[e[7]||(e[7]=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1)),t(a,{modelValue:c(i),"onUpdate:modelValue":e[1]||(e[1]=o=>_(i)?i.value=o:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:F,onChange:y},null,8,["modelValue"]),t(v,{type:"primary",class:"ml-4",onClick:y},{default:l(()=>e[6]||(e[6]=[b("\u67E5\u8BE2")])),_:1})])]),n("div",null,[t(c(S),{style:{height:"400px"},option:c(d),autoresize:!0},null,8,["option"])])]),_:1}),t(x,{shadow:"never",class:"mt-4 !border-none"},{default:l(()=>[n("div",oe,[e[11]||(e[11]=n("span",{class:"text-2xl"},"\u5546\u54C1\u6392\u884C",-1)),n("div",se,[e[10]||(e[10]=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1)),t(a,{modelValue:c(p),"onUpdate:modelValue":e[2]||(e[2]=o=>_(p)?p.value=o:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:F,onChange:E},null,8,["modelValue"]),t(v,{type:"primary",class:"ml-4",onClick:E},{default:l(()=>e[9]||(e[9]=[b("\u67E5\u8BE2")])),_:1})])]),n("div",null,[t(L,{data:c(w)},{default:l(()=>[t(s,{label:"\u5546\u54C1\u56FE\u7247"},{default:l(({row:o})=>[t(R,{src:o.image,fit:"cover",style:{width:"50px",height:"50px"},"preview-teleported":!0},null,8,["src"])]),_:1}),t(s,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"250"}),t(s,{label:"\u6E38\u89C8\u91CF",prop:"visit","min-width":"120"}),t(s,{label:"\u8BBF\u5BA2\u6570",prop:"user","min-width":"120"}),t(s,{label:"\u52A0\u8D2D\u4EF6\u6570",prop:"cart","min-width":"120"}),t(s,{label:"\u4E0B\u5355\u4EF6\u6570",prop:"orders","min-width":"120"}),t(s,{label:"\u652F\u4ED8\u4EF6\u6570",prop:"pay","min-width":"120"}),t(s,{label:"\u652F\u4ED8\u91D1\u989D",prop:"price","min-width":"120"}),t(s,{label:"\u6536\u85CF\u6570",prop:"collect","min-width":"120"}),t(s,{label:"\u6BDB\u5229\u7387(%)",prop:"profit","min-width":"120"},{default:l(({row:o})=>[n("span",null,B(o.profit)+"%",1)]),_:1})]),_:1},8,["data"])])]),_:1})])}}});export{fe as default};
|