fix tag
This commit is contained in:
@@ -74,7 +74,7 @@ import EventRecordAPI from "@/api/EventRecordAPI";
|
|||||||
import EventRecordVerifyDialog from "@/components/EventRecordVerifyDialog.vue";
|
import EventRecordVerifyDialog from "@/components/EventRecordVerifyDialog.vue";
|
||||||
import type { EventRecord, EventRecordListItemView } from "@/types/EventRecord";
|
import type { EventRecord, EventRecordListItemView } from "@/types/EventRecord";
|
||||||
import { getCustomerPhotoURL } from "@/utils/customer";
|
import { getCustomerPhotoURL } from "@/utils/customer";
|
||||||
import { isPackagePurchaseEvent } from "@/utils/event";
|
import { isRetiredEvent } from "@/utils/event";
|
||||||
import { getErrorMessage } from "@/utils/error";
|
import { getErrorMessage } from "@/utils/error";
|
||||||
import { permissionCodes } from "@/utils/permission";
|
import { permissionCodes } from "@/utils/permission";
|
||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
@@ -101,10 +101,10 @@ const route = useRoute();
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const isPackagePurchaseRecord = computed(() => isPackagePurchaseEvent(props.record.event));
|
const isRetiredRecord = computed(() => isRetiredEvent(props.record.event));
|
||||||
const canUpdateRecord = computed(() => !isPackagePurchaseRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.update));
|
const canUpdateRecord = computed(() => !isRetiredRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.update));
|
||||||
const canVerifyRecord = computed(() => !isPackagePurchaseRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.verify));
|
const canVerifyRecord = computed(() => !isRetiredRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.verify));
|
||||||
const canDeleteRecord = computed(() => !isPackagePurchaseRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.delete));
|
const canDeleteRecord = computed(() => !isRetiredRecord.value && userStore.hasPermissions(permissionCodes.eventRecord.delete));
|
||||||
const isDeleting = ref(false);
|
const isDeleting = ref(false);
|
||||||
const isVerifying = ref(false);
|
const isVerifying = ref(false);
|
||||||
const isLoadingVerifyRecord = ref(false);
|
const isLoadingVerifyRecord = ref(false);
|
||||||
@@ -129,19 +129,12 @@ const tagList = computed<RecordTag[]>(() => {
|
|||||||
theme: props.record.verificationStatus === "VERIFIED" ? "success" : "warning"
|
theme: props.record.verificationStatus === "VERIFIED" ? "success" : "warning"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (shouldShowSelectedOptions.value) {
|
if (props.record.selectedOptionGroupList?.length) {
|
||||||
list.push(...getRecordSelectedOptions(props.record));
|
list.push(...getRecordSelectedOptions(props.record));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
});
|
});
|
||||||
const isVerifyLoading = computed(() => isVerifying.value || isLoadingVerifyRecord.value);
|
const isVerifyLoading = computed(() => isVerifying.value || isLoadingVerifyRecord.value);
|
||||||
const shouldShowSelectedOptions = computed(() => {
|
|
||||||
const selectedEventIdList = parseEventIdList(route.query.eventIds);
|
|
||||||
const recordEventId = props.record.eventId || props.record.event?.id;
|
|
||||||
return selectedEventIdList.length === 1
|
|
||||||
&& selectedEventIdList[0] === recordEventId
|
|
||||||
&& !getQueryText("optionIds").trim();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function toDetail(): Promise<void> {
|
async function toDetail(): Promise<void> {
|
||||||
const id = props.record.id;
|
const id = props.record.id;
|
||||||
@@ -274,11 +267,6 @@ function getQueryText(key: string): string {
|
|||||||
return Array.isArray(value) ? String(value[0] || "") : String(value || "");
|
return Array.isArray(value) ? String(value[0] || "") : String(value || "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseEventIdList(value: unknown): string[] {
|
|
||||||
const text = Array.isArray(value) ? String(value[0] || "") : String(value || "");
|
|
||||||
return text.split(",").map(item => item.trim()).filter(Boolean);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCurrentRouteDepth(): number {
|
function getCurrentRouteDepth(): number {
|
||||||
const transitionDepth = getQueryText("transitionDepth").trim();
|
const transitionDepth = getQueryText("transitionDepth").trim();
|
||||||
const depth = Number(transitionDepth);
|
const depth = Number(transitionDepth);
|
||||||
|
|||||||
Reference in New Issue
Block a user