_Screen.cshtml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. @using Abp.Configuration
  2. @using IwbZero.ToolCommon.StringModel
  3. @using WeEngine.Enum
  4. @using WeApp.Configuration
  5. @using WeApp.Helpers
  6. @model WeApp.Views.Exercise.ScreenModel
  7. @{
  8. string groupNo = Model.GroupNo, campNo = Model.CampNo;
  9. bool show = Model.WithScript;
  10. int type = Model.Type;
  11. var dataCenterUrl = SettingManager.GetSettingValue(IwbSettingNames.WeDataCenterIp).Ew("/");
  12. }
  13. @if (show)
  14. {
  15. <link href="~/Content/Css/Exercise/public.min.css" rel="stylesheet" />
  16. }
  17. <div class="box" style="width: 45%; height: 100%;" id="scene_@(groupNo)" data-isRefresh="true">
  18. <div class="box-title">
  19. <span>情景区</span>
  20. </div>
  21. <div class="box-body" style="height: calc(100% - 370px)"><div class="body-content"></div></div>
  22. <div class="media-box" style="height:300px;">
  23. <div class="body-content">
  24. <span>播放区</span>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="box" style="width: 38%; height: 100%" id="log_@(groupNo)">
  29. <div class="box-title" style="position: relative">
  30. <span>决策指挥中心</span>
  31. <a id="warning-btn" href="javascript:void(0)" onclick="ShowWaring()" class="btn-danger btn" style="position: absolute; top: 6px; left: 30px; margin-bottom: 0; z-index: 2; padding: 8px 20px;display:none">查看告警</a>
  32. </div>
  33. <div class="box-body" style=""><div class="body-content"></div></div>
  34. </div>
  35. <div class="box" style="width: 17%; height: 100%; float: left;">
  36. <div class="box" style="width: 100%; height: 70%" id="role_@(groupNo)">
  37. <div class="box-title">
  38. <span>指挥部</span>
  39. <a href="javascript:void(0)" onclick="ShowGroupRole('@(groupNo)')" class="btn-info btn" style="right: 30px;">角色方案</a>
  40. </div>
  41. <div class="box-body" style=""><div class="body-content" style=""></div></div>
  42. </div>
  43. <div class="box" style="width: 100%; height: 30%; border-top: 0" id="score_@(groupNo)">
  44. <div class="box-title" style="border-top: 3px solid #eee;">
  45. <span>评估信息</span>
  46. </div>
  47. <div class="box-body" style="">
  48. <div class="body-content">
  49. @*<div class="score-box">
  50. <span class="name">系统评分</span><span style="padding: 0 5px;">:</span><span class="score">800</span><span style="padding-left: 5px;">分</span>
  51. </div>*@
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. @if (show)
  57. {
  58. using (Html.BeginScripts())
  59. {
  60. <script>
  61. var overlayScrollbar;
  62. $(function() {
  63. abp.signalr.connect(['@(campNo)']);
  64. });
  65. function Scroll2Bottom(that) {
  66. var instance = window.OverlayScrollbars($(that)[0]);
  67. instance.scroll({ y: "100%" });
  68. }
  69. function ShowGroupRole(no) {
  70. $.iwbAjax4({
  71. url: abp.appUrl + 'Query/GetGroupRolePlans?no=' + no,
  72. success: function(res) {
  73. if (res && res.plans && res.plans.length > 0) {
  74. var str = '';
  75. res.plans.forEach(function(v) {
  76. str += FormatterRolePlan(v);
  77. });
  78. if (str) {
  79. $(document).iwbModal('create',
  80. {
  81. modal: 'modal-role-plan',
  82. modaltitle: '角色预案详情',
  83. modalBody: str,
  84. save: function() {
  85. $('#modal-role-plan').modal('hide');
  86. }
  87. });
  88. }
  89. } else {
  90. abp.message.warn("还未创建指挥部!");
  91. }
  92. }
  93. });
  94. }
  95. function FormatterRolePlan(data) {
  96. var str = '';
  97. if (data) {
  98. str += '<div class="plan-box box">';
  99. str += '<div class="plan-name">{0}</div>'.format(data.name);
  100. str += '<div class="plan-role">';
  101. if (data.roleName) {
  102. data.roleName.forEach(function(v) {
  103. str += '<div class="role-box"><div class="name">{0}</div><div class="image"><img src="../../Content/Image/Stu/zhb/user.png" /></div></div>'
  104. .format(v);
  105. });
  106. }
  107. str += '</div>';
  108. str += '</div>';
  109. }
  110. return str;
  111. }
  112. </script>
  113. <script id="scene-s">
  114. var _loadCount = 0, _loadTimeout;
  115. function PreLoad(no) {
  116. _loadCount++;
  117. console.log("加载数据中... " + _loadCount);
  118. if (!$('.load-box').length) {
  119. $('body').append(`<div class="load-box"> <span class="loading">正在加载演练数据</span></div>`);
  120. }
  121. if (_loadCount > 3) {
  122. $('.load-box').fadeOut();
  123. return;
  124. }
  125. $.iwbAjax5({
  126. url: abp.appUrl + "Query/LoadCampPre?no=" + no + "&type=0",
  127. timeout: 1000 * 60 * 5,
  128. success: () => {
  129. clearTimeout(_loadTimeout);
  130. $('.load-box').fadeOut().remove();
  131. $.iwbAjax5({
  132. url: abp.appUrl + "Query/LoadCampPre?no=" + no + "&type=1",
  133. timeout: 1000 * 60 * 5,
  134. complete: () => {
  135. console.log("加载中... " + _loadCount);
  136. }
  137. });
  138. }
  139. , complete: () => {
  140. console.log("加载中... " + _loadCount);
  141. }
  142. });
  143. clearTimeout(_loadTimeout);
  144. _loadTimeout = setTimeout(PreLoad, 1000 * 60 * 2);
  145. }
  146. function GetScenes(no) {
  147. $.iwbAjax5({
  148. url: abp.appUrl + 'Query/GetGroupScenes?no=' + no,
  149. success: function (res) {
  150. if (res) {
  151. FormatterScenes(res, no);
  152. }
  153. }
  154. });
  155. }
  156. function FormatterScenes(data, no) {
  157. var str = "";
  158. if (data && data.length > 0) {
  159. data.forEach(function (v) {
  160. str += FormatterSceneInfo(v, false);
  161. });
  162. }
  163. if (str) {
  164. $('#scene_' + no + ' .box-body .body-content').html(str);
  165. Scroll2Bottom($('#scene_' + no + ' .box-body'));
  166. }
  167. }
  168. function GetSceneInfo(groupNo, sceneNo) {
  169. $.iwbAjax5({
  170. url: abp.appUrl + 'Query/GetGroupSceneInfo?no=' + groupNo + '&scenePath=' + sceneNo,
  171. success: function (res) {
  172. if (res) {
  173. var str = FormatterSceneInfo(res, true);
  174. if (str) {
  175. DisabledScene2(groupNo);
  176. var $box = $('#scene_' + groupNo + ' .box-body .body-content');
  177. $box.append(str);
  178. AutoPlay($box);
  179. var t = $('#scene_' + groupNo).data('t');
  180. //clearTimeout(t);
  181. //t =
  182. //setTimeout(function () {
  183. // $("#scene_" + groupNo + ' .box-body .body-content').find(".flash-scene").removeClass("flash-scene");
  184. //}, 1000 * 20);
  185. $('#scene_' + groupNo).data('t', t);
  186. Scroll2Bottom($('#scene_' + groupNo + ' .box-body'));
  187. }
  188. } else {
  189. setTimeout(function () { GetSceneInfo(groupNo, sceneNo); }, 5000);
  190. }
  191. }
  192. });
  193. }
  194. function FormatterSceneInfo(data, isNew) {
  195. var str = "";
  196. if (data) {
  197. var c = "", str3 = '', descShow = '', attachStr = '';
  198. if (isNew) {
  199. c = "flash-scene new-scene new-scene2";
  200. //str2 = '<span class="label label-danger no-scene">未处理</span>';
  201. str3 =
  202. '<div class="tool open" onclick="ToggleDesc(this)"><i class="iconfont icon-minus"></i></div>';
  203. descShow = 'block';
  204. } else {
  205. //str2 = '<span class="label label-info">已处理</span>';
  206. str3 =
  207. '<div class="tool close" onclick="ToggleDesc(this)"><i class="iconfont icon-plus"></i></div>';
  208. descShow = 'none';
  209. }
  210. if (data.attaches && data.attaches.length > 0) {
  211. var template = '<span class="attach attach-{0} attach1" data-attach-type="{0}" data-path="{1}" onclick="EventAttach(this)"><i class="iconfont {2}" title="{3}"></i></span>';
  212. for (var i = 0; i < data.attaches.length; i++) {
  213. var item = data.attaches[i];
  214. if (item.fileType) {
  215. if (item.fileType === "image") {
  216. attachStr += template.format(item.fileType, item.filePath, 'icon-picture', '图片');
  217. } else if (item.fileType === "video") {
  218. attachStr += template.format(item.fileType, item.filePath, 'icon-training', '视频');
  219. }
  220. }
  221. }
  222. }
  223. str +=
  224. '<div class="scene-box {3}" data-id="{0}" data-path="{5}"><div class="title"><span class="text">{1}</span><div class="attach-box">{4}</div>{6}</div><div class="desc" style="display:{7};">{2}</div></div>'
  225. .format(data.id, data.name, data.description, c, attachStr, data.path, str3, descShow);
  226. }
  227. return str;
  228. }
  229. function ToggleGuide(that) {
  230. var $that = $(that);
  231. if ($that.hasClass('open')) {
  232. $that.removeClass('open');
  233. $that.closest('.scene-box').find('.guide-box').fadeOut(400);
  234. } else {
  235. $that.addClass('open');
  236. $that.closest('.scene-box').find('.guide-box').fadeIn(600);
  237. var $tool = $that.closest('.scene-box').find('.tool');
  238. if (!$tool.hasClass('open')) {
  239. $tool.addClass('open').html('<i class="iconfont icon-minus"></i>');
  240. $tool.closest('.scene-box').find('.desc').fadeIn(600);
  241. }
  242. }
  243. Scroll2Bottom($that.closest('.box-body'));
  244. }
  245. function ToggleDesc(that) {
  246. var $that = $(that);
  247. if ($that.hasClass('open')) {
  248. $that.removeClass('open').html('<i class="iconfont icon-plus"></i>');
  249. $that.closest('.scene-box').find('.desc').fadeOut(400);
  250. } else {
  251. $that.addClass('open').html('<i class="iconfont icon-minus"></i>');
  252. $that.closest('.scene-box').find('.desc').fadeIn(600);
  253. }
  254. Scroll2Bottom($that.closest('.box-body'));
  255. }
  256. function DisabledScene1(groupNo) {
  257. var $that = $('#scene_' + groupNo).find('.scene-box.new-scene2');
  258. $that.attr('onclick', '');
  259. $that.removeClass('new-scene2').addClass("old-scene");
  260. }
  261. function DisabledScene2(groupNo) {
  262. var $that = $('#scene_' + groupNo).find('.scene-box.old-scene');
  263. $that.removeClass('old-scene');
  264. $that.find('.tool.open').trigger('click');
  265. //if ($that.hasClass('old-scene')) {
  266. // $that.attr('onclick', '');
  267. // $that.removeClass('old-scene');
  268. // $that.find('.tool.open').trigger('click');
  269. // //$that.find('.no-scene').text('已处理').removeClass('label-danger').removeClass('no-scene')
  270. // // .addClass('label-info');
  271. //}
  272. //$('#scene-info-box .active').removeClass('active');
  273. //$('#current-scene-box #scene-path').val('');
  274. //$('#current-scene-box .scene-name').text('无');
  275. }
  276. var imageTemplate = '<img src="{0}" style="" />',
  277. videoTemplate = '<video id="video" style="" controls autoplay><source src="{0}" type="video/mp4">您的浏览器不支持 HTML5 video 标签。</video>',
  278. audioTemplate = '<audio id="audio" style="" controls autoplay><source src="{0}" type="audio/mp3">您的浏览器不支持 HTML5 audio 标签。</audio>';
  279. var at;
  280. function EventAttach(that, event) {
  281. var type = $(that).data('attach-type');
  282. var path = $(that).data('path');
  283. if (type) {
  284. var str = type === "image" ? imageTemplate.format(path) : type === "video" ? videoTemplate.format(path) : type === "audio" ? audioTemplate.format(path) : '';
  285. $(that).closest(".box").find(".media-box .body-content").html(str);
  286. $(that).closest(".box").find(".current-scene").removeClass("current-scene");
  287. $(that).closest(".scene-box").addClass("current-scene");
  288. event = event || function () { InitMedia($(that)) };
  289. var video = document.getElementById("video");
  290. if (video) {
  291. video.loop = false;
  292. video.addEventListener('ended', function () { setTimeout(function () { event.call(that); }, 1000 * 3) }, false);
  293. } else {
  294. clearTimeout(at);
  295. at = setTimeout(function () { event.call(that); }, 1000 * 10);
  296. }
  297. }
  298. }
  299. function AutoPlay($box, $that, isForce) {
  300. if (!isForce && $box.data("auto-play")) {
  301. return;
  302. }
  303. $box.data("auto-play", true);
  304. $that = $that === undefined ? $box.find('.new-scene').eq(0).removeClass('new-scene') : $that;
  305. var $attach = $that.find('.attach');
  306. if ($attach.length <= 0) {
  307. var $next = $box.find('.new-scene').eq(0).removeClass('new-scene');
  308. if ($next.length > 0) {
  309. AutoPlay($box, $next, true);
  310. } else {
  311. $box.data("auto-play", false);
  312. InitMedia($box.find('.current-scene'));
  313. }
  314. } else {
  315. if (!$that) { return; }
  316. $attach = $that.find('.attach').first();
  317. EventAttach($attach, function () { AutoPlay($box, $that, true); });
  318. $attach.removeClass('attach');
  319. }
  320. }
  321. function InitMedia(that) {
  322. var $that = (that).closest(".box");
  323. $that.find(".current-scene").removeClass("current-scene");
  324. $that.find(".media-box .body-content").html('<span>播放区</span>');
  325. }
  326. </script>
  327. <script id="log-s">
  328. function GetLogs(no) {
  329. $.iwbAjax5({
  330. url: abp.appUrl + 'Query/GetGroupLogs?no=' + no,
  331. success: function(res) {
  332. if (res) {
  333. FormatterLog(res, no);
  334. }
  335. }
  336. });
  337. }
  338. function FormatterLog(data, no) {
  339. var str = "";
  340. if (data && data.length > 0) {
  341. data.forEach(function(v) {
  342. str += FormatLog(v);
  343. });
  344. }
  345. if (str) {
  346. $('#log_' + no + ' .box-body .body-content').html(str);
  347. }
  348. }
  349. function FormatLog(data) {
  350. var c = '';
  351. if (data.logState == '@(LogStateDefinition.Submit)' || data.logState == '@(LogStateDefinition.Send)'|| data.logState == '@(LogStateDefinition.HasMatch)'|| data.logState == '@(LogStateDefinition.HasSendMatch)') {
  352. c = "send";
  353. }
  354. var str =
  355. '<div class="log-box {3} log_{0}" id="log-box_{0}" data-id="{0}" ><span class="role">{1}</span><span class="word">{2}</span></div>'.format(data.id, data.role, data.word, c);
  356. return str;
  357. }
  358. </script>
  359. <script id="role-s">
  360. function GetRoles(no) {
  361. $.iwbAjax5({
  362. url: abp.appUrl + 'Query/GetGroupRoleInfos?no=' + no,
  363. success: function (res) {
  364. if (res) {
  365. FormatterRole(res, no);
  366. }
  367. }
  368. });
  369. }
  370. function FormatterRole(data, no) {
  371. var str = "";
  372. if (data && data.length > 0) {
  373. data.forEach(function (v) {
  374. str +=
  375. '<div class="role-box"><div class="name">{0}</div><div class="image"><img src="../../Content/Image/Stu/zhb/user.png" /></div></div>'
  376. .format(v);
  377. });
  378. }
  379. if (str) {
  380. $('#role_' + no + ' .box-body .body-content').html(str);
  381. }
  382. }
  383. </script>
  384. <script id="score-s">
  385. function GetScore(no) {
  386. $.iwbAjax5({
  387. url: abp.appUrl + 'Query/GetGroupScoreInfo?no=' + no,
  388. success: function (res) {
  389. if (res) {
  390. res.systemScore = undefined;
  391. FormatterScore(res, no);
  392. }
  393. }
  394. });
  395. }
  396. // ' '
  397. function FormatterScore(data, no) {
  398. var str = "",
  399. template =
  400. '<div class="score-box {2}"><span class="name">{0}</span><span class="score">{1}<span>分</span></span></div>';
  401. if (data.systemScore) {
  402. str += template.format("系统评分", data.systemScore, "system-score");
  403. }
  404. var tags = data.behaviorTagScoreInfo ? JSON.parse(data.behaviorTagScoreInfo) : data.tagScores;
  405. if (tags && tags.length > 0) {
  406. tags.forEach(function (v) {
  407. var score = v.correctionScore ? v.correctionScore : v.systemScore;
  408. if (score > 0) {
  409. str += template.format(v.tagNo, score, "tag-score");
  410. }
  411. });
  412. }
  413. if (str) {
  414. $('#score_' + no + ' .box-body .body-content').prepend(str);
  415. }
  416. }
  417. </script>
  418. <script id="hub-s">
  419. iwbHub.client.getReloadAll = function(msg) {
  420. console.log('getReloadAll: ', msg);
  421. if (msg) {
  422. try {
  423. var data = JSON.parse(msg);
  424. if (data) {
  425. if (data.no == '@(groupNo)' || data.no == '@(campNo)') {
  426. window.location.reload();
  427. }
  428. }
  429. } catch (e) {
  430. console.log('getReloadAll: ', e);
  431. }
  432. }
  433. };
  434. iwbHub.client.getOperationLog = function(msg) {
  435. console.log('getOperationLog: ', msg);
  436. if (msg) {
  437. try {
  438. var data = JSON.parse(msg);
  439. if (@(type) == 2 || data.no=='@(groupNo)') {
  440. var str = FormatLog(data);
  441. $('#log_' + data.no + ' .box-body .body-content').prepend(str);
  442. }
  443. } catch (e) {
  444. console.log('getOperationLog: ', e);
  445. }
  446. }
  447. };
  448. iwbHub.client.getOperationLogSubmit = function(msg) {
  449. console.log('getOperationLogSubmit: ', msg);
  450. if (msg) {
  451. try {
  452. var data = JSON.parse(msg);
  453. if (@(type) == 2 || data.no=='@(groupNo)') {
  454. $('#log_' + data.no + ' .box-body .body-content').find('.log_' + data.logId).addClass('send');
  455. }
  456. } catch (e) {
  457. console.log('getOperationLogSubmit: ', e);
  458. }
  459. }
  460. };
  461. iwbHub.client.getNewScene = function(msg) {
  462. console.log('getNewScene: ', msg);
  463. if (msg) {
  464. try {
  465. var data = typeof msg == 'string' ? JSON.parse(msg) : msg;
  466. if (data) {
  467. if (@(type) == 2 || data.no == '@(groupNo)') {
  468. if ($('#scene_' + data.no).find('.scene-box[data-path="' + data.path + '"]').length <= 0) {
  469. GetSceneInfo(data.no, data.sceneNo);
  470. }
  471. }
  472. }
  473. } catch (e) {
  474. console.log('getNewScene: ', e);
  475. }
  476. }
  477. };
  478. iwbHub.client.getRoundScore = function(msg) {
  479. console.log('getRoundScore: ', msg);
  480. if (msg) {
  481. try {
  482. var data = JSON.parse(msg);
  483. if (@(type) == 2 || data.no=='@(groupNo)') {
  484. data.systemScore = undefined;
  485. FormatterScore(data, data.no);
  486. };
  487. } catch (e) {
  488. console.log('getRoundScore: ', e);
  489. }
  490. }
  491. };
  492. iwbHub.client.getSendScore = function(msg) {
  493. console.log('getSendScore: ', msg);
  494. if (msg) {
  495. try {
  496. var data = JSON.parse(msg);
  497. if (@(type) == 2 || data.no=='@(groupNo)') {
  498. FormatterScore(data, data.no);
  499. };
  500. } catch (e) {
  501. console.log('getSendScore: ', e);
  502. }
  503. }
  504. };
  505. iwbHub.client.getDisabledScene = function(msg) {
  506. console.log('getDisabledScene: ', msg);
  507. if (msg) {
  508. try {
  509. //var data = JSON.parse(msg);
  510. if (@(type) == 2 || msg == '@(groupNo)') {
  511. DisabledScene1(msg);
  512. }
  513. } catch (e) {
  514. console.log('getDisabledScene: ', e);
  515. }
  516. }
  517. }
  518. iwbHub.client.getMatchSuccess = function(msg) {
  519. console.log('getMatchSuccess: ', msg);
  520. if (msg) {
  521. try {
  522. var data = JSON.parse(msg);
  523. if (!data) {
  524. return;
  525. }
  526. var url = "", style = "";
  527. if (data.scoreType == @((int) BehaviorScoreType.Normal)) {
  528. style = "text-success";
  529. url = "/Content/Media/S4.mp3";
  530. } else if (data.scoreType == @((int) BehaviorScoreType.Negative)) {
  531. style = "text-danger";
  532. url = "/Content/Media/E2.mp3";
  533. } else if (data.scoreType == @((int) BehaviorScoreType.ImportantNegative)) {
  534. style = "text-danger text-bold";
  535. url = "/Content/Media/E6.mp3";
  536. }
  537. //ChangeLog(data.word, style);
  538. PlayAudio(url, data.scoreType);
  539. } catch (e) {
  540. console.log('getMatchSuccess: ', e);
  541. }
  542. }
  543. };
  544. </script>
  545. <script>
  546. var et, evList = [];
  547. function Environment(data) {
  548. evList.push(data);
  549. ShowEnvironment();
  550. }
  551. function ShowEnvironment() {
  552. var data = evList[0] ? $.extend({}, evList[0]) : undefined;
  553. console.log(data);
  554. if (!data) {
  555. return;
  556. }
  557. if ($('.environment').length > 0 && $('#ev-' + data.nodePath).length <= 0) {
  558. return;
  559. }
  560. evList.splice(0, 1);
  561. var str = '', str1 = '';
  562. var path = data.resourcePath.indexOf('http') > -1
  563. ? data.resourcePath
  564. : '@(dataCenterUrl)' + data.resourcePath;
  565. switch (data.resourceType) {
  566. case @((int) ResourceType.Image):
  567. str1 = '<img src="{0}" style="" />'.format(path);
  568. break;
  569. case @((int) ResourceType.Audio):
  570. str1 =
  571. '<audio id="audio" style="display:none" controls autoplay><source src="{0}" type="audio/mp3">您的浏览器不支持 HTML5 audio 标签。</audio>'
  572. .format(path);
  573. break;
  574. case @((int) ResourceType.Video):
  575. str1 =
  576. '<video id="video" style="" controls autoplay><source src="{0}" type="video/mp4">您的浏览器不支持 HTML5 video 标签。</video>'
  577. .format(path);
  578. break;
  579. default:
  580. str1 = '';
  581. }
  582. clearTimeout(et);
  583. if ($('#ev-' + data.nodePath).length > 0) {
  584. $('#ev-' + data.nodePath).find('.play-box').append('<div style="width:100% ;height:15px"></div>');
  585. $('#ev-' + data.nodePath).find('.play-box').append(str1);
  586. Scroll2Bottom($('#environment-score'));
  587. } else {
  588. str =
  589. '<div class="environment" id="ev-{0}" style="display:none;"><div class="close" onclick="CloseEnvironment(false)">关闭</div><div id="environment-score"><div class="play-box">{1}</div></div></div>'
  590. .format(data.nodePath, str1);
  591. $('body').append(str);
  592. OverlayScrollbar($('#environment-score'), { className: "os-theme-thin-light" });
  593. $(".environment").fadeIn(600);
  594. }
  595. et = setTimeout(CloseEnvironment, 1000 * 15);
  596. }
  597. function CloseEnvironment(isAuto) {
  598. isAuto = isAuto == undefined ? true : isAuto;
  599. clearTimeout(et);
  600. $(".environment").fadeOut(300).remove();
  601. if (isAuto) {
  602. ShowEnvironment();
  603. }
  604. }
  605. function PlayAudio(url, type) {
  606. if (!$('#audio-hidden-' + type).length) {
  607. var audio =
  608. '<div id="audio-hidden-{1}" style="display:none"><audio style="" controls autoplay><source src="{0}" type="audio/mpeg">您的浏览器不支持 HTML5 audio 标签。</audio></div>'
  609. .format(url, type);
  610. $('body').append(audio);
  611. setTimeout(function() {$('#audio-hidden-' + type).remove();},20000);
  612. }
  613. }
  614. function ChangeLog(word, style) {
  615. var arr = word.split('|');
  616. var $log = $('#log-box_' + arr[0] + ' .word');
  617. if ($log.length) {
  618. var text = $log.html(), text2 = text;
  619. if (arr[2]) {
  620. var arr2 = arr[2].split(',');
  621. arr2.forEach(function(v) {
  622. var reg = new RegExp(v, "g");
  623. var str = '<span class="{1} ml-1 mr-1">{0}</span>'.format(v, style);
  624. if (text2.indexOf(str) < 0) {
  625. text2 = text2.replace(reg, str);
  626. }
  627. });
  628. $log.html(text2);
  629. if (text != text2) {
  630. $.iwbAjax5({
  631. url: abp.appUrl + 'Eval/UpdateLog',
  632. data: { id: arr[0], Text: text2 }
  633. });
  634. }
  635. }
  636. }
  637. }
  638. </script>
  639. }
  640. }
  641. @using (Html.BeginScripts())
  642. {
  643. <script>
  644. $(function () {
  645. if (@(type) == 1) {
  646. abp.signalr.connect(['@(groupNo)'],
  647. function() {
  648. setTimeout(function() {
  649. $.iwbAjax5({
  650. url: abp.appUrl + "/Eval/StartFeedback?no=@(groupNo)",
  651. success: function(res) {
  652. if (res) {
  653. window.GetScenes('@(groupNo)');
  654. }
  655. }
  656. },
  657. 500);
  658. });
  659. });
  660. }
  661. OverlayScrollbar($('.box-body'));
  662. GetLogs('@(groupNo)');
  663. GetRoles('@(groupNo)');
  664. GetScore('@(groupNo)');
  665. PreLoad('@(groupNo)');
  666. if (@(type)!= 1) {
  667. GetScenes('@(groupNo)');
  668. }
  669. });
  670. </script>
  671. }