Browse Source

等待接口

wangmengwei@gyee-china.com 3 years ago
parent
commit
87a144fd48
1 changed files with 35 additions and 17 deletions
  1. 35 17
      src/views/report/nhycfsdl.vue

+ 35 - 17
src/views/report/nhycfsdl.vue

@@ -12,8 +12,7 @@
 			</div>
 		</div>
 		<panel :title="month+'发电量预测'" :showLine="false">
-			<!-- :summary-method="getSummaries" -->
-			<el-table :data="tableData" height="80vh" class="hj-table" style="width: 100%" show-summary
+			<el-table :data="tableData" height="85vh" style="width: 100%" show-summary
 				:summary-method="getSummaries" :span-method="yhmxdbMethod">
 				<el-table-column fixed prop="region" label="名称" width="120" />
 				<el-table-column fixed prop="speed" label="" width="50" />
@@ -21,7 +20,7 @@
 					<el-table-column v-for="(item,index) in dateS" :key="index" :prop="item.prop" :label="item.label"
 						width="50" align="center" />
 				</el-table-column>
-				<el-table-column fixed="right" prop="hj" label="合计" width="100" align="center" />
+				<el-table-column fixed="right" prop="hj" label="平均风速/合计" width="100" align="center" />
 				<el-table-column fixed="right" prop="dqhj" label="地区合并" width="100" align="center" />
 			</el-table>
 		</panel>
@@ -29,6 +28,7 @@
 </template>
 
 <script>
+	import $ from "jquery";
 	export default {
 		data() {
 			return {
@@ -58,6 +58,12 @@
 		created() {
 			this.list(this.res.data);
 		},
+		mounted() {
+			this.$nextTick(() => {
+				$('.el-table__fixed-footer-wrapper tbody td:last-child').remove();
+				$('.el-table__fixed-footer-wrapper tbody td:last-child').attr('colspan','2');
+			})
+		},
 		methods: {
 			list(data) {
 				let that = this,
@@ -69,21 +75,21 @@
 				data.Weatherfd.forEach(ele => {
 					let dd = new Date(ele.recodedata).formatDate("dd");
 					recodedata.push(dd)
-
-					if (windpowerstationid.indexOf(ele.windpowerstationid) === -
-						1) { //判断有木有id,若没有,则加进去,并新增一条tableData的白天和夜间
+					if (windpowerstationid.indexOf(ele.windpowerstationid) === -1) { //判断有木有id,若没有,则加进去,并新增一条tableData的白天和夜间
 						windpowerstationid.push(ele.windpowerstationid);
 						tableData.push({
 							region: ele.region,
 							speed: '白天',
 							[dd]: ele.speed1,
-							wpid: ele.windpowerstationid
+							wpid: ele.windpowerstationid,
+							dqhj:''
 						})
 						tableData.push({
 							region: ele.region,
 							speed: '夜间',
 							[dd]: ele.speed2,
-							wpid: ele.windpowerstationid
+							wpid: ele.windpowerstationid,
+							dqhj:''
 						})
 						average.push(ele.speed1, ele.speed2);
 					} else { //匹配tableData的id,并分别传到夜间和白天data中
@@ -180,6 +186,7 @@
 					})
 				})
 				that.getSpanArr(arr);
+				console.log(arr)
 				that.tableData = arr;
 			},
 			yhmxdbMethod({
@@ -227,8 +234,12 @@
 				this.spanArr.forEach((ele, index) => {
 					if (ele === 2) {
 						idx.push(index + 2);
+						spanArrIndex.push(1)
+					}else if(this.spanArr[index - 1] === 2){
+						spanArrIndex.push(1);
+					}else{
+						spanArrIndex.push(0);
 					}
-					spanArrIndex.push(0);
 				})
 				idx.push(this.spanArr.length + 2);
 				idx.forEach((ele, index) => {
@@ -267,6 +278,7 @@
 						sums[index] = '';
 					}
 				});
+				sums[sums.length - 1] = '';
 				return sums;
 			}
 		},
@@ -279,19 +291,21 @@
 </script>
 
 <style lang="less" scope>
-	.hj-table {
-		&.el-table thead.is-group th.el-table__cell {
+	.main-body {
+		.el-table thead.is-group th.el-table__cell {
 			background-color: rgb(30, 37, 36);
 		}
-
-		.el-table__body {
+		.el-table__expanded-cell {
+		  background: #141E1E;
+		}
+		.el-table__body{
 
 			tr.hover-row.current-row>td,
 			tr.hover-row.el-table__row--striped.current-row>td,
 			tr.hover-row.el-table__row--striped>td,
 			tr.hover-row>td {
 				background-color: rgb(4, 12, 11);
-				color: #B3BDC0;
+				color: #B3BDC0 !important;
 			}
 
 			td {
@@ -300,12 +314,16 @@
 
 			td[rowspan='2'],
 			td[rowspan='3'],
+			td[rowspan='6'],
+			td[rowspan='9'],
+			td[rowspan='12'],
 			tr.hover-row>td[rowspan='2'],
-			tr.hover-row>td[rowspan='3'] {
-				background-color: #141E1E;
+			tr.hover-row>td[rowspan='3'],
+			tr:hover td{
+				background-color: #141E1E !important;
 			}
 		}
-
+		
 		.el-table__fixed-footer-wrapper tbody td.el-table__cell {
 			color: #B3BDC0;
 			background-color: rgb(30, 37, 36);