Manual.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. <link href="~/Content/Css/ExerciseV2/stu-cmd.css" rel="stylesheet" />
  17. @Html.Partial("Layout/V2/_Bg", true)
  18. <div class="box">
  19. <div id="bg_title">
  20. <span class="title">演练情况记录</span>
  21. </div>
  22. <div class="form-box" style="height: calc(100vh - 126px); display: flex; justify-content: center; align-items: center; ">
  23. <form class="form" style="width: 500px; margin-top: -10%; ">
  24. <div class="form-group">
  25. <select id="group" class="form-control" style="width: 100%">
  26. @Html.Raw(groupSelects)
  27. </select>
  28. </div>
  29. <div class="form-group">
  30. <textarea id="txt" class="form-control" style="width: 100%; height: 200px;" placeholder="请输入内容..."></textarea>
  31. </div>
  32. <div id="btn" class="btn" style="padding: 10px 20px;width: 100%" onclick="Go()">记录演练实时情况</div>
  33. </form>
  34. </div>
  35. </div>
  36. @section scripts
  37. {
  38. <script src="~/Content/Js/scene-path.js"></script>
  39. <script>
  40. $('.form #group').select2();
  41. function Go() {
  42. var no = $("#group").val();
  43. if (!no) {
  44. abp.message.warn("请选择一个培训营分组!");
  45. return;
  46. }
  47. var txt = $("#txt").val();
  48. if (!txt) {
  49. abp.message.warn("请输入内容!");
  50. return;
  51. }
  52. $("#btn").prop("disable", true);
  53. $.iwbAjax1({
  54. url: abp.appUrl + "Eval/ManualLog",
  55. data: { no: no, msg: txt },
  56. success: function () {
  57. $("#txt").val("");
  58. }
  59. });
  60. setTimeout(function () { $("#btn").prop("disable", false); }, 1000 * 10);
  61. }
  62. </script>
  63. }