Engine.cshtml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @using Abp.Runtime.Session
  2. @using WePlatform
  3. @using WePlatform.Configuration
  4. @using WePlatform.Authorization
  5. @using WePlatform.Views.Shared.Modals
  6. @using WePlatform.Views.Shared.SearchForm
  7. @using WePlatform.Views.Shared.Table
  8. @{
  9. ViewBag.Title = "推演引擎管理";
  10. string activeMenu = PermissionNames.PagesEngineModelMgEngineMg; //The menu item will be active for this page.
  11. ViewBag.ActiveMenu = activeMenu;
  12. var searchForm = new SearchFormViewModel(new List<SearchItem>()
  13. {
  14. new SearchItem("engineName","引擎名称"),
  15. }, "search-form", false);
  16. var table = new TableViewModel(IwbConsts.ApiAppUrl + "Engine/GetAll", activeMenu, searchForm)
  17. .SetFields(new List<FieldItem>()
  18. {
  19. new FieldItem("engineName", "引擎名称"),
  20. new FieldItem("version", "引擎版本"),
  21. //new FieldItem("description", "引擎描述"),
  22. new FieldItem("engineTypeName", "引擎类型名称"),
  23. });
  24. }
  25. @section css{
  26. }
  27. @Html.Partial("Table/_Table", table)
  28. @section modal{
  29. <!--Main Modal-->
  30. @{
  31. var inputs = new List<Input>()
  32. {
  33. new InputHide("id"),
  34. new Input("engineName", "引擎名称").SetNotRequired(),
  35. new Input("version", "引擎版本").SetNotRequired(),
  36. new InputTextarea("description", "引擎描述").SetNotRequired()
  37. };
  38. if (AbpSession.UserType == UsersAndRolesTypeDefinition.Supper)
  39. {
  40. inputs.Add(new Input("engineTypeName", "引擎类型名称").SetNotRequired());
  41. }
  42. var modal = new ModalViewModel("引擎", new ModalBodyViewModel(inputs));
  43. }
  44. @Html.Partial("Modals/_Modal", modal)
  45. }
  46. @section scripts
  47. {
  48. <script type="text/javascript">
  49. var $table;
  50. $(function () {
  51. $table = LoadTable();
  52. var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
  53. funs["btnCreate"] = function () { BtnCreate({ data: { id: "" } }); }
  54. funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
  55. });
  56. </script>
  57. <!--格式化-->
  58. <script id="formatter-script" type="text/javascript">
  59. function TypeFormatter(v) {
  60. var name = $('#hid-type option[value="' + v + '"]').text();
  61. switch (v) {
  62. case 0:
  63. return '<span class="label label-danger">' + name + '</span>';
  64. default:
  65. return '<span class="label label-info">' + name + '</span>';
  66. }
  67. }
  68. </script>
  69. }
  70. <section style="display: none">
  71. <select id="hid-type">
  72. <option value=""></option>
  73. </select>
  74. @*@Html.DropDownList("hid-type", type)*@
  75. </section>