SysHelps.cshtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @using System.Web.Mvc.Html
  2. @using WeApp
  3. @using WeApp.Authorization
  4. @using WeApp.Configuration
  5. @using WeApp.Views.Shared.Modals
  6. @using WeApp.Views.Shared.SearchForm
  7. @using WeApp.Views.Shared.Table
  8. @{
  9. string activeMenu = PermissionNames.PagesSystemMgHelpMg; //The menu item will be active for this page.
  10. ViewBag.ActiveMenu = activeMenu;
  11. // List<SelectListItem> classification = ViewBag.Classification;
  12. List<SelectListItem> classification = new List<SelectListItem>();
  13. }
  14. @section css
  15. {
  16. }
  17. <section style="display:none">
  18. @Html.DropDownList("hid-classification", classification)
  19. </section>
  20. @{
  21. /**/
  22. ViewBag.Title = "系统帮助管理";
  23. var table = new TableViewModel(IwbConsts.ApiAppUrl + "Helps/GetAll", activeMenu, new SearchFormViewModel(new List<SearchItem>()
  24. {
  25. new SearchItem("classification", "帮助类别").SetSelectItem(classification)
  26. })).SetFields(new List<FieldItem>()
  27. {
  28. new FieldItem("helpTitle", "标题"),
  29. new FieldItem("helpKeyWords", "关键字信息"),
  30. new FieldItem("classification", "帮助类别", "ClassificationFormatter"),
  31. new FieldItem("sequence", "排序"),
  32. });
  33. }
  34. @Html.Partial("Table/_Table", table)
  35. @section modal{
  36. <!--Main Modal-->
  37. @{
  38. /**/
  39. var modal = new ModalViewModel("帮助", new ModalBodyViewModel(new List<Input>()
  40. {
  41. new Input("id", hide: true),
  42. new Input("helpTitle", "标题"),
  43. new Input("helpKeyWords", "关键字"),
  44. new Input("sequence", "序列"),
  45. new Input("classification", "帮助类别").SetSelectOptions(classification),
  46. new InputKindeditor("helpContent","帮助内容").SetLayout("col-sm-2","col-sm-12").SetNotRequired(),
  47. }), width: 700);
  48. @Html.Partial("Modals/_Modal", modal)
  49. }
  50. }
  51. @section scripts
  52. {
  53. <script type="text/javascript">
  54. $(function () {
  55. var $table= LoadTable();
  56. var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
  57. });
  58. </script>
  59. <script>
  60. function ClassificationFormatter(v) {
  61. var name = $('#hid-classification option[value="' + v + '"]').text();
  62. return '<span class="label label-info">' + name + '</span>';
  63. }
  64. </script>
  65. }