Browse Source

功能时间初始状态修改

lizaixun 4 years ago
parent
commit
4fb41238ad

+ 11 - 6
src/views/gradeEvaluation/GradeEvaluation.vue

@@ -13,7 +13,7 @@
 						</div>
 						<div class="block" style="width:20%;float: left;">
 							<span>日期</span>
-							<el-date-picker v-model="value1" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="margin-left: 5%;">
+							<el-date-picker v-model="value1" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="margin-left: 5%;" format="yyyy-MM-dd" @change="gradeByDaygData">
 							</el-date-picker>
 						</div>
 						<div style="width: 2%; float:left;margin-left: 10%;">
@@ -85,7 +85,7 @@
 						</div>
 						<div class="block" style="width:20%;float: left;">
 							<span>月份</span>
-							<el-date-picker v-model="value1" type="month" placeholder="选择月" style="margin-left: 5%;">
+							<el-date-picker v-model="value2" value-format="yyyy-MM" type="month" placeholder="选择月" style="margin-left: 5%;" format="yyyy-MM" @change="gamonthlistByPage">
     						</el-date-picker>
 						</div>
 						<div style="width: 2%; float:left;margin-left: 10%;">
@@ -158,7 +158,7 @@
 						</div>
 						<div class="block" style="width:20%;float: left;">
 							<span>年份</span>
-							<el-date-picker v-model="value1" type="year" placeholder="选择年" style="margin-left: 5%;">
+							<el-date-picker v-model="value3" value-format="yyyy" type="year" placeholder="选择年" style="margin-left: 5%;" format="yyyy" @change="gayearlistByPage">
 							</el-date-picker>
 						</div>
 						<div style="width: 2%; float:left;margin-left: 10%;">
@@ -414,6 +414,8 @@ import excelHelper from "@/utils/excelHelper";
 				gridDataYear:[],
 				value: 'NSS_FDC',
 				value1: '2021-01-01',
+				value2:'2021-01',
+				value3:'2021',
 				yearvalue:'',
 				monthvalue:'',
 				dialogTableVisible: false,
@@ -607,6 +609,7 @@ import excelHelper from "@/utils/excelHelper";
 				page.append('wpId', this.value);
 				page.append('recorddate', this.value1);
 				this.$http.post("/benchmarking/gadaylistByPage", page).then((res) => {
+					console.log(res)
 					that.gridData = res.data.data.list;
 					that.total = res.data.data.total;
 				})
@@ -614,9 +617,11 @@ import excelHelper from "@/utils/excelHelper";
 			},
 			gamonthlistByPage(){
 				let that = this;
-				this.yearvalue = this.value1.slice(0,4);
-				this.monthvalue = this.value1.slice(5,7);
+				// this.yearvalue = this.value1.slice(0,4);
 				var pagemonth = new URLSearchParams();
+				this.monthvalue = this.value2.toString(); 
+				this.yearvalue = this.monthvalue.slice(0,4);
+				this.monthvalue = this.monthvalue.slice(5,7);
 				pagemonth.append('pageNum',this.currentPage2);
 				pagemonth.append('pageSize',this.pagesize);
 				pagemonth.append('wpId',this.value);
@@ -630,7 +635,7 @@ import excelHelper from "@/utils/excelHelper";
 			},
 			gayearlistByPage(){
 				let that = this;
-				this.yearvalue = this.value1.slice(0,4);
+				this.yearvalue = this.value3.toString();
 				var pageyear = new URLSearchParams();
 				pageyear.append('pageNum',this.currentPage2);
 				pageyear.append('pageSize',this.pagesize);

+ 39 - 7
src/views/gradeEvaluation/PerformanceAnalysis.vue

@@ -18,17 +18,21 @@
                 </el-form-item>
                 <el-form-item label="年份:">
                         <el-date-picker
-                        v-model="timeyear"
+                        value-format="yyyy"
+                        v-model="year"
                         type="year"
                         placeholder="选择年"
+                        format="yyyy"
                         >
                         </el-date-picker>
                     </el-form-item>
                     <el-form-item label="月份:">
                         <el-date-picker
-                        v-model="timemonth"
+                        value-format="yyyy-MM"
+                        v-model="month"
                         type="month"
-                        placeholder="选择月">
+                        placeholder="选择月"
+                        format="yyyy-MM">
                         </el-date-picker>
                     </el-form-item>
                 <el-form-item>
@@ -167,8 +171,10 @@ export default {
         project: "",
         line: "",
         },
-        timeyear:'2021',
-        timemonth:'1',
+        month:'',
+        year:'',
+        timeyear:'',
+        timemonth:'',
         currentPage2: 1,
 	      pagesize: 10,
         gridData:[],
@@ -183,6 +189,7 @@ export default {
         value2:'',
         fanData:'',
         title:'',
+        updateTime:'',
       }
     },
    
