perf:首页Echarts图x轴赋值

This commit is contained in:
Xwen
2023-12-16 17:47:44 +08:00
parent 6fc7028507
commit 7141918e27
3 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
# 接口前缀 # 接口前缀
VITE_APP_BASEAPI="/api-dev" VITE_APP_BASEAPI="/api-dev"
#VITE_APP_URL="http://123.207.63.87:19001/api/app" VITE_APP_URL="http://123.207.63.87:19001/api/app"
VITE_APP_URL="http://localhost:19001/api/app" # VITE_APP_URL="http://localhost:19001/api/app"
VITE_APP_ENV_NAME = "dev" VITE_APP_ENV_NAME = "dev"

View File

@@ -140,11 +140,16 @@ onMounted(async () => {
weekList.value = weekData; weekList.value = weekData;
}); });
const weekXAxis = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
// 访问统计 // 访问统计
const statisOptions = computed(() => { const statisOptions = computed(() => {
return { return {
xAxis: { xAxis: {
data: weekList.value.map((item) => item.creationTime), data: weekList.value.map((item, index) => {
return weekXAxis.filter((v, vIndex) => {
return vIndex === index;
})[0];
}),
}, },
series: { series: {
data: weekList.value.map((item) => item.number), data: weekList.value.map((item) => item.number),

View File

@@ -10,7 +10,7 @@ export const statisticsEcharts = {
trigger: "axis", trigger: "axis",
}, },
xAxis: { xAxis: {
show: false, show: true,
type: "category", type: "category",
data: [], data: [],
axisLine: { axisLine: {