forward to detail

This commit is contained in:
Timi
2026-08-22 11:27:17 +08:00
parent 3c1f7ad590
commit 2b0554d365
+38
View File
@@ -32,6 +32,7 @@
<t-cell title="事件名称" :note="triggerEvent.name || '未命名事件'" />
<t-cell title="事件类型" :note="getEventValueTypeText(triggerEvent)" />
<t-cell title="事件说明" :note="Text.display(triggerEvent.description)" />
<t-cell title="查看事件详情" :arrow="canUpdateEvent" :hover="canUpdateEvent" @click="toEventEdit" />
</template>
<div v-else class="empty" v-text="getEventEmptyText()" />
</t-cell-group>
@@ -49,6 +50,7 @@
<t-cell v-if="hasEarnedPointValue" title="本次积分变化" :note="getSignedPointText(eventRecord.earnedPointValue)" />
<t-cell title="登记人" :note="Text.display(eventRecord.operator?.nick || eventRecord.operator?.name)" />
<t-cell title="记录备注" :note="Text.display(eventRecord.remark)" />
<t-cell title="查看记录详情" arrow hover @click="toEventRecordDetail" />
</template>
<div v-else class="empty" v-text="getRecordEmptyText()" />
</t-cell-group>
@@ -64,6 +66,7 @@
<t-cell title="规则优先级" :note="getPointText(hitRule.priority)" />
<t-cell title="命中后停止匹配" :note="hitRule.exclusive ? '是' : '否'" />
<t-cell title="规则备注" :note="Text.display(hitRule.remark)" />
<t-cell title="查看规则详情" :arrow="canUpdateRule" :hover="canUpdateRule" @click="toPointRuleEdit" />
</template>
<div v-else class="empty" v-text="getRuleEmptyText()" />
</t-cell-group>
@@ -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<void> {
}
}
async function toEventEdit(): Promise<void> {
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<void> {
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<void> {
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 });