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

88 lines
3.1 KiB
Plaintext

@{
ViewBag.Title = "kemuMessage";
}
@model dccdc.Models.newsinfoModel
@section scripts{
<script type="text/javascript" src="@Url.Content("~/ueditor/ueditor.config.js")" charset="gb2312"></script>
<script type="text/javascript" src="@Url.Content("~/ueditor/ueditor.all.js")" charset="gb2312"></script>
<script type="text/javascript">
var editor;
$(function () {
editor = UE.getEditor("myEditor", { autoHeightEnabled: false, initialFrameHeight: 200, initialFrameWidth: 600 });
});
function save() {
var id = $("#id").val();
var bt = $("#bt").val();
var nr = editor.getContent();
var yd = $("#yd").val();
var zt = $("#zt").val();
if (!bt) {
$.ligerDialog.error("请填写详细信息!")
return;
}
$.ajax({
url: "@Url.Action("savenewsinfo")", type: "post", dataType: "json", data: { id: id, bt: bt, nr: nr, yd: yd, zt: zt },
success: function (d) {
$.ligerDialog.closeWaitting();
if (d.State == 0) {
$.ligerDialog.error("操作失败!");
}
else {
$.ligerDialog.success("操作成功!");
parent.init();
}
},
error:function(a,b,c){
console.log(c);
},
beforeSend: function () {
$.ligerDialog.waitting("正在进行请稍后……");
}
});
}
</script>
}
<div id="edit">
@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.TextBoxFor(m => m.bt, new { @class = "l-text" }) @Html.ValidationMessageFor(m => m.bt) </td>
</tr>
<tr>
<td class="ltd" width="100px">内容:</td>
<td class="rtd">
<script type="text/plain" id="myEditor">
@if (Model != null)
{
var h = new HtmlString(Model.nr);
@h;
}
</script>
</td>
</tr>
<tr>
<td class="ltd" width="100px">阅读:</td>
<td class="rtd">@Html.TextBoxFor(m => m.yd, new { @class = "l-text", @type = "number" }) @Html.ValidationMessageFor(m => m.yd)</td>
</tr>
<tr>
<td class="ltd" width="100px">状态:</td>
<td class="rtd">@Html.DropDownListFor(m => m.zt, ViewData["ztD"] as SelectList, "----请选择----")@Html.ValidationMessageFor(m => m.zt)</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="button" id="submitid" value="提交" class="l-button" onclick="save()" />
</div>
</td>
</tr>
</table>
</div>