fix: 明确风险平价策略创建时权重总和必须等于1的校验逻辑

This commit is contained in:
claw_bot 2026-03-09 14:18:31 +00:00
parent 237bc47c14
commit 22db4e461e

View File

@ -340,6 +340,7 @@ const validateRiskParityAssets = () => {
totalWeight += parseFloat(asset.targetWeight);
}
// 11%
if (Math.abs(totalWeight - 1) > 0.01) {
uni.showToast({ title: `资产权重总和必须为100%,当前为${(totalWeight * 100).toFixed(0)}%`, icon: 'none' });
return false;