diff --git a/src/pages/point/PointLedgerDetail.vue b/src/pages/point/PointLedgerDetail.vue index afd4449..bc4e369 100644 --- a/src/pages/point/PointLedgerDetail.vue +++ b/src/pages/point/PointLedgerDetail.vue @@ -32,6 +32,7 @@ +
@@ -49,6 +50,7 @@ +
@@ -64,6 +66,7 @@ +
@@ -100,6 +103,8 @@ const canReadCustomer = computed(() => userStore.hasPermissions(permissionCodes. const canReadEvent = computed(() => userStore.hasPermissions(permissionCodes.event.read)); const canReadEventRecord = computed(() => userStore.hasPermissions(permissionCodes.eventRecord.read)); const canReadRule = computed(() => userStore.hasPermissions(permissionCodes.pointRule.read)); +const canUpdateEvent = computed(() => userStore.hasPermissions(permissionCodes.event.update)); +const canUpdateRule = computed(() => userStore.hasPermissions(permissionCodes.pointRule.update)); // ---------- 流水与关联数据 ---------- @@ -351,6 +356,39 @@ async function toCustomerDetail(): Promise { } } +async function toEventEdit(): Promise { + if (!canUpdateEvent.value || !triggerEvent.value?.id) { + return; + } + await router.push({ + name: "EventEdit", + params: { id: triggerEvent.value.id }, + query: { transitionDepth: String(Number(route.meta.depth ?? 0) + 1) } + }); +} + +async function toEventRecordDetail(): Promise { + if (!eventRecord.value?.id) { + return; + } + await router.push({ + name: "EventRecordDetail", + params: { id: eventRecord.value.id }, + query: { transitionDepth: String(Number(route.meta.depth ?? 0) + 1) } + }); +} + +async function toPointRuleEdit(): Promise { + if (!canUpdateRule.value || !hitRule.value?.id) { + return; + } + await router.push({ + name: "PointRuleEdit", + params: { id: hitRule.value.id }, + query: { transitionDepth: String(Number(route.meta.depth ?? 0) + 1) } + }); +} + watch(() => [route.params.id, route.query.snapshot], async () => { await loadPageData(); }, { immediate: true });