fix(swaptrade): 新增交易切换标的时清空残留的净价/全价/收益率
setUnderlyingCode 在切换标的时仅调用 clearBondCalcFlags 清掉手动/源标志,未清字段值;getSpotPrice 只回填净价/全价,收益率(InitYtm)无刷新逻辑,导致旧债券收益率残留污染新债券。显式置空 PosiNetNoFeePrice/PosiGrossPrice/InitYtm,避免残留。
This commit is contained in:
@@ -753,6 +753,13 @@ const vue = new Vue({
|
||||
},
|
||||
setUnderlyingCode(data, item) {
|
||||
if (!data || !data.Code) return;
|
||||
var underlyingCode = item.UnderlyingCode;
|
||||
if (underlyingCode != data.Code) {
|
||||
// 切换标的:清空上一债券残留的收益率,避免旧债券计算结果污染新债券。
|
||||
// 注:clearBondCalcFlags 只清手动/源标志,未清字段值;
|
||||
// 净价/全价会被末尾 getSpotPrice 无条件回填,收益率(InitYtm)无刷新逻辑,必须显式清空。
|
||||
item.InitYtm = null;
|
||||
}
|
||||
item.CountRatio = data.CountRatio;
|
||||
item.ContractSize = data.ContractSize;
|
||||
item.UnderlyingInstrumentType = data.InstrumentType;
|
||||
|
||||
Reference in New Issue
Block a user