|
@@ -221,7 +221,7 @@ export default {
|
|
|
if (wswind && pv) {
|
|
|
json = {...wswind, ...pv}
|
|
|
this.dataList = [];
|
|
|
- this.showList = [];
|
|
|
+ const showList = [];
|
|
|
let arr = Object.keys(json).sort();
|
|
|
for (let id of arr) {
|
|
|
let val = json[id];
|
|
@@ -239,20 +239,20 @@ export default {
|
|
|
val.status === 7 ||
|
|
|
val.lockValue > 0
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
break;
|
|
|
case 1:
|
|
|
- val.status === 5 ? this.showList.push(val) : "";
|
|
|
+ val.status === 5 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 2:
|
|
|
- val.status === 6 ? this.showList.push(val) : "";
|
|
|
+ val.status === 6 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 3:
|
|
|
- val.status === 7 ? this.showList.push(val) : "";
|
|
|
+ val.status === 7 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 4:
|
|
|
- val.lockValue > 0 ? this.showList.push(val) : "";
|
|
|
+ val.lockValue > 0 ? showList.push(val) : "";
|
|
|
break;
|
|
|
default:
|
|
|
if (
|
|
@@ -260,7 +260,7 @@ export default {
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
|
.stationId
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -268,13 +268,37 @@ export default {
|
|
|
let checkoutList = BackgroundData.getInstance().checkouts;
|
|
|
checkoutList.forEach((item) => {
|
|
|
let showIndex = null;
|
|
|
- this.showList.forEach((param, index) => {
|
|
|
+ showList.forEach((param, index) => {
|
|
|
if (item.windturbineId === param.windturbineId) {
|
|
|
showIndex = index;
|
|
|
}
|
|
|
});
|
|
|
- this.showList.splice(showIndex, 1);
|
|
|
+ showList.splice(showIndex, 1);
|
|
|
});
|
|
|
+ showList.sort((a,b)=>{
|
|
|
+ let aSubString = '0', bSubString = '0'
|
|
|
+ let aStation = '1', bStation = '2'
|
|
|
+ if(a.windturbineId && b.windturbineId){
|
|
|
+ aSubString = a.windturbineId.substring(a.windturbineId.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.windturbineId.substring(b.windturbineId.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.windturbineId.substring(0, a.windturbineId.lastIndexOf('_'))
|
|
|
+ bStation = b.windturbineId.substring(0, b.windturbineId.lastIndexOf('_'))
|
|
|
+
|
|
|
+ }else if(a.id && b.id){
|
|
|
+ aSubString = a.id.substring(a.id.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.id.substring(b.id.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.id.substring(0, a.id.lastIndexOf('_'))
|
|
|
+ bStation = b.id.substring(0, b.id.lastIndexOf('_'))
|
|
|
+ }
|
|
|
+ if(aStation === bStation){
|
|
|
+ return parseInt(aSubString) - parseInt(bSubString)
|
|
|
+ }else{
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.showList = showList
|
|
|
}
|
|
|
},
|
|
|
getLocks() {
|
|
@@ -698,7 +722,7 @@ export default {
|
|
|
},
|
|
|
listedChange() {
|
|
|
this.chooseList = [];
|
|
|
- this.showList = [];
|
|
|
+ const showList = [];
|
|
|
if (Number(this.selectValue) >= 6) {
|
|
|
console.log(
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
@@ -723,20 +747,20 @@ export default {
|
|
|
val.status === 7 ||
|
|
|
val.lockValue > 0
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
break;
|
|
|
case 1:
|
|
|
- val.status === 5 ? this.showList.push(val) : "";
|
|
|
+ val.status === 5 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 2:
|
|
|
- val.status === 6 ? this.showList.push(val) : "";
|
|
|
+ val.status === 6 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 3:
|
|
|
- val.status === 7 ? this.showList.push(val) : "";
|
|
|
+ val.status === 7 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 4:
|
|
|
- val.lockValue > 0 ? this.showList.push(val) : "";
|
|
|
+ val.lockValue > 0 ? showList.push(val) : "";
|
|
|
break;
|
|
|
default:
|
|
|
if (Number(this.selectValue) < 12) {
|
|
@@ -745,7 +769,7 @@ export default {
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
|
.stationId
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
} else {
|
|
|
if (
|
|
@@ -753,12 +777,36 @@ export default {
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
|
.stationId
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
});
|
|
|
+ showList.sort((a,b)=>{
|
|
|
+ let aSubString = '0', bSubString = '0'
|
|
|
+ let aStation = '1', bStation = '2'
|
|
|
+ if(a.windturbineId && b.windturbineId){
|
|
|
+ aSubString = a.windturbineId.substring(a.windturbineId.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.windturbineId.substring(b.windturbineId.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.windturbineId.substring(0, a.windturbineId.lastIndexOf('_'))
|
|
|
+ bStation = b.windturbineId.substring(0, b.windturbineId.lastIndexOf('_'))
|
|
|
+
|
|
|
+ }else if(a.id && b.id){
|
|
|
+ aSubString = a.id.substring(a.id.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.id.substring(b.id.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.id.substring(0, a.id.lastIndexOf('_'))
|
|
|
+ bStation = b.id.substring(0, b.id.lastIndexOf('_'))
|
|
|
+ }
|
|
|
+ if(aStation === bStation){
|
|
|
+ return parseInt(aSubString) - parseInt(bSubString)
|
|
|
+ }else{
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.showList = showList
|
|
|
},
|
|
|
handleDetails(itm) {
|
|
|
this.dialogVisible = true;
|
|
@@ -810,7 +858,7 @@ export default {
|
|
|
this.windturbinelist = msg;
|
|
|
this.$store.commit("windturbinelist", msg);
|
|
|
this.dataList = [];
|
|
|
- this.showList = [];
|
|
|
+ const showList = [];
|
|
|
let arr = Object.keys(msg).sort();
|
|
|
let newArr = [];
|
|
|
for (let id of arr) {
|
|
@@ -835,20 +883,20 @@ export default {
|
|
|
val.status === 7 ||
|
|
|
val.lockValue > 0
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
break;
|
|
|
case 1:
|
|
|
- val.status === 5 ? this.showList.push(val) : "";
|
|
|
+ val.status === 5 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 2:
|
|
|
- val.status === 6 ? this.showList.push(val) : "";
|
|
|
+ val.status === 6 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 3:
|
|
|
- val.status === 7 ? this.showList.push(val) : "";
|
|
|
+ val.status === 7 ? showList.push(val) : "";
|
|
|
break;
|
|
|
case 4:
|
|
|
- val.lockValue > 0 ? this.showList.push(val) : "";
|
|
|
+ val.lockValue > 0 ? showList.push(val) : "";
|
|
|
break;
|
|
|
|
|
|
default:
|
|
@@ -866,7 +914,7 @@ export default {
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
|
.stationId
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
} else {
|
|
|
if (
|
|
@@ -874,25 +922,49 @@ export default {
|
|
|
this.options.filter((ops) => ops?.value === this.selectValue)[0]
|
|
|
.stationId
|
|
|
) {
|
|
|
- this.showList.push(val);
|
|
|
+ showList.push(val);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- console.log('showList', this.showList)
|
|
|
+ // console.log('showList', this.showList)
|
|
|
let checkoutList = BackgroundData.getInstance().checkouts;
|
|
|
if (checkoutList.length>0) {
|
|
|
checkoutList.forEach((item) => {
|
|
|
let showIndex = null;
|
|
|
- this.showList.forEach((param, index) => {
|
|
|
+ showList.forEach((param, index) => {
|
|
|
if (item.windturbineId === param.windturbineId) {
|
|
|
showIndex = index;
|
|
|
}
|
|
|
});
|
|
|
- this.showList.splice(showIndex, 1);
|
|
|
+ showList.splice(showIndex, 1);
|
|
|
});
|
|
|
}
|
|
|
+ showList.sort((a,b)=>{
|
|
|
+ let aSubString = '0', bSubString = '0'
|
|
|
+ let aStation = '1', bStation = '2'
|
|
|
+ if(a.windturbineId && b.windturbineId){
|
|
|
+ aSubString = a.windturbineId.substring(a.windturbineId.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.windturbineId.substring(b.windturbineId.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.windturbineId.substring(0, a.windturbineId.lastIndexOf('_'))
|
|
|
+ bStation = b.windturbineId.substring(0, b.windturbineId.lastIndexOf('_'))
|
|
|
+
|
|
|
+ }else if(a.id && b.id){
|
|
|
+ aSubString = a.id.substring(a.id.lastIndexOf('_')+1)
|
|
|
+ bSubString = b.id.substring(b.id.lastIndexOf('_')+1)
|
|
|
+
|
|
|
+ aStation = a.id.substring(0, a.id.lastIndexOf('_'))
|
|
|
+ bStation = b.id.substring(0, b.id.lastIndexOf('_'))
|
|
|
+ }
|
|
|
+ if(aStation === bStation){
|
|
|
+ return parseInt(aSubString) - parseInt(bSubString)
|
|
|
+ }else{
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.showList = showList
|
|
|
|
|
|
}
|
|
|
}
|