Manual.cshtml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. @using WeApp.TrainingCampGroup.Dto
  2. @{
  3. Layout = "~/Views/Shared/Layout/_Layout.Spec.cshtml";
  4. string campName = ViewBag.CampName;
  5. ViewBag.Title = "手动记录演练情况(" + campName + ")";
  6. List<CampGroupDto> groups = ViewBag.Groups;
  7. string groupSelects = "<option value=\"\">请选择培训营分组...</option>";
  8. if (groups != null && groups.Any())
  9. {
  10. foreach (var g in groups)
  11. {
  12. groupSelects += "<option value=\"" + g.Id + "\">" + g.Name + "</option>";
  13. }
  14. }
  15. }
  16. <style>
  17. .main-box{
  18. display: flex;
  19. justify-content: center;
  20. align-items: center;
  21. background-image: linear-gradient(45deg,#005f61,#007f61);
  22. }
  23. .box {
  24. margin-top: -10%;
  25. width: 80%;
  26. max-width: 400px;
  27. }
  28. .box .title {
  29. text-align: center;
  30. font-size: 20px;
  31. font-weight: 600;
  32. color: #fff;
  33. padding: 10px;
  34. }
  35. @@media(min-device-width: 700px) {
  36. .box {
  37. max-width: 600px;
  38. }
  39. .box .title {
  40. font-size: 26px;
  41. padding: 15px;
  42. }
  43. }
  44. </style>
  45. <div class="main-box" style="height: 100vh; width: 100vw; box-sizing: padding-box; position: relative">
  46. <div class="box">
  47. <div class="title">演练情况记录</div>
  48. <div class="form-group">
  49. <select id="group" class="form-control" style="width: 100%">
  50. @Html.Raw(groupSelects)
  51. </select>
  52. </div>
  53. <div class="form-group">
  54. <textarea id="txt" class="form-control" style="width: 100%; height: 100px;" placeholder="请输入内容..."></textarea>
  55. </div>
  56. <button id="btn" class="btn btn-iwb btn-block" type="button" onclick="Go()">记录演练实时情况</button>
  57. </div>
  58. </div>
  59. @section scripts
  60. {
  61. <script src="~/Content/Js/scene-path.js"></script>
  62. <script>
  63. function Go() {
  64. var no = $("#group").val();
  65. if (!no) {
  66. abp.message.warn("请选择一个培训营分组!");
  67. return;
  68. }
  69. var txt = $("#txt").val();
  70. if (!txt) {
  71. abp.message.warn("请输入内容!");
  72. return;
  73. }
  74. $("#btn").prop("disable", true);
  75. $.iwbAjax1({
  76. url: abp.appUrl + "Eval/ManualLog",
  77. data: { no: no, msg: txt },
  78. success: function () {
  79. $("#txt").val("");
  80. }
  81. });
  82. setTimeout(function () { $("#btn").prop("disable", false); }, 1000 * 10);
  83. }
  84. </script>
  85. }