mirror of
https://github.com/dataease/dataease.git
synced 2026-05-24 06:18:10 +08:00
perf(仪表板-日期范围过滤器): 优化时分秒精度设置
This commit is contained in:
@@ -230,8 +230,9 @@ export default {
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
start = timeSection(start, 'datetime', this.labelFormat)[0]
|
||||
end = timeSection(end, 'datetime', this.labelFormat)[1]
|
||||
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
@@ -264,9 +265,6 @@ export default {
|
||||
.coustom-date-picker {
|
||||
border:1px solid var(--BrDateColor, #dfe4ed) !important;
|
||||
background: var(--BgDateColor, #FFFFFF) !important;
|
||||
// .popper__arrow::after{
|
||||
// border-bottom-color: var(--BgDateColor, #FFFFFF) !important;
|
||||
// }
|
||||
|
||||
.popper__arrow,
|
||||
.popper__arrow::after {
|
||||
|
||||
@@ -269,23 +269,24 @@ class TimeDateRangeServiceImpl extends WidgetService {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
const componentType = element.options.attrs.showTime ? 'datetimerange' : 'daterange'
|
||||
let labelFormat = 'yyyy-MM-dd'
|
||||
if (element.options.attrs.showTime && element.options.attrs.accuracy) {
|
||||
labelFormat = labelFormat + ' ' + element.options.attrs.accuracy
|
||||
}
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
|
||||
start = timeSection(start, 'datetime', labelFormat)[0]
|
||||
end = timeSection(end, 'datetime', labelFormat)[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
const componentType = element.options.attrs.showTime ? 'datetimerange' : 'daterange'
|
||||
let labelFormat = 'yyyy-MM-dd'
|
||||
if (element.options.attrs.showTime && element.options.attrs.accuracy) {
|
||||
labelFormat = labelFormat + ' ' + element.options.attrs.accuracy
|
||||
}
|
||||
|
||||
return timeSection(parseFloat(value), componentType || element.options.attrs.type, labelFormat)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user