Student.cshtml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @using WeApp.TrainingCampGroup.Dto
  2. @{
  3. Layout = "~/Views/Shared/Layout/_Layout.Stu.cshtml";
  4. CampGroupDto group = ViewBag.Group;
  5. ViewBag.Title = "学员屏(" + group.Name + ")";
  6. string id = group.Id,
  7. groupName = group.Name,
  8. campNo = group.CampNo;
  9. bool showTip = ViewBag.ShowTip;
  10. }
  11. @section css{
  12. <link href="~/Content/Css/ExerciseV2_1/stu-cmd.min.css" rel="stylesheet" />
  13. }
  14. @Html.Partial("Layout/V2/_Bg", false)
  15. <div class="box public no-select" style="">
  16. <div class="box-title">决策指令下达</div>
  17. <div class="box-body ">
  18. <div class="box-header">
  19. <span class="title">@(groupName)指挥部 —— 组员</span>
  20. </div>
  21. <div class="body">
  22. <div class="cmd-form">
  23. <div class="scene-box">
  24. </div>
  25. <div class="role-box">
  26. <div class="body-card select-box">
  27. <select class="form-control " id="role-select" name="role" style="width: 100%" autocomplete="off" placeholder="请选择角色" onchange="GetTipInfo(); $(this).val()=='self'?$('.input-box').show():$('.input-box').hide()"></select>
  28. </div>
  29. <div class="body-card input-box ">
  30. <input class="form-control " id="role-input" name="self-role" style="width: 100%" autocomplete="off" placeholder="请输入自定义角色" />
  31. </div>
  32. </div>
  33. <div class="d-flex">
  34. <div class="cmd-box body-card" style="width: 100%">
  35. <textarea class="form-control txt" rows="6" name="message" placeholder="请输入指令内容"></textarea>
  36. @if (showTip)
  37. {
  38. <button type="button" class="btn btn-submit " onclick="ShowTips(this)">打开辅助提示</button>
  39. }
  40. </div>
  41. @if (showTip)
  42. {
  43. <div class="tip-box body-card" style="margin-left: 10px;">
  44. <div class="tip-header">辅助提示</div>
  45. <div class="tip-body"></div>
  46. </div>
  47. }
  48. </div>
  49. <div class="body-card">
  50. <button type="button" class="btn btn-submit" style="width: 150px;" onclick="RoleHandle(this)">提交指令</button>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div style="position: absolute; left: 0; bottom: 0; color: #ddd; opacity: 0.5;">@(groupName)</div>
  56. </div>
  57. @section scripts
  58. {
  59. <script src="~/Content/Js/V2.1/stu-cmd.js"></script>
  60. <script>
  61. setCampGroup("@(campNo)", "@(id)", @(showTip?"true":"false"), "SaveOperationScene");
  62. function resizeHeight_Cmd() {
  63. var fs = 38;
  64. var h = $("#bg_header").height();
  65. var newFs = fs * h / 126;
  66. $(".box .box-title").height(h)
  67. .css("fontSize", newFs + "px");
  68. var sh = $(".box .scene-box").height();
  69. resizeHeight((h, wh) => {
  70. var height = 265;
  71. $(".cmd-box,.tip-box").height(wh - h - height - sh);
  72. })
  73. }
  74. </script>
  75. <script id="hub">
  76. abp.signalr.connect(['@(id)','@(campNo)']);
  77. iwbHub.client.getReloadAll = function (msg) {
  78. console.log('getReloadAll: ', msg);
  79. if (msg) {
  80. try {
  81. var data = JSON.parse(msg);
  82. if (data) {
  83. if (data.no == '@(id)'|| data.no == '@(campNo)') {
  84. window.location.reload();
  85. }
  86. }
  87. } catch (e) {
  88. console.log('getReloadAll: ', e);
  89. }
  90. }
  91. };
  92. iwbHub.client.getReloadStu = function (msg) {
  93. console.log('getReloadStu: ', msg);
  94. if (msg) {
  95. try {
  96. var data = JSON.parse(msg);
  97. if (data) {
  98. if (data.no == '@(id)'|| data.no == '@(campNo)') {
  99. window.location.reload();
  100. }
  101. }
  102. } catch (e) {
  103. console.log('getReloadStu: ', e);
  104. }
  105. }
  106. };
  107. iwbHub.client.getNewScene = function(msg) {
  108. console.log('getNewScene: ', msg);
  109. if (msg) {
  110. try {
  111. var data = typeof msg == 'string' ? JSON.parse(msg) : msg;
  112. if (data) {
  113. if (data.no == '@(id)') {
  114. RefeshRunningScene();
  115. }
  116. }
  117. } catch (e) {
  118. console.log('getNewScene: ', e);
  119. }
  120. }
  121. };
  122. iwbHub.client.getRefreshScene = function(msg) {
  123. console.log('getRefreshScene: ', msg);
  124. if (msg && msg == '@(id)') {
  125. RefeshRunningScene(true);
  126. }
  127. };
  128. </script>
  129. }