Health5.vue 5.7 KB

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