stationIndex.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  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/yunxingGFNew.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. cockpitProjectplanApi
  277. } from '../../api/home.js'
  278. export default {
  279. onLoad: function(e) {
  280. },
  281. components: {
  282. stationBar
  283. },
  284. data() {
  285. return {
  286. stationName: '',
  287. stationWpid: '',
  288. stationTab: '',
  289. mesExData: [],
  290. windPowerData: [],
  291. windstatusData: [],
  292. powerstatusData: [],
  293. windData: [],
  294. powerData: [],
  295. timeData: {},
  296. }
  297. },
  298. created() {
  299. this.stationName = uni.getStorageSync('stationName')
  300. this.stationWpid = uni.getStorageSync('stationWpid')
  301. this.getTimeDaya()
  302. this.getHomeData()
  303. this.getHomeDataTwo()
  304. if (this.stationWpid.indexOf('_FDC') > -1) {
  305. this.getwindPowerData("0", "-1");
  306. } else {
  307. this.getwindPowerData("0", "-2");
  308. }
  309. },
  310. mounted() {
  311. this.$refs.stationBar.showTab = '首页'
  312. },
  313. methods: {
  314. getColor(itv) {
  315. switch (Math.ceil(itv.status)) {
  316. case 0:
  317. return "background: #1d99ff";
  318. case 1:
  319. return "background: #05bb4c";
  320. case 2:
  321. return "background: #ba3237";
  322. case 3:
  323. return "background: #e17e23";
  324. case 4:
  325. return "background: #c531c7";
  326. case 5:
  327. return "background: #fff";
  328. case 6:
  329. return "background: #606769";
  330. }
  331. },
  332. //获取时间
  333. getTimeDaya() {
  334. let currentDate = new Date()
  335. this.timeData.year = currentDate.getFullYear()
  336. this.timeData.month = currentDate.getMonth() + 1
  337. this.timeData.day = currentDate.getDate()
  338. this.timeData.hour = currentDate.getHours() + ':'
  339. this.timeData.minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
  340. .getMinutes()
  341. this.timeData.week = new Array('星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六')[currentDate.getDay()]
  342. },
  343. //获取首页整体数据
  344. getHomeData() {
  345. let that = this
  346. cockpitMonitor({
  347. wpId: that.stationWpid
  348. }).then(res => {
  349. if (res.data) {
  350. if (res.data.cblpoint) {
  351. that.powerstatusData = res.data.cblpoint
  352. }
  353. if (res.data.mxztmap) {
  354. that.windstatusData = res.data.mxztmap
  355. }
  356. }
  357. })
  358. },
  359. getHomeDataTwo() {
  360. let that = this
  361. stationCaldataApi({
  362. wpid: that.stationWpid
  363. }).then(res => {
  364. if (res.data.data) {
  365. let datas = res.data.data
  366. let arr = [{
  367. leftName: '容量',
  368. leftValue: Math.ceil(datas.zzjrl / 1000),
  369. leftCode: '(MW)',
  370. },
  371. {
  372. leftName: '安全天数',
  373. leftValue: Math.ceil(datas.aqts),
  374. leftCode: '(天)',
  375. },
  376. {
  377. leftName: '利用小时',
  378. leftValue: Math.ceil(datas.nlyxs),
  379. leftCode: '(h/年)'
  380. }
  381. ]
  382. that.windPowerData = [{
  383. name: '日照强度',
  384. value: 0,
  385. code: '(W/m²)',
  386. min: 6,
  387. max: 20
  388. }, {
  389. name: '功率',
  390. value: datas.yggl,
  391. code: '(MW)',
  392. min: 0,
  393. max: 200
  394. }, {
  395. name: '负荷率',
  396. value: Math.ceil(datas.fhl),
  397. code: '(MW)',
  398. min: 0,
  399. max: 100
  400. }]
  401. if (this.stationWpid.indexOf('_FDC') > -1) {
  402. let obj = {
  403. name: '风速',
  404. value: Math.ceil(datas.sspjfsgzd),
  405. code: '(m/s)',
  406. min: 6,
  407. max: 8
  408. }
  409. that.windPowerData.push(obj)
  410. }
  411. that.getHomeData2(arr)
  412. }
  413. })
  414. },
  415. getHomeData2(arr) {
  416. let that = this
  417. cockpitProjectplanApi({
  418. wpId: that.stationWpid
  419. }).then(res => {
  420. if (res && res.data) {
  421. let item = res.data.proplanmap
  422. let arr2 = [{
  423. leftName: '日发电量',
  424. leftValue: Math.ceil(item.qy_r_sjdl / 10000),
  425. leftCode: '(万kWh)'
  426. },
  427. {
  428. leftName: '月发电量',
  429. leftValue: Math.ceil(item.qy_y_sjdl / 10000),
  430. leftCode: '(万kWh)'
  431. },
  432. {
  433. leftName: '年发电量',
  434. leftValue: Math.ceil(item.qy_n_sjdl / 10000),
  435. leftCode: '(万kWh)'
  436. },
  437. ]
  438. that.mesExData = [...arr, ...arr2]
  439. }
  440. })
  441. },
  442. getwindPowerData(type1, type2) {
  443. let that = this
  444. windPowerDataApi({
  445. company: type1,
  446. type: type2
  447. })
  448. .then((res) => {
  449. if (Object.values(res.data.data).length) {
  450. if (res.data.data.powerVos.length > 0) {
  451. res.data.data.powerVos.forEach(item => {
  452. if (that.stationWpid === item.wpid) {
  453. if (type2 === "-1") {
  454. that.windData.push(item)
  455. } else {
  456. that.powerData.push(item)
  457. }
  458. }
  459. })
  460. }
  461. } else {
  462. this.windData = [];
  463. this.powerData = [];
  464. }
  465. });
  466. },
  467. back() {
  468. this.$tab.switchTab('/pages/home/index')
  469. },
  470. stationTabXY(it) {
  471. this.stationTab = it
  472. }
  473. }
  474. }
  475. </script>
  476. <style lang="scss">
  477. page {
  478. background-color: #202246;
  479. }
  480. .home {
  481. width: 100vw;
  482. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  483. background-repeat: no-repeat, repeat;
  484. background-size: 100% 260px, 100% 5px;
  485. .box-bg {
  486. width: 100vw;
  487. padding: 0;
  488. .uni-navbar {
  489. .uni-navbar__content {
  490. padding: 5px 0;
  491. height: 50px;
  492. }
  493. }
  494. }
  495. .home_main {
  496. padding: 0 20px;
  497. .main_time {
  498. margin-top: 10px;
  499. .mesTime {
  500. display: flex;
  501. padding: 3px 0;
  502. border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  503. image {
  504. width: 20px;
  505. height: 20px;
  506. }
  507. text {
  508. font-size: 34upx;
  509. color: #fff;
  510. margin-left: 15px;
  511. }
  512. text:nth-of-type(3) {
  513. position: relative;
  514. top: 3px;
  515. }
  516. }
  517. .mesAll {
  518. padding-bottom: 60px;
  519. .mesEx {
  520. // display: flex;
  521. line-height: 30px;
  522. color: #fff;
  523. .mesEx_left {
  524. width: 100%;
  525. border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  526. padding: 3px 0;
  527. .mesEx_left_top {
  528. width: 40%;
  529. font-size: 28upx;
  530. .nameSty {
  531. width: 100%;
  532. display: inline-block;
  533. position: relative;
  534. text-align-last: justify;
  535. text-align: justify;
  536. }
  537. }
  538. .mesEx_left_end {
  539. width: 56%;
  540. margin: 0 10px;
  541. display: flex;
  542. justify-content: space-between;
  543. text:nth-of-type(1) {
  544. font-size: 34upx;
  545. }
  546. text:nth-of-type(2) {
  547. font-size: 20upx;
  548. color: #92949B;
  549. }
  550. }
  551. }
  552. }
  553. .windpowerCl {
  554. .windpowerMsg {
  555. margin-top: 10px;
  556. padding: 5px 10px;
  557. color: #fff;
  558. background-image: url('../../static/jnImage/indexPage/windpower.png');
  559. background-repeat: no-repeat;
  560. background-size: cover;
  561. .windpowerMsg_com {
  562. text {
  563. font-size: 24upx;
  564. color: #AFB2C1;
  565. }
  566. }
  567. .windpowerMsg_Data {
  568. margin: 5px;
  569. text-align: center;
  570. font-size: 40upx;
  571. }
  572. }
  573. }
  574. .windMsg,
  575. .powerMsg {
  576. margin-top: 15px;
  577. .windMsg_title {
  578. width: 40%;
  579. height: 30px;
  580. display: flex;
  581. justify-content: center;
  582. align-items: center;
  583. padding: 6px 13px;
  584. background: rgba(51, 57, 118, 0.7);
  585. border-radius: 5px;
  586. image {
  587. width: 18px;
  588. height: 18px;
  589. }
  590. text {
  591. margin-left: 5px;
  592. font-size: 34upx;
  593. color: #fff;
  594. }
  595. }
  596. .windMsg_main {
  597. .windMsg_main_msg {
  598. margin-bottom: 8px;
  599. .windMsgSty {
  600. padding: 5px 8px;
  601. width: 49%;
  602. background: #3F4572;
  603. border-radius: 5px;
  604. .windMsgSty_left {
  605. width: 49%;
  606. height: 32px;
  607. image {
  608. width: 32px;
  609. height: 32px;
  610. }
  611. text {
  612. width: 100px;
  613. display: inline-block;
  614. color: #9A9BA6;
  615. font-size: 28upx;
  616. margin-left: 10px;
  617. position: relative;
  618. top: -26px;
  619. left: 28px;
  620. }
  621. .fourFont {
  622. top: -38px;
  623. }
  624. }
  625. .windMsgSty_right {
  626. width: 49%;
  627. position: relative;
  628. top: 9px;
  629. text:nth-of-type(1) {
  630. margin-left: 5px;
  631. width: 50%;
  632. font-size: 34upx;
  633. color: #fff;
  634. }
  635. text:nth-of-type(2) {
  636. font-size: 28upx;
  637. color: #9A9BA6;
  638. }
  639. }
  640. }
  641. }
  642. }
  643. }
  644. .matrix {
  645. .matrixItem {
  646. margin-top: 10px;
  647. .matrixText {
  648. font-size: 32upx;
  649. color: #9A9BA6;
  650. }
  651. .matrixItemRow {
  652. .matrixItemRowOne {
  653. width: 100%;
  654. height: 30px;
  655. background-color: #2675F6;
  656. text-align: center;
  657. line-height: 30px;
  658. color: #fff;
  659. font-size: 24upx;
  660. border-radius: 5px;
  661. // margin: 1px 2px;
  662. border: 1px solid #202246;
  663. }
  664. }
  665. }
  666. }
  667. }
  668. }
  669. }
  670. }
  671. </style>