2 lines
4.8 KiB
JavaScript
2 lines
4.8 KiB
JavaScript
import{m as A,aT as y,r as f,b as T,bg as U,p as c,q as d,t as l,v as _,x as n,u as o,V as w,W as E,y as z,i as G,a2 as j,H as q,G as b,bF as H,bh as B,b3 as O,b4 as W,ae as I,b5 as J}from"./.pnpm.1b0299fb.js";import{_ as K}from"./index.41edbd86.js";import{e as Q,f as X}from"./workbench.f568dc98.js";import{a as Z}from"./system_store.e6c50bcf.js";import"./index.689cfa31.js";import"./@vueuse.72d44d91.js";import"./lodash.c3b66c05.js";import"./@vue.9d708d7c.js";const $={class:"workbench"},ee={class:"mb-6 flex justify-between items-center"},te={class:"flex items-center text-sm"},ne={class:"flex items-center mr-4"},ae={class:"flex flex-wrap"},se={class:"mr-2"},oe={class:"text-info"},ue={class:"text-6xl"},le=A({name:"statistics_user"}),De=A({...le,setup(re){const i=y({store_id:"",date:""}),k=[{text:"\u8FD1\u4E00\u5468",value:()=>{const t=new Date,e=new Date;return e.setDate(e.getDate()-7),[e,t]}},{text:"\u672C\u6708",value:()=>{const t=new Date,e=new Date;return e.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[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]}}],r=y({xAxis:{type:"category",data:[0],axisLabel:{rotate:45,color:"#333"}},yAxis:{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}]}),M=["#5DB1FF","#4CD384","#FFC46A","#CAA5F1","#FFC46A","#4CD384","#5DB1FF","#CAA5F1"],D=y([{name:"\u4F59\u989D",type:"now_money",icon:"RectangleCopy",num:0,percent:0},{name:"\u91C7\u8D2D\u6B3E",type:"purchase_funds",icon:"RectangleCopy49",num:0,percent:0},{name:"\u65B0\u589E\u7528\u6237\u6570",type:"newUser",icon:"RectangleCopy53",num:0,percent:0},{name:"\u6210\u4EA4\u7528\u6237\u6570",type:"payPeople",icon:"RectangleCopy5",num:0,percent:0},{name:"\u4F1A\u5458\u6570",type:"rechargePeople",icon:"RectangleCopy59",num:0,percent:0},{name:"\u7D2F\u8BA1\u4F1A\u5458\u6570",type:"cumulativeRechargePeople",icon:"RectangleCopy6",num:0,percent:0},{name:"\u7D2F\u8BA1\u6210\u4EA4\u7528\u6237\u6570",type:"cumulativePayPeople",icon:"RectangleCopy9",num:0,percent:0},{name:"\u7D2F\u8BA1\u7528\u6237",type:"cumulativeUser",icon:"RectangleCopy54",num:0,percent:0}]),v=new Date,x=v.getFullYear(),g=v.getMonth()+1,R=new Date(x,g-1,1),V=new Date(x,g,0),u=f([R,V]),p=()=>{let t="";u.value[0]&&u.value[1]&&(t=B(u.value[0]).format("YYYY/MM/DD")+"-"+B(u.value[1]).format("YYYY/MM/DD")),i.date=t,Q(i).then(e=>{D.forEach(a=>{a.num=e[a.type].num,a.percent=e[a.type].percent})}),X(i).then(e=>{r.xAxis.data=[],r.series=[],r.legend.data=e.series.map(a=>a.name),r.xAxis.data=e.xAxis,r.series=e.series.map(a=>({type:"line",smooth:!0,data:a.value,name:a.name}))})},m=f(!1),F=f([]),Y=(t="")=>{m.value=!0,Z({name:t,page_size:50}).then(e=>{F.value=e.lists,setTimeout(()=>{m.value=!1},300)}).catch(e=>{setTimeout(()=>{m.value=!1},300)})};return T(()=>{p()}),(t,e)=>{const a=O,L=W,P=U,N=I,S=K,h=J;return c(),d("div",$,[l(h,{shadow:"never",class:"!border-none"},{default:_(()=>[n("div",ee,[e[4]||(e[4]=n("span",{class:"text-2xl"},"\u7528\u6237\u6982\u51B5",-1)),n("div",te,[n("div",ne,[l(L,{modelValue:o(i).store_id,"onUpdate:modelValue":e[0]||(e[0]=s=>o(i).store_id=s),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":Y,loading:o(m),style:{width:"240px"},onChange:p},{default:_(()=>[(c(!0),d(w,null,E(o(F),s=>(c(),z(a,{key:s.id,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),e[3]||(e[3]=n("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1)),l(P,{modelValue:o(u),"onUpdate:modelValue":e[1]||(e[1]=s=>G(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:k,onChange:p},null,8,["modelValue"]),l(N,{type:"primary",class:"ml-4",onClick:p},{default:_(()=>e[2]||(e[2]=[j("\u67E5\u8BE2")])),_:1})])]),n("div",ae,[(c(!0),d(w,null,E(o(D),(s,C)=>(c(),d("div",{class:"w-1/5 flex mb-6",key:C},[n("div",se,[n("div",{class:"rounded-full p-2",style:q({"background-color":M[C%8]})},[l(S,{iconName:s.icon,white:"",className:"text-6xl"},null,8,["iconName"])],4)]),n("div",null,[n("div",oe,b(s.name),1),n("div",ue,b(s.num),1)])]))),128))])]),_:1}),l(h,{shadow:"never",class:"mt-4 !border-none"},{default:_(()=>[n("div",null,[e[5]||(e[5]=n("div",{class:"mb-6 flex justify-between items-center"},[n("span",{class:"text-2xl"},"\u7528\u6237\u8D8B\u52BF")],-1)),l(o(H),{style:{height:"400px"},option:o(r),autoresize:!0},null,8,["option"])])]),_:1})])}}});export{De as default};
|