acrylicTank.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div id="app-container-acrylic">
  3. <div class="bg-color-black">
  4. <div class="d-flex pt-2 pl-2">
  5. <span style="color:#5cd9e8">
  6. <icon name="chart-area"></icon>
  7. </span>
  8. <div class="d-flex">
  9. <span class="fs-xl text mx-2">{{ $t('丙烯储罐') }}</span>
  10. <div class="decoration2">
  11. <dv-decoration-2 :reverse="true" style="width:5px;height:2.4rem;" />
  12. </div>
  13. </div>
  14. </div>
  15. <div style="text-align: center;padding-bottom: 2px;display: flex;justify-content: space-between;margin-top: 10px;">
  16. <div style="position: relative;">
  17. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="0<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<20">
  18. <img src="@/assets/image/Spherical1.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="20<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<40">
  19. <img src="@/assets/image/Spherical2.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="40<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<60">
  20. <img src="@/assets/image/Spherical3.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="60<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<80">
  21. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="80<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<100">
  22. <span class="modelTop pos1">STT1011</span>
  23. <div class="ModelFont">{{ dashboarddata.acrOne }}%</div>
  24. </div>
  25. <div style="position: relative;">
  26. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="0<=(dashboarddata.acrTwo) && (dashboarddata.acrTwo)<20">
  27. <img src="@/assets/image/Spherical1.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="20<=(dashboarddata.acrTwo) && (dashboarddata.acrTwo)<40">
  28. <img src="@/assets/image/Spherical2.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="40<=(dashboarddata.acrTwo) && (dashboarddata.acrTwo)<60">
  29. <img src="@/assets/image/Spherical3.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="60<=(dashboarddata.acrTwo) && (dashboarddata.acrTwo)<80">
  30. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="80<=(dashboarddata.acrTwo) && (dashboarddata.acrTwo)<100">
  31. <span class="modelTop pos2">STT1012</span>
  32. <div class="ModelFont">{{ dashboarddata.acrTwo }}%</div>
  33. </div>
  34. <div style="position: relative;">
  35. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="0<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<20">
  36. <img src="@/assets/image/Spherical1.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="20<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<40">
  37. <img src="@/assets/image/Spherical2.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="40<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<60">
  38. <img src="@/assets/image/Spherical3.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="60<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<80">
  39. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="80<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<100">
  40. <span class="modelTop pos3">STT1013</span>
  41. <div class="ModelFont">{{ dashboarddata.acrThree }}%</div>
  42. </div>
  43. <div style="position: relative;">
  44. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="0<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<20">
  45. <img src="@/assets/image/Spherical1.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="20<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<40">
  46. <img src="@/assets/image/Spherical2.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="40<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<60">
  47. <img src="@/assets/image/Spherical3.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="60<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<80">
  48. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="80<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<100">
  49. <span class="modelTop pos4">STT1014</span>
  50. <div class="ModelFont">{{ dashboarddata.acrFour }}%</div>
  51. </div>
  52. <div style="position: relative;">
  53. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="0<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<20">
  54. <img src="@/assets/image/Spherical1.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="20<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<40">
  55. <img src="@/assets/image/Spherical2.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="40<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<60">
  56. <img src="@/assets/image/Spherical3.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="60<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<80">
  57. <img src="@/assets/image/spherical.png" style="height: 100px;width: 80px; margin-top: 0.7rem" v-if="80<=(dashboarddata.acrOne) && (dashboarddata.acrOne)<100">
  58. <span class="modelTop pos5">STT1040</span>
  59. <div class="ModelFont">{{ dashboarddata.acrZero }}%</div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import { selectLast } from "@/api/aspen/dashboarddata";
  67. export default {
  68. data () {
  69. return {
  70. dashboarddata: {
  71. acrOne: null,
  72. acrTwo: null,
  73. acrThree: null,
  74. acrFour: null,
  75. acrZero: null,
  76. },
  77. // 查询参数
  78. queryParams: {},
  79. }
  80. },
  81. created() {
  82. this.getList();
  83. // 每隔30秒请求一次数据
  84. window.setInterval(() => {undefined
  85. setTimeout(() => {undefined
  86. ///调取接口获取数据
  87. this.getList();
  88. }, 0)
  89. }, 10000)
  90. },
  91. methods: {
  92. /** 查询dashboard抓取数据列表 */
  93. getList()
  94. {
  95. selectLast(this.queryParams).then(response => {
  96. this.dashboarddata = response.data;
  97. });
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. #app-container-acrylic {
  104. padding: 0.2rem 0.2rem 0;
  105. height: 2.9rem;
  106. min-width: 3.75rem;
  107. border-radius: 0.0625rem;
  108. .bg-color-black {
  109. height: 2rem;
  110. border-radius: 0.125rem;
  111. }
  112. .text {
  113. color: #c3cbde;
  114. } //下滑线动态
  115. .decoration2 {
  116. position: absolute;
  117. right: 0.125rem;
  118. }
  119. .chart-box {
  120. margin-top: 0.2rem;
  121. width: 2.125rem;
  122. height: 2.125rem;
  123. .active-ring-name {
  124. padding-top: 0.125rem;
  125. }
  126. }
  127. .modelTop{
  128. position: absolute;
  129. &.pos1{
  130. left: 20px;
  131. top: 20px;
  132. }
  133. &.pos2{
  134. left: 20px;
  135. top: -15px;
  136. }
  137. &.pos3{
  138. left: 20px;
  139. top: 20px;
  140. }
  141. &.pos4{
  142. left: 20px;
  143. top: -15px;
  144. }
  145. &.pos5{
  146. left: 20px;
  147. top: 20px;
  148. }
  149. }
  150. }
  151. </style>