76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
@model IEnumerable<VarietyVolAdjustModel>
|
|
|
|
@{
|
|
ViewBag.Title = "品种波动率调整";
|
|
Layout = "~/Views/Shared/_LayoutMini.cshtml";
|
|
}
|
|
|
|
@section CSS{
|
|
<style>
|
|
form { border: 0; margin: 0; padding: 0; }
|
|
</style>
|
|
}
|
|
@section JS{
|
|
<script>
|
|
function saveData(varietyId) {
|
|
var val = $('#Volitality' + varietyId).val();
|
|
val = parseFloat(val);
|
|
if (!val) {
|
|
return main.alert('请输入数值');
|
|
}
|
|
main.post("@Url.Action("AjaxSaveAdjust")", { VarietyId: varietyId, Volitality: val/100 });
|
|
}
|
|
|
|
$(function () {
|
|
$('#form1').on('submit', function () {
|
|
var fileName = $('#openFile').val();
|
|
if (!fileName) {
|
|
main.message("请选择文件!");
|
|
return false;
|
|
}
|
|
return true;
|
|
});
|
|
});
|
|
</script>
|
|
}
|
|
|
|
<div class="well">
|
|
<form id="form1" method="post" action="@Url.Action("Import")" enctype="multipart/form-data">
|
|
<input type="file" id="openFile" name="file" accept=".csv" style="display:inline;" />
|
|
<button type="submit" class="btn btn-primary">导入数据</button>
|
|
<a class="btn btn-primary" href="@Url.Action("TemplateFile")">模板文件</a>
|
|
</form>
|
|
</div>
|
|
@{
|
|
var result = ViewData["ImportResult"] as ImportResultModel;
|
|
if (result != null)
|
|
{
|
|
@await Html.PartialAsync("~/Views/Common/ImportResult.cshtml", result)
|
|
}
|
|
}
|
|
|
|
<table class="table table-sm table-center">
|
|
<colgroup>
|
|
<col span="1" width="150" />
|
|
<col span="1" width="200" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th>品种代码</th>
|
|
<th>历史波动率(%)</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model)
|
|
{
|
|
<tr>
|
|
<td>@(item.VarietyCode)</td>
|
|
<td>
|
|
<input type="number" id="Volitality@(item.VarietyId)" min="-999999" max="999999" step="0.01" value="@(item.Volitality*100)" onkeyup="event.keyCode!==13||saveData(@(item.VarietyId))" /> %
|
|
</td>
|
|
<td class="text-left"><button class="btn btn-primary btn-sm" onclick="saveData(@(item.VarietyId))">保存</button></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table> |