feat: 添加访问统计模块

This commit is contained in:
陈淳
2023-09-15 15:05:14 +08:00
parent c2ca0b1f29
commit c988ed7988
10 changed files with 164 additions and 12 deletions

View File

@@ -8,30 +8,34 @@ import { LineChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
import { ref ,onMounted} from 'vue';
import { getWeek } from '@/apis/accessApi.js'
echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);
const VisitsLineChart=ref(null);
onMounted(()=>{
onMounted(async()=>{
var myChart = echarts.init(VisitsLineChart.value, null, {
width: 320,
height: 230
});
var option;
const response=await getWeek();
var numberData=response.data.map(x=>x.number);
option = {
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [
{
data: [82, 93, 90, 93, 129, 133, 132],
data: numberData,
type: 'line',
areaStyle: {}
}