123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618 |
- <template>
- <div class="box">
- <div class="searchBar">
- <el-tabs v-model="activeName" @tab-click="handleClick" type="card">
- <el-tab-pane label="总功率情况" name="first" :key="'first'">
- <el-card class="box-card">
- <el-form :inline="true" :model="formInline" class="demo-form-inline" style="height:30px">
- <el-row :gutter="1">
- <el-form-item label="查询条件:">
- </el-form-item>
- <el-form-item label="风电电场:">
- <el-select v-model="value"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="风机:">
- <el-select v-model="value2"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options2"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="queryApData" :plain="true"
- >查询</el-button
- >
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toExcel()">导出</el-button>
- </el-form-item>
- </el-row>
- </el-form>
- </el-card>
- </el-tab-pane>
- <el-tab-pane label="月功率情况" name="second" :key="'second'">
- <el-card class="box-card">
- <el-form :inline="true" :model="formInline" class="demo-form-inline" style="height:30px">
- <el-row :gutter="1">
- <el-form-item label="查询条件:">
- </el-form-item>
- <el-form-item label="风场">
- <el-select v-model="value"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="风机:">
- <el-select v-model="value2"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options2"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="年份:">
- <el-date-picker
- value-format="yyyy"
- v-model="timeyear"
- type="year"
- placeholder="选择年"
- format="yyyy"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="月份:">
- <el-date-picker
- value-format="yyyy-MM"
- v-model="month"
- type="month"
- placeholder="选择月"
- format="yyyy-MM"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="queryApData" :plain="true"
- >查询</el-button
- >
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toExcel()">导出</el-button>
- </el-form-item>
- </el-row>
- </el-form>
- </el-card>
- </el-tab-pane>
- <el-tab-pane label="日功率情况" name="cord" :key="'cord'">
- <el-card class="box-card">
- <el-form :inline="true" :model="formInline" class="demo-form-inline" style="height:30px">
- <el-row :gutter="1">
- <el-form-item label="查询条件:">
- </el-form-item>
- <el-form-item label="风场">
- <el-select v-model="value"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="风机:">
- <el-select v-model="value2"
- @change="queryApData()" placeholder="请选择">
- <el-option
- v-for="item in options2"
- :key="item.name"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="选择时间:">
- <el-date-picker
- value-format="yyyy-MM-dd"
- v-model="time"
- type="date"
- placeholder="选择日期"
- format="yyyy-MM-dd">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="queryApData" :plain="true"
- >查询</el-button
- >
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toExcel()">导出</el-button>
- </el-form-item>
- </el-row>
- </el-form>
- </el-card>
- </el-tab-pane>
- </el-tabs>
- <el-table v-if="switchtableall"
- id="singlemachinepower"
- :data="gridData"
- :row-style="{ height: '10px' }"
- :cell-style="{ textAlign: 'center',padding:'1px' }"
- :header-cell-style="headStyle"
- @sort-change="changeTableSort"
- style="font-size: 10px;margin-top:0.5%">
- <el-table-column :label=title>
- <el-table-column
- type="index"
- width="40">
- </el-table-column>
- <el-table-column
- prop="windturbineid"
- label="风机"
- width="460">
- </el-table-column>
- <el-table-column
- :sortable="'custom'"
- prop="speed"
- label="风速"
- width="460">
- </el-table-column>
- <el-table-column
- prop="actualpower"
- label="实际拟合功率"
- width="460">
- </el-table-column>
- <el-table-column
- prop="optimalpower"
- label="最优拟合功率"
- width="460">
- </el-table-column>
- </el-table-column>
- </el-table>
- <el-table v-if="switchtableday"
- id="singlemachinepower"
- :data="gridData"
- :row-style="{ height: '10px' }"
- :cell-style="{ textAlign: 'center',padding:'1px' }"
- :header-cell-style="headStyle"
- @sort-change="changeTableSort"
- style="font-size: 10px;margin-top:0.5%">
- <el-table-column :label=title>
- <el-table-column
- type="index"
- width="40">
- </el-table-column>
- <el-table-column
- prop="windturbineid"
- label="风机"
- width="370">
- </el-table-column>
- <el-table-column
- :sortable="'custom'"
- prop="speed"
- label="风速"
- width="370">
- </el-table-column>
- <el-table-column
- prop="actualpower"
- label="实际拟合功率"
- width="370">
- </el-table-column>
- <el-table-column
- prop="optimalpower"
- label="最优拟合功率"
- width="370">
- </el-table-column>
- <el-table-column
- prop="address"
- label="操作"
- width="370">
- <template slot-scope="scope">
- <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- <el-table v-if="switchtablemonth"
- id="singlemachinepower"
- :data="gridData"
- :row-style="{ height: '10px' }"
- :cell-style="{ textAlign: 'center',padding:'1px' }"
- :header-cell-style="headStyle"
- @sort-change="changeTableSort"
- style="font-size: 10px;margin-top:0.5%">
- <el-table-column :label=title>
- <el-table-column
- type="index"
- width="40">
- </el-table-column>
- <el-table-column
- prop="windturbineid"
- label="风机"
- width="370">
- </el-table-column>
- <el-table-column
- :sortable="'custom'"
- prop="speed"
- label="风速"
- width="370">
- </el-table-column>
- <el-table-column
- prop="actualpower"
- label="实际拟合功率"
- width="370">
- </el-table-column>
- <el-table-column
- prop="optimalpower"
- label="最优拟合功率"
- width="370">
- </el-table-column>
- <el-table-column
- prop="address"
- label="操作"
- width="370">
- <template slot-scope="scope">
- <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- <div style="text-align: center;">
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage2"
- :page-sizes="[10, 50, 100, 1000]"
- :page-size="pagesize" layout="total,sizes, prev, pager, next" :total="total">
- </el-pagination>
- </div>
- <div id="leiDaTu" class="echart"></div>
- </div>
- </div>
- </template>
- <script>
- import excelHelper from "@/utils/excelHelper";
- export default {
- data(){
- return {
- formInline: {
- windfarm: "",
- project: "",
- line: "",
- },
- activeName: 'first',
- information:'first',
- value:'MHS_FDC',
- value2:'MG01_01',
- options: [],
- options2:[],
- month:'',
- time:'',
- timemonth:'',
- timeyear:'',
- updateTime:'',
- title:'月曲线偏差率排行榜',
- daymonth:'',
- dayyear:'',
- currentPage2: 1,
- pagesize: 10,
- orderByColumn:'',
- isAsc: '',
- gridData:[],
- gridDataChart:[],
- gridDataChartX:[],
- gridDataChartYsjnh:[],
- gridDataChartYzynh:[],
- gridDataChartYbzgl:[],
- switchtableall:true,
- switchtableday:false,
- switchtablemonth:false,
- total:'',
- }
- },
- created(){
- this.singleMachinePower();
- },
- methods:{
- queryApData() {
- this.singleMachinePower();
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- this.pagesize = val;
- this.singleMachinePower();
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.singleMachinePower();
- },
- headStyle() {
- return "text-align:center"
- },
- handleClick(tab) {
- // console.log(tab.name)
- this.information = tab.name;
- this.singleMachinePower();
- },
- changeTableSort(column){
- this.orderByColumn = column.prop;
- if(column.order == "descending"){
- this.isAsc = 'desc';
- }else if(column.order == "ascending"){
- this.isAsc = "asc";
- }
- this.singleMachinePower();
- },
- singleMachinePower(){
- this.gridDataChartX = [];
- this.gridDataChartYsjnh = [];
- this.gridDataChartYzynh = [];
- this.gridDataChartYbzgl = [];
- this.$http.get('/powercompare/windfarmAjax').then((res) => {
- this.options = res.data.data;
- })
- this.$http.get('/powercompare/windturbineAjax?wpId=' + this.value).then((res) => {
- this.options2 = res.data.data;
- })
- var singleMachinePowerData = new URLSearchParams();
- var singleMachinePowerDataChart = new URLSearchParams();
- if(this.information == 'first'){
- this.title = '单机总功率信息列表';
- this.switchtableall = true;
- this.switchtableday = false;
- this.switchtablemonth = false;
- 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.$http.post("/powersaturation/powersaturationamonutlist",singleMachinePowerData).then((res) => {
- this.gridData = res.data.data.list;
- this.total = res.data.data.total;
- })
- singleMachinePowerDataChart.append('wtId',this.value2);
- this.$http.post("/powersaturation/powersaturationamonutchart",singleMachinePowerDataChart).then((res) => {
- this.gridDataChart = res.data.data;
- for(let i=0;i<this.gridDataChart.length;i++){
- this.gridDataChartX.push(this.gridDataChart[i].value1);
- this.gridDataChartYsjnh.push(this.gridDataChart[i].value2);
- this.gridDataChartYzynh.push(this.gridDataChart[i].value3);
- this.gridDataChartYbzgl.push(this.gridDataChart[i].value4);
- }
- this.$nextTick(function() {
- this.drawPie('leiDaTu')
- })
- })
- }else if(this.information == 'second'){
- this.title = '单机月功率信息列表';
- 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 - 1:'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);
- 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);
- 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.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;
- this.total = res.data.data.total;
- })
- singleMachinePowerDataChart.append('wtId',this.value2);
- singleMachinePowerDataChart.append('year',this.timeyear);
- singleMachinePowerDataChart.append('month',this.timemonth);
- this.$http.post("/powersaturation/powersaturationmonthchart",singleMachinePowerDataChart).then((res) => {
- this.gridDataChart = res.data.data;
- for(let i=0;i<this.gridDataChart.length;i++){
- this.gridDataChartX.push(this.gridDataChart[i].value1);
- this.gridDataChartYsjnh.push(this.gridDataChart[i].value2);
- this.gridDataChartYzynh.push(this.gridDataChart[i].value3);
- this.gridDataChartYbzgl.push(this.gridDataChart[i].value4);
- }
- console.log(this.gridDataChart)
- this.$nextTick(function() {
- this.drawPie('leiDaTu')
- })
- })
- }else if(this.information == 'cord'){
- this.title = '单机日功率信息列表';
- 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 - 1:'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);
- singleMachinePowerData.append('isAsc',this.isAsc);
- singleMachinePowerData.append('wtId',this.value2);
- singleMachinePowerData.append('recorddate',this.time);
- this.$http.post("/powersaturation/powersaturationlist",singleMachinePowerData).then((res) =>{
- this.gridData = res.data.data.list;
- this.total = res.data.data.total;
- })
- singleMachinePowerDataChart.append('wtId',this.value2);
- singleMachinePowerDataChart.append('recorddate',this.time);
- this.$http.post("/powersaturation/powersaturationchart",singleMachinePowerDataChart).then((res) => {
- this.gridDataChart = res.data.data;
- for(let i=0;i<this.gridDataChart.length;i++){
- this.gridDataChartX.push(this.gridDataChart[i].value1);
- this.gridDataChartYsjnh.push(this.gridDataChart[i].value2);
- this.gridDataChartYzynh.push(this.gridDataChart[i].value3);
- this.gridDataChartYbzgl.push(this.gridDataChart[i].value4);
- }
- this.$nextTick(function() {
- this.drawPie('leiDaTu')
- })
- })
- }
- },
- toExcel(){
- excelHelper.exportExcel("singlemachinepower","负荷率排行榜",".xls",true);
- },
- drawPie() {
- var charts;
- if (charts != null && charts != "" && charts != undefined){
- charts.dispose();
- }
- charts= this.$echarts.init(document.getElementById('leiDaTu'));
- let option = {
- title: {
- left: 'center',
- text: '功率曲线'
- },
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data: ['实际拟合功率', '最优拟合功率', '保证功率'],
- x: 'right',
-
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '1%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: this.gridDataChartX
- },
- yAxis: {
- type: 'value',
- name:'功率(KW)',
- nameLocation :'center',
- nameTextStyle: {
- padding: [0, 0, 30, 0] // 四个数字分别为上右下左与原位置距离
- },
- max: 2000,
- axisLabel:{
- formatter: function (value) {
- var texts = [];
- if (value < 1000) {
- value = value / 1000;
- texts.push(value+'k');
- }
- if (value >= 1000) {
- value = value / 1000;
- texts.push(value+'k');
- }
- return texts;
- }
- },
- },
- series: [
- {
- name: '实际拟合功率',
- type: 'line',
- stack: '总量',
- data: this.gridDataChartYsjnh
- },
- {
- name: '最优拟合功率',
- type: 'line',
- stack: '总量',
- data: this.gridDataChartYzynh
- },
- {
- name: '保证功率',
- type: 'line',
- stack: '总量',
- data: this.gridDataChartYbzgl
- },
- ]
- }
- charts.clear();
- charts.setOption(option);
-
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .box{
- width: 100%;
- display: flex;
- justify-content: space-around;
- align-items: center;
- overflow: hidden;
- }
- .searchBar{
- margin-top: 1%;
- }
- #leiDaTu {
- margin-left: 5%;
- height: 200px;
- width: 90%;
- float: left;
- }
- </style>
|