|
@@ -39,6 +39,19 @@
|
|
}}</el-checkbox>
|
|
}}</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
<div class="bpickers">
|
|
<div class="bpickers">
|
|
|
|
+ <!-- <div class="search"> -->
|
|
|
|
+ <div class="date">日期:</div>
|
|
|
|
+ <el-date-picker
|
|
|
|
+ class="pickers"
|
|
|
|
+ @change="changes"
|
|
|
|
+ v-model="timeValue"
|
|
|
|
+ type="datetimerange"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ >
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ <!-- </div> -->
|
|
<div>
|
|
<div>
|
|
<el-button type="info" size="small" @click="exportExcel()"
|
|
<el-button type="info" size="small" @click="exportExcel()"
|
|
>导出</el-button
|
|
>导出</el-button
|
|
@@ -143,11 +156,13 @@
|
|
import api from "api/index";
|
|
import api from "api/index";
|
|
import BackgroundData from "utils/BackgroundData";
|
|
import BackgroundData from "utils/BackgroundData";
|
|
import XLSX from "xlsx";
|
|
import XLSX from "xlsx";
|
|
|
|
+// import XLSXStyle from 'xlsx-style';
|
|
import { saveAs } from 'file-saver'
|
|
import { saveAs } from 'file-saver'
|
|
const cityOptions = ["越限", "超限", "坏点"];
|
|
const cityOptions = ["越限", "超限", "坏点"];
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ timeValue: [],
|
|
windturbineStatus: [
|
|
windturbineStatus: [
|
|
{
|
|
{
|
|
type: 0,
|
|
type: 0,
|
|
@@ -183,9 +198,9 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
contentList: [],
|
|
contentList: [],
|
|
- resultArray: [],
|
|
|
|
hanb:"",
|
|
hanb:"",
|
|
tableData: [],
|
|
tableData: [],
|
|
|
|
+ tablejs:[],
|
|
stationList: [],
|
|
stationList: [],
|
|
current: "",
|
|
current: "",
|
|
intervals: null,
|
|
intervals: null,
|
|
@@ -264,6 +279,11 @@ export default {
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
opened() {
|
|
opened() {
|
|
|
|
+ let date = new Date();
|
|
|
|
+ this.timeValue[0] = new Date(new Date().toLocaleDateString()).getTime() - 86400000;
|
|
|
|
+ this.timeValue[1] = new Date(new Date().toLocaleDateString()).getTime();
|
|
|
|
+
|
|
|
|
+
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
let tableDom = this.$refs.multipleTable?.$refs?.bodyWrapper;
|
|
let tableDom = this.$refs.multipleTable?.$refs?.bodyWrapper;
|
|
let time = null;
|
|
let time = null;
|
|
@@ -375,8 +395,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
tableDatas.push(tableData);
|
|
tableDatas.push(tableData);
|
|
- // console.log('ha',tableDatas);
|
|
|
|
- this.resultArray = tableDatas;
|
|
|
|
|
|
+ // console.log('ha',tableData);
|
|
});
|
|
});
|
|
this.contentList = contentList;
|
|
this.contentList = contentList;
|
|
let arr = [];
|
|
let arr = [];
|
|
@@ -408,7 +427,70 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
exportExcel() {
|
|
exportExcel() {
|
|
- const headers = [
|
|
|
|
|
|
+ let fjcode=[]
|
|
|
|
+ // console.log('sb',this.tableData);
|
|
|
|
+ this.tableData.forEach((ele)=>{
|
|
|
|
+ fjcode.push(ele.code)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ let str = fjcode.join(',');
|
|
|
|
+ console.log('nb',str);
|
|
|
|
+ console.log('nb',this.timeValue[0]);
|
|
|
|
+ console.log('nb',this.timeValue[1]);
|
|
|
|
+ const stTs = this.timeValue[0];
|
|
|
|
+ const endTs = this.timeValue[1];
|
|
|
|
+ api.getnb({
|
|
|
|
+ windturbineIds:str,
|
|
|
|
+ startTs: this.timeValue[0],
|
|
|
|
+ endTs: this.timeValue[1],
|
|
|
|
+ // interval: 200,
|
|
|
|
+ }) .then((res) => {
|
|
|
|
+ if (res.data.length) {
|
|
|
|
+ let contentList = [];
|
|
|
|
+ let tableDatas = [];
|
|
|
|
+ res.data.forEach((item, index) => {
|
|
|
|
+ let tablejs = {};
|
|
|
|
+ tablejs.code = item.code;
|
|
|
|
+ tablejs.windturbineId = item.windturbineId;
|
|
|
|
+ tablejs.windSpeed = item.windSpeed.toFixed(1);
|
|
|
|
+ tablejs.status = Number(item.status);
|
|
|
|
+ tablejs.stationId = item.stationId;
|
|
|
|
+ tablejs.rollSpeed = item.rollSpeed.toFixed(1);
|
|
|
|
+ tablejs.power = item.power.toFixed(1);
|
|
|
|
+ item.temperatureComponentInfos.forEach((val) => {
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ let obj = {
|
|
|
|
+ children: [],
|
|
|
|
+ };
|
|
|
|
+ obj.name = val.name;
|
|
|
|
+ val.temperatureItemInfos.forEach((temp) => {
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ let str = {};
|
|
|
|
+ str.name = temp.name;
|
|
|
|
+ str.keyname = `${val.name}${temp.name}`;
|
|
|
|
+ obj.children.push(str);
|
|
|
|
+ }
|
|
|
|
+ tablejs[`${val.name}${temp.name}`] =
|
|
|
|
+ temp.value.toFixed(1);
|
|
|
|
+ tablejs[`${val.name}${temp.name}Status`] = temp.status;
|
|
|
|
+ });
|
|
|
|
+ contentList.push(obj);
|
|
|
|
+ } else {
|
|
|
|
+ val.temperatureItemInfos.forEach((temp) => {
|
|
|
|
+ tablejs[`${val.name}${temp.name}`] =
|
|
|
|
+ temp.value.toFixed(1);
|
|
|
|
+ tablejs[`${val.name}${temp.name}Status`] = temp.status;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ tableDatas.push(tablejs);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ const headers = [
|
|
|
|
+ "时间",
|
|
"机组编号",
|
|
"机组编号",
|
|
"状态",
|
|
"状态",
|
|
"风速",
|
|
"风速",
|
|
@@ -439,8 +521,10 @@ export default {
|
|
"齿轮箱轴1温度",
|
|
"齿轮箱轴1温度",
|
|
"齿轮箱轴2温度",
|
|
"齿轮箱轴2温度",
|
|
];
|
|
];
|
|
- let data = this.resultArray.map((item) => [
|
|
|
|
|
|
+ // console.log(this.tableData);
|
|
|
|
+ let data = this.tablejs.map((item) => [
|
|
item.code,
|
|
item.code,
|
|
|
|
+ item.windturbineId,
|
|
item.status,
|
|
item.status,
|
|
item.windSpeed,
|
|
item.windSpeed,
|
|
item.power,
|
|
item.power,
|
|
@@ -473,22 +557,22 @@ export default {
|
|
]);
|
|
]);
|
|
|
|
|
|
data.forEach((ele) => {
|
|
data.forEach((ele) => {
|
|
- if (ele[1] == 0) {
|
|
|
|
- ele[1] = '停机';
|
|
|
|
- } else if (ele[1] == 1) {
|
|
|
|
- ele[1] = '上电';
|
|
|
|
- } else if (ele[1] == 2) {
|
|
|
|
- ele[1] = '待机';
|
|
|
|
- } else if (ele[1] == 3) {
|
|
|
|
- ele[1] = '启动';
|
|
|
|
- } else if (ele[1] == 4) {
|
|
|
|
- ele[1] = '并网';
|
|
|
|
- } else if (ele[1] == 5) {
|
|
|
|
- ele[1] = '故障';
|
|
|
|
- } else if (ele[1] == 6) {
|
|
|
|
- ele[1]= '维护';
|
|
|
|
- } else if (ele[1] == 7) {
|
|
|
|
- ele[1] = '离线';
|
|
|
|
|
|
+ if (ele[2] == 0) {
|
|
|
|
+ ele[2] = '停机';
|
|
|
|
+ } else if (ele[2] == 1) {
|
|
|
|
+ ele[2] = '上电';
|
|
|
|
+ } else if (ele[2] == 2) {
|
|
|
|
+ ele[2] = '待机';
|
|
|
|
+ } else if (ele[2] == 3) {
|
|
|
|
+ ele[2] = '启动';
|
|
|
|
+ } else if (ele[2] == 4) {
|
|
|
|
+ ele[2] = '并网';
|
|
|
|
+ } else if (ele[2] == 5) {
|
|
|
|
+ ele[2] = '故障';
|
|
|
|
+ } else if (ele[2] == 6) {
|
|
|
|
+ ele[2]= '维护';
|
|
|
|
+ } else if (ele[2] == 7) {
|
|
|
|
+ ele[2] = '离线';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
console.log("66 ", data);
|
|
console.log("66 ", data);
|
|
@@ -517,6 +601,7 @@ export default {
|
|
link.click()
|
|
link.click()
|
|
document.body.removeChild(link)
|
|
document.body.removeChild(link)
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
/* 右键菜单 */
|
|
/* 右键菜单 */
|
|
contextmenu() {
|
|
contextmenu() {
|