118 lines
4.7 KiB
Plaintext
118 lines
4.7 KiB
Plaintext
@{
|
|
Layout = null;
|
|
RiskDailyReportLimit data = ViewBag.Data;
|
|
}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title></title>
|
|
<script src="~/statics/bundles/jquery.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
<script src="~/Scripts/utils.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
<script src="~/statics/bundles/bundle.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
<style>
|
|
.body {
|
|
padding: 10px;
|
|
}
|
|
|
|
.range {
|
|
padding: 5px;
|
|
width: auto;
|
|
display: flex;
|
|
}
|
|
|
|
.name {
|
|
padding: 5px;
|
|
width: 40%;
|
|
display: inline-block;
|
|
}
|
|
|
|
.value {
|
|
width: 40%;
|
|
padding: 2px;
|
|
}
|
|
|
|
.percent {
|
|
margin: 4px 0 0 -34px;
|
|
background-color: white;
|
|
height: 18px;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
function save() {
|
|
var options = {
|
|
url: "/risk/SetRiskDailyReportLimit",
|
|
data: { "riskLimits": [] },
|
|
success: function (data) {
|
|
if (!data.success) {
|
|
alert(data.msg);
|
|
return;
|
|
}
|
|
else {
|
|
window.parent.location.reload()
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
console("setTraderName error:" + JSON.stringify(msg));
|
|
//alert("error:" + msg);
|
|
}
|
|
};
|
|
var list = $("#limitParameter input");
|
|
for (var i = 0; i < list.length; i++) {
|
|
var limitName = $(list[i]).attr("title");
|
|
var limitValue = $(list[i]).val();
|
|
if (limitName == "场外期权_DeltaCash" || limitName == "场外期权_GammaCash") {
|
|
limitValue = limitValue / 100;
|
|
}
|
|
options.data["riskLimits"].push({ "LimitName": limitName, "LimitValue": limitValue });
|
|
}
|
|
main.ajax(options);
|
|
}
|
|
function checkData(obj, num) {
|
|
obj.value = parseFloat(obj.value).toFixed(num)
|
|
}
|
|
$(() => {
|
|
$("input[type='number']").on('change', checkData(this, 2));
|
|
$("input[type='number']").change();
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="body" id="limitParameter">
|
|
<div class="range">
|
|
<label class="name"> 年盈亏限额</label>
|
|
<input class="value" type="number" id="yearPnlLimitValue" onchange="checkData(this,2);" min="0" step="0.01" title="风控日报_年盈亏限额" value="@data.YearPnlLimit.LimitValue" />
|
|
</div>
|
|
<div class="range">
|
|
<label class="name"> 日盈亏限额</label>
|
|
<input class="value" type="number" id="dailyPnlLimitValue" onchange="checkData(this,2);" min="0" step="0.01" title="风控日报_日盈亏限额" value="@data.DailyPnlLimit.LimitValue" />
|
|
</div>
|
|
<div class="range">
|
|
<label class="name"> Delta盈亏限额</label>
|
|
<input class="value" type="number" id="deltaPnlLimitValue" onchange="checkData(this,2);" min="0" step="0.01" title="场外期权_Delta限额" value="@data.DeltaPnlLimit.LimitValue" />
|
|
</div>
|
|
<div class="range">
|
|
<label class="name"> Gamma盈亏限额</label>
|
|
<input class="value" type="number" id="gammaPnlLimitValue" onchange="checkData(this,2);" min="0" step="0.01" title="场外期权_Gamma限额" value="@data.GammaPnlLimit.LimitValue" />
|
|
</div>
|
|
<div class="range">
|
|
@*<label class="control-label "> DeltaCash基准</label>
|
|
<input type="text" id="deltaCashPercentBenchmark" value="@data.DeltaCashPercent.LimitBenchmark" />*@
|
|
<label class="name"> DeltaCash比例</label>
|
|
<input class="value" type="number" id="deltaCashPercentValue" onchange="checkData(this,2);" min="0" step="0.01" title="场外期权_DeltaCash" value="@(data.DeltaCashPercent.LimitValue * 100)" />
|
|
<span class="percent">%</span>
|
|
</div>
|
|
<div class="range">
|
|
@*<label class="control-label "> GammaCash基准</label>
|
|
<input type="text" id="gammaCashPercentBenchmark" value="@data.GammaCashPercent.LimitBenchmark" />*@
|
|
<label class="name"> GammaCash比例</label>
|
|
<input class="value" type="number" id="gammaCashPercentValue" onchange="checkData(this,2);" min="0" step="0.01" title="场外期权_GammaCash" value="@(data.GammaCashPercent.LimitValue * 100)" />
|
|
<span class="percent">%</span>
|
|
</div>
|
|
</div>
|
|
@MyControls.Btn("保存", "save()")
|
|
</body>
|
|
</html>
|