Health3.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <template>
  2. <div class="health-3">
  3. <div class="power-info mg-b-8">
  4. <div class="info-tab">
  5. <div class="tab" :class="type === '2' ? 'active' : ''" @click="changeDate('2')">
  6. <i class="svg-icon svg-icon svg-icon-sm">
  7. <svg-icon :svgid="'svg-h-day'" />
  8. </i>
  9. <span> 7日健康趋势 </span>
  10. </div>
  11. <div class="tab" :class="type === '3' ? 'active' : ''" @click="changeDate('3')">
  12. <i class="svg-icon svg-icon svg-icon-sm">
  13. <svg-icon :svgid="'svg-h-month'" />
  14. </i>
  15. <span>30日健康趋势</span>
  16. </div>
  17. <div class="empty"></div>
  18. <!-- <div class="tab">
  19. <span>全部风场健康趋势</span>
  20. </div> -->
  21. </div>
  22. <div class="info-chart">
  23. <panel class="info-chart-panel" :title="'损失电量分析'">
  24. <vertival-bar-line-chart :bardata="bardata" :lineData="lineData" :height="'250px'" />
  25. </panel>
  26. </div>
  27. </div>
  28. <div class="fj-info">
  29. <div class="left-info ">
  30. <panel title="预测电量" class="mg-b-16">
  31. <list-bar-chart :list="listBarData1" :colors="listBarData1Color" :height="'9.5vh'" />
  32. <div class="dashboard">
  33. <dashboard-2 :height="'7.5vh'" :width="'115px'" :value="sourceMap.rfdl" />
  34. <div class="lengends">
  35. <div class="item">
  36. <span class="label">本日发电量</span>
  37. <span class="lengend gary"></span>
  38. <span class="value">{{sourceMap.rfdl}}</span>
  39. </div>
  40. <div class="item">
  41. <span class="label">本日预测电量</span>
  42. <span class="lengend green"></span>
  43. <span class="value">{{sourceMap.ycdl1day}}</span>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="dashboard">
  48. <dashboard-2 :height="'7.5vh'" :width="'115px'" :value="sourceMap.yfdl" />
  49. <div class="lengends">
  50. <div class="item">
  51. <span class="label">本月发电量</span>
  52. <span class="lengend gary"></span>
  53. <span class="value">{{sourceMap.yfdl}}</span>
  54. </div>
  55. <div class="item">
  56. <span class="label">本月预测电量</span>
  57. <span class="lengend green"></span>
  58. <span class="value">{{sourceMap.yczqlmonth}}</span>
  59. </div>
  60. </div>
  61. </div>
  62. </panel>
  63. <panel title="设备健康度" class="mg-b-16">
  64. <thermometer-v-chart :height="'5.5vh'" :value="sourceMap.jkd" />
  65. </panel>
  66. <panel title="隐患等级" class="mg-b-16">
  67. <normal-pie-chart :list="dangerData" :height="'14vh'" />
  68. </panel>
  69. </div>
  70. <div class="right-info">
  71. <toolbar-panel title="风机健康矩阵列表" :showLine="false" class="matrix-panel mg-b-8">
  72. <template v-slot:tools>
  73. <div class="tools">
  74. <span class="level">
  75. <span class="text green">优</span>:
  76. <span class="value white">{{sourceMap.ysl}}</span>
  77. <span class="unit gray">台</span>
  78. </span>
  79. <span class="level">
  80. <span class="text purple">良</span>:
  81. <span class="value white">{{sourceMap.lsl}}</span>
  82. <span class="unit gray">台</span>
  83. </span>
  84. <span class="level">
  85. <span class="text orange">差</span>:
  86. <span class="value white">{{sourceMap.csl}}</span>
  87. <span class="unit gray">台</span>
  88. </span>
  89. </div>
  90. </template>
  91. <div class="matrix">
  92. <div class="item" :class="item[1] === '1' ? 'green' : item[1] === '2' ? 'purple' : 'orange'" v-for="(item, index) in sourceMap.wtIdls" :key="index" @click="jumpUrl(item)">{{item[2]}}</div>
  93. <div class="blank" v-for="index of 20" :key="index"></div>
  94. </div>
  95. </toolbar-panel>
  96. <div class="table">
  97. <Table :data="tableData" />
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </template>
  103. <script>
  104. import ListBarChart from "../../components/chart/bar/list-bar-chart.vue";
  105. import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
  106. import Dashboard2 from "../../components/chart/other/Dashboard2.vue";
  107. import ThermometerVChart from "../../components/chart/other/thermometer-v-chart.vue";
  108. import NormalPieChart from "../../components/chart/pie/normal-pie-chart.vue";
  109. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  110. import Panel from "../../components/coms/panel/panel.vue";
  111. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  112. import Table from "../../components/coms/table/table.vue";
  113. export default {
  114. setup () { },
  115. components: { SvgIcon, Panel, VertivalBarLineChart, Table, ListBarChart, ThermometerVChart, NormalPieChart, ToolbarPanel, Dashboard2 },
  116. data () {
  117. return {
  118. sourceMap: {
  119. wtIdls:[]
  120. },
  121. type: "2",
  122. bardata:{
  123. area:[],
  124. legend:[],
  125. data:[[]]
  126. },
  127. lineData:[],
  128. listBarData1: [],
  129. dangerData:[],
  130. listBarData1Color: ["purple", "purple"],
  131. tableData: {
  132. column: [{
  133. name: "",
  134. field: "",
  135. is_num: false,
  136. is_light: false,
  137. },
  138. {
  139. name: "风机编号",
  140. field: "windTurbineId",
  141. is_num: false,
  142. is_light: false,
  143. },
  144. {
  145. name: "故障时间",
  146. field: "stopTime",
  147. is_num: false,
  148. is_light: false,
  149. },
  150. {
  151. name: "故障类型",
  152. field: "stopTypeId",
  153. is_num: false,
  154. is_light: false,
  155. },
  156. {
  157. name: "报警描述",
  158. field: "warningId",
  159. is_num: false,
  160. is_light: false,
  161. },
  162. ],
  163. data: [],
  164. },
  165. };
  166. },
  167. created () {
  168. this.wpId = this.$route.params.wpId;
  169. this.$nextTick(()=>{
  170. this.requestData();
  171. this.getWpMap();
  172. });
  173. },
  174. methods: {
  175. requestData(){
  176. let that = this;
  177. that.API.requestData({
  178. method: "POST",
  179. subUrl: "recommen/findAllChartjz",
  180. data: {
  181. wpId: that.wpId,
  182. type: that.type
  183. },
  184. success (res) {
  185. // 顶部图表绿线
  186. let lineData = res.data.lvchart;
  187. let area = res.data.datechart;
  188. let legend = ["优数量", "良数量", "差数量"];
  189. let data = [];
  190. let dataLength = res.data.datechart.length;
  191. for(let i=0;i<dataLength;i++){
  192. data.push([res.data.yslchart[i], res.data.lslchart[i], res.data.cslchart[i]]);
  193. }
  194. let bardata = {
  195. area,
  196. legend,
  197. data
  198. };
  199. that.bardata = bardata;
  200. that.lineData = lineData;
  201. }
  202. });
  203. },
  204. getWpMap () {
  205. let that = this;
  206. that.API.requestData({
  207. method: "POST",
  208. subUrl: "healthmain/findWpMap",
  209. data: {
  210. wpId: that.wpId
  211. },
  212. success (res) {
  213. that.listBarData1= [
  214. { name: "未来 {c1|15分钟} 预测电量", value: res.data.ycdl15minute },
  215. { name: "未来 {c1|4小时} 预测电量", value: res.data.ycdl1hour },
  216. ];
  217. let dangerData=[{
  218. name:"一级隐患",
  219. value:0
  220. },{
  221. name:"二级隐患",
  222. value:0
  223. },{
  224. name:"三级隐患",
  225. value:0
  226. },{
  227. name:"四级隐患",
  228. value:0
  229. },{
  230. name:"五级隐患",
  231. value:0
  232. }];
  233. dangerData.forEach((ele,index) => {
  234. ele.value=res.data.yhls[index];
  235. });
  236. that.dangerData = dangerData;
  237. that.tableData.data = res.data.gzls;
  238. that.sourceMap = res.data;
  239. }
  240. });
  241. },
  242. changeDate(type){
  243. this.type = type;
  244. this.requestData();
  245. },
  246. jumpUrl(item){
  247. this.$router.push(`/health/health0/${item[0]}`);
  248. }
  249. }
  250. };
  251. </script>
  252. <style lang="less">
  253. .health-3 {
  254. .power-info {
  255. display: flex;
  256. .info-tab {
  257. flex: 0 0 156px;
  258. display: flex;
  259. flex-direction: column;
  260. height: 287px;
  261. margin-right: 1.4815vh;
  262. .tab {
  263. position: relative;
  264. flex: 0 0 auto;
  265. text-align: center;
  266. height: 33px;
  267. line-height: 33px;
  268. margin-right: 8px;
  269. color: @gray-l;
  270. font-size: 12px;
  271. background: fade(@gray, 20);
  272. border: 1px solid fade(@gray, 20);
  273. display: flex;
  274. align-items: center;
  275. i {
  276. margin: 0 1.4815vh;
  277. svg use {
  278. fill: @gray-l;
  279. }
  280. }
  281. &:hover,
  282. &.active {
  283. background: fade(@green, 20);
  284. border: 1px solid @green;
  285. color: @green;
  286. cursor: pointer;
  287. i svg use {
  288. fill: @green;
  289. }
  290. }
  291. &.active::after {
  292. box-sizing: content-box;
  293. width: 0px;
  294. height: 0px;
  295. position: absolute;
  296. right: -19px;
  297. padding: 0;
  298. border-bottom: 9px solid @green;
  299. border-top: 9px solid transparent;
  300. border-left: 9px solid transparent;
  301. border-right: 9px solid transparent;
  302. display: block;
  303. content: '';
  304. z-index: 10;
  305. transform: rotate(90deg);
  306. }
  307. &.active::before {
  308. box-sizing: content-box;
  309. width: 0px;
  310. height: 0px;
  311. position: absolute;
  312. right: -17px;
  313. padding: 0;
  314. border-bottom: 9px solid #063319;
  315. border-top: 9px solid transparent;
  316. border-left: 9px solid transparent;
  317. border-right: 9px solid transparent;
  318. display: block;
  319. content: '';
  320. z-index: 12;
  321. transform: rotate(90deg);
  322. }
  323. & + .tab {
  324. margin-top: 0.7407vh;
  325. }
  326. &:last-child {
  327. text-align: center;
  328. justify-content: center;
  329. }
  330. }
  331. .empty {
  332. flex: 1 0 auto;
  333. }
  334. }
  335. .info-chart {
  336. flex: 1 0 auto;
  337. }
  338. }
  339. .fj-info {
  340. display: flex;
  341. .left-info {
  342. flex: 0 0 300px;
  343. padding-right: 16px;
  344. .com-panel .panel-header {
  345. margin-bottom: 0.7407vh;
  346. }
  347. @media screen and (max-height: 1078px) {
  348. .mg-b-16 {
  349. margin-bottom: 0.7407vh;
  350. }
  351. }
  352. @media screen and (min-height: 1078px) and (max-height: 1080px) {
  353. .com-panel .panel-header {
  354. margin-bottom: 1.4815vh;
  355. }
  356. }
  357. .dashboard {
  358. position: relative;
  359. display: flex;
  360. align-items: center;
  361. .lengends {
  362. font-size: 12px;
  363. line-height: 20px;
  364. padding-left: 12px;
  365. .item {
  366. display: flex;
  367. align-items: center;
  368. .label {
  369. margin-right: 8px;
  370. color: @gray;
  371. }
  372. .lengend {
  373. display: inline-block;
  374. width: 6px;
  375. height: 6px;
  376. background: @gray;
  377. border-radius: 50%;
  378. margin-right: 8px;
  379. &.green {
  380. background: @green;
  381. }
  382. }
  383. .value {
  384. color: fade(@white, 75);
  385. }
  386. }
  387. }
  388. }
  389. }
  390. .right-info {
  391. flex: 1;
  392. .matrix-panel {
  393. .panel-title {
  394. flex: 0 0 auto;
  395. }
  396. .tools {
  397. margin-left: 8px;
  398. .level {
  399. padding: 0 16px;
  400. }
  401. }
  402. .matrix {
  403. display: flex;
  404. flex-wrap: wrap;
  405. .item {
  406. flex: 1 0 calc(100% / 20 - 4px);
  407. line-height: 26px;
  408. background: fade(@gray, 20);
  409. color: @gray-l;
  410. font-size: 12px;
  411. margin-bottom: 4px;
  412. text-align: center;
  413. border: 1px solid transparent;
  414. cursor: pointer;
  415. & + .item {
  416. margin-left: 4px;
  417. }
  418. &:nth-child(20n + 1) {
  419. margin-left: 0px;
  420. }
  421. &.green {
  422. color: @green;
  423. background: fade(@green, 20);
  424. border-color: @green;
  425. }
  426. &.purple {
  427. color: @purple;
  428. background: fade(@purple, 20);
  429. border-color: @purple;
  430. }
  431. &.orange {
  432. color: @orange;
  433. background: fade(@orange, 20);
  434. border-color: @orange;
  435. }
  436. &.red {
  437. color: @red;
  438. background: fade(@red, 20);
  439. border-color: @red;
  440. }
  441. }
  442. .blank {
  443. flex: 1 0 calc(100% / 20 - 4px);
  444. margin-left: 4px;
  445. }
  446. }
  447. }
  448. .table {
  449. tbody {
  450. height: calc(100vh - 640px);
  451. }
  452. }
  453. }
  454. }
  455. }
  456. </style>