From 01b55d7e82c3b13554a412e9c5be0fc96a4906a3 Mon Sep 17 00:00:00 2001 From: li-guang <153605324@qq.com> Date: Tue, 05 Jan 2021 18:22:04 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/jyyforjava/hive-app --- hive-app/components/bory-dateTimePicker/bory-dateTimePicker.vue | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/hive-app/components/bory-dateTimePicker/bory-dateTimePicker.vue b/hive-app/components/bory-dateTimePicker/bory-dateTimePicker.vue index d315f6d..8c6643c 100644 --- a/hive-app/components/bory-dateTimePicker/bory-dateTimePicker.vue +++ b/hive-app/components/bory-dateTimePicker/bory-dateTimePicker.vue @@ -103,7 +103,15 @@ indicatorStyle: { type: Object, default: null - } + }, + startDate: { + type: String, + default: '' + }, + endDate: { + type: String, + default: '' + }, }, data() { return { @@ -126,13 +134,30 @@ }, computed: { years() { - return this.initTimeData(this.endYear, this.startYear); + let startYear = this.startYear; + let endYear = this.endYear; + if(this.startDate){ + if(this.startDate.indexOf('-')>-1){ + startYear = this.startDate.split('-')[0] + }else{ + startYear = this.startDate + } + } + return this.initTimeData(endYear, startYear); }, isShowYear() { return this.type !== 'time' && this.type !== 'hour-minute'; }, months() { - return this.initTimeData(12, 1); + let startMonth = 1; + let endMonth = 12; + if(this.isShowMonth && this.startDate){ + let arr = this.startDate.split('-'); + if(arr.length>1 && arr[0] <= this.years[this.years.length-1]){ + startMonth = Number(arr[1]) + } + } + return this.initTimeData(endMonth, startMonth); }, isShowMonth() { return this.type !== 'year' && this.type !== 'time' && this.type !== 'hour-minute'; @@ -367,7 +392,7 @@ display: flex; align-items: center; justify-content: space-between; - font-size: 28rpx; + font-size: 14px; .cancel-btn { padding: 0 28rpx; @@ -377,7 +402,7 @@ .tool-title { font-weight: 500; - font-size: 16px; + font-size: 15px; max-width: 50%; overflow: hidden; white-space: nowrap; @@ -396,7 +421,7 @@ flex: 1; .item { - font-size: 34rpx; + font-size: 14px; display: flex; align-items: center; justify-content: center; -- Gitblit v1.9.1