|
@@ -59,7 +59,7 @@
|
|
<el-col :span="24" class="pd-l-8">
|
|
<el-col :span="24" class="pd-l-8">
|
|
<panel :title="'风机对标列表明细'" :showLine="false">
|
|
<panel :title="'风机对标列表明细'" :showLine="false">
|
|
<div class="project-table">
|
|
<div class="project-table">
|
|
- <Table :data="tableDataDetail"></Table>
|
|
|
|
|
|
+ <Table :data="tableDataDetail" ref="curRef"></Table>
|
|
</div>
|
|
</div>
|
|
</panel>
|
|
</panel>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -95,8 +95,7 @@
|
|
let that = this;
|
|
let that = this;
|
|
return {
|
|
return {
|
|
tableIdArr: [], //放checkbox的id数组
|
|
tableIdArr: [], //放checkbox的id数组
|
|
- tableDateArr: [],
|
|
|
|
- tableDate: [],
|
|
|
|
|
|
+ tableId: [],
|
|
checkLength: 0, //对标分析只能选择2个
|
|
checkLength: 0, //对标分析只能选择2个
|
|
tableData: {
|
|
tableData: {
|
|
column: [{
|
|
column: [{
|
|
@@ -114,16 +113,18 @@
|
|
return "<input class='check curCheckBox' type='CheckBox'/>";
|
|
return "<input class='check curCheckBox' type='CheckBox'/>";
|
|
},
|
|
},
|
|
click: function(event, data) {
|
|
click: function(event, data) {
|
|
- var dataDate = that.tableDateArr[data.index - 1];
|
|
|
|
|
|
+ var dataId = that.tableIdArr[data.index - 1];
|
|
if (event.target.checked == false && that.checkLength <= 2) {
|
|
if (event.target.checked == false && that.checkLength <= 2) {
|
|
- that.tableDate.forEach((item, i) => {
|
|
|
|
- if (item == dataDate) {
|
|
|
|
- that.tableDate.splice(i, 1)
|
|
|
|
|
|
+ that.tableId.forEach((item, i) => {
|
|
|
|
+ if (item == dataId) {
|
|
|
|
+ that.tableId.splice(i, 1);
|
|
|
|
+ that.dbData.splice(i, 1);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
that.checkLength--;
|
|
that.checkLength--;
|
|
} else if (event.target.checked && that.checkLength < 2) {
|
|
} else if (event.target.checked && that.checkLength < 2) {
|
|
- that.tableDate.push(dataDate)
|
|
|
|
|
|
+ that.tableId.push(dataId);
|
|
|
|
+ that.dbData.push(data);
|
|
that.checkLength++;
|
|
that.checkLength++;
|
|
} else if (that.checkLength == 2) {
|
|
} else if (that.checkLength == 2) {
|
|
event.target.checked = false;
|
|
event.target.checked = false;
|
|
@@ -306,7 +307,7 @@
|
|
},
|
|
},
|
|
click: function(event, data) {
|
|
click: function(event, data) {
|
|
var dataId = that.tableIdArr[data.index - 1];
|
|
var dataId = that.tableIdArr[data.index - 1];
|
|
- console.log(dataId)
|
|
|
|
|
|
+ that.clearDb();
|
|
that.detailShow = 2;
|
|
that.detailShow = 2;
|
|
// var that = this;
|
|
// var that = this;
|
|
that.API.requestData({
|
|
that.API.requestData({
|
|
@@ -323,7 +324,7 @@
|
|
success(res) {
|
|
success(res) {
|
|
var dataTab = [];
|
|
var dataTab = [];
|
|
res.data.forEach((item, index) => {
|
|
res.data.forEach((item, index) => {
|
|
- that.tableIdArr.push(item.id);
|
|
|
|
|
|
+ that.tableIdArr.push(item.date);
|
|
|
|
|
|
dataTab.push({ //表格
|
|
dataTab.push({ //表格
|
|
index: index + 1,
|
|
index: index + 1,
|
|
@@ -372,19 +373,21 @@
|
|
is_num: false,
|
|
is_num: false,
|
|
is_light: false,
|
|
is_light: false,
|
|
template: function() {
|
|
template: function() {
|
|
- return "<input class='check' type='CheckBox'/>";
|
|
|
|
|
|
+ return "<input class='check curCheckBox checkItem' type='CheckBox'/>";
|
|
},
|
|
},
|
|
click: function(event, data) {
|
|
click: function(event, data) {
|
|
var dataId = that.tableIdArr[data.index - 1];
|
|
var dataId = that.tableIdArr[data.index - 1];
|
|
if (event.target.checked == false && that.checkLength <= 2) {
|
|
if (event.target.checked == false && that.checkLength <= 2) {
|
|
that.tableId.forEach((item, i) => {
|
|
that.tableId.forEach((item, i) => {
|
|
if (item == dataId) {
|
|
if (item == dataId) {
|
|
- that.tableId.splice(i, 1)
|
|
|
|
|
|
+ that.tableId.splice(i, 1);
|
|
|
|
+ that.dbData.splice(i, 1);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
that.checkLength--;
|
|
that.checkLength--;
|
|
} else if (event.target.checked && that.checkLength < 2) {
|
|
} else if (event.target.checked && that.checkLength < 2) {
|
|
- that.tableId.push(dataId)
|
|
|
|
|
|
+ that.tableId.push(dataId);
|
|
|
|
+ that.dbData.push(data);
|
|
that.checkLength++;
|
|
that.checkLength++;
|
|
} else if (that.checkLength == 2) {
|
|
} else if (that.checkLength == 2) {
|
|
event.target.checked = false;
|
|
event.target.checked = false;
|
|
@@ -543,7 +546,8 @@
|
|
tabs: [],
|
|
tabs: [],
|
|
analyisDialog: [],
|
|
analyisDialog: [],
|
|
detailShow: 1,
|
|
detailShow: 1,
|
|
- ajaxData: []
|
|
|
|
|
|
+ ajaxData: [],
|
|
|
|
+ dbData:[]
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -619,8 +623,7 @@
|
|
xdssdl = [],
|
|
xdssdl = [],
|
|
slssdl = [];
|
|
slssdl = [];
|
|
res.data.forEach((item, index) => {
|
|
res.data.forEach((item, index) => {
|
|
- that.tableDateArr.push(item.date);
|
|
|
|
- that.tableIdArr.push(item.id);
|
|
|
|
|
|
+ that.tableIdArr.push(item.date);
|
|
dataTab.push({ //表格
|
|
dataTab.push({ //表格
|
|
index: index + 1,
|
|
index: index + 1,
|
|
zhpm: item.zhpm,
|
|
zhpm: item.zhpm,
|
|
@@ -703,9 +706,14 @@
|
|
},
|
|
},
|
|
AjaxDbfx() {
|
|
AjaxDbfx() {
|
|
var that = this;
|
|
var that = this;
|
|
- var data = that.ajaxData;
|
|
|
|
- that.windNum = data[0].date.substr(0, 10);
|
|
|
|
- that.windNum2 = data[1].date.substr(0, 10);
|
|
|
|
|
|
+ var data = that.dbData;
|
|
|
|
+ if(that.detailShow == 1){
|
|
|
|
+ that.windNum = data[0].date.substr(0, 10);
|
|
|
|
+ that.windNum2 = data[1].date.substr(0, 10);
|
|
|
|
+ }if(that.detailShow == 2){
|
|
|
|
+ that.windNum = data[0].name;
|
|
|
|
+ that.windNum2 = data[1].name;
|
|
|
|
+ }
|
|
that.tabs = [{
|
|
that.tabs = [{
|
|
name: "发电量",
|
|
name: "发电量",
|
|
windData1: data[0].fdl,
|
|
windData1: data[0].fdl,
|
|
@@ -830,7 +838,7 @@
|
|
},
|
|
},
|
|
dbfx() {
|
|
dbfx() {
|
|
var that = this;
|
|
var that = this;
|
|
- if (that.tableDate.length == 2) {
|
|
|
|
|
|
+ if (that.tableId.length == 2) {
|
|
that.dialogVisible = true;
|
|
that.dialogVisible = true;
|
|
this.AjaxDbfx();
|
|
this.AjaxDbfx();
|
|
this.clearDb();
|
|
this.clearDb();
|
|
@@ -839,10 +847,12 @@
|
|
clearDb() { //清空对标状态
|
|
clearDb() { //清空对标状态
|
|
this.$refs.curRef.clearCheckBox();
|
|
this.$refs.curRef.clearCheckBox();
|
|
this.tableId = [];
|
|
this.tableId = [];
|
|
|
|
+ this.dbData = [];
|
|
this.checkLength = 0;
|
|
this.checkLength = 0;
|
|
},
|
|
},
|
|
back() {
|
|
back() {
|
|
this.detailShow = 1;
|
|
this.detailShow = 1;
|
|
|
|
+ this.clearDb();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|