123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- <template>
- <view class="power">
- <view class="home_header">
- <view class="header_message" @click="changeMsg">
- <image src="../../static/jnImage/indexPage/alarmSet.png"></image>
- </view>
- <view class="header_title">
- <!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
- <text class="titleName">发电场站生产实时运营管理平台</text>
- </view>
- <view class="header_more">
- <image src="../../static/jnImage/indexPage/moreNew.png"></image>
- </view>
- </view>
- <view class="power_main">
- <view class="flex justify-center">
- <view class="power_tab">
- <text v-for="(item,index) in powerTabData" :key="index" @click="changePowerTab(item)"
- :style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
- </view>
- </view>
- <view class="fdwcl" v-if="powerTab === 'DL'">
- <view class="flex justify-between">
- <view class="fdwcl_title flex justify-center">
- <image src="../../static/jnImage/powerPage/powerTu.png" mode=""></image>
- <text>发电完成率</text>
- </view>
- <view class="yearTab">
- <text v-for="(item,index) in yearData" :key="index" @click="changeYearTab(item)"
- :style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
- </view>
- </view>
- <view class="fdwcl_DataAll" v-for="(item,index) in powerProgressData" :key="index">
- <view class="fdwcl_Data flex justify-between">
- <view class="fdwcl_Data_1 flex">
- <image src="../../static/jnImage/indexPage/windIcon.png" mode=""></image>
- <text>{{item.inPower}}万kWh</text>
- </view>
- <view class="fdwcl_Data_2">
- <text>{{item.name}}</text>
- </view>
- <view class="fdwcl_Data_3">
- <text>{{item.allPower}}万kWh</text>
- </view>
- </view>
- <view class="fdwcl_Data_msg">
- <view class="show_msg" :style="showProgress(item, index)">
- </view>
- </view>
- </view>
- </view>
- <view class="ycdl" v-else>
- <view class="ycdl_msg" v-for="(item,index) in 3" :key="index">
- <view class="ycdl_title flex">
- <image src="../../static/jnImage/powerPage/clock.png" mode=""></image>
- <text>11月22日</text>
- <text>预测电量</text>
- </view>
- <view class="ycdl_data">
- <uni-row class="ycdl_data_row">
- <uni-col :span="12" v-for="(item,index) in powerProgressData" :key="index">
- <view class="ycdl_data_col flex">
- <view class="ycdl_data_col_left">
- <text>{{item.name}}</text>
- </view>
- <view class="ycdl_data_col_right flex justify-between">
- <text>{{item.inPower}}</text>
- <text>MW</text>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </view>
- </view>
- </view>
- <view class="rdldb" v-if="powerTab === 'DL'">
- <view class="rdldb_title flex justify-center">
- <image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""></image>
- <text>日电量对比</text>
- </view>
- <view class="qiun-charts">
- <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
- </view>
- </view>
- <view class="xsfsgl" v-else>
- <view class="xsfsgl_title flex justify-center">
- <image src="../../static/jnImage/powerPage/72clock.png" mode=""></image>
- <text>72小时风速功率</text>
- </view>
- <view class="qiun-chartsLine">
- <qiun-data-charts type="mix" :opts="optsLine" :chartData="chartDataLine" />
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- // import * as echarts from 'echarts'
- // import uCharts from '../../components/u-charts/u-charts.js';
- // import qCharts from '../../components/u-charts/component.vue';
- var uChartsInstance = {};
- export default {
- onLoad: function() {},
- data() {
- return {
- powerTab: 'DL',
- yearTab: 'month',
- powerTabData: [],
- yearData: [],
- powerProgressData: [],
- chartData: {},
- chartDataLine: {},
- opts: {},
- optsLine: {},
- }
- },
- created() {
- this.powerTabData = [{
- nameZN: '电量',
- nameEN: 'DL',
- showColor: true
- },
- {
- nameZN: '预测',
- nameEN: 'YC',
- showColor: false
- }
- ]
- this.yearData = [{
- nameZN: '月',
- nameEN: 'month',
- showColor: true
- },
- {
- nameZN: '年',
- nameEN: 'year',
- showColor: false
- }
- ],
- this.powerProgressData = [{
- type: 'wind',
- inPower: 961,
- allPower: 1865,
- name: '宝龙山'
- },
- {
- type: 'wind',
- inPower: 852,
- allPower: 1865,
- name: '乌力吉'
- },
- {
- type: 'wind',
- inPower: 696,
- allPower: 1865,
- name: '浩日格吐'
- },
- {
- type: 'wind',
- inPower: 527,
- allPower: 1865,
- name: '开鲁'
- },
- {
- type: 'wind',
- inPower: 935,
- allPower: 1865,
- name: '景观'
- },
- {
- type: 'wind',
- inPower: 1022,
- allPower: 1865,
- name: '高力板'
- },
- {
- type: 'wind',
- inPower: 752,
- allPower: 1865,
- name: '书声'
- },
- {
- type: 'wind',
- inPower: 1520,
- allPower: 1865,
- name: '宝力根花'
- },
- {
- type: 'wind',
- inPower: 365.6,
- allPower: 1865,
- name: '振发'
- },
- ]
- },
- onReady() {
- this.getPowerBar()
- },
- methods: {
- changeMsg() {
- this.$tab.navigateTo('/pages/common/uniNavBar')
- },
- getPowerBar() {
- let opts = {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
- "#ea7ccc"
- ],
- padding: [15, 15, 0, 5],
- enableScroll: false,
- legend: {
- show: false
- },
- xAxis: {
- disableGrid: true,
- rotateLabel: true,
- axisLineColor: "#A49EAC",
- fontColor: "#A49EAC",
- fontSize: 10,
- marginTop: 5
- },
- yAxis: {
- showTitle: true,
- data: [{
- min: 0,
- fontColor: "#A49EAC",
- title: "(万kwh)",
- titleFontColor: "#A49EAC",
- titleFontSize: 10
- }]
- },
- extra: {
- column: {
- type: "group",
- width: 15,
- activeBgColor: "#000000",
- activeBgOpacity: 0.08
- }
- }
- }
- let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
- '#766FF1', '#4951B2',
- ]
- //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
- let xAxis = []
- let series = []
- this.powerProgressData.forEach((item, index) => {
- xAxis.push(item.name)
- let obj = {
- color: '',
- name: '',
- textSize: 10,
- textColor: "#A49EAC",
- value: item.inPower
- }
- proColor.forEach((it, idx) => {
- if (index.toString().length > 1) {
- obj.color = proColor[index.toString().slice(-1)]
- } else {
- obj.color = proColor[index]
- }
- })
- series.push(obj)
- })
- let res = {
- categories: xAxis,
- series: [{
- data: series
- }]
- };
- this.opts = opts
- this.chartData = JSON.parse(JSON.stringify(res));
- },
- getLineBar() {
- let opts = {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
- "#ea7ccc"
- ],
- padding: [15, 15, 0, 5],
- enableScroll: false,
- legend: {
- show: true
- },
- xAxis: {
- disableGrid: true,
- axisLineColor: "#A49EAC",
- fontColor: "#A49EAC",
- fontSize: 10,
- marginTop: 5
- },
- yAxis: {
- showTitle: true,
- disabled: false,
- disableGrid: false,
- splitNumber: 5,
- gridType: "dash",
- dashLength: 4,
- gridColor: "#CCCCCC",
- padding: 10,
- data: [{
- position: "left",
- title: "折线",
- fontColor: "#A49EAC",
- titleFontColor: "#A49EAC",
- titleFontSize: 10
- },
- {
- position: "right",
- min: 0,
- max: 200,
- title: "点",
- textAlign: "left",
- fontColor: "#A49EAC",
- titleFontColor: "#A49EAC",
- titleFontSize: 10
- }
- ]
- },
- extra: {
- mix: {
- column: {
- width: 20
- }
- }
- }
- }
- let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
- '#766FF1', '#4951B2',
- ]
- //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
- let res = {
- categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
- series: [{
- name: "折线",
- type: "line",
- color: "#2fc25b",
- data: [150, 186, 205, 155, 96, 84]
- },
- {
- name: "折线",
- type: "line",
- color: "#2fc25b",
- data: [120, 140, 105, 170, 95, 160]
- },
- {
- name: "点",
- index: 2,
- type: "point",
- color: "#f04864",
- data: [100, 80, 125, 150, 112, 132]
- }
- ]
- };
- this.optsLine = opts
- this.chartDataLine = JSON.parse(JSON.stringify(res));
- },
- changePowerTab(item) {
- this.powerTabData.forEach(it => {
- it.showColor = false
- if (it.nameEN === item.nameEN) {
- item.showColor = true
- this.powerTab = it.nameEN
- }
- })
- if (this.powerTab === 'DL') {
- this.getPowerBar()
- } else {
- this.getLineBar()
- }
- },
- changeYearTab(item) {
- this.yearData.forEach(it => {
- it.showColor = false
- if (it.nameEN === item.nameEN) {
- item.showColor = true
- this.yearTab = it.nameEN
- }
- })
- },
- showProgress(item, index) {
- let indexX = index
- if (index > 9) {
- indexX = index - 9
- }
- let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
- '#766FF1'
- ]
- let pro = ((item.inPower / item.allPower).toFixed(2)) * 100 + '%'
- let showColor = proColor[indexX]
- let ss = `width: ${pro};background: ${showColor}`
- return ss
- },
- },
- }
- </script>
- <style lang="scss">
- page {
- background-color: #202246;
- }
- .power {
- width: 100vw;
- background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
- background-repeat: no-repeat, repeat;
- background-size: 100% 260px, 100% 5px;
- .home_header {
- width: calc(100% -32px);
- display: flex;
- justify-content: space-between;
- height: 60px;
- padding-top: 16px;
- // position: fixed;
- .header_message {
- width: 15%;
- image {
- position: relative;
- top: 5px;
- left: 10px;
- width: 25px;
- height: 25px;
- }
- }
- .header_title {
- width: 70%;
- position: relative;
- left: 5px;
- image {
- width: 28px;
- height: 22px;
- position: relative;
- top: 5px;
- }
- .titleName {
- line-height: 20px;
- font-size: 36upx;
- font-family: FZZhengHeiS-M-GB;
- font-weight: 600;
- color: #fff;
- position: relative;
- top: 8px;
- }
- }
- .header_more {
- width: 15%;
- position: relative;
- top: 10px;
- left: 10px;
- image {
- width: 25px;
- height: 15px;
- }
- }
- }
- .power_main {
- padding: 0 20px;
- .power_tab {
- text {
- display: inline-block;
- width: 80px;
- height: 25px;
- border: 1px solid #4287FF;
- text-align: center;
- color: #4287FF;
- line-height: 25px;
- letter-spacing: 2px;
- }
- }
- .fdwcl {
- .fdwcl_title {
- width: 130px;
- height: 45px;
- padding-left: 10px;
- margin-top: 10px;
- background: linear-gradient(90deg, #333976, #202246);
- align-items: center;
- image {
- width: 24px;
- height: 22px;
- }
- text {
- margin-left: 10px;
- font-size: 16px;
- color: #fff;
- }
- }
- .yearTab {
- width: 80px;
- height: 25px;
- border-radius: 20px;
- background: #0B143E;
- margin-top: 20px;
- text {
- display: inline-block;
- width: 40px;
- height: 25px;
- border-radius: 20px;
- text-align: center;
- color: #4287FF;
- line-height: 25px;
- }
- }
- .fdwcl_DataAll {
- margin-top: 10px;
- .fdwcl_Data {
- .fdwcl_Data_1 {
- image {
- width: 18px;
- height: 18px;
- }
- text {
- margin-left: 5px;
- font-size: 28upx;
- color: #A49EAC;
- position: relative;
- top: 0px;
- }
- }
- .fdwcl_Data_2 {
- text {
- font-size: 32upx;
- color: #A49EAC;
- }
- }
- .fdwcl_Data_3 {
- text {
- font-size: 28upx;
- color: #A49EAC;
- }
- }
- }
- .fdwcl_Data_msg {
- width: 100%;
- height: 20px;
- border-radius: 5px;
- background: #0B143E;
- .show_msg {
- height: 20px;
- background: #6C4B9E;
- border-radius: 5px 0 0 5px;
- }
- }
- }
- }
- .rdldb {
- padding-bottom: 20px;
- .rdldb_title {
- width: 130px;
- height: 45px;
- padding-left: 10px;
- margin-top: 10px;
- background: linear-gradient(90deg, #333976, #202246);
- align-items: center;
- image {
- width: 24px;
- height: 22px;
- }
- text {
- margin-left: 10px;
- font-size: 16px;
- color: #fff;
- }
- }
- .qiun-charts {
- width: 100%;
- height: 300px;
- margin: 10px 0;
- }
- }
- .ycdl {
- margin-top: 10px;
- .ycdl_msg {
- .ycdl_title {
- image {
- width: 15px;
- height: 15px;
- position: relative;
- top: 3px;
- }
- text {
- font-size: 32upx;
- color: #676D9C;
- margin-left: 10px;
- }
- }
- .ycdl_data {
- margin-top: 5px;
- .ycdl_data_row {
- .ycdl_data_col {
- width: 98%;
- height: 20px;
- margin-bottom: 5px;
- background: #2E336D;
- border-radius: 5px;
- .ycdl_data_col_left {
- width: 50%;
- height: 20px;
- color: #fff;
- font-size: 30upx;
- background: #3F4572;
- border-radius: 5px;
- text {
- margin-left: 5px;
- }
- }
- .ycdl_data_col_right {
- height: 20px;
- color: #fff;
- font-size: 32upx;
- width: 48%;
- text:nth-of-type(1) {
- margin-left: 5px;
- width: 50%;
- font-size: 32upx;
- color: #fff;
- position: relative;
- top: 3px;
- }
- text:nth-of-type(2) {
- font-size: 22upx;
- color: #96B5D5;
- position: relative;
- top: 4px;
- }
- }
- }
- }
- }
- }
- }
- .xsfsgl {
- padding-bottom: 20px;
- .xsfsgl_title {
- width: 160px;
- height: 45px;
- padding-left: 10px;
- margin-top: 10px;
- background: linear-gradient(90deg, #333976, #202246);
- align-items: center;
- image {
- width: 24px;
- height: 22px;
- }
- text {
- margin-left: 10px;
- font-size: 16px;
- color: #fff;
- }
- }
- .qiun-chartsLine {
- width: 100%;
- height: 300px;
- margin: 10px 0;
- }
- }
- }
- }
- </style>
|