Health2.vue 14 KB

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