App.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template class="app">
  2. <div>
  3. <TitleBar class="titleBar" />
  4. <div class="right">
  5. <el-col>
  6. <el-row>
  7. <el-col>
  8. <ModeControl
  9. ref="modeControl"
  10. :current="current"
  11. @clicks="handleClick"
  12. ></ModeControl>
  13. </el-col>
  14. </el-row>
  15. <el-row>
  16. <el-col>
  17. <FocusArea />
  18. </el-col>
  19. </el-row>
  20. <el-row>
  21. <el-col>
  22. <WarningArea></WarningArea>
  23. </el-col>
  24. </el-row>
  25. </el-col>
  26. </div>
  27. <div class="Dialog" v-show="state">
  28. <div class="D-" @click="none">-</div>
  29. </div>
  30. <StatusBar class="statusBar" @getData="getData" />
  31. <router-view />
  32. </div>
  33. </template>
  34. <script>
  35. import TitleBar from "views/TitleBar.vue";
  36. import StatusBar from "views/StatusBar.vue";
  37. import MessageBridge from "utils/MessageBridge";
  38. import ModeControl from "components/modeControl/modeControl.vue";
  39. import FocusArea from "components/focus/focusArea.vue";
  40. import WarningArea from "components/warning/warningArea.vue";
  41. import api from "api/index";
  42. import boxSelect from "components/boxSelect.vue";
  43. export default {
  44. data() {
  45. return {
  46. state: false,
  47. };
  48. },
  49. components: {
  50. TitleBar,
  51. StatusBar,
  52. ModeControl,
  53. FocusArea,
  54. WarningArea,
  55. boxSelect,
  56. },
  57. created: function () {
  58. this.getStation();
  59. this.initData();
  60. this.subscribe();
  61. },
  62. methods: {
  63. getData(val) {
  64. console.log(val);
  65. this.state = val;
  66. },
  67. none() {
  68. this.state = false;
  69. },
  70. initData: function () {
  71. let mb = MessageBridge.getInstance();
  72. let windturbine = [
  73. { key: "/topic/windturbine", action: this.windturbineMessage },
  74. ];
  75. mb.register(windturbine);
  76. },
  77. windturbineMessage(msg) {
  78. let json = JSON.parse(msg);
  79. this.$store.commit("windturbinelist", json);
  80. // console.log(json);
  81. },
  82. getStation() {
  83. api.getStation().then((res) => {
  84. this.$store.commit("stationList", res.data);
  85. });
  86. },
  87. subscribe() {
  88. setTimeout(() => {
  89. this.subscribe();
  90. }, 20000);
  91. if (!this.$store.state.observers) {
  92. let mb = MessageBridge.getInstance();
  93. let windturbine = [
  94. { key: "/topic/windturbine", action: this.windturbineMessage },
  95. ];
  96. let popup = [{ key: "/topic/fault-popup", action: this.faultMessage }];
  97. let title = [{ key: "/topic/title-info", action: this.titleInfos }];
  98. let suggestion = [
  99. { key: "/topic/suggestion", action: this.suggestion },
  100. ];
  101. mb.register(suggestion);
  102. mb.register(title);
  103. mb.register(windturbine);
  104. mb.register(popup);
  105. this.$store.commit("observers", true);
  106. }
  107. },
  108. },
  109. };
  110. </script>
  111. <style>
  112. @import "../src/assets/styles/main.css";
  113. body {
  114. /* 设置内容不可选中 */
  115. -webkit-user-select: none;
  116. -moz-user-select: none;
  117. -ms-user-select: none;
  118. user-select: none;
  119. }
  120. /* .app{
  121. background-color: #000000;
  122. } */
  123. .Dialog {
  124. width: 520px;
  125. height: 800px;
  126. background-color: rgb(250, 249, 249);
  127. position: absolute;
  128. right: 30px;
  129. z-index: 999;
  130. bottom: 50px;
  131. /* display: none; */
  132. }
  133. .D- {
  134. width: 30px;
  135. height: 30px;
  136. background-color: rgb(167, 204, 192);
  137. font-size: 30px;
  138. position: absolute;
  139. top: 5px;
  140. right: 10px;
  141. line-height: 30px;
  142. text-align: center;
  143. }
  144. .D-:hover {
  145. background-color: #999999;
  146. }
  147. .right {
  148. width: 32%;
  149. position: absolute;
  150. right: 20px;
  151. z-index: 99;
  152. }
  153. .statusBar {
  154. width: 100%;
  155. position: absolute;
  156. bottom: 0;
  157. left: 0;
  158. }
  159. .titleBar {
  160. width: 100%;
  161. position: relative;
  162. top: 0;
  163. left: 0;
  164. }
  165. .el-table__body-wrapper::-webkit-scrollbar-thumb {
  166. background-color: #999999;
  167. border-radius: 8px;
  168. }
  169. .el-collapse-item__wrap {
  170. background-color: #000000 !important;
  171. box-sizing: border-box !important;
  172. padding-left: 27px !important;
  173. }
  174. .el-collapse-item__header {
  175. background-color: rgb(20, 20, 20) !important;
  176. font-size: 12px !important;
  177. color: #bfbfbf !important;
  178. box-sizing: border-box !important;
  179. padding-left: 30px !important;
  180. margin-bottom: 2px !important;
  181. }
  182. .el-collapse {
  183. border: none !important;
  184. }
  185. .el-collapse-item__header {
  186. border: none !important;
  187. }
  188. .el-collapse-item__wrap {
  189. border: none !important;
  190. }
  191. </style>
  192. <style lang="less">
  193. #app {
  194. .currentScroll::-webkit-scrollbar {
  195. width: 8px;
  196. height: 0px;
  197. background-color: black;
  198. }
  199. .currentScroll::-webkit-scrollbar-thumb {
  200. background-color: #292929;
  201. border-radius: 6px;
  202. }
  203. }
  204. </style>