delete event in list
This commit is contained in:
@@ -38,6 +38,14 @@
|
||||
<span v-else>未配置</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadEventRecord"
|
||||
title="登记记录"
|
||||
note="查看该事件登记记录"
|
||||
arrow
|
||||
:hover="true"
|
||||
@click="toEventRecordList"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition="140" v-if="event" title="登记配置" theme="card">
|
||||
<t-cell title="数值类型" :note="getValueTypeText(event.valueType)" />
|
||||
@@ -121,6 +129,7 @@ const defaultColor = "#2f88ff";
|
||||
|
||||
const canUpdate = computed(() => userStore.hasPermissions(permissionCodes.event.update));
|
||||
const canDeleteEvent = computed(() => userStore.hasPermissions(permissionCodes.event.delete));
|
||||
const canReadEventRecord = computed(() => userStore.hasPermissions(permissionCodes.eventRecord.read));
|
||||
const isGlobalManager = computed(() => userStore.hasRoles(gaoRoleCodes.globalManager));
|
||||
const storeName = computed(() => {
|
||||
const storeId = event.value?.storeId;
|
||||
@@ -295,6 +304,31 @@ async function removeEvent(eventId: string): Promise<void> {
|
||||
|
||||
// ---------- 导航 ----------
|
||||
|
||||
async function toEventRecordList(): Promise<void> {
|
||||
const eventId = event.value?.id || String(route.params.id || "");
|
||||
if (!eventId || !canReadEventRecord.value) {
|
||||
return;
|
||||
}
|
||||
await router.push({
|
||||
name: "EventRecordList",
|
||||
query: {
|
||||
eventIds: eventId,
|
||||
transitionDepth: String(getCurrentRouteDepth() + 1)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getCurrentRouteDepth(): number {
|
||||
const transitionDepth = Array.isArray(route.query.transitionDepth)
|
||||
? route.query.transitionDepth[0]
|
||||
: route.query.transitionDepth;
|
||||
const depth = Number(transitionDepth);
|
||||
if (transitionDepth && Number.isInteger(depth) && 0 <= depth && depth <= 20) {
|
||||
return depth;
|
||||
}
|
||||
return Number(route.meta.depth ?? 0);
|
||||
}
|
||||
|
||||
async function toEdit(): Promise<void> {
|
||||
const eventId = String(route.params.id || "");
|
||||
if (!canUpdate.value || !eventId) {
|
||||
|
||||
Reference in New Issue
Block a user