|
@@ -18,7 +18,7 @@
|
|
|
:eledata="eledata"
|
|
|
with-setting
|
|
|
:withSetting="false"
|
|
|
- :withExport="false"
|
|
|
+ :withExport="true"
|
|
|
@getFormData="getFormData"
|
|
|
/>
|
|
|
</div>
|
|
@@ -311,6 +311,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getFormData(data) {
|
|
|
+ this.tableData.time = [];
|
|
|
+ this.tableData.data1 = [];
|
|
|
+ this.tableData.data2 = [];
|
|
|
if (this.action === 2) {
|
|
|
let option = [
|
|
|
{
|
|
@@ -374,11 +377,19 @@ export default {
|
|
|
this.tableData.data1 = [];
|
|
|
});
|
|
|
let ar = [];
|
|
|
+ this.tableData.data1.push(0);
|
|
|
for (let index = 0; index < this.tableData.data2.length; index++) {
|
|
|
- const element =
|
|
|
- (this.tableData.data2[index + 1] - this.tableData.data2[index]) /
|
|
|
- this.tableData.data2[index];
|
|
|
- this.tableData.data1.push(element);
|
|
|
+ // const element =
|
|
|
+ // (this.tableData.data2[index + 1] - this.tableData.data2[index]) /
|
|
|
+ // this.tableData.data2[index];
|
|
|
+ // console.log(element);
|
|
|
+ if (index > 0) {
|
|
|
+ const element =
|
|
|
+ (this.tableData.data2[index] -
|
|
|
+ this.tableData.data2[index - 1]) /
|
|
|
+ this.tableData.data2[index - 1];
|
|
|
+ this.tableData.data1.push(element.toFixed(2));
|
|
|
+ }
|
|
|
}
|
|
|
// this.tableData = returnData.listValues;
|
|
|
// console.log(this.tableData[0])
|