Health2.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <template>
  2. <div class="health-2">
  3. <div class="power-info mg-b-16">
  4. <div class="info-tab">
  5. <div
  6. class="tab"
  7. :class="type === '2' ? 'active' : ''"
  8. @click="changeDate('2')"
  9. >
  10. <i class="svg-icon svg-icon svg-icon-sm">
  11. <svg-icon :svgid="'svg-h-day'" />
  12. </i>
  13. <span> 7日健康趋势 </span>
  14. </div>
  15. <div
  16. class="tab"
  17. :class="type === '3' ? 'active' : ''"
  18. @click="changeDate('3')"
  19. >
  20. <i class="svg-icon svg-icon svg-icon-sm">
  21. <svg-icon :svgid="'svg-h-month'" />
  22. </i>
  23. <span>30日健康趋势</span>
  24. </div>
  25. <div class="empty"></div>
  26. <!-- <div class="tab">
  27. <span>全部风场健康趋势</span>
  28. </div> -->
  29. </div>
  30. <div class="info-chart">
  31. <!-- <panel class="info-chart-panel" :title="'损失电量分析'"> -->
  32. <panel class="info-chart-panel" :title="'健康趋势'">
  33. <vertival-bar-line-chart
  34. :bardata="bardata"
  35. :lineData="lineData"
  36. :height="'250px'"
  37. />
  38. </panel>
  39. </div>
  40. </div>
  41. <div class="fc-info mg-b-16">
  42. <div class="fc-item" v-for="(item, index) in wpmap" :key="index">
  43. <div class="title" @click="jumpUrl(item.wpId)">{{ item.name }}</div>
  44. <div class="tags">
  45. <div class="tag">
  46. <i class="svg-icon svg-icon-gray-l svg-icon-lg">
  47. <svg-icon :svgid="item.svgIcon" />
  48. </i>
  49. </div>
  50. <div class="tag">
  51. <div class="tag-title">实时风速</div>
  52. <div class="tag-value">
  53. {{ item.sjfs }}<span class="unit">m/s</span>
  54. </div>
  55. </div>
  56. <div class="tag">
  57. <div class="tag-title">预测风速</div>
  58. <div class="tag-value">
  59. {{ item.ycfs }}<span class="unit">m/s</span>
  60. </div>
  61. </div>
  62. <div class="tag">
  63. <div class="tag-title">健康度(优)</div>
  64. <div class="tag-value">
  65. {{ item.ysl }}<span class="unit">台</span>
  66. </div>
  67. </div>
  68. <div class="tag">
  69. <div class="tag-title">健康度(良)</div>
  70. <div class="tag-value">
  71. {{ item.lsl }}<span class="unit">台</span>
  72. </div>
  73. </div>
  74. <div class="tag">
  75. <div class="tag-title">健康度(差)</div>
  76. <div class="tag-value">
  77. {{ item.csl }}<span class="unit">台</span>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="health-info">
  82. <div class="title">
  83. 设备健康度
  84. <div class="actions">
  85. <div
  86. class="action"
  87. :class="item.showType === '1' ? 'active' : ''"
  88. @click="changeWpShowType(index, '1')"
  89. >
  90. <i class="svg-icon svg-icon-sm">
  91. <svg-icon :svgid="'svg-wind-site'" />
  92. </i>
  93. 比例
  94. </div>
  95. <div
  96. class="action"
  97. :class="item.showType === '2' ? 'active' : ''"
  98. @click="changeWpShowType(index, '2')"
  99. >
  100. <i class="svg-icon svg-icon-sm">
  101. <svg-icon :svgid="'svg-wind-site'" />
  102. </i>
  103. 风机号
  104. </div>
  105. </div>
  106. </div>
  107. <div class="info-body">
  108. <div class="proportion-info" v-show="item.showType === '1'">
  109. <thermometer-chart
  110. :value="item.jkd"
  111. :height="'120px'"
  112. :width="'80px'"
  113. />
  114. <dashboard
  115. :value="item.csl"
  116. :max="item.jrts"
  117. :height="'150px'"
  118. :width="'150px'"
  119. />
  120. </div>
  121. <div class="device-list" v-show="item.showType === '2'">
  122. <div
  123. class="item orange"
  124. v-for="(gzItem, gzIndex) in item.gzId"
  125. :key="gzIndex"
  126. >
  127. {{ gzItem.name }}
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="fc-list">
  135. <Table :data="tableData" />
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import VertivalBarLineChart from "../../components/chart/combination/health-bar-line-chart.vue";
  141. import Dashboard from "../../components/chart/other/Dashboard.vue";
  142. import ThermometerChart from "../../components/chart/other/thermometer-chart.vue";
  143. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  144. import Panel from "../../components/coms/panel/panel.vue";
  145. import Table from "../../components/coms/table/table.vue";
  146. import api from "@api/wisdomOverhaul/health/index.js";
  147. export default {
  148. setup() {},
  149. components: {
  150. SvgIcon,
  151. Panel,
  152. VertivalBarLineChart,
  153. ThermometerChart,
  154. Dashboard,
  155. Table,
  156. },
  157. data() {
  158. return {
  159. type: "2",
  160. bardata: {
  161. area: [],
  162. legend: [],
  163. data: [[]],
  164. },
  165. wpmap: [],
  166. lineData: [],
  167. tableData: {
  168. column: [
  169. {
  170. name: "",
  171. field: "",
  172. is_num: false,
  173. is_light: false,
  174. },
  175. {
  176. name: "风机编号",
  177. field: "windTurbineId",
  178. is_num: false,
  179. is_light: false,
  180. },
  181. {
  182. name: "故障时间",
  183. field: "stopTime",
  184. is_num: false,
  185. is_light: false,
  186. },
  187. {
  188. name: "故障类型",
  189. field: "stopTypeId",
  190. is_num: false,
  191. is_light: false,
  192. },
  193. {
  194. name: "报警描述",
  195. field: "warningId",
  196. is_num: false,
  197. is_light: false,
  198. },
  199. ],
  200. data: [],
  201. },
  202. };
  203. },
  204. created() {
  205. this.requestData();
  206. this.getAllMap();
  207. },
  208. methods: {
  209. // 获取顶部柱状图数据
  210. requestData() {
  211. api
  212. .findAllChartjz({
  213. wpId: "0",
  214. type: this.type,
  215. })
  216. .then((res) => {
  217. if (res.code == 200) {
  218. this.bardata.legend = ["优数量", "良数量", "差数量"];
  219. this.lineData = res.data.lvchart;
  220. this.bardata.area = res.data.datechart;
  221. this.bardata.data[2] = res.data.cslchart;
  222. this.bardata.data[1] = res.data.lslchart;
  223. this.bardata.data[0] = res.data.yslchart;
  224. }
  225. });
  226. // let that = this;
  227. // that.API.requestData({
  228. // method: "POST",
  229. // timeout: 8000,
  230. // subUrl: "recommen/findAllChartjz",
  231. // data: {
  232. // wpId: "0",
  233. // type: that.type,
  234. // },
  235. // success(res) {
  236. // if (res.code == 200) {
  237. // that.bardata.legend = ["优数量", "良数量", "差数量"];
  238. // that.lineData = res.data.lvchart;
  239. // that.bardata.area = res.data.datechart;
  240. // that.bardata.data[2] = res.data.cslchart;
  241. // that.bardata.data[1] = res.data.lslchart;
  242. // that.bardata.data[0] = res.data.yslchart;
  243. // }
  244. // },
  245. // });
  246. },
  247. getAllMap() {
  248. api.healthmainFindAllMap({
  249. }).then((res) => {
  250. res.data.wpmap.forEach((ele) => {
  251. if (ele.tqyb < 10) ele.tqyb = "0" + ele.tqyb;
  252. ele.showType = "1";
  253. ele.svgIcon = "svg-" + ele.tqyb;
  254. });
  255. this.wpmap = res.data.wpmap;
  256. this.tableData.data = res.data.gzls;
  257. });
  258. // let that = this;
  259. // that.API.requestData({
  260. // method: "POST",
  261. // subUrl: "healthmain/findAllMap",
  262. // success(res) {
  263. // res.data.wpmap.forEach((ele) => {
  264. // if (ele.tqyb < 10) ele.tqyb = "0" + ele.tqyb;
  265. // ele.showType = "1";
  266. // ele.svgIcon = "svg-" + ele.tqyb;
  267. // });
  268. // that.wpmap = res.data.wpmap;
  269. // that.tableData.data = res.data.gzls;
  270. // },
  271. // });
  272. },
  273. // 改变风场显示类型
  274. changeWpShowType(index, showType) {
  275. this.wpmap[index].showType = showType;
  276. },
  277. changeDate(type) {
  278. this.type = type;
  279. this.requestData();
  280. },
  281. // 页面跳转
  282. jumpUrl(wpId) {
  283. this.$router.push({
  284. path: `/health/health3/${wpId}`,
  285. });
  286. },
  287. },
  288. };
  289. </script>
  290. <style lang="less">
  291. .health-2 {
  292. // 电量健康情况
  293. .power-info {
  294. display: flex;
  295. .info-tab {
  296. flex: 0 0 156px;
  297. display: flex;
  298. flex-direction: column;
  299. height: 287px;
  300. margin-right: 1.4815vh;
  301. .tab {
  302. position: relative;
  303. flex: 0 0 auto;
  304. text-align: center;
  305. height: 33px;
  306. line-height: 33px;
  307. margin-right: 8px;
  308. color: @gray-l;
  309. font-size: 12px;
  310. background: fade(@gray, 20);
  311. border: 1px solid fade(@gray, 20);
  312. display: flex;
  313. align-items: center;
  314. i {
  315. margin: 0 1.4815vh;
  316. svg use {
  317. fill: @gray-l;
  318. }
  319. }
  320. &:hover,
  321. &.active {
  322. background: fade(@green, 20);
  323. border: 1px solid @green;
  324. color: @green;
  325. cursor: pointer;
  326. i {
  327. svg use {
  328. fill: @green;
  329. }
  330. }
  331. }
  332. &.active::after {
  333. box-sizing: content-box;
  334. width: 0px;
  335. height: 0px;
  336. position: absolute;
  337. right: -19px;
  338. padding: 0;
  339. border-bottom: 9px solid @green;
  340. border-top: 9px solid transparent;
  341. border-left: 9px solid transparent;
  342. border-right: 9px solid transparent;
  343. display: block;
  344. content: "";
  345. z-index: 10;
  346. transform: rotate(90deg);
  347. }
  348. &.active::before {
  349. box-sizing: content-box;
  350. width: 0px;
  351. height: 0px;
  352. position: absolute;
  353. right: -17px;
  354. padding: 0;
  355. border-bottom: 9px solid #063319;
  356. border-top: 9px solid transparent;
  357. border-left: 9px solid transparent;
  358. border-right: 9px solid transparent;
  359. display: block;
  360. content: "";
  361. z-index: 12;
  362. transform: rotate(90deg);
  363. }
  364. & + .tab {
  365. margin-top: 0.7407vh;
  366. }
  367. &:last-child {
  368. text-align: center;
  369. justify-content: center;
  370. }
  371. }
  372. .empty {
  373. flex: 1 0 auto;
  374. }
  375. }
  376. .info-chart {
  377. flex: 1 0 auto;
  378. }
  379. }
  380. // 风场信息
  381. .fc-info {
  382. display: flex;
  383. flex-wrap: wrap;
  384. //
  385. .fc-item {
  386. flex: 1 0 calc(100% / 5 - 8px);
  387. & > .title {
  388. background: fade(@gray, 20);
  389. padding: 0 1.4815vh;
  390. line-height: 27px;
  391. color: fade(@white, 75);
  392. font-size: @fontsize-s;
  393. margin-bottom: 0.7407vh;
  394. cursor: pointer;
  395. }
  396. & + .fc-item {
  397. margin-left: 8px;
  398. }
  399. .tags {
  400. display: flex;
  401. flex-wrap: wrap;
  402. .tag {
  403. flex: 1 0 calc(100% / 3 - 8px);
  404. background: fade(@gray, 20);
  405. margin-bottom: 8px;
  406. .tag-title {
  407. font-size: 12px;
  408. color: @gray-l;
  409. line-height: 24px;
  410. background: fade(@gray, 40);
  411. text-align: center;
  412. }
  413. .tag-value {
  414. position: relative;
  415. font-size: 20px;
  416. color: @green;
  417. text-align: center;
  418. padding: 12px 0;
  419. .unit {
  420. position: absolute;
  421. color: @gray;
  422. font-size: 12px;
  423. bottom: 8px;
  424. right: 8px;
  425. }
  426. }
  427. & + .tag {
  428. margin-left: 8px;
  429. }
  430. &:nth-child(1) {
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. i {
  435. width: 56px;
  436. height: 56px;
  437. svg {
  438. width: 56px;
  439. height: 56px;
  440. }
  441. }
  442. }
  443. &:nth-child(3n + 1) {
  444. margin-left: 0px;
  445. }
  446. }
  447. }
  448. .health-info {
  449. .title {
  450. line-height: 24px;
  451. color: @gray-l;
  452. background: fade(@gray, 40);
  453. padding: 0 16px;
  454. font-size: 12px;
  455. .actions {
  456. float: right;
  457. display: flex;
  458. .action {
  459. display: flex;
  460. align-items: center;
  461. i {
  462. margin-right: 0.3704vh;
  463. }
  464. & + .action {
  465. margin-left: 1.4815vh;
  466. }
  467. &.active,
  468. &:hover {
  469. cursor: pointer;
  470. color: @green;
  471. svg use {
  472. fill: @green;
  473. }
  474. }
  475. }
  476. }
  477. }
  478. .info-body {
  479. height: 170px;
  480. background: fade(@gray, 20);
  481. .proportion-info {
  482. height: 100%;
  483. display: flex;
  484. justify-content: space-around;
  485. align-items: center;
  486. }
  487. .device-list {
  488. display: flex;
  489. flex-wrap: wrap;
  490. padding: 8px 16px;
  491. .item {
  492. flex: 1 0 64px;
  493. line-height: 26px;
  494. background: fade(@gray, 20);
  495. color: @gray-l;
  496. font-size: 12px;
  497. margin-bottom: 4px;
  498. text-align: center;
  499. border: 1px solid transparent;
  500. & + .item {
  501. margin-left: 4px;
  502. }
  503. &:nth-child(5n + 1) {
  504. margin-left: 0px;
  505. }
  506. &.green {
  507. color: @green;
  508. background: fade(@green, 20);
  509. border-color: @green;
  510. }
  511. &.purple {
  512. color: @purple;
  513. background: fade(@purple, 20);
  514. border-color: @purple;
  515. }
  516. &.orange {
  517. color: @orange;
  518. background: fade(@orange, 20);
  519. border-color: @orange;
  520. }
  521. &.red {
  522. color: @red;
  523. background: fade(@red, 20);
  524. border-color: @red;
  525. }
  526. }
  527. .blank {
  528. flex: 1 0 64px;
  529. margin-left: 4px;
  530. &:nth-child(5n + 1) {
  531. margin-left: 0px;
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. }
  539. // 列表
  540. .fc-list {
  541. .com-table thead tr th {
  542. padding: 4px 0;
  543. }
  544. tbody {
  545. height: calc(100vh - 820px);
  546. }
  547. th,
  548. td {
  549. &:nth-child(1) {
  550. width: 32px;
  551. }
  552. }
  553. }
  554. }
  555. </style>