ActiveUser-Kc2Tu2FA.js 4.1 KB

12
  1. var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,a,o)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,l=(e,t)=>{for(var a in t||(t={}))s.call(t,a)&&i(e,a,t[a]);if(o)for(var a of o(t))r.call(t,a)&&i(e,a,t[a]);return e};import{g as n}from"./index-CT1qRCFx.js";/* empty css */import{u as d,a as c,L as p}from"./useChart-lXWY8jG7.js";import{j as u,c as h,a6 as y,ae as f,Q as g,G as m,R as b,v,ab as x,S as A,F as L,a0 as w,Y as j}from"./vendor-D0p0RnNT.js";import{_ as k}from"./_plugin-vue_export-helper-BCo6x5W8.js";const S=u((O=l({},{name:"ArtBarChart"}),_={__name:"index",props:{data:{default:()=>[0,0,0,0,0,0,0]},xAxisData:{default:()=>[]},barWidth:{default:"40%"},stack:{type:Boolean,default:!1},borderRadius:{default:4},height:{default:d().chartHeight},loading:{type:Boolean,default:!1},isEmpty:{type:Boolean,default:!1},colors:{default:()=>d().colors},showAxisLabel:{type:Boolean,default:!0},showAxisLine:{type:Boolean,default:!0},showSplitLine:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!1},legendPosition:{default:"bottom"}},setup(e){const t=e,a=h((()=>Array.isArray(t.data)&&t.data.length>0&&"object"==typeof t.data[0]&&"name"in t.data[0])),o=(e,a)=>e||(void 0!==a?t.colors[a%t.colors.length]:new p(0,0,0,1,[{offset:0,color:n("--el-color-primary-light-4")},{offset:1,color:n("--el-color-primary")}])),s=e=>new p(0,0,0,1,[{offset:0,color:e},{offset:1,color:e}]),r=e=>{const a=A();return l({name:e.name,data:e.data,type:"bar",stack:e.stack,itemStyle:(o=e.color,{borderRadius:t.borderRadius,color:"string"==typeof o?s(o):o}),barWidth:e.barWidth||t.barWidth},a);var o},{chartRef:i,getAxisLineStyle:d,getAxisLabelStyle:u,getAxisTickStyle:v,getSplitLineStyle:x,getAnimationConfig:A,getTooltipStyle:L,getLegendStyle:w,getGridWithLegend:j}=c({props:t,checkEmpty:()=>{if(Array.isArray(t.data)&&"number"==typeof t.data[0]){const e=t.data;return!e.length||e.every((e=>0===e))}if(Array.isArray(t.data)&&"object"==typeof t.data[0]){const e=t.data;return!e.length||e.every((e=>{var t;return!(null==(t=e.data)?void 0:t.length)||e.data.every((e=>0===e))}))}return!0},watchSources:[()=>t.data,()=>t.xAxisData,()=>t.colors],generateOptions:()=>{const e={grid:j(t.showLegend&&a.value,t.legendPosition,{top:15,right:0,left:0}),tooltip:t.showTooltip?L():void 0,xAxis:{type:"category",data:t.xAxisData,axisTick:v(),axisLine:d(t.showAxisLine),axisLabel:u(t.showAxisLabel)},yAxis:{type:"value",axisLabel:u(t.showAxisLabel),axisLine:d(t.showAxisLine),splitLine:x(t.showSplitLine)}};if(t.showLegend&&a.value&&(e.legend=w(t.legendPosition)),a.value){const a=t.data;e.series=a.map(((e,a)=>{const s=o(t.colors[a],a);return r({name:e.name,data:e.data,color:s,barWidth:e.barWidth,stack:t.stack?e.stack||"total":void 0})}))}else{const a=t.data,s=o();e.series=[r({data:a,color:s})]}return e}});return(e,a)=>{const o=f;return y((m(),g("div",{ref_key:"chartRef",ref:i,style:b({height:t.height})},null,4)),[[o,t.loading]])}}},t(O,a(_))));var O,_;const B={class:"card art-custom-card"},P={class:"list"},W={class:"subtitle"},R=k(u({__name:"ActiveUser",setup(e){const t=[{name:"总用户量",num:"32k"},{name:"总访问量",num:"128k"},{name:"日访问量",num:"1.2k"},{name:"周同比",num:"+5%"}];return(e,a)=>{const o=S;return m(),g("div",B,[v(o,{class:"chart",barWidth:"50%",height:"13.7rem",showAxisLine:!1,data:[160,100,150,80,190,100,175,120,160],xAxisData:["1","2","3","4","5","6","7","8","9"]}),a[0]||(a[0]=x('<div class="text" data-v-04738e0c><h3 class="box-title" data-v-04738e0c>用户概述</h3><p class="subtitle" data-v-04738e0c>比上周 <span class="text-success" data-v-04738e0c>+23%</span></p><p class="subtitle" data-v-04738e0c>我们为您创建了多个选项,可将它们组合在一起并定制为像素完美的页面</p></div>',1)),A("div",P,[(m(),g(L,null,w(t,((e,t)=>A("div",{key:t},[A("p",null,j(e.num),1),A("p",W,j(e.name),1)]))),64))])])}}}),[["__scopeId","data-v-04738e0c"]]);export{R as default};