限额监控 名义本金单位改为万

This commit is contained in:
吴方海
2024-06-14 18:26:18 +08:00
parent a881815c3d
commit 54942e26c8
3 changed files with 19 additions and 0 deletions
@@ -3,6 +3,7 @@ var g_grid = {};
var quotaSettings = {};
var underlyingId = 0;
var disabledQuotaIndexs = ["止损金额", "Delta金额", "浮动盈亏"];
var quotaMonitorMultiple = 10000;
$(function () {
FastVue.numberInput(document.getElementById('QuotaRange-PercentDays'), { precision: 0 });
var postData = GetPostData();
@@ -40,6 +41,9 @@ $(function () {
$("#SingleUnderlyingRate").val(res.SingleUnderlyingRate);
quotaSettings = res.QuotaSettings;
_.forEach(quotaSettings, (item) => {
if (item.QuotaIndex.indexOf("名义本金") != -1) {
item.QuotaIndex = item.QuotaIndex + "(万)";
}
if (item.Percent) {
item.QuotaUpperLimit = item.QuotaUpperLimit == null || item.QuotaUpperLimit == undefined || item.QuotaUpperLimit == "NaN" || item.QuotaUpperLimit === "" ? "" : (Number.parseFloat(item.QuotaUpperLimit) * 100).toFixed(2);
item.QuotaLowerLimit = item.QuotaLowerLimit == null || item.QuotaLowerLimit == undefined || item.QuotaLowerLimit == "NaN" || item.QuotaLowerLimit === "" ? "" : (Number.parseFloat(item.QuotaLowerLimit) * 100).toFixed(2);
@@ -255,6 +259,13 @@ function save() {
item.QuotaLowerLimit = $("#" + v + "_QuotaLowerLimit").val() === "" ? "NaN" : removeThousands($("#" + v + "_QuotaLowerLimit").val());
item.WarningUpperLimit = $("#" + v + "_WarningUpperLimit").val() === "" ? "NaN" : removeThousands($("#" + v + "_WarningUpperLimit").val());
item.WarningLowerLimit = $("#" + v + "_WarningLowerLimit").val() === "" ? "NaN" : removeThousands($("#" + v + "_WarningLowerLimit").val());
if (item.QuotaIndex.indexOf("名义本金") != -1) {
item.QuotaIndex = item.QuotaIndex.replace("(万)", "");
item.QuotaUpperLimit = item.QuotaUpperLimi == "NaN" ?"NaN": item.QuotaUpperLimit * quotaMonitorMultiple;
item.QuotaLowerLimit = item.QuotaLowerLimit == "NaN" ? "NaN" : item.QuotaLowerLimit * quotaMonitorMultiple;
item.WarningUpperLimit = item.WarningUpperLimit == "NaN" ? "NaN" : item.WarningUpperLimit * quotaMonitorMultiple;
item.WarningLowerLimit = item.WarningLowerLimit == "NaN" ? "NaN" : item.WarningLowerLimit * quotaMonitorMultiple;
}
}
arr.push(item);
})