li-guang
2021-01-05 01b55d7e82c3b13554a412e9c5be0fc96a4906a3
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;