123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- @{
- ViewBag.Title = "公告管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <link href="~/Content/scripts/plugins/simditor/css/simditor.css" rel="stylesheet" />
- <script src="~/Content/scripts/plugins/simditor/js/module.min.js"></script>
- <script src="~/Content/scripts/plugins/simditor/js/uploader.min.js"></script>
- <script src="~/Content/scripts/plugins/simditor/js/hotkeys.min.js"></script>
- <script src="~/Content/scripts/plugins/simditor/js/simditor.min.js"></script>
- <link href="~/Content/scripts/plugins/cxColor/css/jquery.cxcolor.css" rel="stylesheet" />
- <script src="~/Content/scripts/plugins/cxColor/js/jquery.cxcolor.js"></script>
- <script>
- var keyValue = request('keyValue');
- var editor = null;
- $(function () {
- editor = new Simditor({
- textarea: $('#NewsContent'),
- placeholder: '这里输入公告内容...',
- toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent']
- });
- initControl();
- })
- //初始化控件
- function initControl() {
- //公告类别
- $("#Category").ComboBox({
- param: { EnCode: "NoticeCategory" },
- url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
- description: "==请选择==",
- id: "ItemValue",
- text: "ItemName",
- height: "230px"
- });
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "../../PublicInfoManage/Notice/GetFormJson",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- editor.setValue(data.NewsContent);
- $("#FullHead").attr("color", data.FullHeadColor).css("color", data.FullHeadColor);
- }
- });
- }
- }
- //选择颜色-设置标题色彩
- function SelectColorEvent() {
- var mycolor = $("#select_color").cxColor();
- mycolor.show();
- $("#select_color").bind("change", function () {
- $("#FullHead").css("color", this.value).attr("color", this.value);
- });
- }
- //保存表单
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = {
- FullHead: $("#FullHead").val(),
- FullHeadColor: $('#FullHead').attr('color'),
- Category: $("#Category").attr('data-value'),
- ReleaseTime: $("#ReleaseTime").val(),
- NewsContent: editor.getValue()
- }
- $.SaveForm({
- url: "../../PublicInfoManage/Notice/SaveForm?keyValue=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <div style="margin-top: 20px; margin-right: 30px;">
- <table class="form" style="table-layout: auto;">
- <tr>
- <td class="formTitle">公告标题<font face="宋体">*</font></td>
- <td class="formValue" colspan="3">
- <input id="FullHead" type="text" class="form-control" style="color: #000000;" placeholder="请输入标题" isvalid="yes" checkexpession="NotNull" />
- <span id="select_color" class="input-button" style="width: 18px; margin-top: -9px; height: auto;" title="使用彩色标题" onclick="SelectColorEvent()">
- <img src="~/Content/images/large_tiles.png" /></span>
- </td>
- </tr>
- <tr>
- <td class="formTitle">公告类别<font face="宋体">*</font></td>
- <td class="formValue">
- <div id="Category" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull" ></div>
- </td>
- <td class="formTitle">发布时间</td>
- <td class="formValue">
- <input id="ReleaseTime" readonly type="text" class="form-control" value="@LeaRun.Util.Time.GetToday("yyyy/MM/dd HH:mm")" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">信息来源</td>
- <td class="formValue">
- <input id="SourceName" type="text" class="form-control" />
- </td>
- <td class="formTitle">来源地址</td>
- <td class="formValue">
- <input id="SourceAddress" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle" valign="top" style="padding-top: 4px;">公告内容</th>
- <td class="formValue" colspan="3">
- <textarea id="NewsContent" class="form-control" rows="5"></textarea>
- </td>
- </tr>
- </table>
- </div>
|