From 76dcd271d992d2d7a80ba03ac33f73b8b4c594b7 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 16 Mar 2021 17:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/QueryListPage/DataForm.vue | 4 +- .../components/menus/gernaratePlanTrain.vue | 165 +++++++++--------- src/views/planMonitor/editTool/schedule.vue | 4 + 3 files changed, 91 insertions(+), 82 deletions(-) diff --git a/src/components/QueryListPage/DataForm.vue b/src/components/QueryListPage/DataForm.vue index 880b3489a..ee8e4fea4 100644 --- a/src/components/QueryListPage/DataForm.vue +++ b/src/components/QueryListPage/DataForm.vue @@ -198,12 +198,13 @@ + + { - console.log(_) + console.log(_); this.dataLoading = false; this.$messageBox(`获取交路列表失败`); }); @@ -222,117 +222,120 @@ export default { this.formModel.inboundRouting = ''; } - this.$nextTick(_ => { - this.$refs.dataform && this.$refs.dataform.clearValidate(); - }); + this.$nextTick(_ => { + this.$refs.dataform && this.$refs.dataform.clearValidate(); + }); }, - onOutboundRouteChange(outboundRouting='') { - const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting); - const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting); + onOutboundRouteChange(outboundRouting = '') { + const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting); + const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting); if (this.formModel.runningRouting) { - this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => { - return route.runningRouting1 && route.runningRouting2 && ( - outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) || + this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => { + 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) || + ); + }); + } 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='') { - const temp = this.runningRoutingMap[runningRouting]; - if (temp) { - this.formModel.runningRouting1 = temp.runningRouting1; - this.formModel.runningRouting2 = temp.runningRouting2; - } + }, + 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); + 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); if (!this.formModel.runningRouting) { - this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2 && ( - outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) || + this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2 && ( + 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 => { return route.routingType == 'OUTBOUND' && ( 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='') { - const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting); - const inboundRoute = this.routingList.find(route => route.value == this.formModel.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); - if (this.formModel.runningRouting) { - this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => { - return route.runningRouting1 && route.runningRouting2 && ( - outboundRoute && [route.startSectionCode, route.endSectionCode].includes(outboundRoute.endSectionCode) || + if (this.formModel.runningRouting) { + this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => { + 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) || + ); + }); + } 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) { + 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() { diff --git a/src/views/planMonitor/editTool/schedule.vue b/src/views/planMonitor/editTool/schedule.vue index b9b7f9ef5..cde1eea58 100644 --- a/src/views/planMonitor/editTool/schedule.vue +++ b/src/views/planMonitor/editTool/schedule.vue @@ -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;