Health3.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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. timeout: 8000,
  180. subUrl: "recommen/findAllChartjz",
  181. data: {
  182. wpId: that.wpId,
  183. type: that.type
  184. },
  185. success (res) {
  186. if (res.code == 200) {
  187. that.bardata.legend = ["优数量", "良数量", "差数量"];
  188. that.lineData = res.data.lvchart;
  189. that.bardata.area = res.data.datechart;
  190. that.bardata.data[2] = res.data.cslchart;
  191. that.bardata.data[1] = res.data.lslchart;
  192. that.bardata.data[0] = res.data.yslchart;
  193. }
  194. }
  195. });
  196. },
  197. getWpMap () {
  198. let that = this;
  199. that.API.requestData({
  200. method: "POST",
  201. subUrl: "healthmain/findWpMap",
  202. data: {
  203. wpId: that.wpId
  204. },
  205. success (res) {
  206. that.listBarData1= [
  207. { name: "未来 {c1|15分钟} 预测电量", value: res.data.ycdl15minute },
  208. { name: "未来 {c1|4小时} 预测电量", value: res.data.ycdl1hour },
  209. ];
  210. let dangerData=[{
  211. name:"一级隐患",
  212. value:0
  213. },{
  214. name:"二级隐患",
  215. value:0
  216. },{
  217. name:"三级隐患",
  218. value:0
  219. },{
  220. name:"四级隐患",
  221. value:0
  222. },{
  223. name:"五级隐患",
  224. value:0
  225. }];
  226. dangerData.forEach((ele,index) => {
  227. ele.value=res.data.yhls[index];
  228. });
  229. that.dangerData = dangerData;
  230. that.tableData.data = res.data.gzls;
  231. that.sourceMap = res.data;
  232. }
  233. });
  234. },
  235. changeDate(type){
  236. this.type = type;
  237. this.requestData();
  238. },
  239. jumpUrl(item){
  240. this.$router.push(`/health/health0/${item[0]}`);
  241. }
  242. }
  243. };
  244. </script>
  245. <style lang="less">
  246. .health-3 {
  247. .power-info {
  248. display: flex;
  249. .info-tab {
  250. flex: 0 0 156px;
  251. display: flex;
  252. flex-direction: column;
  253. height: 287px;
  254. margin-right: 1.4815vh;
  255. .tab {
  256. position: relative;
  257. flex: 0 0 auto;
  258. text-align: center;
  259. height: 33px;
  260. line-height: 33px;
  261. margin-right: 8px;
  262. color: @gray-l;
  263. font-size: 12px;
  264. background: fade(@gray, 20);
  265. border: 1px solid fade(@gray, 20);
  266. display: flex;
  267. align-items: center;
  268. i {
  269. margin: 0 1.4815vh;
  270. svg use {
  271. fill: @gray-l;
  272. }
  273. }
  274. &:hover,
  275. &.active {
  276. background: fade(@green, 20);
  277. border: 1px solid @green;
  278. color: @green;
  279. cursor: pointer;
  280. i svg use {
  281. fill: @green;
  282. }
  283. }
  284. &.active::after {
  285. box-sizing: content-box;
  286. width: 0px;
  287. height: 0px;
  288. position: absolute;
  289. right: -19px;
  290. padding: 0;
  291. border-bottom: 9px solid @green;
  292. border-top: 9px solid transparent;
  293. border-left: 9px solid transparent;
  294. border-right: 9px solid transparent;
  295. display: block;
  296. content: '';
  297. z-index: 10;
  298. transform: rotate(90deg);
  299. }
  300. &.active::before {
  301. box-sizing: content-box;
  302. width: 0px;
  303. height: 0px;
  304. position: absolute;
  305. right: -17px;
  306. padding: 0;
  307. border-bottom: 9px solid #063319;
  308. border-top: 9px solid transparent;
  309. border-left: 9px solid transparent;
  310. border-right: 9px solid transparent;
  311. display: block;
  312. content: '';
  313. z-index: 12;
  314. transform: rotate(90deg);
  315. }
  316. & + .tab {
  317. margin-top: 0.7407vh;
  318. }
  319. &:last-child {
  320. text-align: center;
  321. justify-content: center;
  322. }
  323. }
  324. .empty {
  325. flex: 1 0 auto;
  326. }
  327. }
  328. .info-chart {
  329. flex: 1 0 auto;
  330. }
  331. }
  332. .fj-info {
  333. display: flex;
  334. .left-info {
  335. flex: 0 0 300px;
  336. padding-right: 16px;
  337. .com-panel .panel-header {
  338. margin-bottom: 0.7407vh;
  339. }
  340. @media screen and (max-height: 1078px) {
  341. .mg-b-16 {
  342. margin-bottom: 0.7407vh;
  343. }
  344. }
  345. @media screen and (min-height: 1078px) and (max-height: 1080px) {
  346. .com-panel .panel-header {
  347. margin-bottom: 1.4815vh;
  348. }
  349. }
  350. .dashboard {
  351. position: relative;
  352. display: flex;
  353. align-items: center;
  354. .lengends {
  355. font-size: 12px;
  356. line-height: 20px;
  357. padding-left: 12px;
  358. .item {
  359. display: flex;
  360. align-items: center;
  361. .label {
  362. margin-right: 8px;
  363. color: @gray;
  364. }
  365. .lengend {
  366. display: inline-block;
  367. width: 6px;
  368. height: 6px;
  369. background: @gray;
  370. border-radius: 50%;
  371. margin-right: 8px;
  372. &.green {
  373. background: @green;
  374. }
  375. }
  376. .value {
  377. color: fade(@white, 75);
  378. }
  379. }
  380. }
  381. }
  382. }
  383. .right-info {
  384. flex: 1;
  385. .matrix-panel {
  386. .panel-title {
  387. flex: 0 0 auto;
  388. }
  389. .tools {
  390. margin-left: 8px;
  391. .level {
  392. padding: 0 16px;
  393. }
  394. }
  395. .matrix {
  396. display: flex;
  397. flex-wrap: wrap;
  398. .item {
  399. flex: 1 0 calc(100% / 20 - 4px);
  400. line-height: 26px;
  401. background: fade(@gray, 20);
  402. color: @gray-l;
  403. font-size: 12px;
  404. margin-bottom: 4px;
  405. text-align: center;
  406. border: 1px solid transparent;
  407. cursor: pointer;
  408. & + .item {
  409. margin-left: 4px;
  410. }
  411. &:nth-child(20n + 1) {
  412. margin-left: 0px;
  413. }
  414. &.green {
  415. color: @green;
  416. background: fade(@green, 20);
  417. border-color: @green;
  418. }
  419. &.purple {
  420. color: @purple;
  421. background: fade(@purple, 20);
  422. border-color: @purple;
  423. }
  424. &.orange {
  425. color: @orange;
  426. background: fade(@orange, 20);
  427. border-color: @orange;
  428. }
  429. &.red {
  430. color: @red;
  431. background: fade(@red, 20);
  432. border-color: @red;
  433. }
  434. }
  435. .blank {
  436. flex: 1 0 calc(100% / 20 - 4px);
  437. margin-left: 4px;
  438. }
  439. }
  440. }
  441. .table {
  442. tbody {
  443. height: calc(100vh - 640px);
  444. }
  445. }
  446. }
  447. }
  448. }
  449. </style>