index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  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">
  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/uniNavBar')
  202. },
  203. getPowerBar() {
  204. let opts = {
  205. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  206. "#ea7ccc"
  207. ],
  208. padding: [15, 15, 0, 5],
  209. enableScroll: false,
  210. legend: {
  211. show: false
  212. },
  213. xAxis: {
  214. disableGrid: true,
  215. rotateLabel: true,
  216. axisLineColor: "#A49EAC",
  217. fontColor: "#A49EAC",
  218. fontSize: 10,
  219. marginTop: 5
  220. },
  221. yAxis: {
  222. showTitle: true,
  223. data: [{
  224. min: 0,
  225. fontColor: "#A49EAC",
  226. title: "(万kwh)",
  227. titleFontColor: "#A49EAC",
  228. titleFontSize: 10
  229. }]
  230. },
  231. extra: {
  232. column: {
  233. type: "group",
  234. width: 15,
  235. activeBgColor: "#000000",
  236. activeBgOpacity: 0.08
  237. }
  238. }
  239. }
  240. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  241. '#766FF1', '#4951B2',
  242. ]
  243. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  244. let xAxis = []
  245. let series = []
  246. this.powerProgressData.forEach((item, index) => {
  247. xAxis.push(item.name)
  248. let obj = {
  249. color: '',
  250. name: '',
  251. textSize: 10,
  252. textColor: "#A49EAC",
  253. value: item.inPower
  254. }
  255. proColor.forEach((it, idx) => {
  256. if (index.toString().length > 1) {
  257. obj.color = proColor[index.toString().slice(-1)]
  258. } else {
  259. obj.color = proColor[index]
  260. }
  261. })
  262. series.push(obj)
  263. })
  264. let res = {
  265. categories: xAxis,
  266. series: [{
  267. data: series
  268. }]
  269. };
  270. this.opts = opts
  271. this.chartData = JSON.parse(JSON.stringify(res));
  272. },
  273. getLineBar() {
  274. let opts = {
  275. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  276. "#ea7ccc"
  277. ],
  278. padding: [15, 15, 0, 5],
  279. enableScroll: false,
  280. legend: {
  281. show: true
  282. },
  283. xAxis: {
  284. disableGrid: true,
  285. axisLineColor: "#A49EAC",
  286. fontColor: "#A49EAC",
  287. fontSize: 10,
  288. marginTop: 5
  289. },
  290. yAxis: {
  291. showTitle: true,
  292. disabled: false,
  293. disableGrid: false,
  294. splitNumber: 5,
  295. gridType: "dash",
  296. dashLength: 4,
  297. gridColor: "#CCCCCC",
  298. padding: 10,
  299. data: [{
  300. position: "left",
  301. title: "折线",
  302. fontColor: "#A49EAC",
  303. titleFontColor: "#A49EAC",
  304. titleFontSize: 10
  305. },
  306. {
  307. position: "right",
  308. min: 0,
  309. max: 200,
  310. title: "点",
  311. textAlign: "left",
  312. fontColor: "#A49EAC",
  313. titleFontColor: "#A49EAC",
  314. titleFontSize: 10
  315. }
  316. ]
  317. },
  318. extra: {
  319. mix: {
  320. column: {
  321. width: 20
  322. }
  323. }
  324. }
  325. }
  326. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  327. '#766FF1', '#4951B2',
  328. ]
  329. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  330. let res = {
  331. categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
  332. series: [{
  333. name: "折线",
  334. type: "line",
  335. color: "#2fc25b",
  336. data: [150, 186, 205, 155, 96, 84]
  337. },
  338. {
  339. name: "折线",
  340. type: "line",
  341. color: "#2fc25b",
  342. data: [120, 140, 105, 170, 95, 160]
  343. },
  344. {
  345. name: "点",
  346. index: 2,
  347. type: "point",
  348. color: "#f04864",
  349. data: [100, 80, 125, 150, 112, 132]
  350. }
  351. ]
  352. };
  353. this.optsLine = opts
  354. this.chartDataLine = JSON.parse(JSON.stringify(res));
  355. },
  356. changePowerTab(item) {
  357. this.powerTabData.forEach(it => {
  358. it.showColor = false
  359. if (it.nameEN === item.nameEN) {
  360. item.showColor = true
  361. this.powerTab = it.nameEN
  362. }
  363. })
  364. if (this.powerTab === 'DL') {
  365. this.getPowerBar()
  366. } else {
  367. this.getLineBar()
  368. }
  369. },
  370. changeYearTab(item) {
  371. this.yearData.forEach(it => {
  372. it.showColor = false
  373. if (it.nameEN === item.nameEN) {
  374. item.showColor = true
  375. this.yearTab = it.nameEN
  376. }
  377. })
  378. },
  379. showProgress(item, index) {
  380. let indexX = index
  381. if (index > 9) {
  382. indexX = index - 9
  383. }
  384. let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
  385. '#766FF1'
  386. ]
  387. let pro = ((item.inPower / item.allPower).toFixed(2)) * 100 + '%'
  388. let showColor = proColor[indexX]
  389. let ss = `width: ${pro};background: ${showColor}`
  390. return ss
  391. },
  392. },
  393. }
  394. </script>
  395. <style lang="scss">
  396. page {
  397. background-color: #202246;
  398. }
  399. .power {
  400. width: 100vw;
  401. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  402. background-repeat: no-repeat, repeat;
  403. background-size: 100% 260px, 100% 5px;
  404. .home_header {
  405. width: calc(100% -32px);
  406. display: flex;
  407. justify-content: space-between;
  408. height: 60px;
  409. padding-top: 16px;
  410. // position: fixed;
  411. .header_message {
  412. width: 15%;
  413. image {
  414. position: relative;
  415. top: 5px;
  416. left: 10px;
  417. width: 25px;
  418. height: 25px;
  419. }
  420. }
  421. .header_title {
  422. width: 70%;
  423. position: relative;
  424. left: 5px;
  425. image {
  426. width: 28px;
  427. height: 22px;
  428. position: relative;
  429. top: 5px;
  430. }
  431. .titleName {
  432. line-height: 20px;
  433. font-size: 36upx;
  434. font-family: FZZhengHeiS-M-GB;
  435. font-weight: 600;
  436. color: #fff;
  437. position: relative;
  438. top: 8px;
  439. }
  440. }
  441. .header_more {
  442. width: 15%;
  443. position: relative;
  444. top: 10px;
  445. left: 10px;
  446. image {
  447. width: 25px;
  448. height: 15px;
  449. }
  450. }
  451. }
  452. .power_main {
  453. padding: 0 20px;
  454. .power_tab {
  455. text {
  456. display: inline-block;
  457. width: 80px;
  458. height: 25px;
  459. border: 1px solid #4287FF;
  460. text-align: center;
  461. color: #4287FF;
  462. line-height: 25px;
  463. letter-spacing: 2px;
  464. }
  465. }
  466. .fdwcl {
  467. .fdwcl_title {
  468. width: 130px;
  469. height: 45px;
  470. padding-left: 10px;
  471. margin-top: 10px;
  472. background: linear-gradient(90deg, #333976, #202246);
  473. align-items: center;
  474. image {
  475. width: 24px;
  476. height: 22px;
  477. }
  478. text {
  479. margin-left: 10px;
  480. font-size: 16px;
  481. color: #fff;
  482. }
  483. }
  484. .yearTab {
  485. width: 80px;
  486. height: 25px;
  487. border-radius: 20px;
  488. background: #0B143E;
  489. margin-top: 20px;
  490. text {
  491. display: inline-block;
  492. width: 40px;
  493. height: 25px;
  494. border-radius: 20px;
  495. text-align: center;
  496. color: #4287FF;
  497. line-height: 25px;
  498. }
  499. }
  500. .fdwcl_DataAll {
  501. margin-top: 10px;
  502. .fdwcl_Data {
  503. .fdwcl_Data_1 {
  504. image {
  505. width: 18px;
  506. height: 18px;
  507. }
  508. text {
  509. margin-left: 5px;
  510. font-size: 28upx;
  511. color: #A49EAC;
  512. position: relative;
  513. top: 0px;
  514. }
  515. }
  516. .fdwcl_Data_2 {
  517. text {
  518. font-size: 32upx;
  519. color: #A49EAC;
  520. }
  521. }
  522. .fdwcl_Data_3 {
  523. text {
  524. font-size: 28upx;
  525. color: #A49EAC;
  526. }
  527. }
  528. }
  529. .fdwcl_Data_msg {
  530. width: 100%;
  531. height: 20px;
  532. border-radius: 5px;
  533. background: #0B143E;
  534. .show_msg {
  535. height: 20px;
  536. background: #6C4B9E;
  537. border-radius: 5px 0 0 5px;
  538. }
  539. }
  540. }
  541. }
  542. .rdldb {
  543. padding-bottom: 20px;
  544. .rdldb_title {
  545. width: 130px;
  546. height: 45px;
  547. padding-left: 10px;
  548. margin-top: 10px;
  549. background: linear-gradient(90deg, #333976, #202246);
  550. align-items: center;
  551. image {
  552. width: 24px;
  553. height: 22px;
  554. }
  555. text {
  556. margin-left: 10px;
  557. font-size: 16px;
  558. color: #fff;
  559. }
  560. }
  561. .qiun-charts {
  562. width: 100%;
  563. height: 300px;
  564. margin: 10px 0;
  565. }
  566. }
  567. .ycdl {
  568. margin-top: 10px;
  569. .ycdl_msg {
  570. .ycdl_title {
  571. image {
  572. width: 15px;
  573. height: 15px;
  574. position: relative;
  575. top: 3px;
  576. }
  577. text {
  578. font-size: 32upx;
  579. color: #676D9C;
  580. margin-left: 10px;
  581. }
  582. }
  583. .ycdl_data {
  584. margin-top: 5px;
  585. .ycdl_data_row {
  586. .ycdl_data_col {
  587. width: 98%;
  588. height: 20px;
  589. margin-bottom: 5px;
  590. background: #2E336D;
  591. border-radius: 5px;
  592. .ycdl_data_col_left {
  593. width: 50%;
  594. height: 20px;
  595. color: #fff;
  596. font-size: 30upx;
  597. background: #3F4572;
  598. border-radius: 5px;
  599. text {
  600. margin-left: 5px;
  601. }
  602. }
  603. .ycdl_data_col_right {
  604. height: 20px;
  605. color: #fff;
  606. font-size: 32upx;
  607. width: 48%;
  608. text:nth-of-type(1) {
  609. margin-left: 5px;
  610. width: 50%;
  611. font-size: 32upx;
  612. color: #fff;
  613. position: relative;
  614. top: 3px;
  615. }
  616. text:nth-of-type(2) {
  617. font-size: 22upx;
  618. color: #96B5D5;
  619. position: relative;
  620. top: 4px;
  621. }
  622. }
  623. }
  624. }
  625. }
  626. }
  627. }
  628. .xsfsgl {
  629. padding-bottom: 20px;
  630. .xsfsgl_title {
  631. width: 160px;
  632. height: 45px;
  633. padding-left: 10px;
  634. margin-top: 10px;
  635. background: linear-gradient(90deg, #333976, #202246);
  636. align-items: center;
  637. image {
  638. width: 24px;
  639. height: 22px;
  640. }
  641. text {
  642. margin-left: 10px;
  643. font-size: 16px;
  644. color: #fff;
  645. }
  646. }
  647. .qiun-chartsLine {
  648. width: 100%;
  649. height: 300px;
  650. margin: 10px 0;
  651. }
  652. }
  653. }
  654. }
  655. </style>