86 lines
3.6 KiB
Plaintext
86 lines
3.6 KiB
Plaintext
@model FtpSettings
|
|
|
|
@{
|
|
ViewBag.Title = "兴证数据中心接口";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
var valueDateStr = valuedateBLL.ValueDate.ToString("yyyy-MM-dd");
|
|
var ftpUploadUrl = Url.Action("XingZhengFtpUpload");
|
|
}
|
|
|
|
@section JS{
|
|
<script>
|
|
var valueDate = "@valueDateStr";
|
|
$(function () {
|
|
main.setTradeDatePicker(valueDate, "");
|
|
$("#valueDate").datepicker("option", "maxDate", valueDate);
|
|
});
|
|
function exportFile() {
|
|
$('#exportValueDate').val($("#valueDate").val());
|
|
$('#form2').submit();
|
|
}
|
|
function uploadFileToFtp() {
|
|
let data = $('#form1').serializeObject();
|
|
if (!data.valueDate) {
|
|
return main.alert('请填写持仓日期');
|
|
}
|
|
if (!data.FtpHost) {
|
|
return main.alert('FTP主机必须填写');
|
|
}
|
|
main.post('@(ftpUploadUrl)', data).done(function (resp) {
|
|
$('#ftpMsg').text(resp.obj.msg);
|
|
});
|
|
}
|
|
</script>
|
|
}
|
|
|
|
<div class="yc-panel" style="padding-bottom:200px;min-width:1100px;">
|
|
<h3 class="card-title">兴证数据中心接口</h3>
|
|
<form id="form1" onsubmit="return false;" autocomplete="off">
|
|
<div class="mt-4">
|
|
<span class="mr-1">  持仓日期: </span>
|
|
<input type="text" class="datepicker" value="@(valueDateStr)" name="valueDate" id="valueDate" placeholder="请输入持仓日期日期" autocomplete="off">
|
|
</div>
|
|
<div class="mt-4 border p-2 pb-3">
|
|
<div class="">FTP连接配置</div>
|
|
<div class="mt-3">
|
|
<div class="d-inline-block text-right" style="width:80px">主机IP: </div>
|
|
<input type="text" name="FtpHost" value="@(Model.FtpHost)" />
|
|
|
|
<div class="d-inline-block text-right ml-3" style="width:80px">端口: </div>
|
|
<input type="text" name="FtpPort" value="@(Model.FtpPort)" />
|
|
</div>
|
|
<div class="mt-3">
|
|
<div class="d-inline-block text-right" style="width:80px">用户名: </div>
|
|
<input type="text" name="FtpUser" value="@(Model.FtpUser)" />
|
|
|
|
<div class="d-inline-block text-right ml-3" style="width:80px">密码: </div>
|
|
<input type="password" name="FtpPwd" value="@(Model.FtpPwd)" />
|
|
</div>
|
|
<div class="mt-3">
|
|
<div class="d-inline-block text-right" style="width:80px">传输模式: </div>
|
|
<select name="FtpMode" value="@(Model.FtpMode)">
|
|
<option value="被动" @(Model.FtpMode == "被动" ? "selected" : "")>被动</option>
|
|
<option value="主动" @(Model.FtpMode == "主动" ? "selected" : "")>主动</option>
|
|
</select>
|
|
<div class="d-inline-block text-right ml-3" style="width: 80px">远程目录: </div>
|
|
<input type="text" name="FtpRoot" value="@(Model.FtpRoot)" style="width:350px;" />
|
|
</div>
|
|
<div class="mt-3">
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="mt-4">
|
|
<button class="btn btn-primary" type="button" onclick="exportFile();">导出到本地</button>
|
|
<button class="btn btn-primary" type="button" onclick="uploadFileToFtp();">上传到FTP</button>
|
|
</div>
|
|
|
|
<hr />
|
|
<p>上次操作记录:</p>
|
|
<p id="ftpMsg">@(ViewData["LastMsg"])</p>
|
|
</div>
|
|
|
|
<form id="form2" action="@Url.Action("XingZhengExport")" method="post" target="_blank">
|
|
<input type="hidden" id="exportValueDate" name="valueDate" />
|
|
</form> |