Health2.vue 13 KB

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