Merge pull request #8318 from dataease/pr@dev@refactor_drill_date

refactor(视图): 日期字段下钻支持设置格式
This commit is contained in:
Junjun 2024-03-04 18:26:00 +08:00 committed by GitHub
commit ad46a547e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2689,6 +2689,14 @@ export default {
view.type === 'table-pivot') {
view.drillFields = []
}
view.drillFields.forEach(ele => {
if (!ele.dateStyle || ele.dateStyle === '') {
ele.dateStyle = 'y_M_d'
}
if (!ele.datePattern || ele.datePattern === '') {
ele.datePattern = 'date_sub'
}
})
this.chart = JSON.parse(JSON.stringify(view))
this.view = JSON.parse(JSON.stringify(view))
// stringify json param