ReportTemplate.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. @using WePlatform
  2. @using WePlatform.Configuration
  3. @using WePlatform.Authorization
  4. @using WePlatform.Views.Shared.Modals
  5. @using WePlatform.Views.Shared.SearchForm
  6. @using WePlatform.Views.Shared.Table
  7. @{
  8. ViewBag.Title = "评估报告模板";
  9. string activeMenu = PermissionNames.PagesEngineModelMgEvalReportTemplateMg; //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("name","模板名称"),
  14. new SearchItem("version","模板版本"),
  15. },"search-form",false);
  16. var table = new TableViewModel(IwbConsts.ApiAppUrl + "EvalReportTemplate/GetAll", activeMenu, searchForm)
  17. .SetFields(new List<FieldItem>()
  18. {
  19. new FieldItem("name", "模板名称"),
  20. new FieldItem("version", "模板版本"),
  21. new FieldItem("description", "模板描述"),
  22. });
  23. }
  24. @section css{
  25. }
  26. @Html.Partial("Table/_Table", table)
  27. @section modal{
  28. <!--Main Modal-->
  29. @{
  30. var modal = new ModalViewModel("模板", new ModalBodyViewModel(new List<Input>()
  31. {
  32. new InputHide("id"),
  33. new Input("name", "模板名称"),
  34. new Input("version", "模板版本"),
  35. new InputTextarea("description", "模板描述").SetNotRequired(),
  36. }));
  37. }
  38. @Html.Partial("Modals/_Modal", modal)
  39. }
  40. @section scripts
  41. {
  42. <script type="text/javascript">
  43. var $table;
  44. $(function () {
  45. $table = LoadTable();
  46. var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
  47. funs["btnCreate"] = function() { BtnCreate({ data: { id: "" } }); }
  48. funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
  49. });
  50. </script>
  51. <!--格式化-->
  52. <script id="formatter-script" type="text/javascript">
  53. function TypeFormatter(v) {
  54. var name = $('#hid-type option[value="' + v + '"]').text();
  55. switch (v) {
  56. case 0:
  57. return '<span class="label label-danger">' + name +'</span>';
  58. default:
  59. return '<span class="label label-info">' + name +'</span>';
  60. }
  61. }
  62. </script>
  63. }
  64. <section style="display: none">
  65. <select id="hid-type">
  66. <option value=""></option>
  67. </select>
  68. @*@Html.DropDownList("hid-type", type)*@
  69. </section>