| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- @using WeApp.TrainingCampGroup.Dto
- @{
- Layout = "~/Views/Shared/Layout/_Layout.Stu.cshtml";
- CampGroupDto group = ViewBag.Group;
- bool isLeader = ViewBag.IsLeader;
- string id = group.Id,
- campNo = group.CampNo,
- disabled1 = isLeader ? "" : "disabled",
- disabled2 = isLeader ? "disabled" : "";
- var name = isLeader ? "指挥长" : "学员";
- ViewBag.Title = name + "屏(" + group.Name + ")";
- }
- @section css{
- <style>
- body {
- /*background-image: url('../../Content/Image/Stu/bg-lg-1.png');*/
- background-image: linear-gradient(45deg,#005f61,#007f61);
- }
- .btn-box {
- margin: 10% auto 0;
- width: 40%;
- padding: 10px;
- }
- </style>
- }
- <div class="btn-box" style="">
- <button id="" @(disabled1) class="btn btn-dl btn-block" type="button" onclick="Go(true)" style="font-size: 30px; font-weight: 600; padding: 15px 30px;">指挥长</button>
- <button id="" @(disabled2) class="btn btn-dl btn-block " type="button" onclick="Go(false)" style="font-size: 30px; font-weight: 600; padding: 15px 30px; margin-top: 40px">组员</button>
- </div>
- @section scripts
- {
- <script>
- abp.signalr.connect(['@(id)','@(campNo)']);
- var state = 0;
- function Go(isLeader) {
- if (state) {
- window.location.href = isLeader ? "/Exercise/HeadquarterLeader" : "/Exercise/HeadquarterStu";
- } else {
- abp.message.warn("演练还未开始,请稍后再试!");
- }
- }
- </script>
- <script id="hub">
- abp.signalr.connect(['@(id)','@(campNo)']);
- iwbHub.client.getReloadAll = function (msg) {
- console.log('getReloadAll: ', msg);
- if (msg) {
- try {
- var data = JSON.parse(msg);
- if (data) {
- if (data.no == '@(id)'|| data.no == '@(campNo)') {
- window.location.reload();
- }
- }
- } catch (e) {
- console.log('getReloadAll: ', e);
- }
- }
- };
- @if (isLeader)
- {
- <text>
- iwbHub.client.getReloadLeader = function (msg) {
- console.log('getReloadLeader: ', msg);
- if (msg) {
- try {
- var data = JSON.parse(msg);
- if (data) {
- if (data.no == '@(id)'|| data.no == '@(campNo)') {
- window.location.reload();
- }
- }
- } catch (e) {
- console.log('getReloadLeader: ', e);
- }
- }
- };
- </text>
- }
- else
- {
- <text>
- iwbHub.client.getReloadStu = function (msg) {
- console.log('getReloadStu: ', msg);
- if (msg) {
- try {
- var data = JSON.parse(msg);
- if (data) {
- if (data.no == '@(id)'|| data.no == '@(campNo)') {
- window.location.reload();
- }
- }
- } catch (e) {
- console.log('getReloadStu: ', e);
- }
- }
- };
- </text>
- }
- </script>
- }
|