2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
import{Y as $,w as T,I as P,b as j,L as z,M as G}from"./element-plus.0a93cab1.js";import{d as E,b as M,o as y,c as D,a as n,Q as R,a0 as A,r as k,i as I,W as a,O as i,u as m,j as N,T as x,V as O,a7 as U,$ as q,U as _}from"./@vue.c3e77981.js";import{d as Q}from"./index.0f49d1f2.js";import{e as W,f as H,g as J}from"./statistics.4171392b.js";import{h as f}from"./moment.40bc58bf.js";import{B as K}from"./vue-echarts.60e3d927.js";import"./@vueuse.a48d0173.js";import"./@element-plus.12c58ce2.js";import"./lodash-es.2b5acb28.js";import"./dayjs.16ed1fda.js";import"./axios.a8078129.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.b082b0c1.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.a2abcd4b.js";import"./vue-router.43c06794.js";import"./pinia.b5130627.js";import"./css-color-function.975e80a5.js";import"./color.d986aa86.js";import"./clone.704d8332.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.ded7f805.js";import"./vue-clipboard3.987889a8.js";import"./clipboard.af74a91f.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b8b719e9.js";import"./resize-detector.4e96b72b.js";const X=["xlink:href","fill"],Z=E({__name:"index",props:{iconName:{type:String,required:!0},className:{type:String,default:""},color:{type:String,default:"#333"},white:{type:Boolean,default:!1}},setup(d){const c=d,l=M(()=>`#icon-${c.iconName}`),h=M(()=>c.className?`svg-icon ${c.className}`:"svg-icon");return(v,u)=>(y(),D("svg",{class:R(h.value),"aria-hidden":"true"},[n("use",{"xlink:href":l.value,fill:d.white?"#fff":d.color},null,8,X)],2))}});const ee=Q(Z,[["__scopeId","data-v-9b161d0d"]]),te={class:"workbench"},ae={class:"mb-6 flex justify-between items-center"},ne=n("span",{class:"text-2xl"},"\u5546\u54C1\u6982\u51B5",-1),oe={class:"flex items-center text-sm"},ue=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1),se={class:"flex flex-wrap"},re={class:"mr-2"},le={class:"text-info"},ie={class:"text-6xl"},ce={class:"text-info"},pe={class:"mb-6 flex justify-between items-center"},me=n("span",{class:"text-2xl"},"\u5546\u54C1\u6392\u884C",-1),de={class:"flex items-center text-sm"},_e=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1),fe=E({name:"product"}),Xe=E({...fe,setup(d){const c=[{text:"\u8FD1\u4E00\u5468",value:()=>{const t=new Date,e=new Date;return e.setDate(e.getDate()-7),[e,t]}},{text:"\u8FD1\u4E00\u6708",value:()=>{const t=new Date,e=new Date;return e.setMonth(e.getMonth()-1),[e,t]}},{text:"\u8FD1\u4E09\u6708",value:()=>{const t=new Date,e=new Date;return e.setMonth(e.getMonth()-3),[e,t]}}],l=A({xAxis:{type:"category",data:[0],axisLabel:{rotate:45,color:"#333"}},yAxis:[{type:"value",name:"\u6570\u91CF",position:"left",axisLabel:{formatter:"{value}"}},{type:"value",name:"\u91D1\u989D",position:"right",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}]}),h=["#5DB1FF","#4CD384","#FFC46A","#CAA5F1"],v=A([{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}]),u=k(["",""]);function C(){var t=new Date,e=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(t.getFullYear(),t.getMonth()+1,0),p=B(e),g=B(o);return{firstDay:p,lastDay:g}}function B(t){var e=t.getFullYear(),o=(t.getMonth()+1).toString().padStart(2,"0"),p=t.getDate().toString().padStart(2,"0");return`${e}/${o}/${p}`}u.value[0]=C().firstDay,u.value[1]=C().lastDay;const F=()=>{let t="";u.value[0]&&u.value[1]&&(t=f(u.value[0]).format("YYYY/MM/DD")+"-"+f(u.value[1]).format("YYYY/MM/DD")),W({date:t}).then(e=>{v.forEach(o=>{o.num=e[o.type].num,o.percent=e[o.type].percent})}),H({date:t}).then(e=>{l.xAxis.data=[],l.series=[],l.legend.data=e.series.map(o=>o.name),e.xAxis.forEach(o=>{l.xAxis.data.push(o)}),l.series=e.series.map(o=>({...o,yAxis:o.type=="line"?0:1}))})},b=k([]),L=()=>{let t="";u.value[0]&&u.value[1]&&(t=f(u.value[0]).format("YYYY/MM/DD")+"-"+f(u.value[1]).format("YYYY/MM/DD")),J({date:t}).then(e=>{b.value=e})};return I(()=>{F(),L()}),(t,e)=>{const o=$,p=T,g=ee,w=P,S=j,r=z,V=G;return y(),D("div",te,[a(w,{shadow:"never",class:"!border-none"},{default:i(()=>[n("div",ae,[ne,n("div",oe,[ue,a(o,{modelValue:m(u),"onUpdate:modelValue":e[0]||(e[0]=s=>N(u)?u.value=s:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:c},null,8,["modelValue"]),a(p,{type:"primary",class:"ml-4",onClick:F},{default:i(()=>[x("\u67E5\u8BE2")]),_:1})])]),n("div",se,[(y(!0),D(O,null,U(m(v),(s,Y)=>(y(),D("div",{class:"w-1/5 flex mb-6",key:Y},[n("div",re,[n("div",{class:"rounded-full p-2",style:q({"background-color":h[Y%4]})},[a(g,{iconName:s.icon,white:"",className:"text-6xl"},null,8,["iconName"])],4)]),n("div",null,[n("div",le,_(s.name),1),n("div",ie,_(s.num),1),n("div",ce,[x("\u73AF\u6BD4\u589E\u957F: "),n("span",{class:R(s.percent>0?"text-success":"text-danger")},_(s.percent)+"%",3)])])]))),128))]),n("div",null,[a(m(K),{style:{height:"400px"},option:m(l),autoresize:!0},null,8,["option"])])]),_:1}),a(w,{shadow:"never",class:"mt-4 !border-none"},{default:i(()=>[n("div",pe,[me,n("div",de,[_e,a(o,{modelValue:m(u),"onUpdate:modelValue":e[1]||(e[1]=s=>N(u)?u.value=s:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:c},null,8,["modelValue"]),a(p,{type:"primary",class:"ml-4",onClick:F},{default:i(()=>[x("\u67E5\u8BE2")]),_:1})])]),n("div",null,[a(V,{data:m(b)},{default:i(()=>[a(r,{label:"\u5546\u54C1\u56FE\u7247"},{default:i(({row:s})=>[a(S,{src:s.image,fit:"cover",style:{width:"50px",height:"50px"}},null,8,["src"])]),_:1}),a(r,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"250"}),a(r,{label:"\u6E38\u89C8\u91CF",prop:"visit","min-width":"120"}),a(r,{label:"\u8BBF\u5BA2\u6570",prop:"user","min-width":"120"}),a(r,{label:"\u52A0\u8D2D\u4EF6\u6570",prop:"cart","min-width":"120"}),a(r,{label:"\u4E0B\u5355\u4EF6\u6570",prop:"orders","min-width":"120"}),a(r,{label:"\u652F\u4ED8\u4EF6\u6570",prop:"pay","min-width":"120"}),a(r,{label:"\u652F\u4ED8\u91D1\u989D",prop:"price","min-width":"120"}),a(r,{label:"\u6536\u85CF\u6570",prop:"collect","min-width":"120"}),a(r,{label:"\u6BDB\u5229\u7387(%)",prop:"profit","min-width":"120"},{default:i(({row:s})=>[n("span",null,_(s.profit)+"%",1)]),_:1})]),_:1},8,["data"])])]),_:1})])}}});export{Xe as default};
|