_SceneFlow.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @using IwbZero.ToolCommon.StringModel
  2. @using WeApp.Helpers
  3. @model string
  4. @{
  5. string[] arr = Model.Split('#');
  6. string groupNo = arr[0];
  7. string id = $"scene-flow";
  8. bool withScript = (arr.Length > 1 ? arr[1] : "").ValB();
  9. int type = (arr.Length > 2 ? arr[2] : "").ValI();
  10. string body = $"<div class=\"scene-box-header\">" +
  11. //$"<i class=\"fa fa-sitemap\"></i>" +
  12. $"<img src=\"/Content/V2/Img/Icon/icon-5-3.png\" />" +
  13. $"推演网图</div>" +
  14. $"<div class=\"scene-flow-box\" style=\"height:calc(100% - 30px)\"><div class=\"box-body\"></div></div>";
  15. }
  16. @Html.Partial("__/_AreaBox", $"情景路径#{id}_{groupNo}#{body}")
  17. @if (withScript)
  18. {
  19. <style>
  20. .scene-flow-box .path-box {
  21. --color: #3a89be;
  22. --colorNode: #3a89be;
  23. opacity: 0.9;
  24. }
  25. .scene-flow-box .path-box .round-box .sfb-box .sfb-title {
  26. background: transparent;
  27. background: rgba(81, 189, 246,.75);
  28. }
  29. </style>
  30. using (Html.BeginScripts())
  31. {
  32. <script src="~/Content/Js/scene-path_v2.js"></script>
  33. <script id="path-script">
  34. function GetScenePath(no) {
  35. $.iwbAjax5({
  36. url: abp.appUrl + 'Query/GetGroupRunningInfo?no='+no,
  37. success: function(res) {
  38. var str = FormatterSingleScenePath(res);
  39. $(`#@(id)_${no} .box-body .scene-flow-box .box-body`).html(str);
  40. window.Scroll2Bottom($(`#@(id)_${no} .box-body .scene-flow-box`));
  41. }
  42. });
  43. }
  44. iwbHub.client.getRunningChange = function(msg) {
  45. console.log('getRunningChange: ', msg);
  46. if (msg) {
  47. try {
  48. var data = JSON.parse(msg);
  49. if ( @(type) == 2 ||data.no == '@groupNo') {
  50. GetScenePath(data.no);
  51. }
  52. } catch (e) {
  53. console.log('getRunningChange: ', e);
  54. }
  55. }
  56. };
  57. </script>
  58. }
  59. }
  60. @using (Html.BeginScripts())
  61. {
  62. <script>
  63. GetScenePath('@(groupNo)');
  64. </script>
  65. }