StudentHelp.cshtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @using WeApp
  2. @using WeApp.Configuration
  3. @using WeApp.Authorization
  4. @using WeApp.Views.Shared.Modals
  5. @using WeApp.Views.Shared.SearchForm
  6. @using WeApp.Views.Shared.Table
  7. @{
  8. ViewBag.Title = "学员提示信息";
  9. string activeMenu = PermissionNames.PagesBasicMgStudentHelpMg; //The menu item will be active for this page.
  10. ViewBag.ActiveMenu = activeMenu;
  11. var searchForm = new SearchFormViewModel(new List<SearchItem>()
  12. {
  13. new SearchItem("helpName","提示简称"),
  14. }, "search-form", false);
  15. var table = new TableViewModel(IwbConsts.ApiAppUrl + "StudentHelp/GetAll", activeMenu, searchForm)
  16. .SetFields(new List<FieldItem>()
  17. {
  18. new FieldItem("helpName", "提示简称").SetWidth(200),
  19. new FieldItem("helpContent", "提示内容"),
  20. });
  21. }
  22. @section css{
  23. }
  24. @Html.Partial("Table/_Table", table)
  25. @section modal{
  26. <!--Main Modal-->
  27. @{
  28. var modal = new ModalViewModel("演练角色", new ModalBodyViewModel(new List<Input>()
  29. {
  30. new InputHide("id"),
  31. new Input("helpName", "提示简称"),
  32. new InputTextarea("helpContent", "提示内容"),
  33. }));
  34. }
  35. @Html.Partial("Modals/_Modal", modal)
  36. }
  37. @section scripts
  38. {
  39. <script type="text/javascript">
  40. var $table;
  41. $(function () {
  42. $table = LoadTable();
  43. var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
  44. funs["btnCreate"] = function () { BtnCreate({ data: { id: "" } }); }
  45. funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
  46. });
  47. </script>
  48. <!--格式化-->
  49. <script id="formatter-script" type="text/javascript">
  50. function TypeFormatter(v) {
  51. var name = $('#hid-type option[value="' + v + '"]').text();
  52. switch (v) {
  53. case 0:
  54. return '<span class="label label-danger">' + name + '</span>';
  55. default:
  56. return '<span class="label label-info">' + name + '</span>';
  57. }
  58. }
  59. </script>
  60. }
  61. <section style="display: none">
  62. <select id="hid-type">
  63. <option value=""></option>
  64. </select>
  65. @*@Html.DropDownList("hid-type", type)*@
  66. </section>