perf(仪表板-日期范围过滤器): 允许选择同一天

This commit is contained in:
fit2cloud-chenyw 2022-08-05 04:33:13 -04:00
parent db331f7cdd
commit fc38bef5d1

View File

@ -179,7 +179,18 @@ export default {
}
},
computed: {
isOneDay() {
const isDynamicDay = this.element.options.attrs.default.isDynamic &&
this.element.options.attrs.default.dkey === 4 &&
this.element.options.attrs.default.eDynamicInfill &&
this.element.options.attrs.default.eDynamicInfill === 'day'
if (isDynamicDay) {
const widget = ApplicationContext.getService(this.element.serviceName)
const time = widget.dynamicDateFormNow(this.element)
return isDynamicDay && time[1] === time[0]
}
return false
},
isTimeWidget() {
const widget = ApplicationContext.getService(this.element.serviceName)
return widget.isTimeWidget && widget.isTimeWidget()
@ -234,7 +245,7 @@ export default {
const widget = ApplicationContext.getService(this.element.serviceName)
const time = widget.dynamicDateFormNow(this.element)
this.dval = time
bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0]))
bus.$emit('valid-values-change', (!time || time.length === 0 || time[1] > time[0] || this.isOneDay))
this.element.options.manualModify = false
}
}