tongfeng_xijin.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div>
  3. <topimg></topimg>
  4. <!-- <plcdata></plcdata> -->
  5. <div>
  6. <div class="content" v-for="item in data">
  7. <div class="top">
  8. <div class="left">{{ item.run.tag_name }}</div>
  9. <div class="right">运行</div>
  10. </div>
  11. <div class="data">
  12. <ul>
  13. <li v-for="list in item.list">
  14. <div class="title">{{ list.tag_name }}</div>
  15. <div class="num">
  16. {{
  17. list.tag_value.substring(0, list.tag_value.indexOf(".") + 3)
  18. }}
  19. </div>
  20. </li>
  21. </ul>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import topimg from "@/components/zdh/topimg.vue";
  29. export default {
  30. name: "tongfeng_xijin",
  31. components: { topimg },
  32. data() {
  33. return {
  34. data: "",
  35. };
  36. },
  37. methods: {
  38. async getData() {
  39. const { data: res } = await this.$http.post(
  40. "http://nmjt.nxjiewei.com:8011/api/automate/mine_ventilate/get_list",
  41. { mine_id: "zaoquan", type: 2 }
  42. );
  43. console.log(res.content.data);
  44. this.data = res.content.data;
  45. },
  46. },
  47. mounted() {
  48. this.getData();
  49. this.infos = setInterval(this.getData, 5000);
  50. },
  51. beforeDestroy() {
  52. clearInterval(this.infos);
  53. },
  54. };
  55. </script>
  56. <style scoped>
  57. .content {
  58. font-weight: 400;
  59. background-color: #ffffff;
  60. box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.14);
  61. border-radius: 5px;
  62. margin: 5px;
  63. background-color: #2873ff;
  64. }
  65. .top {
  66. background-color: #ffffff;
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. /* padding: 10px; */
  71. height: 33px;
  72. margin-left: 5px;
  73. border-bottom: 1px #f3f3f3 solid;
  74. padding: 10px;
  75. }
  76. /* span{
  77. background-color: #2873FF;
  78. width: 9px;
  79. height: 33px;
  80. } */
  81. .left {
  82. height: 33px;
  83. line-height: 33px;
  84. /* margin-left: 10px; */
  85. }
  86. .right {
  87. width: 33px;
  88. height: 20px;
  89. background-color: #27ae60;
  90. border-radius: 2px;
  91. color: #ffffff;
  92. text-align: center;
  93. font-size: 10px;
  94. line-height: 14px;
  95. font-weight: 400;
  96. padding-top: 4px;
  97. }
  98. .data {
  99. background-color: #ffffff;
  100. padding: 0 10px;
  101. }
  102. /* ul{
  103. } */
  104. li {
  105. /* margin-right: 5%; */
  106. /* float: left; */
  107. height: 39px;
  108. /* line-height: 39px; */
  109. display: flex;
  110. justify-content: space-between;
  111. align-items: center;
  112. padding: 10px 0px;
  113. border-bottom: 1px #f3f3f3 solid;
  114. }
  115. li div {
  116. height: 17px;
  117. padding-bottom: 3px;
  118. }
  119. .num {
  120. width: 80px;
  121. text-align: center;
  122. background-color: #2873ff;
  123. color: #fff;
  124. }
  125. </style>