@@ -199,11 +206,14 @@ export default {
         tableDatawindturbineName(val){
           this.fanData = val;
           console.log(this.fanData)
+          this.timemonth = this.month.toString(); 
+          this.timeyear = this.year.toString();
+          this.timemonth = this.timemonth.slice(5,7);
           this.$router.push({
             path:'/performanceAnalysisOperation',
             query:{
               data:this.fanData,
-              timeyear: this.timeyear,
+              timeyear: this.year,
               timemonth: this.timemonth
             }
           })
@@ -226,13 +236,35 @@ export default {
             this.$http.get('/powercompare/windfarmAjax').then((res) => {
                 this.options = res.data.data;
             })
+            const nowDate = new Date();
+            const date = {
+                year: nowDate.getFullYear(),
+                month: nowDate.getMonth() + 1,
+                date: nowDate.getDate(),
+            }
+            const newmonth = date.month>10?date.month:'0'+date.month
+            const day = date.date>10?date.date:'0'+date.date
+            this.updateTime = date.year + '-' + newmonth + '-' + day
+            if(this.month == ''){
+              this.month = this.updateTime;
+              this.timemonth = this.month.slice(5,7);
+            }else{
+              this.month = this.month.toString(); 
+              this.timemonth = this.month.slice(5,7);
+            }
+            if(this.year == ''){
+              this.year = this.updateTime;
+              this.year = this.year.slice(0,4);
+            }else{
+              this.year = this.year.toString();
+            }
             var performanceAnalysis = new URLSearchParams();
             performanceAnalysis.append('pageNum',this.currentPage2);
 		      	performanceAnalysis.append('pageSize',this.pagesize);
             performanceAnalysis.append('orderByColumn',this.orderByColumn);
             performanceAnalysis.append('isAsc',this.isAsc);
 		  	    performanceAnalysis.append('wpId',this.value);
-            performanceAnalysis.append('year',this.timeyear);
+            performanceAnalysis.append('year',this.year);
             performanceAnalysis.append('month',this.timemonth);
             this.$http.post('/singleanalysis/singleanalysisMain',performanceAnalysis).then((res) => {
                 this.gridData = res.data.data;

+ 19 - 2
src/views/rankingIndex/CutAndSpeed.vue

@@ -252,7 +252,7 @@ export default {
         project: "",
         line: "",
         },
-        time: '2021-01-01',
+        time: '',
         currentPage2: 1,
 	      pagesize: 10,
         gridData:[],
@@ -265,14 +265,19 @@ export default {
         value: 'MHS_FDC',
         wtid:'',
         endDate:'',
+        updateTime:'',
       }
     },
    
     created(){
         this.callAndSpeedData();
-        this.getNowFormatDate()
+        this.getNowFormatDate();
+        this.addDate();
     },
     methods:{
+       addDate(){
+       
+       },
        getNowFormatDate(){
           var date = new Date();
           var seperator1 = "-";
@@ -321,6 +326,18 @@ export default {
             this.$http.get('/powercompare/windfarmAjax').then((res) => {
                 this.options = res.data.data;
             })
+            const nowDate = new Date();
+            const date = {
+                year: nowDate.getFullYear(),
+                month: nowDate.getMonth() + 1,
+                date: nowDate.getDate(),
+            }
+            const newmonth = date.month>10?date.month:'0'+date.month
+            const day = date.date>10?date.date:'0'+date.date
+            this.updateTime = date.year + '-' + newmonth + '-' + day
+            if(this.time == ''){
+                this.time = this.updateTime
+            }
             console.log(this.time)
             var callAndSpeedData = new URLSearchParams();
             callAndSpeedData.append('pageNum',this.currentPage2);

+ 1 - 1
src/views/rankingIndex/PlannedGeneration.vue

@@ -63,7 +63,7 @@
             :header-cell-style="headStyle"
             @row-click="tableDatawindturbineName"
             @sort-change="changeTableSort"
-            style="font-size: 10px;margin-top:1%">
+            style="font-size: 10px;margin-top:1%;cursor: pointer;">
             <el-table-column label="计划发电量列表">
             <el-table-column
               type="index"

+ 15 - 2
src/views/rankingIndex/RankingCallThePolice.vue

@@ -114,6 +114,8 @@ export default {
         orderByColumn:'',
         isAsc: '',
         value: '1',
+        updateTime:'',
+        updateTime1:'',
       }
     },
    
@@ -145,9 +147,20 @@ export default {
         callThePolicRateData(){
             this.charFreData = [];
             this.charNameData = [];
+            const nowDate = new Date();
+            const date = {
+                year: nowDate.getFullYear(),
+                month: nowDate.getMonth() + 1,
+                date: nowDate.getDate(),
+            }
+            const newmonth = date.month>10?date.month:'0'+date.month
+            const day = date.date>10?date.date:'0'+date.date
+            const day1 = date.date>10?date.date - 1:'0'+date.date
+            this.updateTime = date.year + '-' + newmonth + '-' + day
+            this.updateTime1 = date.year + '-' + newmonth + '-' + day1
             if(this.timedate == ''){
-                this.timedate[0] = '2021-01-01';
-                this.timedate[1] = '2021-01-04';
+                this.timedate[0] = this.updateTime1;
+                this.timedate[1] = this.updateTime;
                 this.beginDate = this.timedate[0];
                 this.endDate = this.timedate[1];
             }else{

+ 48 - 12
src/views/rankingIndex/RankingCurveDeviationRate.vue

@@ -104,7 +104,7 @@
             :header-cell-style="headStyle"
             @sort-change="changeTableSort"
             @row-click="tableDatawindturbineName"
-            style="font-size: 10px;margin-top:1%">
+            style="font-size: 10px;margin-top:1%;cursor: pointer;">
             <el-table-column :label=title>
             <el-table-column
               type="index"
@@ -194,11 +194,11 @@ export default {
             value:'MHS_FDC',
             value2:'',
             options: [],
-            time:'2021-01-01',
+            time:'',
             timemonth:'',
-            month:'2021-01',
+            month:'',
             timeyear:'',
-            year:'2021',
+            year:'',
             title:'月曲线偏差率排行榜',
             daymonth:'',
             dayyear:'',
@@ -311,20 +311,44 @@ export default {
             })
             var deviceRatData = new URLSearchParams();
             if(this.information == 'first'){
+                const nowDate = new Date();
+                const date = {
+                    year: nowDate.getFullYear(),
+                    month: nowDate.getMonth() + 1,
+                    date: nowDate.getDate(),
+                }
+                const newmonth = date.month>10?date.month:'0'+date.month
+                const day = date.date>10?date.date:'0'+date.date
+                this.updateTime = date.year + '-' + newmonth + '-' + day
+                
                 this.title = '月曲线偏差率排行榜';
                 deviceRatData.append('pageNum',this.currentPage2);
                 deviceRatData.append('pageSize',this.pagesize);
                 deviceRatData.append('orderByColumn',this.orderByColumn);
                 deviceRatData.append('isAsc',this.isAsc);
-                deviceRatData.append('wpId',this.value);
-                this.timeyear = this.year.toString();  
-                deviceRatData.append('year',this.timeyear);
-                this.timemonth = this.month.toString();
-                if(this.timemonth.substring(6,7) < 10){
-                    this.timemonth = this.timemonth.substring(6,7);
+                deviceRatData.append('wpId',this.value); 
+                if(this.year == ''){
+                    this.year = this.updateTime;
+                    this.year = this.year.slice(0,4);
+                }else{
+                    this.year = this.year.toString();          
+                    
+                }  
+                deviceRatData.append('year',this.year);
+                if(this.month == ''){
+                    this.month = this.updateTime;
+                    if(this.month.substring(5,7) < 10 ){
+                        this.timemonth = this.month.substring(6,7);
+                    }else{
+                        this.timemonth = this.month.substring(5,7);
+                    }
                 }else{
-                    this.timemonth = this.timemonth.substring(5,7)
-                }    
+                    if(this.month.substring(5,7) < 10){
+                        this.timemonth = this.month.substring(6,7);
+                    }else{
+                        this.timemonth = this.month.substring(5,7)
+                    }
+                }
                 deviceRatData.append('month',this.timemonth);
                 this.$http.post("/leaderboard/curvefittingmonthmainList",deviceRatData).then((res) => {
                     this.gridData = res.data.data;
@@ -337,6 +361,18 @@ export default {
                 deviceRatData.append('orderByColumn',this.orderByColumn);
                 deviceRatData.append('isAsc',this.isAsc);
                 deviceRatData.append('wpId',this.value);
+                const nowDate = new Date();
+                const date = {
+                    year: nowDate.getFullYear(),
+                    month: nowDate.getMonth() + 1,
+                    date: nowDate.getDate(),
+                }
+                const newmonth = date.month>10?date.month:'0'+date.month
+                const day = date.date>10?date.date:'0'+date.date
+                this.updateTime = date.year + '-' + newmonth + '-' + day
+                if(this.time == ''){
+                    this.time = this.updateTime;
+                }
                 deviceRatData.append('recorddate',this.time);
                 this.$http.post("/leaderboard/curvefittingmainList",deviceRatData).then((res) =>{
                     this.gridData = res.data.data;

+ 16 - 3
src/views/rankingIndex/RankingLoadRate.vue

@@ -150,7 +150,9 @@ export default {
         orderByColumn:'',
         isAsc: '',
         value: '风场',
-        value2: 'MHS_FDC'
+        value2: 'MHS_FDC',
+        updateTime:'',
+        updateTime1:'',
       }
     },
     filters: { 
@@ -190,9 +192,20 @@ export default {
             this.$http.get('/powercompare/windfarmAjax').then((res) => {
                 that.options2 = res.data.data;
             })
+            const nowDate = new Date();
+            const date = {
+                year: nowDate.getFullYear(),
+                month: nowDate.getMonth() + 1,
+                date: nowDate.getDate(),
+            }
+            const newmonth = date.month>10?date.month:'0'+date.month
+            const day = date.date>10?date.date:'0'+date.date
+            const day1 = date.date>10?date.date - 1:'0'+date.date
+            this.updateTime = date.year + '-' + newmonth + '-' + day
+            this.updateTime1 = date.year + '-' + newmonth + '-' + day1
             if(this.timedate == ''){
-                this.timedate[0] = '2021-01-01';
-                this.timedate[1] = '2021-01-04';
+                this.timedate[0] = this.updateTime1;
+                this.timedate[1] = this.updateTime;
                 this.beginDate = this.timedate[0];
                 this.endDate = this.timedate[1];
             }else{

+ 13 - 2
src/views/rankingIndex/RankingUtilization.vue

@@ -171,9 +171,20 @@ export default {
             this.$http.get('/powercompare/windfarmAjax').then((res) => {
                 that.options2 = res.data.data;
             })
+             const nowDate = new Date();
+            const date = {
+                year: nowDate.getFullYear(),
+                month: nowDate.getMonth() + 1,
+                date: nowDate.getDate(),
+            }
+            const newmonth = date.month>10?date.month:'0'+date.month
+            const day = date.date>10?date.date:'0'+date.date
+            const day1 = date.date>10?date.date - 1:'0'+date.date
+            this.updateTime = date.year + '-' + newmonth + '-' + day
+            this.updateTime1 = date.year + '-' + newmonth + '-' + day1
             if(this.timedate == ''){
-                this.timedate[0] = '2021-01-01';
-                this.timedate[1] = '2021-01-04';
+                this.timedate[0] = this.updateTime1;
+                this.timedate[1] = this.updateTime;
                 this.beginDate = this.timedate[0];
                 this.endDate = this.timedate[1];
             }else{

+ 48 - 12
src/views/rankingIndex/SingleMachinePower.vue

@@ -310,10 +310,11 @@ export default {
             value2:'MG01_01',
             options: [],
             options2:[],
-            month:'2021-01',
-            time:'2021-01-01',
-            timemonth:'1',
-            timeyear:'2021',
+            month:'',
+            time:'',
+            timemonth:'',
+            timeyear:'',
+            updateTime:'',
             title:'月曲线偏差率排行榜',
             daymonth:'',
             dayyear:'',
@@ -411,21 +412,44 @@ export default {
                 this.switchtableall = false;
                 this.switchtableday = true;
                 this.switchtablemonth = false;
+                const nowDate = new Date();
+                const date = {
+                    year: nowDate.getFullYear(),
+                    month: nowDate.getMonth() + 1,
+                    date: nowDate.getDate(),
+                }
+                const newmonth = date.month>10?date.month:'0'+date.month
+                const day = date.date>10?date.date:'0'+date.date
+                this.updateTime = date.year + '-' + newmonth + '-' + day
                 singleMachinePowerData.append('pageNum',this.currentPage2);
                 singleMachinePowerData.append('pageSize',this.pagesize);
                 singleMachinePowerData.append('orderByColumn',this.orderByColumn);
                 singleMachinePowerData.append('isAsc',this.isAsc);
                 singleMachinePowerData.append('wtId',this.value2);
-                this.timeyear = this.timeyear.toString();          
+                if(this.timeyear == ''){
+                    this.timeyear = this.updateTime;
+                    this.timeyear = this.timeyear.slice(0,4);
+                }else{
+                    this.timeyear = this.timeyear.toString();          
+                    
+                }
                 singleMachinePowerData.append('year',this.timeyear);
-                this.timemonth = this.month.toString();          
-                console.log(this.timemonth)
-                    // this.timemonth = this.month.substring(6,7);
-                if(this.timemonth.substring(6,7) < 10){
-                    this.timemonth = this.timemonth.substring(6,7);
+                if(this.month == ''){
+                    this.month = this.updateTime;
+                    if(this.month.substring(5,7) < 10 ){
+                        this.timemonth = this.month.substring(6,7);
+                    }else{
+                        this.timemonth = this.month.substring(5,7);
+                    }
                 }else{
-                    this.timemonth = this.timemonth.substring(5,7)
-                }                 
+                    this.timemonth = this.month.toString(); 
+                    if(this.timemonth.substring(5,7) < 10){
+                        this.timemonth = this.timemonth.substring(6,7);
+                    }else{
+                        this.timemonth = this.timemonth.substring(5,7)
+                    }
+                }
+                console.log(this.timemonth)
                 singleMachinePowerData.append('month',this.timemonth);
                 this.$http.post("/powersaturation/powersaturationmonthlist",singleMachinePowerData).then((res) =>{
                     this.gridData = res.data.data.list;
@@ -452,6 +476,18 @@ export default {
                 this.switchtableall = false;
                 this.switchtableday = false;
                 this.switchtablemonth = true;
+                const nowDate = new Date();
+                const date = {
+                    year: nowDate.getFullYear(),
+                    month: nowDate.getMonth() + 1,
+                    date: nowDate.getDate(),
+                }
+                const newmonth = date.month>10?date.month:'0'+date.month
+                const day = date.date>10?date.date:'0'+date.date
+                this.updateTime = date.year + '-' + newmonth + '-' + day
+                if(this.time == ''){
+                    this.time = this.updateTime;
+                }
                 singleMachinePowerData.append('pageNum',this.currentPage2);
                 singleMachinePowerData.append('pageSize',this.pagesize);
                 singleMachinePowerData.append('orderByColumn',this.orderByColumn);