= 0 ? t('编辑图片定价') : t('添加图片定价')}
visible={modalVisible}
onOk={submit}
onCancel={() => setModalVisible(false)}
okText={t('保存')}
cancelText={t('取消')}
width={760}
confirmLoading={loading}
>
{MATCH_MODE_OPTIONS.map((option) => (
{t(option.label)}
))}
setResolutionRule(value)}
extraText={t(currentRule.help)}
>
{RESOLUTION_RULE_OPTIONS.map((option) => (
{t(option.label)}
))}
{currentRule.requiredTiers.length > 0
? t('当前规则必须配置档位:{{tiers}}', {
tiers: currentRule.requiredTiers.join('、'),
})
: t('手工规则可自定义档位 key,并通过别名匹配请求尺寸。')}
{t('别名始终优先于自动识别,可用于覆盖个别尺寸的计费档位。')}
{t('自定义宽高按总像素向上取最近档位,避免低档计费。')}
{t('档位列表')}
{tierRows.map((row, index) => (
updateTier(index, { key: value })}
/>
updateTier(index, { label: value })}
/>
updateTier(index, { price_per_image: value })
}
/>
updateTier(index, { aliases: value })}
/>
}
size='small'
type='danger'
theme='borderless'
disabled={tierRows.length === 1}
aria-label={t('删除档位')}
onClick={() =>
setTierRows((rows) =>
rows.filter((_, rowIndex) => rowIndex !== index),
)
}
/>
))}
}
size='small'
style={{ marginTop: 10 }}
onClick={() => setTierRows((rows) => [...rows, emptyTier()])}
>
{t('添加档位')}
);
}