Health2.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  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. timeout: 8000,
  161. subUrl: "recommen/findAllChartjz",
  162. data: {
  163. wpId: "0",
  164. type: that.type,
  165. },
  166. success(res) {
  167. if (res.code == 200) {
  168. that.bardata.legend = ["优数量", "良数量", "差数量"];
  169. that.lineData = res.data.lvchart;
  170. that.bardata.area = res.data.datechart;
  171. that.bardata.data[2] = res.data.cslchart;
  172. that.bardata.data[1] = res.data.lslchart;
  173. that.bardata.data[0] = res.data.yslchart;
  174. }
  175. },
  176. });
  177. },
  178. getAllMap() {
  179. let that = this;
  180. that.API.requestData({
  181. method: "POST",
  182. subUrl: "healthmain/findAllMap",
  183. success(res) {
  184. res.data.wpmap.forEach((ele) => {
  185. if (ele.tqyb < 10) ele.tqyb = "0" + ele.tqyb;
  186. ele.showType = "1";
  187. ele.svgIcon = "svg-" + ele.tqyb;
  188. });
  189. that.wpmap = res.data.wpmap;
  190. that.tableData.data = res.data.gzls;
  191. },
  192. });
  193. },
  194. // 改变风场显示类型
  195. changeWpShowType(index, showType) {
  196. this.wpmap[index].showType = showType;
  197. },
  198. changeDate(type) {
  199. this.type = type;
  200. this.requestData();
  201. },
  202. // 页面跳转
  203. jumpUrl(wpId) {
  204. this.$router.push({
  205. path: `/health/health3/${wpId}`,
  206. });
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="less">
  212. .health-2 {
  213. // 电量健康情况
  214. .power-info {
  215. display: flex;
  216. .info-tab {
  217. flex: 0 0 156px;
  218. display: flex;
  219. flex-direction: column;
  220. height: 287px;
  221. margin-right: 1.4815vh;
  222. .tab {
  223. position: relative;
  224. flex: 0 0 auto;
  225. text-align: center;
  226. height: 33px;
  227. line-height: 33px;
  228. margin-right: 8px;
  229. color: @gray-l;
  230. font-size: 12px;
  231. background: fade(@gray, 20);
  232. border: 1px solid fade(@gray, 20);
  233. display: flex;
  234. align-items: center;
  235. i {
  236. margin: 0 1.4815vh;
  237. svg use {
  238. fill: @gray-l;
  239. }
  240. }
  241. &:hover,
  242. &.active {
  243. background: fade(@green, 20);
  244. border: 1px solid @green;
  245. color: @green;
  246. cursor: pointer;
  247. i {
  248. svg use {
  249. fill: @green;
  250. }
  251. }
  252. }
  253. &.active::after {
  254. box-sizing: content-box;
  255. width: 0px;
  256. height: 0px;
  257. position: absolute;
  258. right: -19px;
  259. padding: 0;
  260. border-bottom: 9px solid @green;
  261. border-top: 9px solid transparent;
  262. border-left: 9px solid transparent;
  263. border-right: 9px solid transparent;
  264. display: block;
  265. content: "";
  266. z-index: 10;
  267. transform: rotate(90deg);
  268. }
  269. &.active::before {
  270. box-sizing: content-box;
  271. width: 0px;
  272. height: 0px;
  273. position: absolute;
  274. right: -17px;
  275. padding: 0;
  276. border-bottom: 9px solid #063319;
  277. border-top: 9px solid transparent;
  278. border-left: 9px solid transparent;
  279. border-right: 9px solid transparent;
  280. display: block;
  281. content: "";
  282. z-index: 12;
  283. transform: rotate(90deg);
  284. }
  285. & + .tab {
  286. margin-top: 0.7407vh;
  287. }
  288. &:last-child {
  289. text-align: center;
  290. justify-content: center;
  291. }
  292. }
  293. .empty {
  294. flex: 1 0 auto;
  295. }
  296. }
  297. .info-chart {
  298. flex: 1 0 auto;
  299. }
  300. }
  301. // 风场信息
  302. .fc-info {
  303. display: flex;
  304. flex-wrap: wrap;
  305. //
  306. .fc-item {
  307. flex: 1 0 calc(100% / 5 - 8px);
  308. & > .title {
  309. background: fade(@gray, 20);
  310. padding: 0 1.4815vh;
  311. line-height: 27px;
  312. color: fade(@white, 75);
  313. font-size: @fontsize-s;
  314. margin-bottom: 0.7407vh;
  315. cursor: pointer;
  316. }
  317. & + .fc-item {
  318. margin-left: 8px;
  319. }
  320. .tags {
  321. display: flex;
  322. flex-wrap: wrap;
  323. .tag {
  324. flex: 1 0 calc(100% / 3 - 8px);
  325. background: fade(@gray, 20);
  326. margin-bottom: 8px;
  327. .tag-title {
  328. font-size: 12px;
  329. color: @gray-l;
  330. line-height: 24px;
  331. background: fade(@gray, 40);
  332. text-align: center;
  333. }
  334. .tag-value {
  335. position: relative;
  336. font-size: 20px;
  337. color: @green;
  338. text-align: center;
  339. padding: 12px 0;
  340. .unit {
  341. position: absolute;
  342. color: @gray;
  343. font-size: 12px;
  344. bottom: 8px;
  345. right: 8px;
  346. }
  347. }
  348. & + .tag {
  349. margin-left: 8px;
  350. }
  351. &:nth-child(1) {
  352. display: flex;
  353. justify-content: center;
  354. align-items: center;
  355. i {
  356. width: 56px;
  357. height: 56px;
  358. svg {
  359. width: 56px;
  360. height: 56px;
  361. }
  362. }
  363. }
  364. &:nth-child(3n + 1) {
  365. margin-left: 0px;
  366. }
  367. }
  368. }
  369. .health-info {
  370. .title {
  371. line-height: 24px;
  372. color: @gray-l;
  373. background: fade(@gray, 40);
  374. padding: 0 16px;
  375. font-size: 12px;
  376. .actions {
  377. float: right;
  378. display: flex;
  379. .action {
  380. display: flex;
  381. align-items: center;
  382. i {
  383. margin-right: 0.3704vh;
  384. }
  385. & + .action {
  386. margin-left: 1.4815vh;
  387. }
  388. &.active,
  389. &:hover {
  390. cursor: pointer;
  391. color: @green;
  392. svg use {
  393. fill: @green;
  394. }
  395. }
  396. }
  397. }
  398. }
  399. .info-body {
  400. height: 170px;
  401. background: fade(@gray, 20);
  402. .proportion-info {
  403. height: 100%;
  404. display: flex;
  405. justify-content: space-around;
  406. align-items: center;
  407. }
  408. .device-list {
  409. display: flex;
  410. flex-wrap: wrap;
  411. padding: 8px 16px;
  412. .item {
  413. flex: 1 0 64px;
  414. line-height: 26px;
  415. background: fade(@gray, 20);
  416. color: @gray-l;
  417. font-size: 12px;
  418. margin-bottom: 4px;
  419. text-align: center;
  420. border: 1px solid transparent;
  421. & + .item {
  422. margin-left: 4px;
  423. }
  424. &:nth-child(5n + 1) {
  425. margin-left: 0px;
  426. }
  427. &.green {
  428. color: @green;
  429. background: fade(@green, 20);
  430. border-color: @green;
  431. }
  432. &.purple {
  433. color: @purple;
  434. background: fade(@purple, 20);
  435. border-color: @purple;
  436. }
  437. &.orange {
  438. color: @orange;
  439. background: fade(@orange, 20);
  440. border-color: @orange;
  441. }
  442. &.red {
  443. color: @red;
  444. background: fade(@red, 20);
  445. border-color: @red;
  446. }
  447. }
  448. .blank {
  449. flex: 1 0 64px;
  450. margin-left: 4px;
  451. &:nth-child(5n + 1) {
  452. margin-left: 0px;
  453. }
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. // 列表
  461. .fc-list {
  462. .com-table thead tr th {
  463. padding: 4px 0;
  464. }
  465. tbody {
  466. height: calc(100vh - 820px);
  467. }
  468. th,
  469. td {
  470. &:nth-child(1) {
  471. width: 32px;
  472. }
  473. }
  474. }
  475. }
  476. </style>