tijian_tieying/web/dccdc/Views/Dictionaries/xcximgMessage.cshtml
2025-02-20 12:14:39 +08:00

97 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@{
ViewBag.Title = "kemuMessage";
}
@model dccdc.Models.xcximgModel
@section scripts{
<script type="text/javascript">
function success(data) {
if (data.State == "1") {
$.ligerDialog.alert(data.Message,
function () {
window.parent.init();
});
}
}
$(function () {
//上传文件
$("#file1").on("change", function () {
$.ajax({
url: "@Url.Action("uploadFile")",
type: 'POST',
cache: false,
data: new FormData($('#fileForm')[0]),
processData: false,
contentType: false,
dataType: "json",
beforeSend: function () {
$.ligerDialog.waitting("正在进行请稍后……");
},
success: function (data) {
$.ligerDialog.closeWaitting();
if (data.state) {
$("#path").val(data.url)
}
else {
$.ligerDialog.error(data.msg);
}
}
});
});
})
</script>
}
<div id="edit">
<table class="t1" style="width: 100%">
<tr>
<td class="ltd" width="100px">上传图片:</td>
<td class="rtd">
<form id="fileForm" enctype='multipart/form-data'>
<input type="file" name="file1" id="file1" />
</form>
</td>
</tr>
</table>
@using (Ajax.BeginForm("xcximgMessage", new AjaxOptions { HttpMethod = "Post", OnSuccess = "success" }))
{
@Html.HiddenFor(m => m.id, new { id = "id" })
<table class="t1" style="width: 100%">
<tr>
<td class="ltd" width="100px">图片路径:</td>
<td class="rtd">
@Html.HiddenFor(m => m.path)
@if (!string.IsNullOrEmpty(Model.path))
{
<a href="@Model.path">下载 @Model.path</a>
}
</td>
</tr>
<tr>
<td class="ltd" width="100px">url</td>
<td class="rtd">@Html.TextBoxFor(m => m.url, new { @class = "l-text" }) @Html.ValidationMessageFor(m => m.url) </td>
</tr>
<tr>
<td class="ltd" width="100px">排序:</td>
<td class="rtd">@Html.TextBoxFor(m => m.sort, new { @class = "l-text l-text-field-number", @type = "number" }) @Html.ValidationMessageFor(m => m.sort) </td>
</tr>
<tr>
<td class="ltd" width="100px">状态:</td>
<td class="rtd">@Html.DropDownListFor(m => m.zt, ViewData["ztD"] as SelectList, "----请选择----", new { @class = "l-text" })@Html.ValidationMessageFor(m => m.zt)</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" id="submitid" value="提交" class="l-button" />
</div>
</td>
</tr>
</table>
}
</div>