代码调整

This commit is contained in:
joylink_cuiweidong 2021-03-16 17:43:22 +08:00
parent c11568348f
commit 76dcd271d9
3 changed files with 91 additions and 82 deletions

View File

@ -204,6 +204,7 @@
:disabled="item.disabled"
@change="item.onChange"
>
<!-- :popper-append-to-body="false" -->
<el-option
v-for="option in item.options"
:key="option[item.optionValue|| 'value']"
@ -223,6 +224,7 @@
:disabled="item.disabled"
@change="((val)=>{deviceChange(val, item)})"
>
<!-- :popper-append-to-body="false" -->
<el-option
v-for="option in item.options"
:key="option[item.optionValue|| 'value']"

View File

@ -164,7 +164,7 @@ export default {
this.onInboundRouteChange();
this.dataLoading = false;
}).catch(_ => {
console.log(_)
console.log(_);
this.dataLoading = false;
this.$messageBox(`获取交路列表失败`);
});
@ -226,7 +226,7 @@ export default {
this.$refs.dataform && this.$refs.dataform.clearValidate();
});
},
onOutboundRouteChange(outboundRouting='') {
onOutboundRouteChange(outboundRouting = '') {
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
@ -235,38 +235,37 @@ export default {
return route.runningRouting1 && route.runningRouting2 && (
outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode)
)
})
);
});
} else {
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => {
return route.runningRouting1 && route.runningRouting2 && (
outboundRoute && !inboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
!outboundRoute && inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
outboundRoute && inboundRoute && (
outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode,route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode,route.endSectionCode].includes(outboundRoute.endSectionCode)
outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode, route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode)
) ||
!inboundRoute && !outboundRoute
)
})
);
});
}
if (!outboundRouting) {
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND'
})
return route.routingType == 'OUTBOUND';
});
}
this.checkRouteCurrentValue();
},
onRunningRouteChange(runningRouting='') {
onRunningRouteChange(runningRouting = '') {
const temp = this.runningRoutingMap[runningRouting];
if (temp) {
this.formModel.runningRouting1 = temp.runningRouting1;
this.formModel.runningRouting2 = temp.runningRouting2;
}
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
const runningRoute = Object.values(this.runningRoutingMap).find(route => route.value == this.formModel.runningRouting);
@ -276,7 +275,7 @@ export default {
outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
!inboundRoute && !outboundRoute
))
));
}
this.outboundRouteList = this.covertRouting(this.routingList, route => {
@ -284,20 +283,20 @@ export default {
runningRoute
? [runningRoute.startSectionCode, runningRoute.endSectionCode].includes(route.endSectionCode)
: true
)
})
);
});
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND' && (
runningRoute
? [runningRoute.startSectionCode, runningRoute.endSectionCode].includes(route.startSectionCode)
: true
)
})
);
});
this.checkRouteCurrentValue();
},
onInboundRouteChange(inboundRouting='') {
onInboundRouteChange(inboundRouting = '') {
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
@ -306,33 +305,37 @@ export default {
return route.runningRouting1 && route.runningRouting2 && (
outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode)
)
})
);
});
} else {
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => {
return route.runningRouting1 && route.runningRouting2 && (
outboundRoute && !inboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) ||
!outboundRoute && inboundRoute && [route.startSectionCode, route.endSectionCode].includes(inboundRoute.startSectionCode) ||
outboundRoute && inboundRoute && (
outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode,route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode,route.endSectionCode].includes(outboundRoute.endSectionCode)
outboundRoute.endSectionCode != inboundRoute.startSectionCode && JSON.stringify([route.startSectionCode, route.endSectionCode].sort()) == JSON.stringify([outboundRoute.endSectionCode, inboundRoute.startSectionCode].sort()) ||
outboundRoute.endSectionCode == inboundRoute.startSectionCode && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode)
) ||
!inboundRoute && !outboundRoute
)
})
);
});
}
if (!inboundRouting) {
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND'
})
return route.routingType == 'INBOUND';
});
}
this.checkRouteCurrentValue();
},
doClose() {
this.loading = false;
debugger;
// this.$refs.dataform.validateField('runningRouting');
this.$refs.dataform.resetForm();
// this.$refs.dataform.clearValidate();
// blur
this.formModel = {
gernarateType:'01',
serviceNumber:'', //
@ -348,7 +351,7 @@ export default {
};
this.dialogShow = false;
},
covertRouting(list, cb=e => true) {
covertRouting(list, cb = e => true) {
return list.filter(route=> cb(route));
},
handleCommit() {

View File

@ -289,6 +289,10 @@ export default {
serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] || {};
const op = this.myChart.getOption();
//console.log(op.series);
// const array1 = []; op.series[1].data.forEach(each=>{ array1.push({dataTime:each[0], temperature:each[1], serviceNumber:each[3]}); });
//const array1 = []; op.series[5].data.forEach(each=>{ array1.push({dataTime:each[0], kiloMemter:each[1], serviceNumber:each[3], tripNumber:'05'}); });
//debugger;
op.series.forEach((item, index) => {
item.lineStyle.color = '#000';
item.lineStyle.width = 0.5;