index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. <template>
  2. <view class="power">
  3. <view class="home_header">
  4. <view class="header_message" @click="changeMsg">
  5. <image src="../../static/jnImage/indexPage/alarmSet.png"></image>
  6. </view>
  7. <view class="header_title">
  8. <!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
  9. <text class="titleName">发电场站生产实时运营管理平台</text>
  10. </view>
  11. <view class="header_more" @click="changeStation">
  12. <image src="../../static/jnImage/indexPage/moreNew.png"></image>
  13. </view>
  14. </view>
  15. <view class="power_main">
  16. <view class="flex justify-center">
  17. <view class="power_tab">
  18. <text v-for="(item,index) in powerTabData" :key="index" @click="changePowerTab(item)"
  19. :style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
  20. </view>
  21. </view>
  22. <view class="fdwcl" v-if="powerTab === 'DL'">
  23. <view class="flex justify-between">
  24. <view class="fdwcl_title flex justify-center">
  25. <image src="../../static/jnImage/powerPage/powerTu.png" mode=""></image>
  26. <text>发电完成率</text>
  27. </view>
  28. <view class="yearTab">
  29. <text v-for="(item,index) in yearData" :key="index" @click="changeYearTab(item)"
  30. :style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
  31. </view>
  32. </view>
  33. <view class="fdwcl_DataAll" v-for="(item,index) in powerProgressData" :key="index">
  34. <view class="fdwcl_Data flex justify-between">
  35. <view class="fdwcl_Data_1 flex">
  36. <image src="../../static/jnImage/indexPage/windIcon.png" mode=""></image>
  37. <text>{{item.inPower}}万kWh</text>
  38. </view>
  39. <view class="fdwcl_Data_2">
  40. <text>{{item.name}}</text>
  41. </view>
  42. <view class="fdwcl_Data_3">
  43. <text>{{item.allPower}}万kWh</text>
  44. </view>
  45. </view>
  46. <view class="fdwcl_Data_msg">
  47. <view class="show_msg" :style="showProgress(item, index)">
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="ycdl" v-else>
  53. <view class="ycdl_msg" v-for="(item,index) in 3" :key="index">
  54. <view class="ycdl_title flex">
  55. <image src="../../static/jnImage/powerPage/clock.png" mode=""></image>
  56. <text>11月22日</text>
  57. <text>预测电量</text>
  58. </view>
  59. <view class="ycdl_data">
  60. <uni-row class="ycdl_data_row">
  61. <uni-col :span="12" v-for="(item,index) in powerProgressData" :key="index">
  62. <view class="ycdl_data_col flex">
  63. <view class="ycdl_data_col_left">
  64. <text>{{item.name}}</text>
  65. </view>
  66. <view class="ycdl_data_col_right flex justify-between">
  67. <text>{{item.inPower}}</text>
  68. <text>MW</text>
  69. </view>
  70. </view>
  71. </uni-col>
  72. </uni-row>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="rdldb" v-if="powerTab === 'DL'">
  77. <view class="rdldb_title flex justify-center">
  78. <image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""></image>
  79. <text>日电量对比</text>
  80. </view>
  81. <view class="qiun-charts">
  82. <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
  83. </view>
  84. </view>
  85. <view class="xsfsgl" v-else>
  86. <view class="xsfsgl_title flex justify-center">
  87. <image src="../../static/jnImage/powerPage/72clock.png" mode=""></image>
  88. <text>72小时风速功率</text>
  89. </view>
  90. <view class="qiun-chartsLine">
  91. <qiun-data-charts type="mix" :opts="optsLine" :chartData="chartDataLine" />
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. // import * as echarts from 'echarts'
  99. // import uCharts from '../../components/u-charts/u-charts.js';
  100. // import qCharts from '../../components/u-charts/component.vue';
  101. var uChartsInstance = {};
  102. export default {
  103. onLoad: function() {},
  104. data() {
  105. return {
  106. powerTab: 'DL',
  107. yearTab: 'month',
  108. powerTabData: [],
  109. yearData: [],
  110. powerProgressData: [],
  111. chartData: {},
  112. chartDataLine: {},
  113. opts: {},
  114. optsLine: {},
  115. }
  116. },
  117. created() {
  118. this.powerTabData = [{
  119. nameZN: '电量',
  120. nameEN: 'DL',
  121. showColor: true
  122. },
  123. {
  124. nameZN: '预测',
  125. nameEN: 'YC',
  126. showColor: false
  127. }
  128. ]
  129. this.yearData = [{
  130. nameZN: '月',
  131. nameEN: 'month',
  132. showColor: true
  133. },
  134. {
  135. nameZN: '年',
  136. nameEN: 'year',
  137. showColor: false
  138. }
  139. ],
  140. this.powerProgressData = [{
  141. type: 'wind',
  142. inPower: 961,
  143. allPower: 1865,
  144. name: '宝龙山'
  145. },
  146. {
  147. type: 'wind',
  148. inPower: 852,
  149. allPower: 1865,
  150. name: '乌力吉'
  151. },
  152. {
  153. type: 'wind',
  154. inPower: 696,
  155. allPower: 1865,
  156. name: '浩日格吐'
  157. },
  158. {
  159. type: 'wind',
  160. inPower: 527,
  161. allPower: 1865,
  162. name: '开鲁'
  163. },
  164. {
  165. type: 'wind',
  166. inPower: 935,
  167. allPower: 1865,
  168. name: '景观'
  169. },
  170. {
  171. type: 'wind',
  172. inPower: 1022,
  173. allPower: 1865,
  174. name: '高力板'
  175. },
  176. {
  177. type: 'wind',
  178. inPower: 752,
  179. allPower: 1865,
  180. name: '书声'
  181. },
  182. {
  183. type: 'wind',
  184. inPower: 1520,
  185. allPower: 1865,
  186. name: '宝力根花'
  187. },
  188. {
  189. type: 'wind',
  190. inPower: 365.6,
  191. allPower: 1865,
  192. name: '振发'
  193. },
  194. ]
  195. },
  196. onReady() {
  197. this.getPowerBar()
  198. },
  199. methods: {
  200. changeMsg() {
  201. this.$tab.navigateTo('/pages/common/messagePage')
  202. },
  203. changeStation() {
  204. this.$tab.navigateTo('/pages/common/stationListPage')
  205. },
  206. getPowerBar() {
  207. let opts = {
  208. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  209. "#ea7ccc"
  210. ],
  211. padding: [15, 15, 0, 5],
  212. enableScroll: false,
  213. legend: {
  214. show: false
  215. },
  216. xAxis: {
  217. disableGrid: true,
  218. rotateLabel: true,
  219. axisLineColor: "#A49EAC",
  220. fontColor: "#A49EAC",
  221. fontSize: 10,
  222. marginTop: 5
  223. },
  224. yAxis: {
  225. showTitle: true,
  226. data: [{
  227. min: 0,
  228. fontColor: "#A49EAC",
  229. title: "(万kwh)",
  230. titleFontColor: "#A49EAC",
  231. titleFontSize: 10
  232. }]
  233. },
  234. extra: {
  235. column: {
  236. type: "group",
  237. width: 15,
  238. activeBgColor: "#000000",
  239. activeBgOpacity: 0.08
  240. }
  241. }
  242. }
  243. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  244. '#766FF1', '#4951B2',
  245. ]
  246. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  247. let xAxis = []
  248. let series = []
  249. this.powerProgressData.forEach((item, index) => {
  250. xAxis.push(item.name)
  251. let obj = {
  252. color: '',
  253. name: '',
  254. textSize: 10,
  255. textColor: "#A49EAC",
  256. value: item.inPower
  257. }
  258. proColor.forEach((it, idx) => {
  259. if (index.toString().length > 1) {
  260. obj.color = proColor[index.toString().slice(-1)]
  261. } else {
  262. obj.color = proColor[index]
  263. }
  264. })
  265. series.push(obj)
  266. })
  267. let res = {
  268. categories: xAxis,
  269. series: [{
  270. data: series
  271. }]
  272. };
  273. this.opts = opts
  274. this.chartData = JSON.parse(JSON.stringify(res));
  275. },
  276. getLineBar() {
  277. let opts = {
  278. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  279. "#ea7ccc"
  280. ],
  281. padding: [15, 15, 0, 5],
  282. enableScroll: false,
  283. legend: {
  284. show: true
  285. },
  286. xAxis: {
  287. disableGrid: true,
  288. axisLineColor: "#A49EAC",
  289. fontColor: "#A49EAC",
  290. fontSize: 10,
  291. marginTop: 5
  292. },
  293. yAxis: {
  294. showTitle: true,
  295. disabled: false,
  296. disableGrid: false,
  297. splitNumber: 5,
  298. gridType: "dash",
  299. dashLength: 4,
  300. gridColor: "#CCCCCC",
  301. padding: 10,
  302. data: [{
  303. position: "left",
  304. title: "折线",
  305. fontColor: "#A49EAC",
  306. titleFontColor: "#A49EAC",
  307. titleFontSize: 10
  308. },
  309. {
  310. position: "right",
  311. min: 0,
  312. max: 200,
  313. title: "点",
  314. textAlign: "left",
  315. fontColor: "#A49EAC",
  316. titleFontColor: "#A49EAC",
  317. titleFontSize: 10
  318. }
  319. ]
  320. },
  321. extra: {
  322. mix: {
  323. column: {
  324. width: 20
  325. }
  326. }
  327. }
  328. }
  329. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  330. '#766FF1', '#4951B2',
  331. ]
  332. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  333. let res = {
  334. categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
  335. series: [{
  336. name: "折线",
  337. type: "line",
  338. color: "#2fc25b",
  339. data: [150, 186, 205, 155, 96, 84]
  340. },
  341. {
  342. name: "折线",
  343. type: "line",
  344. color: "#2fc25b",
  345. data: [120, 140, 105, 170, 95, 160]
  346. },
  347. {
  348. name: "点",
  349. index: 2,
  350. type: "point",
  351. color: "#f04864",
  352. data: [100, 80, 125, 150, 112, 132]
  353. }
  354. ]
  355. };
  356. this.optsLine = opts
  357. this.chartDataLine = JSON.parse(JSON.stringify(res));
  358. },
  359. changePowerTab(item) {
  360. this.powerTabData.forEach(it => {
  361. it.showColor = false
  362. if (it.nameEN === item.nameEN) {
  363. item.showColor = true
  364. this.powerTab = it.nameEN
  365. }
  366. })
  367. if (this.powerTab === 'DL') {
  368. this.getPowerBar()
  369. } else {
  370. this.getLineBar()
  371. }
  372. },
  373. changeYearTab(item) {
  374. this.yearData.forEach(it => {
  375. it.showColor = false
  376. if (it.nameEN === item.nameEN) {
  377. item.showColor = true
  378. this.yearTab = it.nameEN
  379. }
  380. })
  381. },
  382. showProgress(item, index) {
  383. let indexX = index
  384. if (index > 9) {
  385. indexX = index - 9
  386. }
  387. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  388. '#766FF1'
  389. ]
  390. let pro = ((item.inPower / item.allPower).toFixed(2)) * 100 + '%'
  391. let showColor = proColor[indexX]
  392. let ss = `width: ${pro};background: ${showColor}`
  393. return ss
  394. },
  395. },
  396. }
  397. </script>
  398. <style lang="scss">
  399. page {
  400. background-color: #202246;
  401. }
  402. .power {
  403. width: 100vw;
  404. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  405. background-repeat: no-repeat, repeat;
  406. background-size: 100% 260px, 100% 5px;
  407. .home_header {
  408. width: calc(100% -32px);
  409. display: flex;
  410. justify-content: space-between;
  411. height: 60px;
  412. padding-top: 16px;
  413. // position: fixed;
  414. .header_message {
  415. width: 15%;
  416. image {
  417. position: relative;
  418. top: 5px;
  419. left: 10px;
  420. width: 25px;
  421. height: 25px;
  422. }
  423. }
  424. .header_title {
  425. width: 70%;
  426. position: relative;
  427. left: 5px;
  428. image {
  429. width: 28px;
  430. height: 22px;
  431. position: relative;
  432. top: 5px;
  433. }
  434. .titleName {
  435. line-height: 20px;
  436. font-size: 36upx;
  437. font-family: FZZhengHeiS-M-GB;
  438. font-weight: 600;
  439. color: #fff;
  440. position: relative;
  441. top: 8px;
  442. }
  443. }
  444. .header_more {
  445. width: 15%;
  446. position: relative;
  447. top: 10px;
  448. left: 10px;
  449. image {
  450. width: 25px;
  451. height: 18px;
  452. }
  453. }
  454. }
  455. .power_main {
  456. padding: 0 20px;
  457. .power_tab {
  458. text {
  459. display: inline-block;
  460. width: 80px;
  461. height: 25px;
  462. border: 1px solid #4287FF;
  463. text-align: center;
  464. color: #4287FF;
  465. line-height: 25px;
  466. letter-spacing: 2px;
  467. }
  468. }
  469. .fdwcl {
  470. .fdwcl_title {
  471. width: 130px;
  472. height: 45px;
  473. padding-left: 10px;
  474. margin-top: 10px;
  475. background: linear-gradient(90deg, #333976, transparent);
  476. align-items: center;
  477. image {
  478. width: 24px;
  479. height: 22px;
  480. }
  481. text {
  482. margin-left: 10px;
  483. font-size: 16px;
  484. color: #fff;
  485. }
  486. }
  487. .yearTab {
  488. width: 80px;
  489. height: 25px;
  490. border-radius: 20px;
  491. background: #0B143E;
  492. margin-top: 20px;
  493. text {
  494. display: inline-block;
  495. width: 40px;
  496. height: 25px;
  497. border-radius: 20px;
  498. text-align: center;
  499. color: #4287FF;
  500. line-height: 25px;
  501. }
  502. }
  503. .fdwcl_DataAll {
  504. margin-top: 10px;
  505. .fdwcl_Data {
  506. .fdwcl_Data_1 {
  507. image {
  508. width: 18px;
  509. height: 18px;
  510. }
  511. text {
  512. margin-left: 5px;
  513. font-size: 28upx;
  514. color: #A49EAC;
  515. position: relative;
  516. top: 0px;
  517. }
  518. }
  519. .fdwcl_Data_2 {
  520. text {
  521. font-size: 32upx;
  522. color: #A49EAC;
  523. }
  524. }
  525. .fdwcl_Data_3 {
  526. text {
  527. font-size: 28upx;
  528. color: #A49EAC;
  529. }
  530. }
  531. }
  532. .fdwcl_Data_msg {
  533. width: 100%;
  534. height: 20px;
  535. border-radius: 5px;
  536. background: #0B143E;
  537. .show_msg {
  538. height: 20px;
  539. background: #6C4B9E;
  540. border-radius: 5px 0 0 5px;
  541. }
  542. }
  543. }
  544. }
  545. .rdldb {
  546. padding-bottom: 20px;
  547. .rdldb_title {
  548. width: 130px;
  549. height: 45px;
  550. padding-left: 10px;
  551. margin-top: 10px;
  552. background: linear-gradient(90deg, #333976, transparent);
  553. align-items: center;
  554. image {
  555. width: 24px;
  556. height: 22px;
  557. }
  558. text {
  559. margin-left: 10px;
  560. font-size: 16px;
  561. color: #fff;
  562. }
  563. }
  564. .qiun-charts {
  565. width: 100%;
  566. height: 300px;
  567. margin: 10px 0;
  568. }
  569. }
  570. .ycdl {
  571. margin-top: 10px;
  572. .ycdl_msg {
  573. .ycdl_title {
  574. image {
  575. width: 15px;
  576. height: 15px;
  577. position: relative;
  578. top: 3px;
  579. }
  580. text {
  581. font-size: 32upx;
  582. color: #676D9C;
  583. margin-left: 10px;
  584. }
  585. }
  586. .ycdl_data {
  587. margin-top: 5px;
  588. .ycdl_data_row {
  589. .ycdl_data_col {
  590. width: 98%;
  591. height: 20px;
  592. margin-bottom: 5px;
  593. background: #2E336D;
  594. border-radius: 5px;
  595. .ycdl_data_col_left {
  596. width: 50%;
  597. height: 20px;
  598. color: #fff;
  599. font-size: 30upx;
  600. background: #3F4572;
  601. border-radius: 5px;
  602. text {
  603. margin-left: 5px;
  604. }
  605. }
  606. .ycdl_data_col_right {
  607. height: 20px;
  608. color: #fff;
  609. font-size: 32upx;
  610. width: 48%;
  611. text:nth-of-type(1) {
  612. margin-left: 5px;
  613. width: 50%;
  614. font-size: 32upx;
  615. color: #fff;
  616. position: relative;
  617. top: 3px;
  618. }
  619. text:nth-of-type(2) {
  620. font-size: 22upx;
  621. color: #96B5D5;
  622. position: relative;
  623. top: 4px;
  624. }
  625. }
  626. }
  627. }
  628. }
  629. }
  630. }
  631. .xsfsgl {
  632. padding-bottom: 20px;
  633. .xsfsgl_title {
  634. width: 160px;
  635. height: 45px;
  636. padding-left: 10px;
  637. margin-top: 10px;
  638. background: linear-gradient(90deg, #333976, transparent);
  639. align-items: center;
  640. image {
  641. width: 24px;
  642. height: 22px;
  643. }
  644. text {
  645. margin-left: 10px;
  646. font-size: 16px;
  647. color: #fff;
  648. }
  649. }
  650. .qiun-chartsLine {
  651. width: 100%;
  652. height: 300px;
  653. margin: 10px 0;
  654. }
  655. }
  656. }
  657. }
  658. </style>