From 5a447964a7792d55a1ba58e92337c62ac78f4157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Sun, 28 Apr 2024 15:58:34 +0800 Subject: [PATCH] =?UTF-8?q?CN-1637=20fix:=20=E3=80=90Report=E3=80=91?= =?UTF-8?q?=E6=96=B0=E5=BB=BAReport=EF=BC=8C=E5=BD=93=E7=94=9F=E6=95=88?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=A4=A7=E4=BA=8E=E5=A4=B1=E6=95=88=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=97=B6=EF=BC=8CReport=E4=BB=8D=E8=83=BD=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/common/right-box-common.scss | 2 +- src/components/rightBox/report/ReportBox.vue | 32 +++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/assets/css/common/right-box-common.scss b/src/assets/css/common/right-box-common.scss index b0759e89..1a9c970a 100644 --- a/src/assets/css/common/right-box-common.scss +++ b/src/assets/css/common/right-box-common.scss @@ -16,7 +16,7 @@ $border-radius-small: 2px; .el-date-editor { .el-input__inner { - padding-left: 32px; + //padding-left: 32px; } } } diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue index 090e07b0..f3b7e2a4 100644 --- a/src/components/rightBox/report/ReportBox.vue +++ b/src/components/rightBox/report/ReportBox.vue @@ -335,9 +335,6 @@ export default { categoryId: [ { required: true, message: i18n.global.t('validate.required'), trigger: 'change' } ], - schedulerStart: [ - { required: true, message: i18n.global.t('validate.required'), trigger: 'change' } - ], 'config.startTime': [ { required: true, message: i18n.global.t('validate.required'), trigger: 'change' }, { validator: startTimeValidator, trigger: 'change' } @@ -360,6 +357,31 @@ export default { } }, data () { + const schedulerStartTimeValidator = (rule, value, callback) => { + if (this.editObject.schedulerEnd) { + if (this.$refs.reportForm) { + this.$refs.reportForm.validateField('schedulerEnd') + } + callback() + } + } + + const schedulerEndTimeValidator = (rule, value, callback) => { + if (this.editObject.schedulerStart && (getMillisecond(this.editObject.schedulerStart) >= getMillisecond(value))) { + callback(new Error(this.$t('config.user.timeVerification'))) + } else { + callback() + } + } + + this.rules.schedulerStart = [ + { required: true, message: i18n.global.t('validate.required'), trigger: 'change' }, + { validator: schedulerStartTimeValidator, trigger: 'change' } + ] + this.rules.schedulerEnd = [ + { required: true, message: i18n.global.t('validate.required'), trigger: 'change' }, + { validator: schedulerEndTimeValidator, trigger: 'change' } + ] return { url: api.reportTemp, @@ -505,11 +527,11 @@ export default { } } }, - mounted() { + mounted () { this.initDateCalendarPreIcon() }, methods: { - initDateCalendarPreIcon() { + initDateCalendarPreIcon () { this.$nextTick(() => { const datePrefixIcon = document.getElementsByClassName('el-input__prefix-inner') if (datePrefixIcon && datePrefixIcon.length > 0) {