diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue
index f67a1c34..8d0e9d63 100644
--- a/src/components/rightBox/report/ReportBox.vue
+++ b/src/components/rightBox/report/ReportBox.vue
@@ -22,7 +22,9 @@
:disabled="!!editObject.id"
placeholder=""
popper-class="right-box-select-dropdown right-box-select-report "
- size="small">
+ size="small"
+ @change="timeConfigTypeChange"
+ >
@@ -44,7 +46,7 @@
-
+
@@ -108,7 +110,7 @@
{{$t('report.customEvery')}}
-
+
{{$t('report.day')}}
@@ -321,6 +323,19 @@ export default {
scheduleChecked (n) {
this.editObject.config.isScheduler = n ? 1 : 0
},
+ 'editObject.config.schedulerConfig.interval': {
+ handler (n) {
+ if (!_.isNumber(n)) {
+ if (n) {
+ if (!_.isNumber(parseInt(n)) || _.isNaN(parseInt(n))) {
+ this.editObject.config.schedulerConfig.interval = 1
+ } else {
+ this.editObject.config.schedulerConfig.interval = parseInt(n)
+ }
+ }
+ }
+ }
+ },
'editObject.categoryId': {
handler (n) {
const category = this.categoryList.find(c => c.id === n)
@@ -339,9 +354,21 @@ export default {
handler (n) {
this.editObject = JSON.parse(JSON.stringify(n))
this.scheduleChecked = this.editObject.config.isScheduler === 1
- if (n.config.schedulerConfig && n.config.schedulerConfig.type) {
- this.scheduleType = n.config.schedulerConfig.type
+ if (n.config.schedulerConfig) {
+ if (n.config.schedulerConfig.type) {
+ this.scheduleType = n.config.schedulerConfig.type
+ // 初始化每月下面的tab、循环
+ if (this.scheduleType === 'month') {
+ if (n.config.schedulerConfig.monthDates && n.config.schedulerConfig.monthDates.length > 0) {
+ this.monthScheduleType = 'daily'
+ } else if (n.config.schedulerConfig.monthDates && n.config.schedulerConfig.weekDates.length > 0) {
+ this.monthScheduleType = 'weekly'
+ }
+ this.monthIsCycle = !(n.config.schedulerConfig.months && n.config.schedulerConfig.months.length > 0)
+ }
+ }
}
+
if (n.schedulerStart) {
this.editObject.schedulerStart = dateFormat(this.editObject.schedulerStart, this.dateFormat)
}
@@ -376,6 +403,11 @@ export default {
},
typeChange (id) {
+ },
+ timeConfigTypeChange (val) {
+ if (val === 'customize') {
+ this.scheduleChecked = false
+ }
},
save () {
if (this.blockOperation.save) { return }
@@ -392,6 +424,13 @@ export default {
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)
}