diff --git a/src/components/EventRecordCalendar.vue b/src/components/EventRecordCalendar.vue index 429bbac..74370d6 100644 --- a/src/components/EventRecordCalendar.vue +++ b/src/components/EventRecordCalendar.vue @@ -63,6 +63,9 @@ :title="getRecordEventName(item)" :description="getRecordCustomerName(item)" :note="`${formatRecordTime(item.registeredAt)}`" + arrow + hover + @click="toRecordDetail(item)" />
该日暂无登记事件记录
@@ -130,6 +133,8 @@ const emit = defineEmits<{ "update:selectedEventIdList": [value: string[]]; }>(); +const route = useRoute(); +const router = useRouter(); const weekNameList = ["日", "一", "二", "三", "四", "五", "六"]; const dayRecordVisible = ref(false); const eventFilterVisible = ref(false); @@ -192,6 +197,20 @@ function openDayRecords(day: CalendarDay): void { dayRecordVisible.value = true; } +async function toRecordDetail(record: EventRecord): Promise { + if (!record.id) { + return; + } + + dayRecordVisible.value = false; + await router.push({ + path: `/management/registration-event-records/${record.id}`, + query: { + transitionDepth: String(getCurrentRouteDepth() + 1) + } + }); +} + function getRecordEventName(record?: EventRecord): string { if (!record) { return ""; @@ -226,6 +245,10 @@ function isInCurrentMonth(value?: number): boolean { return !!date && date.getFullYear() === props.modelValue.getFullYear() && date.getMonth() === props.modelValue.getMonth(); } +function getCurrentRouteDepth(): number { + return Number(route.meta.depth ?? 0); +} + function getMonthStart(date: Date): Date { return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0); } diff --git a/src/components/PageTransition.vue b/src/components/PageTransition.vue index 2a5d93b..f2c6eee 100644 --- a/src/components/PageTransition.vue +++ b/src/components/PageTransition.vue @@ -30,6 +30,11 @@ const pageBackground = computed(() => globalUIStore.bodyBackground); const pathCache = new Map(); function calcDepth(sourceRoute: RouteLocationNormalized): number { + const queryDepth = parseTransitionDepth(sourceRoute.query.transitionDepth); + if (queryDepth !== undefined) { + return queryDepth; + } + if (!sourceRoute.meta.dynamicDepth) { return Number(sourceRoute.meta.depth ?? 0); } @@ -47,6 +52,22 @@ function calcDepth(sourceRoute: RouteLocationNormalized): number { return depth; } +function parseTransitionDepth(value: unknown): number | undefined { + if (Array.isArray(value)) { + return parseTransitionDepth(value[0]); + } + + if (typeof value !== "string") { + return undefined; + } + + const depth = Number(value); + if (!Number.isInteger(depth) || depth < 0 || 20 < depth) { + return undefined; + } + return depth; +} + const unregisterGuard = router.beforeEach((to, from) => { const toDepth = calcDepth(to); const fromDepth = calcDepth(from); diff --git a/src/pages/store/component/StoreCustomerGenderChart.vue b/src/pages/store/component/StoreCustomerGenderChart.vue index a129b02..65585a8 100644 --- a/src/pages/store/component/StoreCustomerGenderChart.vue +++ b/src/pages/store/component/StoreCustomerGenderChart.vue @@ -27,6 +27,16 @@ const statList = ref([]); const chartOption = computed(() => ({ ...buildStoreBaseChartOption(props.dateTextList), + grid: { + top: 24, + left: 12, + right: 12, + bottom: 12, + containLabel: true + }, + legend: { + show: false + }, tooltip: { trigger: "item" }, diff --git a/src/pages/store/component/StoreEventRecordTrendChart.vue b/src/pages/store/component/StoreEventRecordTrendChart.vue index 20c8f29..8582a70 100644 --- a/src/pages/store/component/StoreEventRecordTrendChart.vue +++ b/src/pages/store/component/StoreEventRecordTrendChart.vue @@ -1,7 +1,11 @@