fix: 首页去掉地市分布
This commit is contained in:
@@ -16,7 +16,6 @@ interface PoolDash {
|
||||
addedToday: number;
|
||||
addedWeek: number;
|
||||
dailyAdded: { date: string; count: number }[];
|
||||
cities: { name: string; count: number }[];
|
||||
}
|
||||
|
||||
function emptyPool(): PoolDash {
|
||||
@@ -29,7 +28,6 @@ function emptyPool(): PoolDash {
|
||||
addedToday: 0,
|
||||
addedWeek: 0,
|
||||
dailyAdded: [],
|
||||
cities: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,7 +41,6 @@ function readPool(result: unknown): PoolDash | null {
|
||||
...blank,
|
||||
...source,
|
||||
dailyAdded: Array.isArray(source.dailyAdded) ? source.dailyAdded : blank.dailyAdded,
|
||||
cities: Array.isArray(source.cities) ? source.cities : blank.cities,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -127,31 +124,6 @@ const statusOption = computed<EChartsCoreOption>(() => {
|
||||
};
|
||||
});
|
||||
|
||||
const cityOption = computed<EChartsCoreOption>(() => {
|
||||
const colors = theme();
|
||||
void isDark.value;
|
||||
const rows = stats.value.cities.slice(0, 8);
|
||||
return {
|
||||
color: [colors.accent],
|
||||
tooltip: { trigger: "axis" },
|
||||
grid: { left: 56, right: 16, top: 16, bottom: 28 },
|
||||
xAxis: { type: "value", minInterval: 1, ...axis(colors) },
|
||||
yAxis: {
|
||||
type: "category",
|
||||
data: rows.map((item) => item.name),
|
||||
inverse: true,
|
||||
...axis(colors),
|
||||
},
|
||||
series: [{
|
||||
type: "bar",
|
||||
name: "账号",
|
||||
barMaxWidth: 16,
|
||||
data: rows.map((item) => item.count),
|
||||
itemStyle: { borderRadius: [0, 3, 3, 0] },
|
||||
}],
|
||||
};
|
||||
});
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const next = readPool(await api<unknown>("/api/admin/dashboard"));
|
||||
@@ -187,10 +159,6 @@ onMounted(load);
|
||||
<h3>凭证状态</h3>
|
||||
<ChartPane :option="statusOption" />
|
||||
</section>
|
||||
<section class="surface dash-card dash-wide">
|
||||
<h3>地市分布</h3>
|
||||
<ChartPane :option="cityOption" />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -175,7 +175,6 @@ button, input, select { font: inherit; }
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.dash-wide { grid-column: 1 / -1; }
|
||||
.dash-chart { height: 260px; }
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
|
||||
Reference in New Issue
Block a user