index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-row :gutter="24">
  4. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '12px' }">
  5. <a-card
  6. :loading="loading"
  7. :body-style="{ padding: '10px 8px 8px' }"
  8. class="topcard"
  9. :bordered="false"
  10. style="text-align: center"
  11. >
  12. <a-row :gutter="24">
  13. <a-col :span="12">
  14. <div class="totalEle-trend" ref="realPowerChart"></div>
  15. <span style="margin-top: 120px">实时发电功率(kW)</span>
  16. </a-col>
  17. <a-col :span="12">
  18. <div class="head-info" style="text-align: left; margin-top: 30px">
  19. <span style="line-height: 32px">并网电价:{{ stationInfo.fSubsidyprice }} 元/kW·h</span>
  20. </div>
  21. <div class="head-info" style="text-align: left">
  22. <span style="line-height: 32px">电站装机容量:{{ stationInfo.fInstalledcapacity }} kW</span>
  23. </div>
  24. <div class="head-info" style="text-align: left">
  25. <span style="line-height: 32px">逆变器数量:{{ stationInfo.inverterNum }} 个</span>
  26. </div>
  27. <div class="head-info" style="text-align: left">
  28. <span style="line-height: 32px">并网电压:{{ stationInfo.fGridvoltage }} V</span>
  29. </div>
  30. <div class="head-info" style="text-align: left">
  31. <span style="line-height: 32px">年利用小时数:{{ elecdetail.effectiveHours }} h</span>
  32. </div>
  33. <div class="head-info" style="text-align: left">
  34. <span style="line-height: 32px">总发电量:{{ totalEpiValue }} kWh</span>
  35. </div>
  36. </a-col>
  37. </a-row>
  38. </a-card>
  39. </a-col>
  40. <a-col :sm="24" :md="12" :xl="8" :style="{ padding: '0px 12px 0px 0px' }">
  41. <a-row>
  42. <a-col :span="24">
  43. <a-card
  44. :loading="loading"
  45. :body-style="{ padding: '10px 8px 8px' }"
  46. class="topcard"
  47. :bordered="false"
  48. title="发电量信息"
  49. >
  50. <a-row>
  51. <a-col :span="8">
  52. <div class="head-info" :class="center && 'center'">
  53. <span>日发电量</span>
  54. <p>{{ elecdetail.powerByDay }} kW·h</p>
  55. </div>
  56. </a-col>
  57. <a-col :span="8">
  58. <div class="head-info" :class="center && 'center'">
  59. <span>月发电量</span>
  60. <p>{{ elecdetail.powerByMonth }} kW·h</p>
  61. </div>
  62. </a-col>
  63. <a-col :span="8">
  64. <div class="head-info" :class="center && 'center'">
  65. <span>年发电量</span>
  66. <p>{{ elecdetail.powerByYear }} kW·h</p>
  67. </div>
  68. </a-col>
  69. </a-row>
  70. <a-divider style="margin: 8px 0" />
  71. <span class="head-title">收益信息</span>
  72. <a-row>
  73. <a-col :span="8">
  74. <div class="head-info" :class="center && 'center'">
  75. <span>日收益</span>
  76. <p>{{ elecdetail.powerByDayProfit }} 元</p>
  77. </div>
  78. </a-col>
  79. <a-col :span="8">
  80. <div class="head-info" :class="center && 'center'">
  81. <span>日收益</span>
  82. <p>{{ elecdetail.powerByMonthProfit }} 元</p>
  83. </div>
  84. </a-col>
  85. <a-col :span="8">
  86. <div class="head-info" :class="center && 'center'">
  87. <span>年收益</span>
  88. <p>{{ elecdetail.powerByYearProfit }} 元</p>
  89. </div>
  90. </a-col>
  91. </a-row>
  92. </a-card>
  93. </a-col>
  94. </a-row>
  95. </a-col>
  96. <a-col :sm="24" :md="12" :xl="8" :style="{ padding: '0px 12px 0px 0px' }">
  97. <a-row>
  98. <a-card
  99. :loading="loading"
  100. :body-style="{ padding: '10px 8px 8px' }"
  101. class="topcard"
  102. :bordered="false"
  103. title="视频监控"
  104. >
  105. </a-card>
  106. </a-row>
  107. </a-col>
  108. </a-row>
  109. <a-row>
  110. <a-col :sm="24" :md="12" :xl="8" :style="{ padding: '0px 16px 0px 0px' }">
  111. <a-card
  112. :loading="loading"
  113. :body-style="{ padding: '10px 8px 8px' }"
  114. class="middlecard"
  115. :bordered="false"
  116. title="气象信息"
  117. >
  118. <a-row>
  119. <a-col :span="8">
  120. <div class="head-info" :class="center && 'center'">
  121. <span>辐照度</span>
  122. <p>{{ envirInfo.irradiance }} {{ envirInfo.irradianceUnit }}</p>
  123. </div>
  124. </a-col>
  125. <a-col :span="8">
  126. <div class="head-info" :class="center && 'center'">
  127. <span>环境温湿度</span>
  128. <p>{{ envirInfo.temp }} {{ envirInfo.tempUnit }} / {{ envirInfo.humi }} {{ envirInfo.humiUnit }}</p>
  129. </div>
  130. </a-col>
  131. <a-col :span="8">
  132. <div class="head-info" :class="center && 'center'">
  133. <span>风速</span>
  134. <p>{{ envirInfo.windSpeed }} {{ envirInfo.windSpeedUnit }}</p>
  135. </div>
  136. </a-col>
  137. </a-row>
  138. </a-card>
  139. </a-col>
  140. <a-col :sm="24" :md="12" :xl="16">
  141. <a-card
  142. :body-style="{ padding: '0px 8px 8px' }"
  143. class="middlecard"
  144. :bordered="false"
  145. title="功率及发电量趋势"
  146. style="margin-left: -4px"
  147. >
  148. <div class="totalEle-trend" ref="powerChart"></div>
  149. </a-card>
  150. </a-col>
  151. </a-row>
  152. <a-row>
  153. <a-col :sm="24" :md="12" :xl="24" :style="{ padding: '12px 0px 0px 0px' }">
  154. <div class="tri-colorLight" ref="flexDivGroup">
  155. <div class="item-title">逆变器信息</div>
  156. <a-divider style="margin: 8px 0" />
  157. <div class="item-content" ref="itemFlexDiv" v-for="(item, index) in invInfo" :key="index" cl>
  158. <div class="item-title">{{ item.fInvertername }}</div>
  159. <div class="item-title"></div>
  160. <div>厂家:{{ item.fManufacturername }}</div>
  161. <div>设备型号:{{ item.fProductmodel }}</div>
  162. <div>状态:{{ item.state }}</div>
  163. <div>额定交流功率:{{ item.fRatedoutputpower }} kW</div>
  164. <div>实时发电功率:{{ item.realGeneratingPower }} kW</div>
  165. <div>当日发电量:{{ item.powerByDay }} kW·h</div>
  166. <div>组件峰值功率:{{ item.fComponentpeakpower }} kWp</div>
  167. <router-link :to="'/equipment/info/detail/' + item.fInverterid">
  168. <!-- <router-link :to="'/system/dict-data/index/' + item.equipmentid"> -->
  169. <a-button type="success" plain style="margin-top: 10px"
  170. >查看详情
  171. </a-button>
  172. </router-link>
  173. </div>
  174. <!-- 优化布局 -->
  175. <!-- <div ref="completion" v-for="item in completionNumber" :key="'com' + item" class="completion"></div> -->
  176. </div>
  177. <!-- <a-card :loading="loading" :body-style="{ padding: '10px 8px 8px' }" :bordered="false" title="逆变器信息">
  178. </a-card> -->
  179. </a-col>
  180. </a-row>
  181. </div>
  182. </template>
  183. <script>
  184. import * as echarts from 'echarts'
  185. import { httpAction, getAction } from '@/api/manage'
  186. import { pvdata } from '../pvdata'
  187. export default {
  188. name: 'IndexChart',
  189. components: {},
  190. data() {
  191. return {
  192. loading: true,
  193. center: null,
  194. elecdetail: {}, // 发电量信息
  195. envirInfo: {}, // 气象信息
  196. invInfo: [], // 逆变器信息
  197. stationInfo: {}, // 电站信息
  198. totalEpiValue: 0, // 总发电量
  199. times: [], // 功率及发电量趋势-时间
  200. powers: [], // 功率及发电量趋势-功率
  201. irradiances: [], // 功率及发电量趋势-辐照强度
  202. }
  203. },
  204. created() {
  205. setTimeout(() => {
  206. this.loading = !this.loading
  207. }, 1000)
  208. },
  209. mounted() {
  210. this.$nextTick(() => {
  211. setTimeout(() => {
  212. this.getTest()
  213. }, 1000)
  214. // this.getEnergyoverview()
  215. })
  216. },
  217. methods: {
  218. getTest() {
  219. var listData = pvdata.stationMonitorData
  220. console.log(listData)
  221. this.totalEpiValue = listData.totalEpiValue
  222. this.elecdetail = pvdata.pvDashboardData.elecdetail
  223. this.envirInfo = listData.envirInfo
  224. this.invInfo = listData.invInfo
  225. this.stationInfo = listData.stationInfo
  226. listData.dayPowerValue.forEach((i) => {
  227. this.times.push(i.fTime)
  228. this.powers.push(i.fP)
  229. this.irradiances.push(i.irradianceValue)
  230. })
  231. this.initRealPowerChart()
  232. this.initPowerChart()
  233. },
  234. initRealPowerChart() {
  235. var _this = this
  236. var chartDom = _this.$refs.realPowerChart
  237. var myChart = echarts.init(chartDom)
  238. var option = {
  239. tooltip: {
  240. formatter: '{a} <br/>{b} : {c}%',
  241. },
  242. series: [
  243. {
  244. name: 'Pressure',
  245. type: 'gauge',
  246. min: 0,
  247. max: 30,
  248. progress: {
  249. show: true,
  250. },
  251. detail: {
  252. formatter: '{value}',
  253. },
  254. radius: '100%', // 仪表盘放大/缩小
  255. axisLine: { lineStyle: { width: 5 } }, // 修改线段宽度
  256. data: [
  257. {
  258. value: _this.stationInfo.realPower,
  259. name: '功率',
  260. },
  261. ],
  262. },
  263. ],
  264. }
  265. option && myChart.setOption(option)
  266. window.addEventListener('resize', function () {
  267. myChart.resize()
  268. })
  269. },
  270. initPowerChart() {
  271. var _this = this
  272. var chartDom = _this.$refs.powerChart
  273. var myChart = echarts.init(chartDom)
  274. var option = {
  275. tooltip: {
  276. trigger: 'axis',
  277. position: function (pt) {
  278. return [pt[0], '20%']
  279. },
  280. },
  281. legend: {
  282. data: ['功率', '辐照度'],
  283. },
  284. xAxis: {
  285. type: 'category',
  286. boundaryGap: false,
  287. data: _this.times,
  288. },
  289. yAxis: [
  290. {
  291. type: 'value',
  292. name: '功率',
  293. boundaryGap: [0, '30%'],
  294. },
  295. {
  296. type: 'value',
  297. name: '辐照度',
  298. boundaryGap: [0, '30%'],
  299. },
  300. ],
  301. // dataZoom: [
  302. // {
  303. // type: 'inside',
  304. // start: 0,
  305. // end: 100,
  306. // xAxisIndex: 0,
  307. // },
  308. // {
  309. // start: 0,
  310. // end: 10,
  311. // },
  312. // {
  313. // show: true,
  314. // yAxisIndex: 0,
  315. // filterMode: "empty",
  316. // width: 30,
  317. // height: "80%",
  318. // right: "7%",
  319. // },
  320. // ],
  321. series: [
  322. {
  323. name: '功率',
  324. type: 'line',
  325. symbol: 'none',
  326. sampling: 'lttb',
  327. itemStyle: {
  328. color: '#91CC75',
  329. },
  330. data: _this.powers,
  331. },
  332. {
  333. name: '辐照度',
  334. type: 'line',
  335. symbol: 'none',
  336. sampling: 'lttb',
  337. yAxisIndex: 1, // 依据哪儿个y周坐标显示数据
  338. itemStyle: {
  339. color: '#EE6666',
  340. },
  341. data: _this.irradiances,
  342. },
  343. ],
  344. }
  345. option && myChart.setOption(option)
  346. window.addEventListener('resize', function () {
  347. myChart.resize()
  348. })
  349. },
  350. },
  351. }
  352. </script>
  353. <style lang="less" scoped>
  354. .chart-card-header {
  355. position: relative;
  356. overflow: hidden;
  357. width: 100%;
  358. height: 50px;
  359. .meta {
  360. position: relative;
  361. overflow: hidden;
  362. // width: 100%;
  363. color: #ffffff;
  364. font-size: 20px;
  365. line-height: 38px;
  366. float: left;
  367. }
  368. }
  369. .chart-card-action {
  370. cursor: pointer;
  371. position: absolute;
  372. top: 0;
  373. right: 0;
  374. }
  375. .chart-card-footer {
  376. border-top: 1px solid #e8e8e8;
  377. padding-top: 9px;
  378. margin-top: 8px;
  379. > * {
  380. position: relative;
  381. }
  382. .field {
  383. white-space: nowrap;
  384. overflow: hidden;
  385. text-overflow: ellipsis;
  386. margin: 0;
  387. }
  388. }
  389. .chart-card-content {
  390. margin-bottom: 12px;
  391. position: relative;
  392. height: 46px;
  393. width: 100%;
  394. .content-fix {
  395. position: absolute;
  396. left: 0;
  397. bottom: 0;
  398. width: 100%;
  399. }
  400. }
  401. .total {
  402. overflow: hidden;
  403. text-overflow: ellipsis;
  404. word-break: break-all;
  405. white-space: nowrap;
  406. color: #ffffff;
  407. // margin-top: 4px;
  408. margin-bottom: 0;
  409. font-size: 30px;
  410. line-height: 38px;
  411. height: 38px;
  412. float: right;
  413. }
  414. .circle-cust {
  415. position: relative;
  416. top: 28px;
  417. left: -100%;
  418. }
  419. .extra-wrapper {
  420. line-height: 55px;
  421. padding-right: 24px;
  422. .extra-item {
  423. display: inline-block;
  424. margin-right: 24px;
  425. a {
  426. margin-left: 24px;
  427. }
  428. }
  429. }
  430. /* 首页访问量统计 */
  431. .head-info {
  432. position: relative;
  433. text-align: center;
  434. padding: 0 32px 0 0;
  435. min-width: 125px;
  436. &.center {
  437. text-align: center;
  438. padding: 0 32px;
  439. }
  440. span {
  441. color: rgba(0, 0, 0, 0.45);
  442. display: inline-block;
  443. font-size: 0.95rem;
  444. line-height: 42px;
  445. margin-bottom: 4px;
  446. }
  447. p {
  448. line-height: 42px;
  449. margin: 0;
  450. a {
  451. font-weight: 600;
  452. font-size: 1rem;
  453. }
  454. }
  455. .bm-view {
  456. width: 100%;
  457. height: 300px;
  458. }
  459. }
  460. .head-title {
  461. font-size: 15px;
  462. margin-left: 20px;
  463. }
  464. .totalEle-trend {
  465. height: 220px;
  466. }
  467. .topcard {
  468. height: 295px;
  469. }
  470. .middlecard {
  471. height: 280px;
  472. }
  473. // 三色灯
  474. .tri-colorLight {
  475. display: flex;
  476. background: #fff;
  477. justify-content: space-around;
  478. align-items: center;
  479. flex-wrap: wrap;
  480. // width: 20%;
  481. .item-container {
  482. padding: 10px;
  483. box-sizing: border-box;
  484. }
  485. .item-content {
  486. width: 254px;
  487. border: 2px solid #314977;
  488. color: #63b4ca;
  489. // padding: 16px 50px 20px;
  490. padding-top: 16px;
  491. padding-bottom: 20px;
  492. margin: 10px 6px;
  493. box-shadow: 0 2px 10px 2px rgba(59, 78, 128, 0.5) inset;
  494. text-align: center;
  495. box-sizing: border-box;
  496. display: flex;
  497. flex-direction: column;
  498. justify-content: center;
  499. align-items: center;
  500. .item-title {
  501. font-weight: bold;
  502. }
  503. .light-con {
  504. margin-top: 20px;
  505. display: flex;
  506. }
  507. .item-light {
  508. width: 20px;
  509. height: 20px;
  510. border-radius: 100%;
  511. margin: 0 15px;
  512. background: #7c7ea6;
  513. }
  514. .green {
  515. background-color: #0df708;
  516. box-shadow: 0 0 18px 6px rgba(13, 247, 8, 0.5);
  517. }
  518. .yellow {
  519. background-color: #f8fa12;
  520. box-shadow: 0 0 18px 6px rgba(248, 250, 18, 0.5);
  521. }
  522. .red {
  523. background-color: #fb0301;
  524. box-shadow: 0 0 18px 6px rgba(251, 3, 1, 0.5);
  525. }
  526. }
  527. .item_content_rad {
  528. border-radius: 18px;
  529. }
  530. .completion {
  531. width: 254px;
  532. margin: 10px 6px;
  533. }
  534. }
  535. </style>