From bb7ef889372af9ef1619788efdaac2e72d08411c Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 15 Sep 2021 16:59:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A0=86=E5=8F=A0=E9=A1=B9=E4=B8=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/drag-item/ChartDragItem.vue | 61 ++++++++++++++++++- frontend/src/views/chart/view/ChartEdit.vue | 6 ++ 2 files changed, 66 insertions(+), 1 deletion(-) 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' }