moreShopAdmin/build/admin/assets/index.48dc40f2.js

2 lines
4.0 KiB
JavaScript

import{m as C,aT as E,r as _,b as T,bg as j,b9 as q,p as d,q as p,t as c,v,x as a,u as n,i as z,a2 as S,V as G,W as H,G as l,y as I,A as F,bF as J,bh as g,ae as O,J as R,b5 as U}from"./.pnpm.1b0299fb.js";import{d as W,s as $}from"./workbench.f568dc98.js";import"./index.689cfa31.js";import"./@vueuse.72d44d91.js";import"./lodash.c3b66c05.js";import"./@vue.9d708d7c.js";const K={class:"workbench"},Q={class:"mb-6 flex justify-between items-center"},X={class:"flex items-center text-sm"},Z={class:"flex flex-wrap"},tt=["onClick"],et={class:"mr-2"},at={class:"rounded-full p-2"},st={class:"text-info"},nt={class:""},ot={class:""},rt={class:"mb-6 flex justify-between items-center"},lt={key:0,class:"text-2xl",style:{margin:"0 auto","padding-right":"67px"}},ut=C({name:"product"}),ht=C({...ut,setup(it){const B=[{text:"\u8FD1\u4E00\u5468",value:()=>{const e=new Date,t=new Date;return t.setDate(t.getDate()-7),[t,e]}},{text:"\u672C\u6708",value:()=>{const e=new Date,t=new Date;return t.setDate(1),e.setMonth(e.getMonth()+1),e.setDate(0),[t,e]}},{text:"\u8FD1\u4E00\u6708",value:()=>{const e=new Date,t=new Date;return t.setMonth(t.getMonth()-1),[t,e]}},{text:"\u8FD1\u4E09\u6708",value:()=>{const e=new Date,t=new Date;return t.setMonth(t.getMonth()-3),[t,e]}}],i=E({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}]}),D=new Date,f=D.getFullYear(),y=D.getMonth()+1,Y=new Date(f,y-1,1),M=new Date(f,y,0),u=_([Y,M]),b=_([]),x=_(0),h=_(""),s=E({product_id:"",start_time:"",end_time:"",page_no:1,page_size:10}),m=()=>{s.start_time=g(u.value[0]).format("YYYY-MM-DD"),s.end_time=g(u.value[1]).format("YYYY-MM-DD"),W(s).then(e=>{b.value=e.lists,x.value=e.count})},k=e=>{s.page_no=e,m()},V=e=>{s.start_time=g(u.value[0]).format("YYYY-MM-DD"),s.end_time=g(u.value[1]).format("YYYY-MM-DD"),s.product_id=e.product_id,h.value=e.store_name,$(s).then(t=>{i.xAxis.data=[],i.series=[],i.legend.data=t.series.map(r=>r.name),t.xAxis.forEach(r=>{i.xAxis.data.push(r)}),i.series=t.series.map(r=>({type:"line",smooth:!0,data:r.value,name:r.name}))})};return T(()=>{m()}),(e,t)=>{const r=j,A=O,L=R,N=q,w=U;return d(),p("div",K,[c(w,{shadow:"never",class:"!border-none"},{default:v(()=>[a("div",Q,[t[3]||(t[3]=a("span",{class:"text-2xl"},"\u5546\u54C1\u6982\u51B5",-1)),a("div",X,[t[2]||(t[2]=a("span",{class:"mr-4"},"\u65F6\u95F4\u7B5B\u9009: ",-1)),c(r,{modelValue:n(u),"onUpdate:modelValue":t[0]||(t[0]=o=>z(u)?u.value=o:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:B,onChange:m},null,8,["modelValue"]),c(A,{type:"primary",class:"ml-4",onClick:m},{default:v(()=>t[1]||(t[1]=[S("\u67E5\u8BE2")])),_:1})])]),a("div",Z,[(d(!0),p(G,null,H(n(b),(o,P)=>(d(),p("div",{class:"w-1/5 flex mb-6",key:P,onClick:ct=>V(o)},[a("div",et,[a("div",at,[c(L,{style:{width:"50px",height:"50px"},src:o.image},null,8,["src"])])]),a("div",null,[a("div",st,l(o.store_name),1),a("div",nt," \u9500\u91CF:"+l(o.cart_num)+l(o.unit_name)+"|\u603B\u4EF7:"+l(o.total_price),1),a("div",ot,"\u89C4\u683C:"+l(o.store_info),1)])],8,tt))),128))]),n(x)>10?(d(),I(N,{key:0,background:"",layout:"prev, pager, next",total:n(x),onChange:k,style:{"margin-right":"56px","margin-bottom":"11px",float:"right"}},null,8,["total"])):F("",!0)]),_:1}),c(w,{shadow:"never",class:"mt-4 !border-none"},{default:v(()=>[a("div",rt,[t[4]||(t[4]=a("span",{class:"text-2xl"},"\u5546\u54C1\u8D8B\u52BF",-1)),n(h)?(d(),p("span",lt,l(n(h))+" "+l(n(s).start_time)+" - "+l(n(s).end_time),1)):F("",!0)]),a("div",null,[c(n(J),{style:{height:"400px"},option:n(i),autoresize:!0},null,8,["option"])])]),_:1})])}}});export{ht as default};