2 lines
7.2 KiB
JavaScript
2 lines
7.2 KiB
JavaScript
import{$ as S,w as T,L as P,b as $,M as j,N as z}from"./element-plus.1e96d4ee.js";import{d as D,b as w,o as f,c as h,a as n,O as M,Z as k,r as Y,i as G,U as t,L as c,u as m,j as A,R as x,T as U,a9 as q,a0 as I,S as d}from"./@vue.18505fe0.js";import{d as O,r as v}from"./index.163b09f9.js";import{h as _}from"./moment.40bc58bf.js";import{B as Z}from"./vue-echarts.01ad0ec2.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.8ae0c638.js";import"./axios.2b8d80bd.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.60201f64.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.b82a2ce7.js";import"./color.b905eb26.js";import"./clone.e1fb2883.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.495afef3.js";import"./vue-clipboard3.cb649e18.js";import"./clipboard.4592e390.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./resize-detector.4e96b72b.js";const H=["xlink:href","fill"],J=D({__name:"index",props:{iconName:{type:String,required:!0},className:{type:String,default:""},color:{type:String,default:"#333"},white:{type:Boolean,default:!1}},setup(r){const p=r,i=w(()=>`#icon-${p.iconName}`),y=w(()=>p.className?`svg-icon ${p.className}`:"svg-icon");return(F,a)=>(f(),h("svg",{class:M(y.value),"aria-hidden":"true"},[n("use",{"xlink:href":i.value,fill:r.white?"#fff":r.color},null,8,H)],2))}});const K=O(J,[["__scopeId","data-v-9b161d0d"]]);function Q(r){return v.get({url:"/workbench/get_basic",params:r})}function W(r){return v.get({url:"/workbench/get_trend",params:r})}function X(r){return v.get({url:"/workbench/get_product_ranking",params:r})}const ee={class:"workbench"},te={class:"mb-6 flex justify-between items-center"},ne=n("span",{class:"text-2xl"},"\u5546\u54C1\u6982\u51B5",-1),ae={class:"flex items-center text-sm"},oe=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1),ue={class:"flex flex-wrap"},se={class:"mr-2"},re={class:"text-info"},le={class:"text-6xl"},ie={class:"text-info"},ce={class:"mb-6 flex justify-between items-center"},pe=n("span",{class:"text-2xl"},"\u5546\u54C1\u6392\u540D",-1),me={class:"flex items-center text-sm"},de=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1),_e=D({name:"workbench"}),Je=D({..._e,setup(r){const p=[{text:"\u8FD1\u4E00\u5468",value:()=>{const u=new Date,e=new Date;return e.setDate(e.getDate()-7),[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]}}],i=k({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}"}}],legend:{data:["\u8BBF\u95EE\u91CF"]},itemStyle:{color:"red"},tooltip:{trigger:"axis"},series:[{name:"\u8BBF\u95EE\u91CF",data:[0],type:"line",smooth:!0}]}),y=["#5DB1FF","#4CD384","#FFC46A","#CAA5F1"],F=k([{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}]),a=Y(["",""]),g=()=>{let u="";a.value[0]&&a.value[1]&&(u=_(a.value[0]).format("YYYY/MM/DD")+"-"+_(a.value[1]).format("YYYY/MM/DD")),Q({date:u}).then(e=>{F.forEach(o=>{o.num=e[o.type].num,o.percent=e[o.type].percent})}),W({date:u}).then(e=>{i.xAxis.data=[],i.series=[],i.legend.data=e.series.map(o=>o.name),e.xAxis.forEach(o=>{i.xAxis.data.push(o)}),i.series=e.series.map(o=>({...o,yAxis:o.type=="line"?0:1}))})},E=Y([]),N=()=>{let u="";a.value[0]&&a.value[1]&&(u=_(a.value[0]).format("YYYY/MM/DD")+"-"+_(a.value[1]).format("YYYY/MM/DD")),X({date:u}).then(e=>{E.value=e})};return G(()=>{g(),N()}),(u,e)=>{const o=S,C=T,R=K,b=P,L=$,l=j,V=z;return f(),h("div",ee,[t(b,{shadow:"never",class:"!border-none"},{default:c(()=>[n("div",te,[ne,n("div",ae,[oe,t(o,{modelValue:m(a),"onUpdate:modelValue":e[0]||(e[0]=s=>A(a)?a.value=s:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:p},null,8,["modelValue"]),t(C,{type:"primary",class:"ml-4",onClick:g},{default:c(()=>[x("\u67E5\u8BE2")]),_:1})])]),n("div",ue,[(f(!0),h(U,null,q(m(F),(s,B)=>(f(),h("div",{class:"w-1/5 flex mb-6",key:B},[n("div",se,[n("div",{class:"rounded-full p-2",style:I({"background-color":y[B%4]})},[t(R,{iconName:s.icon,white:"",className:"text-6xl"},null,8,["iconName"])],4)]),n("div",null,[n("div",re,d(s.name),1),n("div",le,d(s.num),1),n("div",ie,[x("\u73AF\u6BD4\u589E\u957F: "),n("span",{class:M(s.percent>0?"text-success":"text-danger")},d(s.percent)+"%",3)])])]))),128))]),n("div",null,[t(m(Z),{style:{height:"350px"},option:m(i),autoresize:!0},null,8,["option"])])]),_:1}),t(b,{shadow:"never",class:"mt-4 !border-none"},{default:c(()=>[n("div",ce,[pe,n("div",me,[de,t(o,{modelValue:m(a),"onUpdate:modelValue":e[1]||(e[1]=s=>A(a)?a.value=s:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:p},null,8,["modelValue"]),t(C,{type:"primary",class:"ml-4",onClick:g},{default:c(()=>[x("\u67E5\u8BE2")]),_:1})])]),n("div",null,[t(V,{data:m(E)},{default:c(()=>[t(l,{label:"\u5546\u54C1\u56FE\u7247"},{default:c(({row:s})=>[t(L,{src:s.image,fit:"cover",style:{width:"50px",height:"50px"}},null,8,["src"])]),_:1}),t(l,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"250"}),t(l,{label:"\u6E38\u89C8\u91CF",prop:"visit","min-width":"120"}),t(l,{label:"\u8BBF\u5BA2\u6570",prop:"user","min-width":"120"}),t(l,{label:"\u52A0\u8D2D\u4EF6\u6570",prop:"cart","min-width":"120"}),t(l,{label:"\u4E0B\u5355\u4EF6\u6570",prop:"orders","min-width":"120"}),t(l,{label:"\u652F\u4ED8\u4EF6\u6570",prop:"pay","min-width":"120"}),t(l,{label:"\u652F\u4ED8\u91D1\u989D",prop:"price","min-width":"120"}),t(l,{label:"\u6536\u85CF\u6570",prop:"collect","min-width":"120"}),t(l,{label:"\u6BDB\u5229\u7387(%)",prop:"profit","min-width":"120"},{default:c(({row:s})=>[n("span",null,d(s.profit)+"%",1)]),_:1})]),_:1},8,["data"])])]),_:1})])}}});export{Je as default};
|