Health8.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <div class="health-8">
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">场站:</div>
  7. <div class="search-input">
  8. <el-select
  9. v-model="value1"
  10. clearable
  11. placeholder="请选择"
  12. popper-class="select"
  13. @change="searchWindTurbineHealthList"
  14. >
  15. <el-option
  16. v-for="item in options"
  17. :key="item.id"
  18. :label="item.name"
  19. :value="item.id"
  20. >
  21. </el-option>
  22. </el-select>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="table">
  28. <table style="width: 100%" border="0" cellspacing="0">
  29. <thead>
  30. <tr>
  31. <th rowspan="2" class="type1" style="width: 50px"></th>
  32. <th rowspan="2" class="type1" style="width: 105px">风机编号</th>
  33. <th rowspan="2" class="type1" style="width: 105px">风机型号</th>
  34. <th rowspan="2" class="type1" style="width: 350px">置信度</th>
  35. <th rowspan="2" class="type1" style="width: 100px">健康分数</th>
  36. <th
  37. rowspan="2"
  38. class="type1"
  39. style="border: 2px solid #07140f; border-left: 0"
  40. >
  41. 未来风机健康程度
  42. </th>
  43. <th colspan="8">组件健康度</th>
  44. </tr>
  45. <tr>
  46. <th style="width: 100px">齿轮箱</th>
  47. <th style="width: 100px">发电机</th>
  48. <th style="width: 100px">主轴</th>
  49. <th style="width: 100px">变桨</th>
  50. <th style="width: 100px">偏航</th>
  51. <th style="width: 100px">机舱</th>
  52. <th style="width: 100px">变频器</th>
  53. <th style="width: 100px">主控</th>
  54. </tr>
  55. </thead>
  56. </table>
  57. <el-scrollbar>
  58. <div style="height: calc(100vh - 174px)">
  59. <table style="width: 100%" border="0" cellspacing="0">
  60. <tbody>
  61. <tr v-for="(item,index) in tableData" :key="index">
  62. <td style="width: 50px">{{item.id}}</td>
  63. <td style="width: 105px">{{item.wtname}}</td>
  64. <td style="width: 105px">{{item.model}}</td>
  65. <td style="width: 350px">
  66. <div class="percent-item">
  67. {{item.zxd}}%
  68. <div class="percent-bar" style="">
  69. <div class="percent-value" :style="{'width':`${item.zxd}%`}"></div>
  70. </div>
  71. </div>
  72. </td>
  73. <td class="score" style="width: 100px">
  74. <div>{{item.score}}</div>
  75. </td>
  76. <td>
  77. <table-line-chart :list='item.futureHealth'/>
  78. </td>
  79. <td class="item">
  80. <div :class="[color(item.clx)]">{{item.clx}}</div>
  81. </td>
  82. <td class="item">
  83. <div :class="[color(item.fdj)]">{{item.fdj}}</div>
  84. </td>
  85. <td class="item">
  86. <div :class="[color(item.zz)]">{{item.zz}}</div>
  87. </td>
  88. <td class="item">
  89. <div :class="[color(item.bj)]">{{item.bj}}</div>
  90. </td>
  91. <td class="item">
  92. <div :class="[color(item.ph)]">{{item.ph}}</div>
  93. </td>
  94. <td class="item">
  95. <div :class="[color(item.jc)]">{{item.jc}}</div>
  96. </td>
  97. <td class="item">
  98. <div :class="[color(item.bpq)]">{{item.bpq}}</div>
  99. </td>
  100. <td class="item">
  101. <div :class="[color(item.zk)]">{{item.zk}}</div>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. </div>
  107. </el-scrollbar>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import TableLineChart from "../../components/chart/line/table-line-chart.vue";
  113. export default {
  114. setup() {},
  115. components: { TableLineChart },
  116. data() {
  117. return {
  118. options: [
  119. {
  120. value: "选项1",
  121. label: "黄金糕",
  122. },
  123. {
  124. value: "选项2",
  125. label: "双皮奶",
  126. },
  127. {
  128. value: "选项3",
  129. label: "蚵仔煎",
  130. },
  131. {
  132. value: "选项4",
  133. label: "龙须面",
  134. },
  135. {
  136. value: "选项5",
  137. label: "北京烤鸭",
  138. },
  139. ],
  140. value1: "",
  141. tableData:'',
  142. colorval:{
  143. '优':'purple',
  144. '良':'orange',
  145. '差':'red',
  146. }
  147. };
  148. },
  149. created() {
  150. this.search();
  151. },
  152. methods: {
  153. color(val){
  154. return this.colorval[val]
  155. },
  156. async search() {
  157. const {data} = await this.API.requestData({
  158. subUrl: "powercompare/windfarmAjax",
  159. });
  160. this.options = data.data
  161. this.value1 = data.data[0].id
  162. this.searchWindTurbineHealthList()
  163. },
  164. async searchWindTurbineHealthList(){
  165. const {data} = await this.API.requestData({
  166. subUrl: "wtHealthList/windTurbineHealthList",
  167. method: "POST",
  168. data:{
  169. wpId : this.value1
  170. }
  171. });
  172. this.tableData = data.data
  173. }
  174. },
  175. };
  176. </script>
  177. <style lang="less">
  178. .health-8 {
  179. .table {
  180. tbody {
  181. tr:nth-child(2n) td {
  182. background-color: fade(@gray, 20%);
  183. &.item {
  184. background-color: transparent;
  185. }
  186. }
  187. }
  188. th {
  189. background: fade(@gray, 40);
  190. font-size: 12px;
  191. font-weight: 400;
  192. line-height: 24px;
  193. color: @gray-l;
  194. border: 2px solid #07140f;
  195. &.type1 {
  196. border-left: 0;
  197. border-right: 0;
  198. }
  199. }
  200. td {
  201. color: @gray-l;
  202. text-align: center;
  203. height: 26px;
  204. line-height: 26px;
  205. &.item {
  206. width: 100px;
  207. div {
  208. color: @white;
  209. background: fade(@gray, 20);
  210. margin: 2px;
  211. border: 1px solid transparent;
  212. &.green {
  213. color: @green;
  214. background: fade(@green, 20);
  215. border-color: @green;
  216. }
  217. &.purple {
  218. color: @purple;
  219. background: fade(@purple, 20);
  220. border-color: @purple;
  221. }
  222. &.orange {
  223. color: @orange;
  224. background: fade(@orange, 20);
  225. border-color: @orange;
  226. }
  227. &.red {
  228. color: @red;
  229. background: fade(@red, 20);
  230. border-color: @red;
  231. }
  232. }
  233. }
  234. }
  235. .percent-item {
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. height: 34px;
  240. .percent-bar {
  241. height: 12px;
  242. width: 170px;
  243. background: transparent;
  244. border: 1px solid @gray-l;
  245. margin-left: 8px;
  246. .percent-value {
  247. height: calc(100% - 4px);
  248. background: @green;
  249. margin: 2px;
  250. }
  251. }
  252. }
  253. .score {
  254. width: 100px;
  255. div {
  256. background: fade(@gray, 20);
  257. }
  258. }
  259. }
  260. }
  261. </style>