App.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template class="app">
  2. <TitleBar class="titleBar" />
  3. <div class="right">
  4. <el-col >
  5. <el-row>
  6. <el-col>
  7. <ModeControl ref="modeControl" :current="current" @clicks="handleClick"></ModeControl>
  8. </el-col>
  9. </el-row>
  10. <el-row>
  11. <el-col>
  12. <FocusArea />
  13. </el-col>
  14. </el-row>
  15. <el-row>
  16. <el-col>
  17. <WarningArea></WarningArea>
  18. </el-col>
  19. </el-row>
  20. </el-col>
  21. </div>
  22. <StatusBar class="statusBar" />
  23. <router-view />
  24. </template>
  25. <script>
  26. import TitleBar from 'views/TitleBar.vue'
  27. import StatusBar from 'views/StatusBar.vue'
  28. import MessageBridge from 'utils/MessageBridge'
  29. import ModeControl from "components/modeControl/modeControl.vue";
  30. import FocusArea from "components/focus/focusArea.vue";
  31. import WarningArea from "components/warning/warningArea.vue";
  32. export default {
  33. components: {
  34. TitleBar,
  35. StatusBar,
  36. ModeControl,
  37. FocusArea,
  38. WarningArea
  39. },
  40. created: function () {
  41. this.initData()
  42. },
  43. methods: {
  44. initData: function () {
  45. var mb = MessageBridge.getInstance();
  46. var windturbine = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
  47. var popup = [{ key: "/topic/fault-popup", action: this.faultMessage }];
  48. var suggestion = [{ key: "/topic/suggestion", action: this.suggestion }];
  49. var title = [{ key: "/topic/title-info", action: this.titleInfos }];
  50. mb.register(title);
  51. mb.register(windturbine);
  52. mb.register(popup);
  53. mb.register(suggestion);
  54. },
  55. windturbineMessage(msg) {
  56. var json = JSON.parse(msg);
  57. this.$store.commit('windturbinelist', json)
  58. },
  59. faultMessage(msg){
  60. var json = JSON.parse(msg);
  61. this.$store.commit('warning', json)
  62. },
  63. suggestion(msg){
  64. var json = JSON.parse(msg);
  65. this.$store.commit('suggestion', json)
  66. },
  67. // titleInfos(msg){
  68. // var json = JSON.parse(msg);
  69. // this.$store.commit('titleInfo', json)
  70. // },
  71. },
  72. }
  73. </script>
  74. <style>
  75. @import "../src/assets/styles/main.css";
  76. body {
  77. /* 设置内容不可选中 */
  78. -webkit-user-select: none;
  79. -moz-user-select: none;
  80. -ms-user-select: none;
  81. user-select: none;
  82. }
  83. /* .app{
  84. background-color: #000000;
  85. } */
  86. .right{
  87. width: 32%;
  88. position: absolute;
  89. right: 20px;
  90. z-index: 99;
  91. }
  92. .statusBar {
  93. width: 100%;
  94. position: absolute;
  95. bottom: 0;
  96. left: 0;
  97. }
  98. .titleBar {
  99. width: 100%;
  100. position: relative;
  101. top: 0;
  102. left: 0;
  103. }
  104. </style>