倍率问题和图片问题调整
This commit is contained in:
1 parent
f1993eb388
commit
3f29ba716a
20 files changed
+1210
-24
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import type { BillingParameterDimension, BillingParameterTier, BillingPriceRule } from "@/lib/types";
|
||||
|
||||
export type PriceEditTarget = {
|
||||
dimensionKey?: string;
|
||||
tierValue?: string;
|
||||
label: string;
|
||||
markupMultiplier: number;
|
||||
};
|
||||
|
||||
export function groupedPriceRuleSections(rules: BillingPriceRule[]) {
|
||||
return rules.map((rule, index) => ({
|
||||
rule,
|
||||
label: rule.provider === "seedream" && rule.capability === "image.generate"
|
||||
? rule.conditions?.layerDecomposition === true ? "图层拆分" : "基础生图"
|
||||
: rule.variantKey || `规则 ${index + 1}`,
|
||||
dimensions: rule.parameterDimensions?.filter((dimension) => dimension.tiers.length > 0) || []
|
||||
}));
|
||||
}
|
||||
|
||||
export function priceTierEditTarget(dimension: BillingParameterDimension, tier: BillingParameterTier, businessLabel?: string): PriceEditTarget {
|
||||
return {
|
||||
dimensionKey: dimension.key,
|
||||
tierValue: String(tier.value),
|
||||
label: [businessLabel, dimension.label || dimension.key, tier.label || String(tier.value)].filter(Boolean).join(" · "),
|
||||
markupMultiplier: tier.markupMultiplier
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user