diff --git a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue index 0b5ba92f6f..400fadab32 100644 --- a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue +++ b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue @@ -49,7 +49,45 @@ - + + + + + + + {{ $t('chart.dateStyle') }} + ({{ $t('chart.'+item.dateStyle) }}) + + + + + {{ $t('chart.y') }} + {{ $t('chart.y_M') }} + {{ $t('chart.y_M_d') }} + {{ $t('chart.H_m_s') }} + {{ $t('chart.y_M_d_H_m') }} + {{ $t('chart.y_M_d_H_m_s') }} + + + + + + + + + {{ $t('chart.datePattern') }} + ({{ $t('chart.'+item.datePattern) }}) + + + + + {{ $t('chart.date_sub') }}(1990-01-01) + {{ $t('chart.date_split') }}(1990/01/01) + + + + + @@ -143,6 +181,27 @@ export default { removeItem() { this.item.index = this.index this.$emit('onItemRemove', this.item) + }, + + dateStyle(param) { + // console.log(param) + this.item.dateStyle = param.type + this.$emit('onItemChange', this.item) + }, + beforeDateStyle(type) { + return { + type: type + } + }, + datePattern(param) { + // console.log(param) + this.item.datePattern = param.type + this.$emit('onItemChange', this.item) + }, + beforeDatePattern(type) { + return { + type: type + } } } } diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index b43817bd9a..37773650d7 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -949,6 +949,12 @@ export default { }) } view.extStack.forEach(function(ele) { + if (!ele.dateStyle || ele.dateStyle === '') { + ele.dateStyle = 'y_M_d' + } + if (!ele.datePattern || ele.datePattern === '') { + ele.datePattern = 'date_sub' + } if (!ele.sort || ele.sort === '') { ele.sort = 'none' }