Browse Source

Merge branch 'master' of http://124.70.43.205:3000/yangxiao/sis_zhfx

chenminghua 2 years ago
parent
commit
21509d3e4b
5 changed files with 304 additions and 1 deletions
  1. 1 1
      src/api/axios.js
  2. 11 0
      src/assets/icon/svg/menu/gffx.svg
  3. 5 0
      src/router/index.js
  4. 12 0
      src/views/layout/Menu.vue
  5. 275 0
      src/views/report/loadRate.vue

+ 1 - 1
src/api/axios.js

@@ -95,7 +95,7 @@ export function requestData(options) {
         BASE.showMsg({
           msg: (response.data && response.data.msg) || ("请求出错[" + response.data.code + "]")
         });
-
+        options.fail && options.fail(response);
       }
     }).catch(error => {
 

File diff suppressed because it is too large
+ 11 - 0
src/assets/icon/svg/menu/gffx.svg


+ 5 - 0
src/router/index.js

@@ -764,6 +764,11 @@ const routes = [{
 	component: () => import("../views/report/weather.vue"),
 },
 {
+	path: "/decision/loadRate",
+	name: "loadRate",
+	component: () => import("../views/report/loadRate.vue"),
+},
+{
 	path: "/others/ExportExcel",
 	name: "ExportExcel",
 	component: () => import("../views/report/ExportExcel.vue"),

+ 12 - 0
src/views/layout/Menu.vue

@@ -333,6 +333,18 @@ export default {
               ],
             },
             {
+              text: "光伏分析",
+              icon: "svg-gffx",
+              path: "/decision/loadRate",
+              children: [
+              {
+                  text: "光伏负荷率",
+                  icon: "svg-wind-site",
+                  path: "/decision/loadRate",
+                },
+              ]
+            },
+            {
               text: "气象分析",
               icon: "svg-qxfx",
               path: "/decision/fs",

+ 275 - 0
src/views/report/loadRate.vue

@@ -0,0 +1,275 @@
+<template>
+	<div>
+		<div class="query mg-b-8">
+			<div class="query-items">
+				<div class="query-item">
+					<div class="lable">场站:</div>
+					<div class="search-input">
+						<el-select v-model="query.stationId" clearable placeholder="请选择" popper-class="select">
+							<el-option v-for="item in ChangZhan" :key="item.id" :value="item.id" :label="item.name">
+							</el-option>
+						</el-select>
+					</div>
+				</div>
+				<div class="query-item">
+					<div class="lable">日期:</div>
+					<div class="search-input">
+						<el-date-picker v-model="query.date" type="date" placeholder="日期" popper-class="date-select"
+							value-format="YYYY-MM-DD"></el-date-picker>
+					</div>
+				</div>
+				<div class="query-item">
+					<div class="lable"></div>
+					<div class="search-input">
+						<el-select v-model="query.useType" style="width: 120px" placeholder="请选择" popper-class="select">
+							<el-option value="1" label="负荷率"></el-option>
+							<el-option value="2200" label="利用小时"></el-option>
+						</el-select>
+					</div>
+				</div>
+				<div class="query-item">
+					<div class="lable"></div>
+					<div class="search-input">
+						<el-select v-model="query.time" style="width: 120px" placeholder="请选择" v-if="query.useType!=='2200'" popper-class="select">
+							<el-option value="0930" label="早"></el-option>
+							<el-option value="1230" label="中"></el-option>
+							<el-option value="1830" label="晚"></el-option>
+						</el-select>
+					</div>
+				</div>
+				<div class="query-actions">
+					<button class="btn green" @click="getTable()">查询</button>
+					<button class="btn green" @click="exportCsv('now')">当前导出</button>
+					<button class="btn green" @click="exportCsv('all')">全天导出</button>
+				</div>
+			</div>
+		</div>
+		<div class="table-box">
+			<!-- <div class="title">光伏负荷率</div> -->
+			<ComTable
+			  ref="curRef"
+			  :data="tableData"
+			  :pageSize="-1"
+			  height="68vh"
+			  v-loading="tableLoading"
+			  element-loading-text="拼命加载中.."
+			  element-loading-background="rgba(0, 0, 0, 0.8)"
+			></ComTable>
+		</div>
+	</div>
+</template>
+<script>
+	import ComTable from "@/components/coms/table/table.vue";
+import { ElMessage } from 'element-plus';
+	import Papa from 'papaparse';
+	export default {
+		name: "boosterAlarm",
+		components: {
+			ComTable,
+			Papa
+		},
+		data() {
+			let that = this;
+			return {
+				ChangZhan: [],
+				query: {
+					stationId: 'MHS_FDC',
+					date: new Date().formatDate("yyyy-MM-dd"),
+					useType: '1',
+					time: '0930'
+
+					// stationId: 'DWK_GDC',
+					// date: '2022-11-10',
+					// time: '1830'
+					// useType: '1',
+				},
+				tableLoading: true,
+				pageIndex: 1,
+				pageSize: 20,
+				tableData: {
+					column: [],
+					data: [],
+					currentPageTotal: 0
+				}
+			};
+		},
+		created() {
+			this.ChangZhanVal();
+			this.getTable();
+		},
+		methods: {
+			exportCsv(type) {
+				switch(type){
+					case 'now':
+						this.BASE.exportExcel(this.tableData, "光伏负荷率");
+						break;
+					case 'all':
+						let el = document.createElement("a");
+						//链接赋值
+						el.href = window.__MODE__.baseURL + 'loadrate/down?date=' + this.query.date;
+						el.download = '';
+						document.body.appendChild(el)
+						el.click()
+						document.body.removeChild(el)
+						break;
+				}
+			},
+			// 场站
+			ChangZhanVal() {
+				var that = this;
+				that.API.requestData({
+					method: "GET",
+					subUrl: "powercompare/windfarmAjax",
+					success(res) {
+						that.ChangZhan = res.data;
+						that.query.stationId = res.data[0].id;
+					}
+				});
+			},
+			getTable() {
+				let that = this;
+				this.tableLoading = true;
+				if(this.query.useType!=='2200'){
+					this.tableData.column = [{
+						name: "逆变器编号",
+						field: "id",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "支路数量",
+						field: "branchcount",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "板件数量",
+						field: "platecount",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "逆变器所带光伏板总容量(kw)",
+						field: "platecapacity",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "时间",
+						field: "time",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "当前逆变器功率(kw)",
+						field: "power",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "负荷率(%)",
+						field: "loadfactor",
+						is_num: false,
+						is_light: false,
+					} ]
+				}else{
+					this.tableData.column = [{
+						name: "逆变器编号",
+						field: "id",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "支路数量",
+						field: "branchcount",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "板件数量",
+						field: "platecount",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "逆变器所带光伏板总容量(kw)",
+						field: "platecapacity",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "时间",
+						field: "time",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "逆变器发电量(kw·h)",
+						field: "generatedenergy",
+						is_num: false,
+						is_light: false,
+					},{
+						name: "利用小时",
+						field: "utilizationhour",
+						is_num: false,
+						is_light: false,
+					} ]
+				}
+				this.API.requestData({
+					timeout: 30000,
+					method: "GET",
+					subUrl: "loadrate/info",
+					showLoading: true,
+					data: {
+						stationid: that.query.stationId,
+						date: that.query.date,
+						time: that.query.useType!=='2200'? that.query.time: that.query.useType,
+					},
+					success(res) {
+						var dataTab = [];
+						if (res.data) {
+						  res.data.forEach(item => {
+						  	dataTab.push({ //表格
+						  		branchcount: item.branchcount,
+									generatedenergy: item.generatedenergy,
+									id: item.id,
+									loadfactor: item.loadfactor,
+									platecapacity: item.platecapacity,
+									platecount: item.platecount,
+									power: item.power,
+									time: item.time,
+									utilizationhour: item.utilizationhour,
+						  	})
+						  })
+						  that.tableData.data = dataTab;
+						  that.tableData.total = 0;
+						} else {
+						  that.tableData.data = [];
+						  that.tableData.total = 0;
+						}
+						that.tableLoading = false;
+					},
+					fail(err){
+						that.tableData.data = [];
+						that.tableData.total = 0;
+						that.tableLoading = false;
+					}
+				});
+			},
+			formatTime(value) {
+				if (typeof(value) == 'undefined') {
+					return ''
+				} else {
+					let date = new Date(parseInt(value))
+					let y = date.getFullYear()
+					let MM = date.getMonth() + 1
+					MM = MM < 10 ? ('0' + MM) : MM
+					let d = date.getDate()
+					d = d < 10 ? ('0' + d) : d
+					return y + '-' + MM + '-' + d
+				}
+			},
+			// onChangePage(params) {
+			// 	this.pageIndex = params.pageIndex;
+			// 	this.pageSize = params.pageSize;
+			// 	this.getTable();
+			// },
+		}
+	};
+</script>
+<style scoped>
+	.title {
+		background: rgba(255, 255, 255, 0.1);
+		margin-bottom: 8px;
+		padding: 1vh;
+	}
+</style>