update customer profile card

This commit is contained in:
Timi
2026-08-18 15:15:47 +08:00
parent ac11ee6b81
commit 9c57dcfc87
6 changed files with 47 additions and 69 deletions
-26
View File
@@ -86,11 +86,6 @@ import type { PointLedger, PointRule, PointRuleMode, PointRuleStatus, PointRuleT
import { formatEventNumberValue, getEventValueUnitText } from "@/utils/eventValue";
import { permissionCodes } from "@/utils/permission";
type SourcePayloadItem = {
key: string;
value: string;
};
defineOptions({
name: "PointLedgerDetail"
});
@@ -119,16 +114,6 @@ const isLoading = ref(false);
const hasEventNumberValue = computed(() => eventRecord.value?.numberValue !== undefined && eventRecord.value?.numberValue !== null);
const hasSubmittedPointValue = computed(() => eventRecord.value?.pointValue !== undefined && eventRecord.value?.pointValue !== null);
const hasEarnedPointValue = computed(() => eventRecord.value?.earnedPointValue !== undefined && eventRecord.value?.earnedPointValue !== null);
const sourcePayloadList = computed<SourcePayloadItem[]>(() => {
const payload = ledger.value?.sourcePayload;
if (!payload) {
return [];
}
return Object.entries(payload).map(([key, value]) => ({
key,
value: formatSourceValue(value)
}));
});
function getQueryText(key: string): string {
const value = route.query[key];
@@ -328,17 +313,6 @@ function getRuleEmptyText(): string {
return canReadRule.value ? "未找到命中规则" : "暂无命中规则查看权限";
}
function formatSourceValue(value: unknown): string {
if (value === null || value === undefined) {
return "-";
}
if (typeof value === "string") {
return value || "-";
}
const text = JSON.stringify(value);
return text === undefined ? String(value) : text;
}
// ---------- 导航 ----------
async function toCustomerDetail(): Promise<void> {