From df1461862134090f12831f04c85d9286b7dfc53c Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 19 May 2020 10:05:05 +0800 Subject: [PATCH] =?UTF-8?q?js=20=E9=87=8C=E7=9A=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20computed=20=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=20=E4=B8=8D=E8=83=BD=E6=94=BE=E5=9C=A8=20data=20?= =?UTF-8?q?=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/MsTestHeatmap.vue | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/frontend/src/business/components/common/components/MsTestHeatmap.vue b/frontend/src/business/components/common/components/MsTestHeatmap.vue index fd5e92178..df843f1e7 100644 --- a/frontend/src/business/components/common/components/MsTestHeatmap.vue +++ b/frontend/src/business/components/common/components/MsTestHeatmap.vue @@ -16,46 +16,45 @@ data() { return { endDate: new Date(), - unit: 'tests', colorRange: ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127'], - locale: { - // 一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月 - months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - // 星期日 Sun. 星期一 Mon. 星期二 Tues. 星期三 Wed. 星期四 Thur. 星期五 Fri. 星期六 Sat. - days: ['Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'], + } + }, + computed: { + locale() { + return { + months: [ + this.$t('commons.months_1'), + this.$t('commons.months_2'), + this.$t('commons.months_3'), + this.$t('commons.months_4'), + this.$t('commons.months_5'), + this.$t('commons.months_6'), + this.$t('commons.months_7'), + this.$t('commons.months_8'), + this.$t('commons.months_9'), + this.$t('commons.months_10'), + this.$t('commons.months_11'), + this.$t('commons.months_12') + ], + days: [ + this.$t('commons.weeks_0'), + this.$t('commons.weeks_1'), + this.$t('commons.weeks_2'), + this.$t('commons.weeks_3'), + this.$t('commons.weeks_4'), + this.$t('commons.weeks_5'), + this.$t('commons.weeks_6') + ], No: 'No', on: ',', less: 'Less', more: 'More' - }, + } + }, + unit() { + return this.$t('commons.test_unit') } }, - mounted() { - this.locale.months = [ - this.$t('commons.months_1'), - this.$t('commons.months_2'), - this.$t('commons.months_3'), - this.$t('commons.months_4'), - this.$t('commons.months_5'), - this.$t('commons.months_6'), - this.$t('commons.months_7'), - this.$t('commons.months_8'), - this.$t('commons.months_9'), - this.$t('commons.months_10'), - this.$t('commons.months_11'), - this.$t('commons.months_12') - ]; - this.locale.days = [ - this.$t('commons.weeks_0'), - this.$t('commons.weeks_1'), - this.$t('commons.weeks_2'), - this.$t('commons.weeks_3'), - this.$t('commons.weeks_4'), - this.$t('commons.weeks_5'), - this.$t('commons.weeks_6') - ]; - this.unit = this.$t('commons.test_unit') - } } -- GitLab