代码提交

This commit is contained in:
lixiaobang 2023-01-07 15:36:08 +08:00
parent e8590d8964
commit e8e4c46023
3 changed files with 155 additions and 29 deletions

View File

@ -33,7 +33,7 @@
overflow-y:scroll overflow-y:scroll
z-index: 9999; z-index: 9999;
top: 98px; top: 98px;
border: 20px solid rgb(5,53,45); border: 10px solid rgb(5,53,45);
" "
> >
<div <div
@ -42,17 +42,14 @@
width: 20%; width: 20%;
height: 3%; height: 3%;
font-size: 18px; font-size: 18px;
padding: 5px 10px 0 0;
color: #fff;
text-align: right; text-align: right;
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
background: rgb(5,53,45,0.7); background: rgb(5,53,45,0.7);
z-index: 9999; z-index: 9999;
" "
@click="handleClosePdf"
> >
x <img src="./assets/images/close.png" style="position: absolute;right:0" @click="handleClosePdf"/>
</div> </div>
<pdf v-for="i in numPages" :key="i" :page="i" :src="filePdf" style="top:3.2%;z-index:999"></pdf> <pdf v-for="i in numPages" :key="i" :page="i" :src="filePdf" style="top:3.2%;z-index:999"></pdf>
</div> </div>
@ -70,7 +67,7 @@ import {getData} from './api/index.js'
handleAction:'', handleAction:'',
handleAction1:'', handleAction1:'',
fileType:false, //pdf fileType:false, //pdf
numPages: 1, //pdf numPages: null, //pdf
filePdf:'', //pdf filePdf:'', //pdf
weather:require('./assets/weather/Cloudy .png'), weather:require('./assets/weather/Cloudy .png'),
weekList:['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], weekList:['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
@ -83,14 +80,6 @@ import {getData} from './api/index.js'
} }
}, },
mounted() { mounted() {
//pdf
// this.$nextTick(()=>{
// this.filePdf.promise.then((pdf) => {
// this.numPages = pdf.numPages
// }).catch(err =>{
// console.log(err);
// })
// })
let week = new Date(this.$moment().format("YYYY-MM-DD")).getDay() let week = new Date(this.$moment().format("YYYY-MM-DD")).getDay()
this.week = this.weekList[week] this.week = this.weekList[week]
window.setInterval(()=>{ window.setInterval(()=>{
@ -159,34 +148,57 @@ import {getData} from './api/index.js'
this.weather = require('./assets/weather/Cloudy .png'); this.weather = require('./assets/weather/Cloudy .png');
} }
} }
}) });
}, },
methods:{ methods:{
//PDF //PDF
handleClosePdf(){ handleClosePdf(){
this.fileType = false this.fileType = false
this.filePdf = '' this.filePdf = ''
this.numPages = null
this.$nextTick(()=>{ this.$nextTick(()=>{
this.handleAction = '' this.handleAction = ''
this.handleAction1 = '' this.handleAction1 = ''
}) })
}, },
powerPdf(){ powerPdf(){
if (this.filePdf != '') {
return false
}else{
this.filePdf = '' this.filePdf = ''
let fileUrl = "/pdf/power.pdf"; let fileUrl = "/pdf/power.pdf";
this.numPages = 20
this.filePdf = pdf.createLoadingTask(fileUrl) this.filePdf = pdf.createLoadingTask(fileUrl)
//pdf
this.filePdf.promise.then(pdf => {
this.numPages = pdf.numPages
}).catch(err =>{
// this.$message.error(err.message);
console.log('pdf加载失败',err);
})
this.fileType = true this.fileType = true
this.handleAction = '电力行业发展' this.handleAction = '电力行业发展'
}
}, },
energyPdf(){ energyPdf(){
if (this.filePdf != '') {
return false
}else{
this.filePdf = '' this.filePdf = ''
let fileUrl = "/pdf/energy.pdf"; let fileUrl = "/pdf/energy.pdf";
this.filePdf = pdf.createLoadingTask(fileUrl) this.filePdf = pdf.createLoadingTask(fileUrl)
this.numPages = 27 //pdf
this.filePdf.promise.then(pdf => {
this.numPages = pdf.numPages
}).catch(err =>{
// this.$message.error(err.message);
console.log('pdf加载失败',err);
})
this.fileType = true this.fileType = true
this.handleAction1 = '能源发展综述' this.handleAction1 = '能源发展综述'
} }
}
}, },
components: { components: {
pdf pdf
@ -350,8 +362,38 @@ import {getData} from './api/index.js'
justify-content: space-around; justify-content: space-around;
} }
.pdfShow{ .pdfShow{
-webkit-animation: fadeInDown 0.3s;
animation: fadeInDown 0.3s;
&::-webkit-scrollbar{ &::-webkit-scrollbar{
width: 0; width: 0;
} }
} }
/**
下拉显示动画效果
*/
@keyframes fadeInDown {
0% {
-webkit-transform: translate3d(0, -20%, 0);
transform: translate3d(0, -20%, 0);
opacity: 0;
}
100% {
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
@-webkit-keyframes fadeInDown {
0% {
-webkit-transform: translate3d(0, -20%, 0);
opacity: 0;
}
100% {
-webkit-transform: none;
opacity: 1;
}
}
</style>> </style>>

79
src/views/greenPop.vue Normal file
View File

@ -0,0 +1,79 @@
<template>
<div class="greenPop">
<div class="close">
<img src="../assets/images/close.png" style="position: absolute;right:0" @click="close"/>
</div>
</div>
</template>
<script>
export default {
name:'greenPop',
data(){
return{
}
},
mounted(){
},
methods:{
close(){
this.$parent.componentShow = "";
this.$parent.modelOthers = false;
}
}
}
</script>
<style lang="less" scoped>
.greenPop{
width: 20%;
height: 85%;
position: absolute;
background: rgb(5,53,45);
-webkit-animation: fadeInDown 0.3s;
animation: fadeInDown 0.3s;
top: 11%;
.close{
height: 5%;
width: 100%;
// color: #ffffff;
// background: url("../assets/images/twoTitle.png") no-repeat;
// background-size: 100% 100%;
font-size: 18px;
display: flex;
justify-content: space-around;
align-items: center;
position: relative;
}
}
/**
下拉显示动画效果
*/
@keyframes fadeInDown {
0% {
-webkit-transform: translate3d(0, -20%, 0);
transform: translate3d(0, -20%, 0);
opacity: 0;
}
100% {
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
@-webkit-keyframes fadeInDown {
0% {
-webkit-transform: translate3d(0, -20%, 0);
opacity: 0;
}
100% {
-webkit-transform: none;
opacity: 1;
}
}
</style>

View File

@ -117,7 +117,7 @@
<div class="content"> <div class="content">
<div class="one"> <div class="one">
<div class="oneContent"> <div class="oneContent">
<div class="details"><img src="../assets/images/details.png" style="width:99px;height:41px"/></div> <div class="details"><img src="../assets/images/details.png" style="width:99px;height:41px" @click="handlePop(5)" /></div>
<div class="green"> <div class="green">
<div class="greenLeft"> <div class="greenLeft">
<div class="powerGeneration" v-for="(item,index) in greenLeftData" :key="index"> <div class="powerGeneration" v-for="(item,index) in greenLeftData" :key="index">
@ -303,6 +303,7 @@
import geoJson from '../json/320900.json'; import geoJson from '../json/320900.json';
import axios from 'axios' import axios from 'axios'
import pop from './pop.vue' import pop from './pop.vue'
import greenPop from './greenPop.vue'
import {getData} from '../api/index.js' import {getData} from '../api/index.js'
export default { export default {
data(){ data(){
@ -4326,11 +4327,15 @@ export default {
this.componentShow = 'pop'; this.componentShow = 'pop';
this.popName = '非统调光伏电站装机容量分布'; this.popName = '非统调光伏电站装机容量分布';
this.popTableShow = val this.popTableShow = val
}else if (val == 5) {
this.modelOthers = true
this.componentShow = 'greenPop';
} }
} }
}, },
components:{ components:{
pop pop, //
greenPop //绿
} }
} }