| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @{
- /**/
- ViewBag.ActiveMenu = PermissionNames.PagesSystemSysHelp; //The menu item will be active for this page.
- ViewBag.Title = "系统帮助管理";
- List<SelectListItem> classification = ViewBag.Classification;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("classification","帮助类别",FiledType.S )
- .SetSearchItem(classification)
- }, false);
- }
- @section css
- {
-
- <link href="~/Content/Plugins/kindeditor/themes/default/default.css" rel="stylesheet" />
- }
- <div class="table-box mr-4 iwb-bootstrap-table">
- @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
- <table id="table"
- data-url="/api/services/app/SysHelps/GetAll"
- data-striped="true" data-id-field="id" data-unique-id="id"
- data-method="post"
- data-side-pagination="server"
- data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false"
- data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
- data-query-params="QueryParams"
- data-response-handler="ResponseHandler"
- data-click-to-select="true"
- data-single-select="true">
- <thead>
- <tr class="row" id="header">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="helpTitle">角色编号</th>
- <th data-align="center" data-field="helpKeyWords">关键字信息</th>
- <th data-align="center" data-field="classificationShow">帮助类别</th>
- <th data-align="center" data-field="sequence">排序</th>
- </tr>
- </thead>
- </table>
- </div>
- @section modal{
- <section>
- <!--Main Modal-->
- <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("系统帮助"))
- @{
- var inputs = new List<InputViewModel>
- {
- new InputViewModel("id", hide: true),
- new InputViewModel("helpTitle", displayName: "标题"),
- new InputViewModel("helpKeyWords", displayName: "关键字信息"),
- new InputViewModel("sequence", displayName: "序列"),
- new InputViewModel("classification",InputTypes.List, "帮助类别")
- .SetSelectOptions(classification),
- new InputViewModel("helpContent",InputTypes.Textarea, "内容").SetNotRequired(),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
- @Html.Partial("Modals/_ModalFooter", "0")
- </div>
- </div>
- </div>
- </section>
- }
- @section scripts
- {
- <script src="~/Content/Plugins/kindeditor/kindeditor-all.js"></script>
- <script src="~/Content/Plugins/kindeditor/lang/zh-CN.js"></script>
- <script type="text/javascript">
- var KeditOptions = {
- resizeType: 1,
- width: "100%",
- height: "300px",
- uploadJson: '@Url.Action("KindEditorUploadFile", "System")',
- allowUpload: true,
- //allowImageUpload: true,
- //allowImageRemote: false,
- //formatUploadUrl: false,
- afterChange: function() {
- this.sync();
- },
- afterBlur: function() {
- this.sync();
- },
- items: [
- 'formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', '|', 'justifyleft', 'justifycenter', 'justifyright',
- 'justifyfull', 'strikethrough', 'lineheight', 'removeformat', '|', 'source', 'preview', '/', 'undo',
- 'redo', 'template',
- 'plainpaste', 'wordpaste', '|', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
- 'subscript',
- 'superscript', 'clearhtml', 'quickformat', 'selectall',
- 'image',
- 'insertfile', 'table', 'hr', 'emoticons', 'pagebreak', 'fullscreen',
- 'link', 'unlink'
- ]
- }
- /*var editor;
- function Kedit($Content) {
- editor = KindEditor.create($Content, KeditOptions);
- }*/
- $(function () {
- //show完毕前执行
- /*$('#modal').on('shown.bs.modal',
- function () {
- //加上下面这句!解决了~
- $(document).off('focusin.modal');
- // 打开Dialog后创建编辑器
- //Kedit("#helpContent");
- });
- //hide完毕前执行
- $('#modal').on('hidden.bs.modal',
- function () {
- // 关闭Dialog前移除编辑器
- //KindEditor.remove('#helpContent');
- });//show完毕前执行*/
-
- LoadTable();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- //funs["btnUpdate"] = function () { BtnUpdate({ readonly: "name" }); };
- KindEditor.create("#helpContent", KeditOptions);
- funs["btnUpdate"] = function () {
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- BtnUpdate({ readonly: "" });
- setTimeout(function () {
- KindEditor.html("#helpContent", rows[0].helpContent);
- },
- 500);
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- };
- funs["btnCreate"] = function () {
- BtnCreate();
- //KindEditor.html("#discription", '');
- setTimeout(function() {
- KindEditor.html("#helpContent", "");
- },
- 500);
- }
- });
- </script>
- }
|