index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="health-5">
  3. <!-- 当内容超出页面时 添加 el-scrollbar 即可自动添加滚动条 -->
  4. <el-scrollbar>
  5. <div class="health-matrix">
  6. <div
  7. class="health-matrix-panel"
  8. v-for="(pEle, pIndex) in stationsList"
  9. :key="pIndex"
  10. >
  11. <div class="header">
  12. <i class="svg-icon svg-icon-sm svg-icon-white">
  13. <svg-icon :svgid="'svg-wind-site'" />
  14. </i>
  15. <span class="title">{{ pEle.name }}健康矩阵列表</span>
  16. <div class="tools">
  17. <div class="tool-block">
  18. <div class="legend bg-green"></div>
  19. <div class="legend-text green">良好数量(台)</div>
  20. <div class="legend-value">{{ pEle.lhsl }}</div>
  21. </div>
  22. <div class="tool-block">
  23. <div class="legend bg-purple"></div>
  24. <div class="legend-text purple">正常数量(台)</div>
  25. <div class="legend-value">{{ pEle.zcsl }}</div>
  26. </div>
  27. <div class="tool-block">
  28. <div class="legend bg-yellow"></div>
  29. <div class="legend-text yellow">注意数量(台)</div>
  30. <div class="legend-value">{{ pEle.zysl }}</div>
  31. </div>
  32. <div class="tool-block">
  33. <div class="legend bg-orange"></div>
  34. <div class="legend-text orange">严重数量(台)</div>
  35. <div class="legend-value">{{ pEle.yzsl }}</div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="body">
  40. <div class="matrix">
  41. <div
  42. class="item"
  43. v-for="(cItem, cIndex) in pEle.windturbineList"
  44. :key="cIndex"
  45. @click="onClickJump(cItem)"
  46. >
  47. <div v-if="parseInt(cItem.fjzt) == 1" class="green">
  48. {{ cItem.wtCode }}号
  49. </div>
  50. <div v-if="parseInt(cItem.fjzt) == 2" class="purple">
  51. {{ cItem.wtCode }}号
  52. </div>
  53. <div v-if="parseInt(cItem.fjzt) == 3" class="yellow">
  54. {{ cItem.wtCode }}号
  55. </div>
  56. <div v-if="parseInt(cItem.fjzt) == 4" class="orange">
  57. {{ cItem.wtCode }}号
  58. </div>
  59. <div v-if="parseInt(cItem.fjzt) == 0" class="gray">
  60. {{ cItem.wtCode }}号
  61. </div>
  62. </div>
  63. <div class="blank" v-for="index of 25" :key="index"></div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </el-scrollbar>
  69. </div>
  70. </template>
  71. <script>
  72. import SvgIcon from "@/components/coms/icon/svg-icon.vue";
  73. import api from "@api/wisdomOverhaul/health/index.js";
  74. export default {
  75. name: "healthMatrix",
  76. setup() {},
  77. components: { SvgIcon },
  78. data() {
  79. return {
  80. stationsList: [],
  81. };
  82. },
  83. created() {
  84. this.getHealthMatrix();
  85. },
  86. methods: {
  87. // 健康矩阵数据
  88. getHealthMatrix() {
  89. api.healthmainFindHealthMatrixMap().then((res) => {
  90. if (res.code == 200) {
  91. let stationsList = [];
  92. for (let key in res.data.fczbmap) {
  93. let wpItem = Object.assign({}, res.data.fczbmap[key]);
  94. wpItem.wpId = key;
  95. stationsList.push(wpItem);
  96. }
  97. stationsList.forEach((ele) => {
  98. for (let i = 0; i < res.data.fjmap.length; i++) {
  99. if (res.data.fjmap[i]?.[0]?.wpId === ele.wpId) {
  100. ele.windturbineList = res.data.fjmap[i];
  101. break;
  102. }
  103. }
  104. });
  105. this.stationsList = stationsList;
  106. }
  107. });
  108. },
  109. // 跳转按钮
  110. onClickJump(item) {
  111. this.$router.push({
  112. path: `/health/healthDetail/wtHealth/${item.wpId}/${item.wtId}`,
  113. });
  114. },
  115. },
  116. };
  117. </script>
  118. <style lang="less">
  119. .health-5 {
  120. height: 100%;
  121. padding: 10px 30px;
  122. .health-matrix {
  123. height: 100%;
  124. .health-matrix-panel {
  125. margin-bottom: 8px;
  126. .header {
  127. background: fade(@gray, 20);
  128. line-height: 37px;
  129. margin-bottom: 8px;
  130. padding: 0 16px;
  131. display: flex;
  132. align-items: center;
  133. i {
  134. margin-right: 8px;
  135. }
  136. .title {
  137. font-size: @fontsize-s;
  138. }
  139. .tools {
  140. display: flex;
  141. .tool-block {
  142. display: flex;
  143. align-items: center;
  144. margin-left: 36px;
  145. .legend {
  146. flex: auto;
  147. width: 10px;
  148. height: 10px;
  149. margin-right: 10px;
  150. &.long {
  151. width: 2.963vh;
  152. height: 0.37vh;
  153. }
  154. }
  155. .legend-value {
  156. color: @white;
  157. margin-left: 16px;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. .matrix {
  164. display: flex;
  165. flex-wrap: wrap;
  166. .item {
  167. flex: 1 0 calc(100% / 25 - 4px);
  168. line-height: 26px;
  169. background: fade(@gray, 20);
  170. color: @gray-l;
  171. font-size: 12px;
  172. margin-bottom: 4px;
  173. text-align: center;
  174. border: 1px solid transparent;
  175. cursor: pointer;
  176. & + .item {
  177. margin-left: 4px;
  178. }
  179. &:nth-child(25n + 1) {
  180. margin-left: 0px;
  181. }
  182. &.green {
  183. color: @green;
  184. background: fade(@green, 20);
  185. border-color: @green;
  186. }
  187. &.purple {
  188. color: @purple;
  189. background: fade(@purple, 20);
  190. border-color: @purple;
  191. }
  192. &.yellow {
  193. color: @yellow;
  194. background: fade(@yellow, 20);
  195. border-color: @yellow;
  196. }
  197. &.orange {
  198. color: @orange;
  199. background: fade(@orange, 20);
  200. border-color: @orange;
  201. }
  202. &.red {
  203. color: @red;
  204. background: fade(@red, 20);
  205. border-color: @red;
  206. }
  207. &.gray {
  208. color: @gray;
  209. background: fade(@gray, 20);
  210. border-color: @gray;
  211. }
  212. }
  213. .blank {
  214. flex: 1 0 calc(100% / 25 - 4px);
  215. margin-left: 4px;
  216. }
  217. }
  218. }
  219. }
  220. </style>