Health3.vue 13 KB

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