Health2.vue 13 KB

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