Health5.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. //以下解析顺序不可变
  75. that.stationsList.push(res.data.fczbmap.NSS_FDC)
  76. that.stationsList.push(res.data.fczbmap.XS_FDC)
  77. that.stationsList.push(res.data.fczbmap.SBQ_FDC)
  78. that.stationsList.push(res.data.fczbmap.QS_FDC)
  79. that.stationsList.push(res.data.fczbmap.MHS_FDC)
  80. that.windturbineList.push(res.data.fjmap[1]) //牛首山
  81. that.windturbineList.push(res.data.fjmap[4]) //香山
  82. that.windturbineList.push(res.data.fjmap[3]) //石板泉
  83. that.windturbineList.push(res.data.fjmap[2]) //青山
  84. that.windturbineList.push(res.data.fjmap[0]) //麻黄山
  85. }
  86. },
  87. });
  88. },
  89. // 跳转按钮
  90. onClickJump(item){
  91. console.warn(item);
  92. this.$router.push({
  93. path: `/health/health0/${item.wpId}/${item.wtId}`
  94. });
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="less">
  100. .health-5 {
  101. .health-matrix {
  102. height: calc(100vh - 7vh);
  103. .health-matrix-panel {
  104. margin-bottom: 8px;
  105. .header {
  106. background: fade(@gray, 20);
  107. line-height: 37px;
  108. margin-bottom: 8px;
  109. padding: 0 16px;
  110. display: flex;
  111. align-items: center;
  112. i {
  113. margin-right: 8px;
  114. }
  115. .title {
  116. font-size: @fontsize-s;
  117. }
  118. .tools {
  119. display: flex;
  120. .tool-block {
  121. display: flex;
  122. align-items: center;
  123. margin-left: 36px;
  124. .legend {
  125. flex: auto;
  126. width: 0.741vh;
  127. height: 0.741vh;
  128. margin-right: 0.741vh;
  129. &.long {
  130. width: 2.963vh;
  131. height: 0.37vh;
  132. }
  133. }
  134. .legend-value {
  135. color: @white;
  136. margin-left: 16px;
  137. }
  138. }
  139. }
  140. }
  141. }
  142. .matrix {
  143. display: flex;
  144. flex-wrap: wrap;
  145. .item {
  146. flex: 1 0 calc(100% / 25 - 4px);
  147. line-height: 26px;
  148. background: fade(@gray, 20);
  149. color: @gray-l;
  150. font-size: 12px;
  151. margin-bottom: 4px;
  152. text-align: center;
  153. border: 1px solid transparent;
  154. cursor: pointer;
  155. & + .item {
  156. margin-left: 4px;
  157. }
  158. &:nth-child(25n + 1) {
  159. margin-left: 0px;
  160. }
  161. &.green {
  162. color: @green;
  163. background: fade(@green, 20);
  164. border-color: @green;
  165. }
  166. &.purple {
  167. color: @purple;
  168. background: fade(@purple, 20);
  169. border-color: @purple;
  170. }
  171. &.yellow {
  172. color: @yellow;
  173. background: fade(@yellow, 20);
  174. border-color: @yellow;
  175. }
  176. &.orange {
  177. color: @orange;
  178. background: fade(@orange, 20);
  179. border-color: @orange;
  180. }
  181. &.red {
  182. color: @red;
  183. background: fade(@red, 20);
  184. border-color: @red;
  185. }
  186. }
  187. .blank {
  188. flex: 1 0 calc(100% / 25 - 4px);
  189. margin-left: 4px;
  190. }
  191. }
  192. }
  193. }
  194. </style>