代码调整
This commit is contained in:
parent
c11568348f
commit
76dcd271d9
@ -198,12 +198,13 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="formModel[item.prop]"
|
v-model="formModel[item.prop]"
|
||||||
filterable
|
filterable
|
||||||
:clearable="!!item.clearable"
|
:clearable="!!item.clearable"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:no-data-text="item.noDataText?item.noDataText:'无数据'"
|
:no-data-text="item.noDataText?item.noDataText:'无数据'"
|
||||||
: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']"
|
||||||
|
@ -87,9 +87,9 @@ export default {
|
|||||||
{ required: true, message: '请选择出库交路', trigger: 'change' }
|
{ required: true, message: '请选择出库交路', trigger: 'change' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
outboundRouteList: [],
|
outboundRouteList: [],
|
||||||
runningRouteList: [],
|
runningRouteList: [],
|
||||||
inboundRouteList: []
|
inboundRouteList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -97,7 +97,7 @@ export default {
|
|||||||
return '生成计划';
|
return '生成计划';
|
||||||
},
|
},
|
||||||
form() {
|
form() {
|
||||||
return {
|
return {
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
size:'small',
|
size:'small',
|
||||||
items: [
|
items: [
|
||||||
@ -110,7 +110,7 @@ export default {
|
|||||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||||
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
|
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
|
||||||
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
|
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
|
||||||
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.outboundRouteList, clearable: true, change:true, onChange: this.onOutboundRouteChange, noDataText:'请先设置交路'},
|
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.outboundRouteList, clearable: true, change:true, onChange: this.onOutboundRouteChange, noDataText:'请先设置交路'},
|
||||||
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
|
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
|
||||||
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
|
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
|
||||||
{ prop: 'runningRouting', label:'环路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onRunningRouteChange},
|
{ prop: 'runningRouting', label:'环路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onRunningRouteChange},
|
||||||
@ -142,9 +142,9 @@ export default {
|
|||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].label = elem.name;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].label = elem.name;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].value = elem.startSectionCode + '-' + elem.endSectionCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].value = elem.startSectionCode + '-' + elem.endSectionCode;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.code;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.code;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.code;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].runningRouting1 = elem.code;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startSectionCode = elem.startSectionCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].startSectionCode = elem.startSectionCode;
|
||||||
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endSectionCode = elem.endSectionCode;
|
runningRoutingMap[elem.startSectionCode + '-' + elem.endSectionCode].endSectionCode = elem.endSectionCode;
|
||||||
} else {
|
} else {
|
||||||
// temp = name.split('-')[1];
|
// temp = name.split('-')[1];
|
||||||
// const data = ;
|
// const data = ;
|
||||||
@ -153,18 +153,18 @@ export default {
|
|||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].label = elem.name;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].label = elem.name;
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].value = elem.endSectionCode + '-' + elem.startSectionCode;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].value = elem.endSectionCode + '-' + elem.startSectionCode;
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].runningRouting2 = elem.code;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].runningRouting2 = elem.code;
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].startSectionCode = elem.startSectionCode;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].startSectionCode = elem.startSectionCode;
|
||||||
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].endSectionCode = elem.endSectionCode;
|
runningRoutingMap[elem.endSectionCode + '-' + elem.startSectionCode].endSectionCode = elem.endSectionCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.runningRoutingMap = runningRoutingMap;
|
this.runningRoutingMap = runningRoutingMap;
|
||||||
this.onOutboundRouteChange();
|
this.onOutboundRouteChange();
|
||||||
this.onRunningRouteChange();
|
this.onRunningRouteChange();
|
||||||
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(`获取交路列表失败`);
|
||||||
});
|
});
|
||||||
@ -222,117 +222,120 @@ export default {
|
|||||||
this.formModel.inboundRouting = '';
|
this.formModel.inboundRouting = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(_ => {
|
this.$nextTick(_ => {
|
||||||
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);
|
||||||
|
|
||||||
if (this.formModel.runningRouting) {
|
if (this.formModel.runningRouting) {
|
||||||
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
||||||
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);
|
|
||||||
|
|
||||||
if (!this.formModel.runningRouting) {
|
if (!this.formModel.runningRouting) {
|
||||||
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2 && (
|
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => 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) ||
|
||||||
!inboundRoute && !outboundRoute
|
!inboundRoute && !outboundRoute
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.outboundRouteList = this.covertRouting(this.routingList, route => {
|
this.outboundRouteList = this.covertRouting(this.routingList, route => {
|
||||||
return route.routingType == 'OUTBOUND' && (
|
return route.routingType == 'OUTBOUND' && (
|
||||||
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);
|
||||||
|
|
||||||
if (this.formModel.runningRouting) {
|
if (this.formModel.runningRouting) {
|
||||||
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
|
||||||
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() {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user