|
@@ -74,12 +74,13 @@
|
|
|
></div>
|
|
|
<div style="position: absolute">
|
|
|
{{
|
|
|
- index === 0
|
|
|
+ 9999 ||
|
|
|
+ (index === 0
|
|
|
? scope?.row.filter((val) => val.name === item.name)[0]
|
|
|
?.value
|
|
|
: scope?.row
|
|
|
.filter((val) => val.name === item.name)[0]
|
|
|
- ?.value?.toFixed(2)
|
|
|
+ ?.value?.toFixed(2))
|
|
|
}}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -146,11 +147,14 @@ export default {
|
|
|
this.dataList = dataJson.column;
|
|
|
|
|
|
let titleList = [];
|
|
|
- let dataList = [[]];
|
|
|
+ let dataList = [];
|
|
|
+
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ dataList.push([
|
|
|
+ { name: `A01`, value: 66, maxValue: 55, showFlag: false },
|
|
|
+ ]);
|
|
|
+ }
|
|
|
|
|
|
- new Array(10).forEach((cEle) => {
|
|
|
- dataList[0].push({ name: `#01`, value: 66, maxValue: 55 });
|
|
|
- });
|
|
|
dataJson.column.forEach((pEle) => {
|
|
|
pEle.children.forEach((cEle) => {
|
|
|
titleList.push({ name: cEle.name });
|
|
@@ -159,7 +163,6 @@ export default {
|
|
|
|
|
|
this.titleList = titleList;
|
|
|
this.dataList = dataList;
|
|
|
- console.log(1122, dataJson.column);
|
|
|
|
|
|
return;
|
|
|
api.stationCompared(params).then((res) => {
|
|
@@ -177,63 +180,63 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getLatest(index) {
|
|
|
- // let list = [];
|
|
|
- // let arr = this.arrList.map((item) => {
|
|
|
- // return {
|
|
|
- // ...item,
|
|
|
- // };
|
|
|
- // });
|
|
|
- // this.titleList.forEach((item, index) => {
|
|
|
- // if (index !== 0) {
|
|
|
- // arr.filter((val) => val.name === item.name)[0].type = true;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // arr.map((item) => {
|
|
|
- // if (this.labelList.filter((val) => val.name === item.name)[0]?.type) {
|
|
|
- // list.push(item.code);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // arr.unshift({
|
|
|
- // name: "风机",
|
|
|
- // value: this.chooseList[index].windturbineId,
|
|
|
- // });
|
|
|
- // let params = list.join(",");
|
|
|
- // api
|
|
|
- // .nitWinturbineBaseData({
|
|
|
- // thingType: "windturbine",
|
|
|
- // thingId: this.chooseList[index].windturbineId,
|
|
|
- // uniformCodes: params,
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // if (res) {
|
|
|
- // arr.forEach((item) => {
|
|
|
- // if (item.type) {
|
|
|
- // item.value = res.data[item.code]?.value;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // this.dataList.push(arr);
|
|
|
- // if (index < this.chooseList.length - 1) {
|
|
|
- // index++;
|
|
|
- // this.getLatest(index);
|
|
|
- // } else {
|
|
|
- // this.titleList.forEach((item, index) => {
|
|
|
- // if (index > 0) {
|
|
|
- // let datas = [];
|
|
|
- // this.dataList.map((items) => {
|
|
|
- // datas.push(
|
|
|
- // items.filter((val) => item.name === val.name)[0]?.value
|
|
|
- // );
|
|
|
- // });
|
|
|
- // item.maxValue = Math.max.apply(
|
|
|
- // null,
|
|
|
- // datas.map((v) => v)
|
|
|
- // );
|
|
|
- // item.showFlag = false;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
+ let list = [];
|
|
|
+ let arr = this.arrList.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.titleList.forEach((item, index) => {
|
|
|
+ if (index !== 0) {
|
|
|
+ arr.filter((val) => val.name === item.name)[0].type = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ arr.map((item) => {
|
|
|
+ if (this.labelList.filter((val) => val.name === item.name)[0]?.type) {
|
|
|
+ list.push(item.code);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ arr.unshift({
|
|
|
+ name: "风机",
|
|
|
+ value: this.chooseList[index].windturbineId,
|
|
|
+ });
|
|
|
+ let params = list.join(",");
|
|
|
+ api
|
|
|
+ .nitWinturbineBaseData({
|
|
|
+ thingType: "windturbine",
|
|
|
+ thingId: this.chooseList[index].windturbineId,
|
|
|
+ uniformCodes: params,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ arr.forEach((item) => {
|
|
|
+ if (item.type) {
|
|
|
+ item.value = res.data[item.code]?.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.dataList.push(arr);
|
|
|
+ if (index < this.chooseList.length - 1) {
|
|
|
+ index++;
|
|
|
+ this.getLatest(index);
|
|
|
+ } else {
|
|
|
+ this.titleList.forEach((item, index) => {
|
|
|
+ if (index > 0) {
|
|
|
+ let datas = [];
|
|
|
+ this.dataList.map((items) => {
|
|
|
+ datas.push(
|
|
|
+ items.filter((val) => item.name === val.name)[0]?.value
|
|
|
+ );
|
|
|
+ });
|
|
|
+ item.maxValue = Math.max.apply(
|
|
|
+ null,
|
|
|
+ datas.map((v) => v)
|
|
|
+ );
|
|
|
+ item.showFlag = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
closed() {
|
|
|
this.labelList = [];
|