add EventDetail and PointRuleDetail

This commit is contained in:
Timi
2026-08-23 12:26:44 +08:00
parent cfa6364d93
commit 38df3edc54
7 changed files with 702 additions and 25 deletions
+8 -10
View File
@@ -32,7 +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" />
<t-cell title="查看事件详情" :arrow="canReadEvent" :hover="canReadEvent" @click="toEventDetail" />
</template>
<div v-else class="empty" v-text="getEventEmptyText()" />
</t-cell-group>
@@ -66,7 +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" />
<t-cell title="查看规则详情" :arrow="canReadRule" :hover="canReadRule" @click="toPointRuleDetail" />
</template>
<div v-else class="empty" v-text="getRuleEmptyText()" />
</t-cell-group>
@@ -103,8 +103,6 @@ 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));
// ---------- 流水与关联数据 ----------
@@ -356,12 +354,12 @@ async function toCustomerDetail(): Promise<void> {
}
}
async function toEventEdit(): Promise<void> {
if (!canUpdateEvent.value || !triggerEvent.value?.id) {
async function toEventDetail(): Promise<void> {
if (!canReadEvent.value || !triggerEvent.value?.id) {
return;
}
await router.push({
name: "EventEdit",
name: "EventDetail",
params: { id: triggerEvent.value.id },
query: { transitionDepth: String(Number(route.meta.depth ?? 0) + 1) }
});
@@ -378,12 +376,12 @@ async function toEventRecordDetail(): Promise<void> {
});
}
async function toPointRuleEdit(): Promise<void> {
if (!canUpdateRule.value || !hitRule.value?.id) {
async function toPointRuleDetail(): Promise<void> {
if (!canReadRule.value || !hitRule.value?.id) {
return;
}
await router.push({
name: "PointRuleEdit",
name: "PointRuleDetail",
params: { id: hitRule.value.id },
query: { transitionDepth: String(Number(route.meta.depth ?? 0) + 1) }
});