_SelectCamp2.cshtml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. @using IwbZero.ToolCommon.StringModel
  2. @using WeApp.Helpers
  3. @model WeApp.Views.Shared.Camp.SelectCampModel
  4. @{
  5. string url = Model.PageUrl.Ew("/"), camps = Model.CampSelect,title = Model.PageTitle;
  6. bool hasGroup = Model.HasGroup;
  7. }
  8. <!-- TABLE SELECTCAMP START-->
  9. <style>
  10. body {
  11. --c: #fff;
  12. --bc: #eee;
  13. }
  14. .content-wrapper {
  15. height: calc(100vh - 110px);
  16. padding: 0 !important;
  17. overflow: hidden;
  18. }
  19. .body {
  20. width: 100%;
  21. height: 100vh;
  22. background-image: linear-gradient(45deg,#005f61,#007f61);
  23. /*background-image: url('../../../Content/Image/bg_blue.png');*/
  24. /*background-image: url('../../../Content/Image/Stu/bg-lg-1.png');
  25. background-size: 100%;*/
  26. }
  27. .select-page {
  28. width: 100%;
  29. min-height: calc(100vh - 420px);
  30. display: flex;
  31. justify-content: center;
  32. align-items: center;
  33. }
  34. .select-box {
  35. margin-top: 150px;
  36. margin-left: -10px;
  37. width: 400px;
  38. display: flex;
  39. flex-direction: column;
  40. justify-content: center;
  41. }
  42. .select-box .title {
  43. color: var(--c);
  44. font-size: 20px;
  45. font-weight: 600;
  46. text-align: center;
  47. margin-bottom: 15px;
  48. }
  49. .select-box .select2-container--default .select2-selection--single {
  50. border: 1px solid var(--bc);
  51. border-radius: 20px;
  52. background: rgba(0,0,0,.1);
  53. height: 38px;
  54. outline: none;
  55. }
  56. .select2-container--default .select2-selection--single .select2-selection__rendered {
  57. color: var(--c);
  58. }
  59. .select-box .select2-container--default .select2-selection--single .select2-selection__arrow {
  60. top: 6px;
  61. right: 5px;
  62. }
  63. .select2-container--default .select2-selection--single .select2-selection__arrow b {
  64. border-color: var(--bc) transparent transparent transparent;
  65. }
  66. .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  67. border-color: transparent transparent var(--bc) transparent;
  68. }
  69. .select2-container--open .select2-dropdown {
  70. left: 0;
  71. background: var(--c);
  72. background: rgba(0,0,0,.5);
  73. border-color: var(--bc);
  74. padding: 5px 0 15px;
  75. border-radius: 0 0 20px 20px;
  76. }
  77. .select2-results__option[aria-selected] {
  78. color: #ddd;
  79. }
  80. .select2-container--default .select2-results__option[aria-selected=true] {
  81. background-color: rgba(0,0,0,.1);
  82. color: #fff;
  83. }
  84. .select2-container--default .select2-results__option--highlighted[aria-selected] {
  85. background-color: rgba(0,0,0,.1);
  86. /*color: var(--c);*/
  87. font-weight: 600;
  88. }
  89. .select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted[aria-selected]:hover {
  90. background-color: rgba(0,0,0,.2);
  91. color: #fff;
  92. }
  93. .select2-search--dropdown {
  94. display: none;
  95. }
  96. .select-box .btn-box {
  97. width: 100%;
  98. text-align: center;
  99. }
  100. .select-box .btn {
  101. color: var(--c);
  102. border: 1px solid var(--bc);
  103. border-radius: 20px;
  104. min-width: 100px;
  105. background: rgba(0,0,0,.1);
  106. margin: 10px auto;
  107. }
  108. .select-box .btn:hover {
  109. font-weight: 600;
  110. background: rgba(0,0,0,.2);
  111. }
  112. </style>
  113. <div class="body">
  114. <div class="select-page">
  115. <div class="select-box">
  116. <div class="title">选择演练培训营</div>
  117. <form>
  118. <div class="form-group">
  119. <select id="camp" class="form-control" style="width: 100%">
  120. @(Html.Raw(camps))
  121. </select>
  122. </div>
  123. @if (hasGroup)
  124. {
  125. <div class="form-group">
  126. <select id="camp-group" class="form-control" style="width: 100%">
  127. <option value="">请选择培训营分组</option>
  128. </select>
  129. </div>
  130. }
  131. <div class="btn-box">
  132. <button class="btn" type="button" onclick="Go()">确定</button>
  133. </div>
  134. </form>
  135. </div>
  136. </div>
  137. </div>
  138. @using (Html.BeginScripts())
  139. {
  140. <script>
  141. function Go() {
  142. var no = $("#camp").val();
  143. if (no) {
  144. @if (hasGroup)
  145. {
  146. <text>
  147. var groupNo = $("#camp-group").val();
  148. if (groupNo) {
  149. window.location.href = '@(url)' + groupNo ;
  150. } else {
  151. abp.message.warn("请选择一个分组!");
  152. }
  153. </text>
  154. }
  155. else
  156. {
  157. <text>
  158. window.location.href = '@(url)' + no;
  159. </text>
  160. }
  161. } else {
  162. abp.message.warn("请选择一个培训营!");
  163. }
  164. }
  165. $(function () {
  166. //document.title = '@(title)' + document.title;
  167. $("#camp").select2();
  168. @if (hasGroup)
  169. {
  170. <text>
  171. $("#camp-group").select2();
  172. var campNo = "";
  173. $("#camp").on('change',function() {
  174. var no = $("#camp").val();
  175. if (no && campNo != no) {
  176. campNo = no;
  177. $.iwbAjax4({
  178. url: abp.appUrl + 'Query/GetCampGroupSelectStr?no='+no,
  179. success: function(res) {
  180. $("#camp-group").html(res).select2();
  181. }
  182. });
  183. }
  184. });
  185. </text>
  186. }
  187. });
  188. </script>
  189. }
  190. <!-- TABLE SELECTCAMP END-->