History.cshtml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @using WeOnlineApp.Configuration
  2. @using WeOnlineApp.Views.Shared.Table
  3. @{
  4. Layout = "~/Views/Shared/Layout/_Layout.Play.cshtml";
  5. ViewBag.PageId = "history";
  6. ViewBag.Title = "演练历史";
  7. var table = new TableViewModel(IwbConsts.ApiAppUrl + "CampPlay/GetHistoryPlay", hasBox: false)
  8. .SetFields(new List<FieldItem>()
  9. {
  10. new FieldItem("name", "演练名称",isSort:false),
  11. new FieldItem("campName", "培训营名称",isSort:false),
  12. new FieldItem("packageName", "演练主题",isSort:false),
  13. new FieldItem("playModel", "演练模式","PlayModelFormatter",isSort:false),
  14. new FieldItem("startDate", "演练日期","DateFormatter",isSort:false),
  15. //new FieldItem("endDate", "开始时间","DateTimeFormatter"),
  16. new FieldItem("trainingMinute", "演练时长","MinuteFormatter",isSort:false),
  17. new FieldItem("id", "","ActionFormatter",isSort:false),
  18. });
  19. }
  20. <style>
  21. .bs-checkbox .iwb-checkbox > span {
  22. top: -5px;
  23. left: 3px;
  24. height: 17px;
  25. width: 17px;
  26. color: #008080;
  27. }
  28. .bootstrap-table .table thead > tr > th {
  29. padding: 0;
  30. margin: 0;
  31. background: #008080;
  32. color: #fff;
  33. }
  34. .bootstrap-table .fixed-table-container {
  35. border: 1px solid #008080;
  36. border-top: none;
  37. }
  38. .fixed-table-container tbody tr td {
  39. color: #008080;
  40. }
  41. .fixed-table-container tbody tr.selected td {
  42. background: #008080;
  43. color: #fff;
  44. }
  45. .fixed-table-container tbody tr.selected .iwb-checkbox > span {
  46. background: #fff;
  47. }
  48. .fixed-table-pagination .pagination-info {
  49. color: #008080;
  50. }
  51. .table-action {
  52. cursor: pointer;
  53. }
  54. </style>
  55. @Html.Partial("Table/_Table", table)
  56. @section scripts
  57. {
  58. <script>
  59. $(function() {
  60. LoadTable({
  61. height: $(window).height() - 10
  62. });
  63. })
  64. </script>
  65. <script>
  66. function Report(id) {
  67. window.open('/Play/Report/' + id, '_blank');
  68. }
  69. function ActionFormatter(v, r) {
  70. return '<span class="table-action" onclick="Report(\'{0}\')" target="_blank">{1}查看报告</span>'.format(r.id,icon);
  71. }
  72. function MinuteFormatter(v) {
  73. return v + "分钟";
  74. }
  75. function PlayModelFormatter(v) {
  76. var name = $('#hid-play-model option[value="' + v + '"]').text();
  77. switch (v) {
  78. case @(CampPlayModelDefinition.Team):
  79. return '<span class="label label-success">' + name + '</span>';
  80. default:
  81. return '<span class="label label-danger">' + name + '</span>';
  82. }
  83. }
  84. </script>
  85. }
  86. <section style="display: none">
  87. @*<select id="hid-state">
  88. @Html.Raw(state)
  89. </select>*@
  90. <select id="hid-play-model" class="float-label required" autocomplete="off">
  91. <option value="@(CampPlayModelDefinition.Team)">团队合作演练</option>
  92. <option value="@(CampPlayModelDefinition.Single)">单人演练</option>
  93. </select>
  94. @*@Html.DropDownList("hid-type", type)*@
  95. </section>