forked from github/dataease
feat(仪表板-日期范围过滤器): 增加时分秒精度设置
This commit is contained in:
parent
75e38914d5
commit
cd253983bb
@ -89,7 +89,7 @@ export default {
|
||||
componentType() {
|
||||
let result = this.element.options.attrs.type || 'date'
|
||||
if (this.isTimeWidget && this.element.options.attrs.showTime) {
|
||||
result = 'datetime'
|
||||
result = this.element.serviceName === 'timeDateWidget' ? 'datetime' : 'datetimerange'
|
||||
}
|
||||
return result
|
||||
},
|
||||
|
@ -29,7 +29,9 @@ const dialogPanel = {
|
||||
eDynamicPrefix: 1,
|
||||
eDynamicInfill: 'day',
|
||||
eDynamicSuffix: 'after'
|
||||
}
|
||||
},
|
||||
showTime: false,
|
||||
accuracy: 'HH:mm'
|
||||
},
|
||||
value: '',
|
||||
manualModify: false
|
||||
@ -279,8 +281,17 @@ class TimeDateRangeServiceImpl extends WidgetService {
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(parseFloat(value), element.options.attrs.type)
|
||||
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)
|
||||
}
|
||||
}
|
||||
isTimeWidget() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
const timeDateRangeServiceImpl = new TimeDateRangeServiceImpl()
|
||||
|
Loading…
Reference in New Issue
Block a user