AlarmArea.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* 告警区 */
  2. <template>
  3. <gy-card
  4. title="告警区"
  5. area-style="alarm"
  6. circle-style="green"
  7. content-style="25"
  8. >
  9. <table class="ToolBar">
  10. <tr>
  11. <td width="150px">时间</td>
  12. <td idth="400px">描述</td>
  13. <td width="50px">确认</td>
  14. </tr>
  15. </table>
  16. <table class="Tables">
  17. <tr v-for="v in values" :key="v">
  18. <div>
  19. <td width="150px">{{ v.lastUpdateTime }}</td>
  20. <td width="400px">{{ v.alertText }}</td>
  21. <td width="50px"><input type="checkbox" disabled="disabled"/></td>
  22. </div>
  23. </tr>
  24. </table>
  25. </gy-card>
  26. </template>
  27. <script>
  28. import MessageBridge from "../../assets/script/MessageBridge";
  29. export default {
  30. name: "AlarmArea",
  31. created: function () {
  32. this.initData();
  33. },
  34. props: {
  35. },
  36. data() {
  37. return {
  38. values: new Array(),
  39. };
  40. },
  41. methods: {
  42. initData() {
  43. var mb = MessageBridge.getInstance();
  44. var vs = [{ key: "/topic/fault-popup", action: this.faultMessage }];
  45. mb.register(vs);
  46. },
  47. faultMessage(msg) {
  48. var val = JSON.parse(msg);
  49. this.values = new Array();
  50. for (var v in val) {
  51. this.values.push(val[v]);
  52. }
  53. console.log(val);
  54. },
  55. },
  56. };
  57. </script>
  58. <style scoped>
  59. div{
  60. background: #292929;
  61. line-height: 1.5;
  62. }
  63. td,tr{
  64. line-height: 1.5;
  65. }
  66. .ToolBar{
  67. position:absolute;
  68. right:12px;
  69. width:596px;
  70. text-align:center;
  71. z-index:2;
  72. font-size:14px;
  73. height: 28px;
  74. margin-top:-2px;
  75. background: #292929;
  76. }
  77. .Tables{
  78. font-size:14px;
  79. width:600px;
  80. padding-top: 28px;
  81. text-align:center;
  82. }
  83. </style>