|
@@ -383,14 +383,22 @@ export default {
|
|
|
stationObj[val] = this.cache[val];
|
|
|
}
|
|
|
|
|
|
- let list = Object.keys(stationObj).sort();
|
|
|
+ let list = Object.keys(stationObj);
|
|
|
for (const id of list) {
|
|
|
- stationArr.push(stationObj[id]);
|
|
|
+ stationArr.push(stationObj[id].sort((a,b)=>{
|
|
|
+ let aSubString = '0', bSubString = '0'
|
|
|
+ if(a.windturbineId && b.windturbineId){
|
|
|
+ aSubString = a.windturbineId.substring(a.windturbineId.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.windturbineId.substring(b.windturbineId.lastIndexOf('_')+1)
|
|
|
+ }else if(a.id && b.id){
|
|
|
+ aSubString = a.id.substring(a.id.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.id.substring(b.id.lastIndexOf('_')+1)
|
|
|
+ }
|
|
|
+ return parseInt(aSubString) - parseInt(bSubString)
|
|
|
+ }));
|
|
|
}
|
|
|
this.stationObj = stationObj;
|
|
|
this.stationArr = stationArr;
|
|
|
- console.log('stationArr======>>>>>', this.stationArr)
|
|
|
- debugger
|
|
|
},
|
|
|
//风场回调
|
|
|
handleDetial(itm) {
|
|
@@ -772,9 +780,19 @@ export default {
|
|
|
this.current === "all" &&
|
|
|
(this.cache = JSON.parse(JSON.stringify(this.stationObj)));
|
|
|
// let list = Object.keys(this.stationObj).sort();
|
|
|
- let list = Object.keys(this.stationObj);
|
|
|
+ let list = Object.keys(this.stationObj)
|
|
|
for (const id of list) {
|
|
|
- stationArr.push(this.stationObj[id]);
|
|
|
+ stationArr.push(this.stationObj[id].sort((a,b)=>{
|
|
|
+ let aSubString = '0', bSubString = '0'
|
|
|
+ if(a.windturbineId && b.windturbineId){
|
|
|
+ aSubString = a.windturbineId.substring(a.windturbineId.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.windturbineId.substring(b.windturbineId.lastIndexOf('_')+1)
|
|
|
+ }else if(a.id && b.id){
|
|
|
+ aSubString = a.id.substring(a.id.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.id.substring(b.id.lastIndexOf('_')+1)
|
|
|
+ }
|
|
|
+ return parseInt(aSubString) - parseInt(bSubString)
|
|
|
+ }))
|
|
|
}
|
|
|
// this.stationArr = stationArr;
|
|
|
this.stationArr = this.sortStarionArr(stationArr);
|