stationIndex.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <template>
  2. <view class="home">
  3. <view class="box-bg">
  4. <uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
  5. @clickLeft="back" />
  6. </view>
  7. <view class="home_main">
  8. <view class="main_time">
  9. <view class="mesTime">
  10. <image src="../../static/jnImage/indexPage/time.png"></image>
  11. <text>{{timeData.year}}年{{timeData.month}}月{{timeData.day}}日</text>
  12. <text>{{timeData.week}}</text>
  13. <text>{{timeData.hour}}{{timeData.minute}}</text>
  14. </view>
  15. <view class="mesAll">
  16. <uni-row class="mesEx">
  17. <uni-col :span="12" v-for="(item,index) in mesExData" :key="index">
  18. <view class="mesEx_left flex">
  19. <view class="mesEx_left_top">
  20. <text class="nameSty">{{item.leftName}}</text>
  21. </view>
  22. <view class="mesEx_left_end">
  23. <text>{{item.leftValue}}</text>
  24. <text>{{item.leftCode}}</text>
  25. </view>
  26. </view>
  27. </uni-col>
  28. </uni-row>
  29. <uni-row class="windpowerCl">
  30. <uni-col :span="12" v-for="(item,index) in windPowerData" :key="index">
  31. <view class="windpowerMsg">
  32. <view class="windpowerMsg_com flex justify-between">
  33. <text style="font-size: 28upx">{{item.name}}</text>
  34. <text>{{item.code}}</text>
  35. </view>
  36. <view class="windpowerMsg_Data">
  37. <text>{{item.value}}</text>
  38. </view>
  39. <view class="windpowerMsg_com flex justify-between">
  40. <text>min:{{item.min}}</text>
  41. <text>max:{{item.max}}</text>
  42. </view>
  43. </view>
  44. </uni-col>
  45. </uni-row>
  46. <view class="windMsg" v-if="stationWpid.indexOf('_FDC') > -1">
  47. <view class="flex justify-center" style="margin-bottom: 6px;" @click="watchWindStatus('wind')">
  48. <view class="windMsg_title">
  49. <image src="../../static/jnImage/indexPage/wancheng.png" mode=""></image>
  50. <text>风机状态</text>
  51. </view>
  52. </view>
  53. <view class="windMsg_main">
  54. <view class="windMsg_main_msg flex justify-between">
  55. <view class="windMsgSty flex">
  56. <view class="windMsgSty_left">
  57. <image src="../../static/jnImage/indexPage/jn_jieru.png" mode=""></image>
  58. <text>接入</text>
  59. </view>
  60. <view class="windMsgSty_right flex justify-between">
  61. <text>{{Math.ceil(powerstatusData.jr_fj_ts)}}</text>
  62. <text>台</text>
  63. </view>
  64. </view>
  65. <view class="windMsgSty flex">
  66. <view class="windMsgSty_left">
  67. <image src="../../static/jnImage/indexPage/jn_daiji.png" mode=""></image>
  68. <text>待机</text>
  69. </view>
  70. <view class="windMsgSty_right flex justify-between">
  71. <text>{{Math.ceil(windstatusData.fd_djnum)}}</text>
  72. <text>台</text>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="windMsg_main_msg flex justify-between">
  77. <view class="windMsgSty flex">
  78. <view class="windMsgSty_left">
  79. <image src="../../static/jnImage/indexPage/jn_bingwang.png" mode=""></image>
  80. <text>并网</text>
  81. </view>
  82. <view class="windMsgSty_right flex justify-between">
  83. <text>{{Math.ceil(windstatusData.fd_yxnum)}}</text>
  84. <text>台</text>
  85. </view>
  86. </view>
  87. <view class="windMsgSty flex">
  88. <view class="windMsgSty_left">
  89. <image src="../../static/jnImage/indexPage/jn_guzhang.png" mode=""></image>
  90. <text>故障</text>
  91. </view>
  92. <view class="windMsgSty_right flex justify-between">
  93. <text>{{Math.ceil(windstatusData.fd_gznum)}}</text>
  94. <text>台</text>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="windMsg_main_msg flex justify-between">
  99. <view class="windMsgSty flex">
  100. <view class="windMsgSty_left">
  101. <image src="../../static/jnImage/indexPage/jn_jianxiu.png" mode=""></image>
  102. <text>检修</text>
  103. </view>
  104. <view class="windMsgSty_right flex justify-between">
  105. <text>{{Math.ceil(windstatusData.fd_jxnum)}}</text>
  106. <text>台</text>
  107. </view>
  108. </view>
  109. <view class="windMsgSty flex">
  110. <view class="windMsgSty_left">
  111. <image src="../../static/jnImage/indexPage/jn_xiandian.png" mode=""></image>
  112. <text>限电</text>
  113. </view>
  114. <view class="windMsgSty_right flex justify-between">
  115. <text>{{Math.ceil(windstatusData.fd_xdnum)}}</text>
  116. <text>台</text>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="windMsg_main_msg flex justify-between">
  121. <view class="windMsgSty flex">
  122. <view class="windMsgSty_left">
  123. <image src="../../static/jnImage/indexPage/jn_shoulei.png" mode=""></image>
  124. <text>受累</text>
  125. </view>
  126. <view class="windMsgSty_right flex justify-between">
  127. <text>{{Math.ceil(windstatusData.fd_slnum)}}</text>
  128. <text>台</text>
  129. </view>
  130. </view>
  131. <view class="windMsgSty flex">
  132. <view class="windMsgSty_left">
  133. <image src="../../static/jnImage/indexPage/jn_lixian.png" mode=""></image>
  134. <text>离线</text>
  135. </view>
  136. <view class="windMsgSty_right flex justify-between">
  137. <text>{{Math.ceil(windstatusData.fd_lxnum)}}</text>
  138. <text>台</text>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="powerMsg" v-else>
  145. <view class="flex justify-center" style="margin-bottom: 6px;" @click="watchWindStatus('power')">
  146. <view class="windMsg_title">
  147. <image src="../../static/jnImage/indexPage/wancheng.png" mode=""></image>
  148. <text>光伏状态</text>
  149. </view>
  150. </view>
  151. <view class="windMsg_main">
  152. <view class="windMsg_main_msg flex justify-between">
  153. <view class="windMsgSty flex">
  154. <view class="windMsgSty_left">
  155. <image src="../../static/jnImage/indexPage/jn_jieru.png" mode=""></image>
  156. <text>接入</text>
  157. </view>
  158. <view class="windMsgSty_right flex justify-between">
  159. <text>{{Math.ceil(powerstatusData.jr_gf_jzts+powerstatusData.jr_gf_zcts)}}</text>
  160. <text>台</text>
  161. </view>
  162. </view>
  163. <view class="windMsgSty flex">
  164. <view class="windMsgSty_left">
  165. <image src="../../static/jnImage/indexPage/jn_daiji.png" mode=""></image>
  166. <text>待机</text>
  167. </view>
  168. <view class="windMsgSty_right flex justify-between">
  169. <text>{{Math.ceil(windstatusData.gf_djnum)}}</text>
  170. <text>台</text>
  171. </view>
  172. </view>
  173. </view>
  174. <view class="windMsg_main_msg flex justify-between">
  175. <view class="windMsgSty flex">
  176. <view class="windMsgSty_left">
  177. <image src="../../static/jnImage/indexPage/jn_bingwang.png" mode=""></image>
  178. <text>并网</text>
  179. </view>
  180. <view class="windMsgSty_right flex justify-between">
  181. <text>{{Math.ceil(windstatusData.gf_yxnum)}}</text>
  182. <text>台</text>
  183. </view>
  184. </view>
  185. <view class="windMsgSty flex">
  186. <view class="windMsgSty_left">
  187. <image src="../../static/jnImage/indexPage/jn_guzhang.png" mode=""></image>
  188. <text>故障</text>
  189. </view>
  190. <view class="windMsgSty_right flex justify-between">
  191. <text>{{Math.ceil(windstatusData.gf_gznum)}}</text>
  192. <text>台</text>
  193. </view>
  194. </view>
  195. </view>
  196. <view class="windMsg_main_msg flex justify-between">
  197. <view class="windMsgSty flex">
  198. <view class="windMsgSty_left">
  199. <image src="../../static/jnImage/indexPage/jn_jianxiu.png" mode=""></image>
  200. <text>检修</text>
  201. </view>
  202. <view class="windMsgSty_right flex justify-between">
  203. <text>{{Math.ceil(windstatusData.gf_jxnum)}}</text>
  204. <text>台</text>
  205. </view>
  206. </view>
  207. <view class="windMsgSty flex">
  208. <view class="windMsgSty_left">
  209. <image src="../../static/jnImage/indexPage/jn_xiandian.png" mode=""></image>
  210. <text>限电</text>
  211. </view>
  212. <view class="windMsgSty_right flex justify-between">
  213. <text>{{Math.ceil(windstatusData.gf_xdnum)}}</text>
  214. <text>台</text>
  215. </view>
  216. </view>
  217. </view>
  218. <view class="windMsg_main_msg flex justify-between">
  219. <view class="windMsgSty flex">
  220. <view class="windMsgSty_left">
  221. <image src="../../static/jnImage/indexPage/jn_shoulei.png" mode=""></image>
  222. <text>受累</text>
  223. </view>
  224. <view class="windMsgSty_right flex justify-between">
  225. <text>{{Math.ceil(windstatusData.gf_slnum)}}</text>
  226. <text>台</text>
  227. </view>
  228. </view>
  229. <view class="windMsgSty flex">
  230. <view class="windMsgSty_left">
  231. <image src="../../static/jnImage/indexPage/jn_lixian.png" mode=""></image>
  232. <text>离线</text>
  233. </view>
  234. <view class="windMsgSty_right flex justify-between">
  235. <text>{{Math.ceil(windstatusData.gf_lxnum)}}</text>
  236. <text>台</text>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. </view>
  242. <view class="matrix">
  243. <view class="matrixItem" v-if="stationWpid.indexOf('_FDC') > -1"
  244. v-for="(item,index) in windData" :key="index">
  245. <view class="matrixText">{{item.wpname}}</view>
  246. <uni-row class="matrixItemRow">
  247. <uni-col :span="3" v-for="(itv,index) in item.wtlist" :key="index">
  248. <view class="matrixItemRowOne" :style="getColor(itv)">{{itv.wtname}}</view>
  249. </uni-col>
  250. </uni-row>
  251. </view>
  252. <view class="matrixItem" v-if="stationWpid.indexOf('_GDC') > -1"
  253. v-for="(item,index) in powerData" :key="index">
  254. <view class="matrixText">{{item.wpname}}</view>
  255. <uni-row class="matrixItemRow">
  256. <uni-col :span="3" v-for="(itv,index) in item.wtlist" :key="index">
  257. <view class="matrixItemRowOne" :style="getColor(itv)">{{itv.wtname}}</view>
  258. </uni-col>
  259. </uni-row>
  260. </view>
  261. </view>
  262. </view>
  263. </view>
  264. </view>
  265. <station-bar ref="stationBar"></station-bar>
  266. </view>
  267. </template>
  268. <script>
  269. import stationBar from '../common/stationTab.vue'
  270. import {
  271. windPowerDataApi
  272. } from '../../api/common.js'
  273. import {
  274. cockpitMonitor,
  275. stationCaldataApi
  276. } from '../../api/home.js'
  277. export default {
  278. onLoad: function(e) {
  279. },
  280. components: {
  281. stationBar
  282. },
  283. data() {
  284. return {
  285. stationName: '',
  286. stationWpid: '',
  287. stationTab: '',
  288. mesExData: [],
  289. windPowerData: [],
  290. windstatusData: [],
  291. powerstatusData: [],
  292. windData: [],
  293. powerData: [],
  294. timeData: {},
  295. }
  296. },
  297. created() {
  298. this.stationName = uni.getStorageSync('stationName')
  299. this.stationWpid = uni.getStorageSync('stationWpid')
  300. this.getTimeDaya()
  301. this.getHomeData()
  302. this.getHomeDataTwo()
  303. if (this.stationWpid.indexOf('_FDC') > -1) {
  304. this.getwindPowerData("0", "-1");
  305. } else {
  306. this.getwindPowerData("0", "-2");
  307. }
  308. },
  309. mounted() {
  310. this.$refs.stationBar.showTab = '首页'
  311. },
  312. methods: {
  313. getColor(itv) {
  314. switch (Math.ceil(itv.status)) {
  315. case 0:
  316. return "background: #1d99ff";
  317. case 1:
  318. return "background: #05bb4c";
  319. case 2:
  320. return "background: #ba3237";
  321. case 3:
  322. return "background: #e17e23";
  323. case 4:
  324. return "background: #c531c7";
  325. case 5:
  326. return "background: #fff";
  327. case 6:
  328. return "background: #606769";
  329. }
  330. },
  331. //获取时间
  332. getTimeDaya() {
  333. let currentDate = new Date()
  334. this.timeData.year = currentDate.getFullYear()
  335. this.timeData.month = currentDate.getMonth() + 1
  336. this.timeData.day = currentDate.getDate()
  337. this.timeData.hour = currentDate.getHours() + ':'
  338. this.timeData.minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
  339. .getMinutes()
  340. this.timeData.week = new Array('星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六')[currentDate.getDay()]
  341. },
  342. //获取首页整体数据
  343. getHomeData() {
  344. let that = this
  345. cockpitMonitor({
  346. wpId: that.stationWpid
  347. }).then(res => {
  348. if (res.data) {
  349. if (res.data.cblpoint) {
  350. that.powerstatusData = res.data.cblpoint
  351. }
  352. if (res.data.mxztmap) {
  353. that.windstatusData = res.data.mxztmap
  354. }
  355. }
  356. })
  357. },
  358. getHomeDataTwo() {
  359. let that = this
  360. stationCaldataApi({
  361. wpid: that.stationWpid
  362. }).then(res => {
  363. if (res.data.data) {
  364. let datas = res.data.data
  365. that.mesExData = [{
  366. leftName: '容量',
  367. leftValue: Math.ceil(datas.zzjrl / 1000),
  368. leftCode: '(WM)',
  369. },
  370. {
  371. leftName: '安全天数',
  372. leftValue: Math.ceil(datas.aqts),
  373. leftCode: '(天)',
  374. },
  375. {
  376. leftName: '日发电量',
  377. leftValue: Math.ceil(datas.rfdl),
  378. leftCode: '(万kWh)'
  379. },
  380. {
  381. leftName: '利用小时',
  382. leftValue: Math.ceil(datas.ylyxs + datas.nlyxs),
  383. leftCode: '(万kWh)'
  384. },
  385. {
  386. leftName: '月发电量',
  387. leftValue: Math.ceil(datas.yfdl),
  388. leftCode: '(万kWh)'
  389. },
  390. {
  391. leftName: '年发电量',
  392. leftValue: Math.ceil(datas.nfdl),
  393. leftCode: '(万kWh)'
  394. },
  395. ]
  396. that.windPowerData = [{
  397. name: '风速',
  398. value: Math.ceil(datas.sspjfsgzd),
  399. code: '(m/s)',
  400. min: 6,
  401. max: 8
  402. }, {
  403. name: '日照强度',
  404. value: 0,
  405. code: '(m/s)',
  406. min: 6,
  407. max: 20
  408. }, {
  409. name: '功率',
  410. value: datas.yggl,
  411. code: '(万kW)',
  412. min: 0,
  413. max: 200
  414. }, {
  415. name: '负荷率',
  416. value: Math.ceil(datas.fhl),
  417. code: '(万kW)',
  418. min: 0,
  419. max: 500
  420. }]
  421. }
  422. })
  423. },
  424. getwindPowerData(type1, type2) {
  425. let that = this
  426. windPowerDataApi({
  427. company: type1,
  428. type: type2
  429. })
  430. .then((res) => {
  431. if (Object.values(res.data.data).length) {
  432. if (res.data.data.powerVos.length > 0) {
  433. res.data.data.powerVos.forEach(item => {
  434. if (that.stationWpid === item.wpid) {
  435. if (type2 === "-1") {
  436. that.windData.push(item)
  437. } else {
  438. that.powerData.push(item)
  439. }
  440. }
  441. })
  442. }
  443. } else {
  444. this.windData = [];
  445. this.powerData = [];
  446. }
  447. });
  448. },
  449. back() {
  450. this.$tab.switchTab('/pages/home/index')
  451. },
  452. stationTabXY(it) {
  453. this.stationTab = it
  454. }
  455. }
  456. }
  457. </script>
  458. <style lang="scss">
  459. page {
  460. background-color: #202246;
  461. }
  462. .home {
  463. width: 100vw;
  464. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  465. background-repeat: no-repeat, repeat;
  466. background-size: 100% 260px, 100% 5px;
  467. .box-bg {
  468. width: 100vw;
  469. padding: 0;
  470. .uni-navbar {
  471. .uni-navbar__content {
  472. padding: 5px 0;
  473. height: 50px;
  474. }
  475. }
  476. }
  477. .home_main {
  478. padding: 0 20px;
  479. .main_time {
  480. margin-top: 10px;
  481. .mesTime {
  482. display: flex;
  483. padding: 3px 0;
  484. border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  485. image {
  486. width: 20px;
  487. height: 20px;
  488. }
  489. text {
  490. font-size: 34upx;
  491. color: #fff;
  492. margin-left: 15px;
  493. }
  494. text:nth-of-type(3) {
  495. position: relative;
  496. top: 3px;
  497. }
  498. }
  499. .mesAll {
  500. padding-bottom: 60px;
  501. .mesEx {
  502. // display: flex;
  503. line-height: 30px;
  504. color: #fff;
  505. .mesEx_left {
  506. width: 100%;
  507. border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  508. padding: 3px 0;
  509. .mesEx_left_top {
  510. width: 40%;
  511. font-size: 28upx;
  512. .nameSty {
  513. width: 100%;
  514. display: inline-block;
  515. position: relative;
  516. text-align-last: justify;
  517. text-align: justify;
  518. }
  519. }
  520. .mesEx_left_end {
  521. width: 56%;
  522. margin: 0 10px;
  523. display: flex;
  524. justify-content: space-between;
  525. text:nth-of-type(1) {
  526. font-size: 34upx;
  527. }
  528. text:nth-of-type(2) {
  529. font-size: 20upx;
  530. color: #92949B;
  531. }
  532. }
  533. }
  534. }
  535. .windpowerCl {
  536. .windpowerMsg {
  537. margin-top: 10px;
  538. padding: 5px 10px;
  539. color: #fff;
  540. background-image: url('../../static/jnImage/indexPage/windpower.png');
  541. background-repeat: no-repeat;
  542. background-size: cover;
  543. .windpowerMsg_com {
  544. text {
  545. font-size: 24upx;
  546. color: #AFB2C1;
  547. }
  548. }
  549. .windpowerMsg_Data {
  550. margin: 5px;
  551. text-align: center;
  552. font-size: 40upx;
  553. }
  554. }
  555. }
  556. .windMsg,
  557. .powerMsg {
  558. margin-top: 15px;
  559. .windMsg_title {
  560. width: 40%;
  561. height: 30px;
  562. display: flex;
  563. justify-content: center;
  564. align-items: center;
  565. padding: 6px 13px;
  566. background: rgba(51, 57, 118, 0.7);
  567. border-radius: 5px;
  568. image {
  569. width: 18px;
  570. height: 18px;
  571. }
  572. text {
  573. margin-left: 5px;
  574. font-size: 34upx;
  575. color: #fff;
  576. }
  577. }
  578. .windMsg_main {
  579. .windMsg_main_msg {
  580. margin-bottom: 8px;
  581. .windMsgSty {
  582. padding: 5px 8px;
  583. width: 49%;
  584. background: #3F4572;
  585. border-radius: 5px;
  586. .windMsgSty_left {
  587. width: 49%;
  588. height: 32px;
  589. image {
  590. width: 32px;
  591. height: 32px;
  592. }
  593. text {
  594. width: 100px;
  595. display: inline-block;
  596. color: #9A9BA6;
  597. font-size: 28upx;
  598. margin-left: 10px;
  599. position: relative;
  600. top: -26px;
  601. left: 28px;
  602. }
  603. .fourFont {
  604. top: -38px;
  605. }
  606. }
  607. .windMsgSty_right {
  608. width: 49%;
  609. position: relative;
  610. top: 9px;
  611. text:nth-of-type(1) {
  612. margin-left: 5px;
  613. width: 50%;
  614. font-size: 34upx;
  615. color: #fff;
  616. }
  617. text:nth-of-type(2) {
  618. font-size: 28upx;
  619. color: #9A9BA6;
  620. }
  621. }
  622. }
  623. }
  624. }
  625. }
  626. .matrix {
  627. .matrixItem {
  628. margin-top: 10px;
  629. .matrixText {
  630. font-size: 32upx;
  631. color: #9A9BA6;
  632. }
  633. .matrixItemRow {
  634. .matrixItemRowOne {
  635. width: 100%;
  636. height: 30px;
  637. background-color: #2675F6;
  638. text-align: center;
  639. line-height: 30px;
  640. color: #fff;
  641. font-size: 24upx;
  642. border-radius: 5px;
  643. // margin: 1px 2px;
  644. border: 1px solid #202246;
  645. }
  646. }
  647. }
  648. }
  649. }
  650. }
  651. }
  652. }
  653. </style>