fix point rule unit

This commit is contained in:
Timi
2026-08-19 15:46:03 +08:00
parent ff156926f5
commit 84bc6d137d
5 changed files with 150 additions and 103 deletions
+9 -1
View File
@@ -296,7 +296,15 @@ function getRuleConditionText(rule: PointRule): string {
textList.push(`来源事件:${sourceEvent.value?.name || sourceEvent.value?.id || condition.sourceEventId}`);
}
if (condition.tiers?.length) {
textList.push(condition.tiers.map(tier => `${tier.min}~${tier.max ?? "以上"}:${0 < tier.pointValue ? "发放" : "消耗"} ${Math.abs(tier.pointValue)} 分`).join(","));
const tierSourceEvent = sourceEvent.value || (condition.sourceEventId === triggerEvent.value?.id ? triggerEvent.value : undefined);
textList.push(condition.tiers.map(tier => {
const minText = formatEventNumberValue(tierSourceEvent, tier.min);
const maxText = tier.max === undefined || tier.max === null ? "以上" : formatEventNumberValue(tierSourceEvent, tier.max);
const pointText = tier.pointValue === 0
? "不产生积分流水"
: `${0 < tier.pointValue ? "发放" : "消耗"} ${Math.abs(tier.pointValue)} 分`;
return `${minText}~${maxText}:${pointText}`;
}).join(","));
}
return textList.join(";") || "无额外条件";
}