diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue index 93e2072a..7676a7e9 100644 --- a/src/components/rightBox/report/ReportBox.vue +++ b/src/components/rightBox/report/ReportBox.vue @@ -134,7 +134,7 @@ {{$t('report.customEvery')}} - {{$t('report.moon')}} + {{$t('report.month')}} @@ -316,9 +316,14 @@ export default { watch: { scheduleType (n, o) { this.editObject.config.schedulerConfig.type = n + this.cleanScheduleConfig() }, scheduleChecked (n) { this.editObject.config.isScheduler = n ? 1 : 0 + this.cleanScheduleConfig() + }, + monthScheduleType (n) { + this.cleanScheduleConfig() }, 'editObject.config.schedulerConfig.interval': { handler (n) { @@ -400,6 +405,19 @@ export default { }, typeChange (id) { + }, + cleanScheduleConfig () { + this.editObject.config.schedulerConfig.monthDates = [] + this.editObject.config.schedulerConfig.weekDates = [] + this.editObject.config.schedulerConfig.months = [] + this.editObject.config.schedulerConfig.monthWeekDates = [] + this.monthIsCycle = true + this.dateCheckedAll = false + this.dateIsIndeterminate = false + this.monthCheckedAll = false + this.monthIsIndeterminate = false + this.monthWeekdayCheckedAll = false + this.monthWeekdayIsIndeterminate = false }, timeConfigTypeChange (val) { if (val === 'customize') { @@ -411,52 +429,54 @@ export default { this.blockOperation.save = true this.$refs.userForm.validate((valid) => { - let startTime = '' - let endTime = '' - let schedulerStart = '' - let schedulerEnd = '' - if (this.editObject.config && this.editObject.config.startTime) { - startTime = getMillisecond(this.editObject.config.startTime) - } - if (this.editObject.config && this.editObject.config.endTime) { - endTime = getMillisecond(this.editObject.config.endTime) - } - if (this.editObject.config && this.editObject.config.schedulerConfig) { - if (['day', 'week', 'month'].indexOf(this.editObject.config.schedulerConfig.type) > -1) { - this.editObject.config.isRepeat = 1 - } else { - this.editObject.config.isRepeat = 0 - } - } - if (this.editObject.schedulerStart) { - schedulerStart = getMillisecond(this.editObject.schedulerStart) - } - if (this.editObject.schedulerEnd) { - schedulerEnd = getMillisecond(this.editObject.schedulerEnd) - } - - const copyObject = _.cloneDeep(this.editObject) - if (startTime) { - copyObject.config.startTime = startTime - } - if (endTime) { - copyObject.config.endTime = endTime - } - if (schedulerStart) { - copyObject.schedulerStart = schedulerStart - } - if (schedulerEnd) { - copyObject.schedulerEnd = schedulerEnd - } - if (this.categoryParams.length > 0) { - const queryParam = {} - this.categoryParams.forEach(p => { - queryParam[p.key] = p.value - }) - copyObject.config.queryParam = queryParam - } - copyObject.config = JSON.stringify(copyObject.config) if (valid) { + let startTime = '' + let endTime = '' + let schedulerStart = '' + let schedulerEnd = '' + if (this.editObject.config && this.editObject.config.startTime) { + startTime = getMillisecond(this.editObject.config.startTime) + } + if (this.editObject.config && this.editObject.config.endTime) { + endTime = getMillisecond(this.editObject.config.endTime) + } + if (this.editObject.config && this.editObject.config.schedulerConfig) { + if (['day', 'week', 'month'].indexOf(this.editObject.config.schedulerConfig.type) > -1) { + this.editObject.config.isRepeat = 1 + } else { + this.editObject.config.isRepeat = 0 + } + } + if (this.editObject.schedulerStart) { + schedulerStart = getMillisecond(this.editObject.schedulerStart) + } + if (this.editObject.schedulerEnd) { + schedulerEnd = getMillisecond(this.editObject.schedulerEnd) + } + + const copyObject = _.cloneDeep(this.editObject) + if (startTime) { + copyObject.config.startTime = startTime + } + if (endTime) { + copyObject.config.endTime = endTime + } + if (schedulerStart) { + copyObject.schedulerStart = schedulerStart + } + if (schedulerEnd) { + copyObject.schedulerEnd = schedulerEnd + } + if (this.categoryParams.length > 0) { + const queryParam = {} + this.categoryParams.forEach(p => { + queryParam[p.key] = p.value + }) + copyObject.config.queryParam = queryParam + } + copyObject.config = JSON.stringify(copyObject.config) + + if (copyObject.id) { put(this.url, copyObject).then(res => { this.blockOperation.save = false diff --git a/src/components/rightBox/report/reportTestBox.vue b/src/components/rightBox/report/reportTestBox.vue deleted file mode 100644 index bb4ff39f..00000000 --- a/src/components/rightBox/report/reportTestBox.vue +++ /dev/null @@ -1,479 +0,0 @@ - - - - {{editObject.id ? $t('report.editBuiltin') : $t('report.createBuiltin')}} - - - - - - - - - - - - - - - - - - - - { this.$forceUpdate() }"> - - - - - - - - - - - { this.$forceUpdate() }"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{$t('report.daily')}} - {{$t('report.weekly')}} - {{$t('report.perMonth')}} - {{$t('report.single')}} - - - {{$t('report.customEvery')}} - - {{$t('report.day')}} - - - - {{$t('report.customEvery')}} - - {{$t('report.week')}} - - - - - - - - {{$t('report.date')}} - {{$t('report.week')}} - - - - {{$t('report.customEvery')}} - - {{$t('report.moon')}} - - - - - - - checkboxChange(val, item)" /> - - - *一月,三月,五月,七月,八月,十月和12月含31天;闰年二月含29天* - - - - {{$t('report.custom')}} - - - - - - - - - {{$t('report.customEvery')}} - - {{$t('report.moon')}} - - - { this.$forceUpdate() }"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { this.$forceUpdate() }"> - - - - - - - - - - - - -