areaCard.vue 5.0 KB

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