ControlArea.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* 控制区 */
  2. <template>
  3. <gy-card
  4. title="控制区"
  5. area-style="control"
  6. circle-style="green"
  7. content-style="44"
  8. >
  9. <MatrixCard title="待启动" :datas="ls.start"></MatrixCard>
  10. <MatrixCard title="待停机" :datas="ls.stop"></MatrixCard>
  11. <MatrixCard title="待维护" :datas="ls.maintain"></MatrixCard>
  12. <MatrixCard title="待取消维护" :datas="ls.unmaintain"></MatrixCard>
  13. <MatrixCard title="待复位" :datas="ls.reset"></MatrixCard>
  14. </gy-card>
  15. </template>
  16. <script>
  17. import MatrixCard from "./windturbine/MatrixCard.vue";
  18. import MessageBridge from "../../assets/script/MessageBridge";
  19. export default {
  20. name: "ControlArea",
  21. components: {
  22. MatrixCard,
  23. },
  24. created: function () {
  25. this.initData();
  26. },
  27. data() {
  28. return {
  29. ls: {
  30. start: { key: "待启动", value: [] },
  31. stop: { key: "待停机", value: [] },
  32. maintain: { key: "待维护", value: [] },
  33. unmaintain: { key: "待取消维护", value: [] },
  34. reset: { key: "待复位", value: [] },
  35. },
  36. };
  37. },
  38. methods: {
  39. initData: function () {
  40. var mb = MessageBridge.getInstance();
  41. var vs = [
  42. { key: "/topic/windturbine", action: this.windturbineMessage },
  43. { key: "/topic/suggestion", action: this.suggestion },
  44. ];
  45. mb.register(vs);
  46. },
  47. windturbineMessage: function (msg) {
  48. console.log(msg);
  49. },
  50. suggestion: function (msg) {
  51. console.log(msg);
  52. },
  53. },
  54. };
  55. </script>