环保
This commit is contained in:
		| @@ -221,18 +221,30 @@ export default { | ||||
|     timeSelect() { | ||||
|       switch (this.queryParams.timeDim) { | ||||
|         case '1': | ||||
|           if (!this.timeValue) { | ||||
|             this.$modal.msgError('时间范围不能为空') | ||||
|             return false | ||||
|           } | ||||
|           if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) { | ||||
|             this.$modal.msgError('最大时间范围为7天,请重新选择') | ||||
|             this.timeValue = [] | ||||
|           } | ||||
|           break | ||||
|         case '2': | ||||
|           if (!this.dateValue) { | ||||
|             this.$modal.msgError('时间范围不能为空') | ||||
|             return false | ||||
|           } | ||||
|           if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) { | ||||
|             this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59 | ||||
|             this.dateValue = [] | ||||
|           } | ||||
|           break | ||||
|         case '4': | ||||
|           if (!this.monthValue) { | ||||
|             this.$modal.msgError('时间范围不能为空') | ||||
|             return false | ||||
|           } | ||||
|           if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) { | ||||
|             this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面 | ||||
|             this.monthValue = [] | ||||
| @@ -338,7 +350,7 @@ export default { | ||||
|       } | ||||
|       switch (this.queryParams.timeDim) { | ||||
|         case '1': | ||||
|           if (this.timeValue.length > 0) { | ||||
|           if (this.timeValue && this.timeValue.length > 0) { | ||||
|             this.queryParams.startTime = this.timeValue[0] | ||||
|             this.queryParams.endTime = this.timeValue[1] // 不用转 | ||||
|           } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user