From 0d16b31c9a71527f3108f43fa967deb8145dd6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BE=A4?= Date: Tue, 5 Sep 2023 13:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=BB=9F=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E6=AE=B5=E8=A7=84=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/highWay/runData/form.vue | 23 +- pages/highWay/runStatusData/form.vue | 1642 +++++++++++++------------ pages/railway/railwayRunData/form.vue | 1402 +++++++++++---------- pages/railway/runStatus/form.vue | 25 +- 4 files changed, 1600 insertions(+), 1492 deletions(-) diff --git a/pages/highWay/runData/form.vue b/pages/highWay/runData/form.vue index c49945e..2125d03 100644 --- a/pages/highWay/runData/form.vue +++ b/pages/highWay/runData/form.vue @@ -206,20 +206,15 @@ userInfo: {}, yoyMom: {},//同比环比 showStaion: false,//展开收起 + pageType: '', } }, onLoad(options) { this.userInfo = uni.getStorageSync('userInfo'); if (options.type == 'add') { + this.pageType = 'add'; let now = new Date(); this.form.statDate = getDateStr(now, -1);//默认前一天 - //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); - if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { - this.form.statPeriod = '0012'; - }else{ - this.form.statPeriod = '03'; //默认0-24 - } this.queryYoYMom(); this.queryStation('add'); } else if (options.item) { @@ -400,6 +395,20 @@ this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse( new Date()), {}, 'GET').then(res => { this.array = res.data; + if(this.pageType == 'add') { + let now = new Date(); + //11:00-13:30 默认选择0-12 + let dateStr = getDateStr(now, 0); + if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { + this.form.statPeriod = '0012'; + this.index = this.array.findIndex(item => item.dictValue == '0012'); + }else{ + this.form.statPeriod = '03'; //默认0-24 + this.index = this.array.findIndex(item => item.dictValue == '03'); + } + }else{ + this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); + } }) }, //确认提交 diff --git a/pages/highWay/runStatusData/form.vue b/pages/highWay/runStatusData/form.vue index 9feb519..ea9d0d7 100644 --- a/pages/highWay/runStatusData/form.vue +++ b/pages/highWay/runStatusData/form.vue @@ -1,804 +1,838 @@ - - - - \ No newline at end of file + + + + diff --git a/pages/railway/railwayRunData/form.vue b/pages/railway/railwayRunData/form.vue index cbe2927..6d3bcbd 100644 --- a/pages/railway/railwayRunData/form.vue +++ b/pages/railway/railwayRunData/form.vue @@ -1,672 +1,730 @@ - - - - \ No newline at end of file + + + + diff --git a/pages/railway/runStatus/form.vue b/pages/railway/runStatus/form.vue index ed4e14f..7132ad7 100644 --- a/pages/railway/runStatus/form.vue +++ b/pages/railway/runStatus/form.vue @@ -97,14 +97,7 @@ if (options.type == 'add') { this.pageType = 'add'; let now = new Date(); - this.form.statDate = getDateStr(now, -1); //默认前一天 - //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); - if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { - this.form.statPeriod = '0012'; - }else{ - this.form.statPeriod = '03'; //默认0-24 - } + this.form.statDate = getDateStr(now, -1); //默认前一天 } else if (options.item) { this.form = JSON.parse(options.item); console.log(this.form); @@ -162,7 +155,21 @@ this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date .parse( new Date()), {}, 'GET').then(res => { - this.array = res.data; + this.array = res.data; + if(this.pageType == 'add') { + let now = new Date(); + //11:00-13:30 默认选择0-12 + let dateStr = getDateStr(now, 0); + if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { + this.form.statPeriod = '0012'; + this.index = this.array.findIndex(item => item.dictValue == '0012'); + }else{ + this.form.statPeriod = '03'; //默认0-24 + this.index = this.array.findIndex(item => item.dictValue == '03'); + } + }else{ + this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); + } }) }, //确认提交