areaCard.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /* 自定义tabs */
  2. <template>
  3. <!-- <transition>
  4. <div :class='areaClass' @mouseover="hover = false" @mouseleave="hover = false" onselectstart="return false">
  5. <div :class="headerClass">
  6. <div :class='circleClass'></div>
  7. <span class="gy-card-title">{{ title }}</span>
  8. <img class="gy-card-decoration01" src="../../assets/img/controlcenter/decoration01.png">
  9. <img class="gy-card-decoration02" src="../../assets/img/controlcenter/decoration02.png">
  10. </div>
  11. <div :class='contentClass'>
  12. <el-scrollbar style="height: 100%">
  13. <slot></slot>
  14. </el-scrollbar>
  15. </div>
  16. </div>
  17. </transition> -->
  18. <div class="body">
  19. <img class="logo" src="../../assets/img/logo.png" alt="">
  20. <div class="title">{{ title }}</div>
  21. <div class="record" @click="showRecord">校验记录</div>
  22. <div style="margin-top: 50px; margin-left: 20px; height: 80%;">
  23. <el-scrollbar>
  24. <div class="scoll" style="margin-left: 5px;">
  25. <MatrixBlock @on-click="handleClick" :dataList="showList"></MatrixBlock>
  26. </div>
  27. </el-scrollbar>
  28. </div>
  29. <OperationRecords ref="records" v-model="display" @closed="closed()"></OperationRecords>
  30. <WindturbineDetailPages v-model="dialogVisible" @close="handleClose" :windturbine="currentWindturbine">
  31. </WindturbineDetailPages>
  32. </div>
  33. </template>
  34. <script>
  35. import BackgroundData from 'utils/BackgroundData'
  36. import MatrixBlock from "../matrixBlock.vue";
  37. import OperationRecords from "./operationRecords.vue";
  38. import WindturbineDetailPages from "../WindturbineDetailPages.vue";
  39. export default {
  40. props: {
  41. title: {
  42. type: String,
  43. default: '校验区',
  44. required: true
  45. },
  46. height: {
  47. type: Number,
  48. default: 200,
  49. },
  50. },
  51. components: {
  52. MatrixBlock,
  53. OperationRecords,
  54. WindturbineDetailPages
  55. },
  56. data() {
  57. return {
  58. showList: [],
  59. arr: [],
  60. list: [],
  61. display:false,
  62. dialogVisible:false,
  63. currentWindturbine: {},
  64. }
  65. },
  66. methods: {
  67. dataDeal() {
  68. let flag = false
  69. let showList = []
  70. let arr = []
  71. let checks = BackgroundData.getInstance().checkouts;
  72. checks.forEach(item => {
  73. if (item.status === this.list[item.windturbineId].status) {
  74. showList.push(this.list[item.windturbineId])
  75. } else {
  76. BackgroundData.getInstance().removeCheckouts(item);
  77. }
  78. if ((new Date()).getTime() - item.checkTime > 120000) {
  79. BackgroundData.getInstance().removeCheckouts(item);
  80. arr.push(item.windturbineId)
  81. flag = true
  82. }
  83. })
  84. this.showList = showList
  85. if (flag) {
  86. let mss = arr.join(',') + '风机超时未响应,已移除'
  87. this.$notify({
  88. title: "控制",
  89. message: mss,
  90. type: "warning",
  91. position: "bottom-right",
  92. offset: 60,
  93. duration: 3000,
  94. });
  95. flag = false
  96. }
  97. },
  98. showRecord(){
  99. this.display = true
  100. this.$refs.records.dataDeal()
  101. },
  102. closed(){
  103. this.display = false
  104. },
  105. handleClick(itm) {
  106. this.dialogVisible = true;
  107. this.currentWindturbine = itm;
  108. },
  109. handleClose() {
  110. this.dialogVisible = false
  111. },
  112. },
  113. watch: {
  114. "$store.getters.windturbinelist": {
  115. deep: true,
  116. handler: function (json) {
  117. this.list = json
  118. this.arr = BackgroundData.getInstance().checkouts;
  119. this.dataDeal()
  120. },
  121. },
  122. },
  123. }
  124. </script>
  125. <style scoped="scoped">
  126. .body {
  127. border: 1px solid #373737;
  128. width: 100%;
  129. margin-left: 15px;
  130. margin-top: 10px;
  131. height: 25vh;
  132. }
  133. .body .scoll {
  134. height: 91%;
  135. }
  136. .title {
  137. color: #ffffff;
  138. font-size: 14px;
  139. margin-left: 32px;
  140. /* margin-top: 12px; */
  141. margin-bottom: 10px;
  142. /* width: 570px; */
  143. width: 29vw;
  144. height: 50px;
  145. display: flex;
  146. align-items: center;
  147. position: absolute;
  148. background-color: #000000;
  149. }
  150. .title::before {
  151. z-index: 1;
  152. content: '';
  153. position: absolute;
  154. left: -18px !important;
  155. /* top: 30px !important; */
  156. width: 5px;
  157. height: 5px;
  158. background-color: #54B75A;
  159. border-radius: 50%;
  160. }
  161. .record {
  162. position: absolute;
  163. color: #ffffff;
  164. font-size: 14px;
  165. right: 0;
  166. top: 23px;
  167. width: 80px;
  168. height: 30px;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. background-color: rgba(37, 116, 219, 1);
  173. }
  174. .logo {
  175. position: absolute;
  176. top: 2px;
  177. left: 12px;
  178. }
  179. </style>