代码调整

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

View File

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

View File

@ -289,6 +289,10 @@ export default {
serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] || {}; serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] || {};
const op = this.myChart.getOption(); 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) => { op.series.forEach((item, index) => {
item.lineStyle.color = '#000'; item.lineStyle.color = '#000';
item.lineStyle.width = 0.5; item.lineStyle.width = 0.5;