areaCard.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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
  26. @on-click="handleClick"
  27. :dataList="showList"
  28. ></MatrixBlock>
  29. </div>
  30. </el-scrollbar>
  31. </div>
  32. <OperationRecords
  33. ref="records"
  34. v-model="display"
  35. @closed="closed()"
  36. ></OperationRecords>
  37. <WindturbineDetailPages
  38. v-model="dialogVisible"
  39. @close="handleClose"
  40. :windturbine="currentWindturbine"
  41. >
  42. </WindturbineDetailPages>
  43. </div>
  44. </template>
  45. <script>
  46. import BackgroundData from "utils/BackgroundData";
  47. import MatrixBlock from "../matrixBlock.vue";
  48. import OperationRecords from "./operationRecords.vue";
  49. import WindturbineDetailPages from "../WindturbineDetailPages.vue";
  50. import dataJson from "./dataJson.json";
  51. export default {
  52. props: {
  53. title: {
  54. type: String,
  55. default: "校验区",
  56. required: true,
  57. },
  58. height: {
  59. type: Number,
  60. default: 200,
  61. },
  62. },
  63. components: {
  64. MatrixBlock,
  65. OperationRecords,
  66. WindturbineDetailPages,
  67. },
  68. data() {
  69. return {
  70. showList: [],
  71. arr: [],
  72. display: false,
  73. dialogVisible: false,
  74. currentWindturbine: {},
  75. intervals: null,
  76. };
  77. },
  78. created() {
  79. // this.dataDeal();
  80. // this.intervals = setInterval(this.dataDeal, 1000);
  81. this.showList = dataJson.showList;
  82. this.arr = BackgroundData.getInstance().checkouts;
  83. },
  84. methods: {
  85. dataDeal() {
  86. if (this.arr.length > 0) {
  87. let flag = false;
  88. let showList = [];
  89. let arr = [];
  90. let checks = BackgroundData.getInstance().checkouts;
  91. checks.forEach((item) => {
  92. if (
  93. item.status ===
  94. this.$store.state.windturbinelist[item.windturbineId].status
  95. ) {
  96. showList.push(
  97. this.$store.state.windturbinelist[item.windturbineId]
  98. );
  99. } else {
  100. BackgroundData.getInstance().removeCheckouts(item);
  101. }
  102. if (new Date().getTime() - item.checkTime > 120000) {
  103. BackgroundData.getInstance().removeCheckouts(item);
  104. arr.push(item.windturbineId);
  105. flag = true;
  106. }
  107. });
  108. this.showList = showList;
  109. if (flag) {
  110. let mss = arr.join(",") + "风机超时未响应,已移除";
  111. this.$notify({
  112. title: "控制",
  113. message: mss,
  114. type: "warning",
  115. position: "bottom-right",
  116. offset: 60,
  117. duration: 3000,
  118. });
  119. flag = false;
  120. }
  121. } else {
  122. this.showList = [];
  123. }
  124. },
  125. showRecord() {
  126. this.display = true;
  127. this.$refs.records.dataDeal();
  128. },
  129. closed() {
  130. this.display = false;
  131. },
  132. handleClick(itm) {
  133. this.dialogVisible = true;
  134. this.currentWindturbine = itm;
  135. },
  136. handleClose() {
  137. this.dialogVisible = false;
  138. },
  139. },
  140. unmounted() {
  141. clearInterval(this.intervals);
  142. this.intervals = null;
  143. },
  144. };
  145. </script>
  146. <style scoped="scoped">
  147. .body {
  148. border: 1px solid #373737;
  149. width: 100%;
  150. margin-left: 15px;
  151. margin-top: 10px;
  152. height: 25vh;
  153. }
  154. .body .scoll {
  155. height: 91%;
  156. }
  157. .title {
  158. color: #ffffff;
  159. font-size: 14px;
  160. margin-left: 32px;
  161. /* margin-top: 12px; */
  162. margin-bottom: 10px;
  163. /* width: 570px; */
  164. width: 29vw;
  165. height: 50px;
  166. display: flex;
  167. align-items: center;
  168. position: absolute;
  169. background-color: #000000;
  170. }
  171. .title::before {
  172. z-index: 1;
  173. content: "";
  174. position: absolute;
  175. left: -18px !important;
  176. /* top: 30px !important; */
  177. width: 5px;
  178. height: 5px;
  179. background-color: #54b75a;
  180. border-radius: 50%;
  181. }
  182. .record {
  183. position: absolute;
  184. color: #ffffff;
  185. font-size: 14px;
  186. right: 0;
  187. top: 23px;
  188. width: 80px;
  189. height: 30px;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. background-color: rgba(37, 116, 219, 1);
  194. }
  195. .logo {
  196. position: absolute;
  197. top: 2px;
  198. left: 12px;
  199. }
  200. </style>