@kyfe/hroa-ui 1.0.6 → 1.0.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hroa-ui.common.js +2344 -2381
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +2344 -2381
- package/dist/hroa-ui.umd.min.js +2 -2
- package/lib/h5-iaa/hr-assistant-profile/demo/index.css +1 -0
- package/lib/h5-iaa/hr-assistant-profile/demo/index.js +1 -0
- package/lib/hr-add-list/index.js +1 -1
- package/lib/hr-bottom-button/index.js +1 -1
- package/lib/hr-breadcrumb/index.js +2 -2
- package/lib/hr-button/index.js +1 -1
- package/lib/hr-checkbox/index.js +1 -1
- package/lib/hr-checkbox-group/index.js +1 -1
- package/lib/hr-clipboard/index.js +1 -1
- package/lib/hr-collapse-card/index.js +1 -1
- package/lib/hr-condition-filtrate/index.js +1 -1
- package/lib/hr-condition-filtrate-popup/index.js +1 -1
- package/lib/hr-date-filter/index.css +1 -1
- package/lib/hr-date-filter/index.js +1 -1
- package/lib/hr-dropdown-date/index.css +1 -1
- package/lib/hr-dropdown-date/index.js +1 -1
- package/lib/hr-elasticity-box/index.js +1 -1
- package/lib/hr-elasticity-box-item/index.js +1 -1
- package/lib/hr-emotional-picture/index.js +1 -1
- package/lib/hr-employee-choose/index.js +1 -1
- package/lib/hr-file-list/index.js +1 -1
- package/lib/hr-full-screen/index.js +1 -1
- package/lib/hr-img-list/index.css +1 -1
- package/lib/hr-img-list/index.js +1 -1
- package/lib/hr-info-card/index.js +1 -1
- package/lib/hr-information/index.js +1 -1
- package/lib/hr-license-plate-number/index.js +1 -1
- package/lib/hr-module-card/index.js +1 -1
- package/lib/hr-multiterm-choose/index.css +1 -1
- package/lib/hr-multiterm-choose/index.js +1 -1
- package/lib/hr-no-data/index.js +1 -1
- package/lib/hr-notice-bar/index.js +1 -1
- package/lib/hr-notification-dialog/index.js +1 -1
- package/lib/hr-open-ks/index.js +1 -1
- package/lib/hr-pager/index.js +1 -1
- package/lib/hr-popup/index.js +1 -1
- package/lib/hr-preview-file/index.js +1 -1
- package/lib/hr-radiobox/index.js +1 -1
- package/lib/hr-radiobox-group/index.js +1 -1
- package/lib/hr-rate/index.js +1 -1
- package/lib/hr-reason-textarea/index.js +1 -1
- package/lib/hr-search-input/index.js +1 -1
- package/lib/hr-search-tips/index.js +2 -2
- package/lib/hr-select/index.js +1 -1
- package/lib/hr-select-list/index.js +2 -2
- package/lib/hr-single-choose/index.css +1 -1
- package/lib/hr-single-choose/index.js +1 -1
- package/lib/hr-slide-pager/index.js +1 -1
- package/lib/hr-sort/index.js +1 -1
- package/lib/hr-stack-image/index.js +1 -1
- package/lib/hr-tab-nav/index.js +1 -1
- package/lib/hr-time-picker/index.js +1 -1
- package/lib/hr-view-item/index.js +1 -1
- package/lib/hr-virtual-list/index.js +1 -1
- package/lib/index/index.css +1 -1
- package/lib/index/index.js +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +82 -71
- package/lib/getJsModule/index.css +0 -1
- package/lib/getJsModule/index.js +0 -9
- package/packages/getJsModule.js +0 -11
- package/packages/hr-add-list/image/add.svg +0 -1
- package/packages/hr-add-list/image/close.svg +0 -1
- package/packages/hr-add-list/index.js +0 -7
- package/packages/hr-add-list/src/index.vue +0 -125
- package/packages/hr-add-list//346/226/260/345/242/236/345/244/232/347/254/224/346/225/260/346/215/256.md +0 -0
- package/packages/hr-bottom-button/index.js +0 -7
- package/packages/hr-bottom-button/src/index.vue +0 -128
- package/packages/hr-breadcrumb/index.js +0 -3
- package/packages/hr-breadcrumb/src/index.vue +0 -87
- package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
- package/packages/hr-button/index.js +0 -13
- package/packages/hr-button/src/hr-button.vue +0 -39
- package/packages/hr-checkbox/index.js +0 -8
- package/packages/hr-checkbox/src/active-icon.png +0 -0
- package/packages/hr-checkbox/src/checkbox-group.vue +0 -74
- package/packages/hr-checkbox/src/checkbox.vue +0 -226
- package/packages/hr-checkbox/src/data.js +0 -46
- package/packages/hr-checkbox//345/244/215/351/200/211/346/241/206-/345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-checkbox-group/index.js +0 -8
- package/packages/hr-clipboard/index.js +0 -8
- package/packages/hr-clipboard/src/index.vue +0 -46
- package/packages/hr-clipboard/src/util.js +0 -9
- package/packages/hr-collapse-card/index.js +0 -3
- package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
- package/packages/hr-collapse-card/src/index.vue +0 -151
- package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
- package/packages/hr-condition-filtrate/enum/index.js +0 -11
- package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
- package/packages/hr-condition-filtrate/index.js +0 -7
- package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
- package/packages/hr-condition-filtrate/src/index.vue +0 -246
- package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
- package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
- package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
- package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
- package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
- package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
- package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
- package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
- package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
- package/packages/hr-condition-filtrate-popup/index.js +0 -7
- package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
- package/packages/hr-date-filter/index.js +0 -7
- package/packages/hr-date-filter/src/date-select.vue +0 -153
- package/packages/hr-date-filter/src/index.vue +0 -243
- package/packages/hr-date-filter/src/style.less +0 -130
- package/packages/hr-date-filter/src/utils.js +0 -109
- package/packages/hr-dropdown-date/index.js +0 -7
- package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
- package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
- package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
- package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
- package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
- package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
- package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
- package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
- package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
- package/packages/hr-dropdown-date/src/index.vue +0 -482
- package/packages/hr-dropdown-date/src/week.js +0 -194
- package/packages/hr-elasticity-box/index.js +0 -7
- package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
- package/packages/hr-elasticity-box/src/index.vue +0 -52
- package/packages/hr-elasticity-box-item/index.js +0 -7
- package/packages/hr-emotional-picture/index.js +0 -7
- package/packages/hr-emotional-picture/src/index.vue +0 -66
- package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
- package/packages/hr-employee-choose/index.js +0 -7
- package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
- package/packages/hr-employee-choose/src/index.vue +0 -119
- package/packages/hr-file-list/index.js +0 -3
- package/packages/hr-file-list/src/file-type/other.vue +0 -45
- package/packages/hr-file-list/src/file-type/picture.vue +0 -38
- package/packages/hr-file-list/src/file-type/video.vue +0 -60
- package/packages/hr-file-list/src/index.vue +0 -246
- package/packages/hr-file-list/src/utils/enum.js +0 -95
- package/packages/hr-file-list/src/utils/fun.js +0 -16
- package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
- package/packages/hr-full-screen/index.js +0 -7
- package/packages/hr-full-screen/src/index.vue +0 -117
- package/packages/hr-img-list/index.js +0 -3
- package/packages/hr-img-list/src/index.vue +0 -144
- package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
- package/packages/hr-info-card/index.js +0 -7
- package/packages/hr-info-card/src/index.vue +0 -67
- package/packages/hr-information/index.js +0 -7
- package/packages/hr-information/src/index.vue +0 -72
- package/packages/hr-license-plate-number/index.js +0 -8
- package/packages/hr-license-plate-number/src/enum.js +0 -44
- package/packages/hr-license-plate-number/src/index.vue +0 -164
- package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
- package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
- package/packages/hr-module-card/index.js +0 -13
- package/packages/hr-module-card/src/index.vue +0 -132
- package/packages/hr-module-card//346/250/241/345/235/227/345/215/241/347/211/207/347/273/204/344/273/266.md +0 -29
- package/packages/hr-multiterm-choose/index.js +0 -8
- package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
- package/packages/hr-multiterm-choose/src/index.vue +0 -224
- package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
- package/packages/hr-no-data/index.js +0 -7
- package/packages/hr-no-data/src/index.vue +0 -48
- package/packages/hr-notice-bar/index.js +0 -7
- package/packages/hr-notice-bar/src/bem.js +0 -38
- package/packages/hr-notice-bar/src/index.js +0 -52
- package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
- package/packages/hr-notification-dialog/images/header.png +0 -0
- package/packages/hr-notification-dialog/index.js +0 -7
- package/packages/hr-notification-dialog/src/index.vue +0 -293
- package/packages/hr-notification-dialog//345/274/271/347/252/227/346/217/220/347/244/272/347/273/204/344/273/266.md +0 -0
- package/packages/hr-open-ks/index.js +0 -7
- package/packages/hr-open-ks/src/icon.png +0 -0
- package/packages/hr-open-ks/src/index.vue +0 -97
- package/packages/hr-open-ks/src/util.js +0 -31
- package/packages/hr-pager/images/next-page.png +0 -0
- package/packages/hr-pager/images/prev-page.png +0 -0
- package/packages/hr-pager/index.js +0 -7
- package/packages/hr-pager/src/index.vue +0 -120
- package/packages/hr-pager//346/214/211/351/222/256/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
- package/packages/hr-popup/index.js +0 -3
- package/packages/hr-popup/src/index.vue +0 -64
- package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/packages/hr-preview-file/index.js +0 -7
- package/packages/hr-preview-file/src/index.vue +0 -58
- package/packages/hr-preview-file/src/util.js +0 -50
- package/packages/hr-radiobox/index.js +0 -8
- package/packages/hr-radiobox/src/data.js +0 -46
- package/packages/hr-radiobox/src/radiobox-group.vue +0 -64
- package/packages/hr-radiobox/src/radiobox.vue +0 -191
- package/packages/hr-radiobox-group/index.js +0 -8
- package/packages/hr-rate/index.js +0 -7
- package/packages/hr-rate/src/index.vue +0 -42
- package/packages/hr-rate//350/257/204/345/210/206/347/273/204/344/273/266/357/274/210/345/270/246/346/226/207/346/241/210/357/274/211.md +0 -0
- package/packages/hr-reason-textarea/index.js +0 -7
- package/packages/hr-reason-textarea/src/index.vue +0 -128
- package/packages/hr-search-input/image/input-close-icon.png +0 -0
- package/packages/hr-search-input/image/search-icon.png +0 -0
- package/packages/hr-search-input/index.js +0 -8
- package/packages/hr-search-input/src/index.vue +0 -144
- package/packages/hr-search-tips/index.js +0 -3
- package/packages/hr-search-tips/src/index.vue +0 -213
- package/packages/hr-search-tips//350/277/234/347/250/213/346/250/241/347/263/212/346/220/234/347/264/242.md +0 -0
- package/packages/hr-select/index.js +0 -7
- package/packages/hr-select/src/index.vue +0 -41
- package/packages/hr-select-list/index.js +0 -3
- package/packages/hr-select-list/src/index.vue +0 -214
- package/packages/hr-select-list//344/270/213/346/213/211/351/200/211/346/213/251(/351/273/230/350/256/244/345/244/232/351/200/211).md +0 -0
- package/packages/hr-single-choose/index.js +0 -8
- package/packages/hr-single-choose/src/index.vue +0 -195
- package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
- package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
- package/packages/hr-slide-pager/guide/index.vue +0 -59
- package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
- package/packages/hr-slide-pager/index.js +0 -7
- package/packages/hr-slide-pager/src/index.vue +0 -374
- package/packages/hr-slide-pager//346/273/221/345/212/250/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
- package/packages/hr-sort/index.js +0 -3
- package/packages/hr-sort/src/main.vue +0 -133
- package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
- package/packages/hr-stack-image/index.js +0 -3
- package/packages/hr-stack-image/src/main.vue +0 -77
- package/packages/hr-stack-image//345/261/202/345/217/240/345/233/276/347/211/207/347/273/204/344/273/266.md +0 -0
- package/packages/hr-tab-nav/index.js +0 -8
- package/packages/hr-tab-nav/src/index.vue +0 -190
- package/packages/hr-time-picker/index.js +0 -3
- package/packages/hr-time-picker/src/index.vue +0 -85
- package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
- package/packages/hr-view-item/index.js +0 -13
- package/packages/hr-view-item/src/index.vue +0 -89
- package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
- package/packages/hr-virtual-list/index.js +0 -7
- package/packages/hr-virtual-list/src/cc-item.vue +0 -105
- package/packages/hr-virtual-list/src/index.vue +0 -227
- package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
- package/packages/index.js +0 -23
- package/packages/utils/directive/common.js +0 -0
- package/packages/utils/directive/index.js +0 -2
- package/packages/utils/directive/specific.js +0 -54
- package/packages/utils/index.js +0 -7
- package/packages/utils/tool/common.js +0 -65
- package/packages/utils/tool/index.js +0 -2
- package/packages/utils/tool/specific.js +0 -0
|
@@ -1,485 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="wh_container">
|
|
3
|
-
<div class="wh_content_all">
|
|
4
|
-
<!-- 月份切换栏 -->
|
|
5
|
-
<div class="wh_top_changge">
|
|
6
|
-
<li>
|
|
7
|
-
<slot name="left"></slot>
|
|
8
|
-
</li>
|
|
9
|
-
<li @click="PreMonth(myDate,false)"
|
|
10
|
-
class="pre-warp">
|
|
11
|
-
<div class="wh_jiantou1">
|
|
12
|
-
</div>
|
|
13
|
-
</li>
|
|
14
|
-
<li class="wh_content_li">{{dateTop}}</li>
|
|
15
|
-
<li @click="NextMonth(myDate,false)"
|
|
16
|
-
class="next-warp">
|
|
17
|
-
<div class="wh_jiantou2"></div>
|
|
18
|
-
</li>
|
|
19
|
-
<li>
|
|
20
|
-
<slot name="right"></slot>
|
|
21
|
-
</li>
|
|
22
|
-
</div>
|
|
23
|
-
<!-- 星期指示栏 -->
|
|
24
|
-
<div class="wh_content">
|
|
25
|
-
<div class="wh_content_item wh_content_item-header"
|
|
26
|
-
v-for="tag in textTop"
|
|
27
|
-
:key="tag">
|
|
28
|
-
<div class="wh_top_tag">{{tag}}</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<!-- 日期容器 -->
|
|
32
|
-
<div class="wh_content">
|
|
33
|
-
<div class="wh_content_item wh_content_item-content"
|
|
34
|
-
v-for="(item,index) in list"
|
|
35
|
-
:key="item"
|
|
36
|
-
:class="{'is-week':isWeekClass(item),'is-before-half-week':isHalfWeekClass('1',item),'is-after-half-week':isHalfWeekClass('2',item)}"
|
|
37
|
-
@click="clickDay(item,index)">
|
|
38
|
-
<div class="wh_item_date"
|
|
39
|
-
v-bind:class="[{ wh_isMark: item.isMark},{wh_other_dayhide:item.otherMonth!=='nowMonth' || disableCheck(item.date)},{wh_want_dayhide:item.dayHide},{wh_isToday:item.isToday},{wh_chose_day:item.chooseDay}]">
|
|
40
|
-
<p class="wh_item_date_h1">{{item.id}}</p>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</section>
|
|
46
|
-
</template>
|
|
47
|
-
<script>
|
|
48
|
-
import timeUtil from "./calendar.js";
|
|
49
|
-
import { getWeekRange, getDayForMill } from '../week.js'
|
|
50
|
-
|
|
51
|
-
export default {
|
|
52
|
-
data () {
|
|
53
|
-
return {
|
|
54
|
-
myDate: new Date(),
|
|
55
|
-
list: [],
|
|
56
|
-
dateTop: '',
|
|
57
|
-
minStartTimestamp: null,
|
|
58
|
-
maxStartTimestamp: null,
|
|
59
|
-
minEndTimestamp: null,
|
|
60
|
-
maxEndTimestamp: null,
|
|
61
|
-
dayTimestamp: getDayForMill(1),
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
props: {
|
|
65
|
-
// 周选择器组件的时间范围
|
|
66
|
-
weekRange: {
|
|
67
|
-
type: Object
|
|
68
|
-
},
|
|
69
|
-
textTop: {
|
|
70
|
-
type: Array,
|
|
71
|
-
default: () => ["一", "二", "三", "四", "五", "六", "日"]
|
|
72
|
-
},
|
|
73
|
-
formatter: {
|
|
74
|
-
type: Function
|
|
75
|
-
},
|
|
76
|
-
agoDayHide: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: `0`
|
|
79
|
-
},
|
|
80
|
-
futureDayHide: {
|
|
81
|
-
type: String,
|
|
82
|
-
default: `2554387200`
|
|
83
|
-
},
|
|
84
|
-
// 是否为周选择器
|
|
85
|
-
isWeek: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: true
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
created () {
|
|
91
|
-
if (this.weekRange && this.weekRange.monday) {
|
|
92
|
-
this.myDate = new Date(this.weekRange.monday)
|
|
93
|
-
} else {
|
|
94
|
-
this.myDate = new Date(getWeekRange(new Date()).monday)
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
mounted () {
|
|
98
|
-
console.log('周选择器----------weekRange', this.weekRange)
|
|
99
|
-
this.getList(this.myDate, this.weekRange)
|
|
100
|
-
},
|
|
101
|
-
watch: {
|
|
102
|
-
// 监听时间变化做状态回显
|
|
103
|
-
weekRange () {
|
|
104
|
-
console.log('weekRange change!!')
|
|
105
|
-
this.setWeekRange(this.weekRange)
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
methods: {
|
|
109
|
-
/**
|
|
110
|
-
* 本周之后的时间禁用
|
|
111
|
-
*/
|
|
112
|
-
disableCheck (time) {
|
|
113
|
-
let week = getWeekRange(new Date())
|
|
114
|
-
let maxEndTimestamp = week.sunday
|
|
115
|
-
return (+new Date(time) > maxEndTimestamp)
|
|
116
|
-
},
|
|
117
|
-
/**
|
|
118
|
-
* @description 判断是否为选中日期的头尾
|
|
119
|
-
* @param { type } type 1头 2尾
|
|
120
|
-
* @param { Object } date 日历时间数据对象
|
|
121
|
-
* @returns { Boolean }
|
|
122
|
-
*/
|
|
123
|
-
isHalfWeekClass (type, date) {
|
|
124
|
-
if (!this.isWeek) return false
|
|
125
|
-
switch (type) {
|
|
126
|
-
case '1':
|
|
127
|
-
if (date.timestamp >= this.minStartTimestamp && date.timestamp <= this.maxStartTimestamp) return true
|
|
128
|
-
break
|
|
129
|
-
case '2':
|
|
130
|
-
if (date.timestamp >= this.minEndTimestamp && date.timestamp <= this.maxEndTimestamp) return true
|
|
131
|
-
break
|
|
132
|
-
default:
|
|
133
|
-
break
|
|
134
|
-
}
|
|
135
|
-
return false
|
|
136
|
-
},
|
|
137
|
-
/**
|
|
138
|
-
* @description 判断是否为选中的日期
|
|
139
|
-
* @param { Object } 日历时间数据对象
|
|
140
|
-
* @returns { Boolean }
|
|
141
|
-
*/
|
|
142
|
-
isWeekClass (date) {
|
|
143
|
-
if (!this.isWeek) return false
|
|
144
|
-
if (date.timestamp >= this.maxStartTimestamp && date.timestamp < this.minEndTimestamp) {
|
|
145
|
-
return true
|
|
146
|
-
}
|
|
147
|
-
return false
|
|
148
|
-
},
|
|
149
|
-
setClass (data) {
|
|
150
|
-
let obj = {};
|
|
151
|
-
obj[data.markClassName] = data.markClassName;
|
|
152
|
-
return obj;
|
|
153
|
-
},
|
|
154
|
-
clickDay (item) {
|
|
155
|
-
// 周选择器
|
|
156
|
-
if (this.isWeek) {
|
|
157
|
-
// 禁止选中当前之后的时间
|
|
158
|
-
let week = getWeekRange(new Date(item.date))
|
|
159
|
-
let _minStartTimestamp = week.monday
|
|
160
|
-
if (+new Date() < _minStartTimestamp) {
|
|
161
|
-
return false
|
|
162
|
-
}
|
|
163
|
-
// 根据选中的日期设置选中的周范围
|
|
164
|
-
this.setWeekRange(new Date(item.date))
|
|
165
|
-
this.$emit('confirm', {
|
|
166
|
-
monday: this.minStartTimestamp,
|
|
167
|
-
sunday: this.maxEndTimestamp
|
|
168
|
-
})
|
|
169
|
-
return
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
/**
|
|
173
|
-
* @description 获取上个月日历内容
|
|
174
|
-
*/
|
|
175
|
-
PreMonth () {
|
|
176
|
-
// 获取当前日期的上个月日期
|
|
177
|
-
this.myDate = timeUtil.getOtherMonth(this.myDate, 'preMonth')
|
|
178
|
-
this.getList(this.myDate)
|
|
179
|
-
},
|
|
180
|
-
/**
|
|
181
|
-
* @description 获取下个月日历内容
|
|
182
|
-
*/
|
|
183
|
-
NextMonth () {
|
|
184
|
-
// 获取当前日期的下个月日期
|
|
185
|
-
this.myDate = timeUtil.getOtherMonth(this.myDate, 'nextMonth')
|
|
186
|
-
this.getList(this.myDate)
|
|
187
|
-
},
|
|
188
|
-
/**
|
|
189
|
-
* @description 获取所选日期月份的所有日期
|
|
190
|
-
* @param { Date } date 所选日期的date对象
|
|
191
|
-
* @param { Object } dateRange 需要设置的选中范围
|
|
192
|
-
*/
|
|
193
|
-
async getList (date, dateRange = null) {
|
|
194
|
-
this.dateTop = `${date.getFullYear()}年${date.getMonth() + 1}月`
|
|
195
|
-
// 获取所选月份的所有日期
|
|
196
|
-
let arr = timeUtil.getMonthList(this.myDate)
|
|
197
|
-
for (let i = 0; i < arr.length; i++) {
|
|
198
|
-
let markClassName = ''
|
|
199
|
-
let k = arr[i]
|
|
200
|
-
if (typeof (this.formatter) === 'function') {
|
|
201
|
-
this.formatter(k)
|
|
202
|
-
}
|
|
203
|
-
k.chooseDay = false
|
|
204
|
-
const nowTime = k.date
|
|
205
|
-
const t = new Date(nowTime).getTime() / 1000
|
|
206
|
-
|
|
207
|
-
//标记选中某些天 设置class
|
|
208
|
-
k.markClassName = markClassName
|
|
209
|
-
k.isMark = false
|
|
210
|
-
//无法选中某天
|
|
211
|
-
k.dayHide = t < this.agoDayHide || t > this.futureDayHide
|
|
212
|
-
if (k.isToday) {
|
|
213
|
-
k.isToday = false
|
|
214
|
-
this.$emit("isToday", nowTime)
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
if (this.isWeek) {
|
|
218
|
-
// 如果有传入dateRange,则进行日期范围回显
|
|
219
|
-
if (dateRange) {
|
|
220
|
-
this.setWeekRange(dateRange)
|
|
221
|
-
}
|
|
222
|
-
this.list = arr
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
/**
|
|
226
|
-
* @description 根据选中的日期设置选中的周范围
|
|
227
|
-
* @param { Date, Object } date 查询的日期/需要选中回显的日期范围
|
|
228
|
-
*/
|
|
229
|
-
setWeekRange (date) {
|
|
230
|
-
if (typeof date === 'number') {
|
|
231
|
-
date = new Date(date)
|
|
232
|
-
}
|
|
233
|
-
if (date.monday && date.sunday) {
|
|
234
|
-
// 传入的date为指定的对象类型 则直接设置时间范围
|
|
235
|
-
this.minStartTimestamp = date.monday
|
|
236
|
-
this.maxStartTimestamp = date.monday + this.dayTimestamp - 1
|
|
237
|
-
this.minEndTimestamp = date.sunday - this.dayTimestamp + 1
|
|
238
|
-
this.maxEndTimestamp = date.sunday
|
|
239
|
-
} else {
|
|
240
|
-
let week = getWeekRange(date)
|
|
241
|
-
this.minStartTimestamp = week.monday
|
|
242
|
-
this.maxStartTimestamp = week.monday + this.dayTimestamp - 1
|
|
243
|
-
this.minEndTimestamp = week.sunday - this.dayTimestamp + 1
|
|
244
|
-
this.maxEndTimestamp = week.sunday
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
}
|
|
249
|
-
</script>
|
|
250
|
-
|
|
251
|
-
<style scoped lang="less">
|
|
252
|
-
@selectColor: #7972fe;
|
|
253
|
-
@dateHeaderHeight: 88px;
|
|
254
|
-
@itemDateHeight: 80px;
|
|
255
|
-
@isWeekColor: #ecebff;
|
|
256
|
-
|
|
257
|
-
.wh_container {
|
|
258
|
-
position: relative;
|
|
259
|
-
width: 750px;
|
|
260
|
-
height: 780px;
|
|
261
|
-
margin: auto;
|
|
262
|
-
}
|
|
263
|
-
.loading {
|
|
264
|
-
position: absolute;
|
|
265
|
-
width: 100%;
|
|
266
|
-
height: 100%;
|
|
267
|
-
top: 0;
|
|
268
|
-
/deep/ .van-loading {
|
|
269
|
-
margin: 40% 0 0 47%;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
li {
|
|
274
|
-
list-style-type: none;
|
|
275
|
-
}
|
|
276
|
-
.wh_top_changge {
|
|
277
|
-
height: 90px;
|
|
278
|
-
display: flex;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.wh_top_changge li {
|
|
282
|
-
cursor: pointer;
|
|
283
|
-
display: flex;
|
|
284
|
-
color: #666666;
|
|
285
|
-
font-size: 30px;
|
|
286
|
-
flex: 1;
|
|
287
|
-
justify-content: center;
|
|
288
|
-
align-items: center;
|
|
289
|
-
height: 90px;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.wh_top_changge .wh_content_li {
|
|
293
|
-
cursor: auto;
|
|
294
|
-
flex: 1;
|
|
295
|
-
}
|
|
296
|
-
.wh_content_all {
|
|
297
|
-
background-color: #ffffff;
|
|
298
|
-
width: 100%;
|
|
299
|
-
overflow: hidden;
|
|
300
|
-
padding-bottom: 8px;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.wh_content {
|
|
304
|
-
display: flex;
|
|
305
|
-
flex-wrap: wrap;
|
|
306
|
-
padding: 0 3% 0 3%;
|
|
307
|
-
width: 100%;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.wh_content:first-child .wh_content_item_tag,
|
|
311
|
-
.wh_content:first-child .wh_content_item {
|
|
312
|
-
color: #666666;
|
|
313
|
-
font-size: 16px;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.wh_content_item,
|
|
317
|
-
.wh_content_item_tag {
|
|
318
|
-
font-size: 15px;
|
|
319
|
-
width: 13.4%;
|
|
320
|
-
text-align: center;
|
|
321
|
-
color: #666666;
|
|
322
|
-
position: relative;
|
|
323
|
-
}
|
|
324
|
-
.wh_content_item-header {
|
|
325
|
-
height: @dateHeaderHeight;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.wh_content_item-content {
|
|
329
|
-
height: @itemDateHeight;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.wh_top_tag {
|
|
333
|
-
font-size: 30px;
|
|
334
|
-
width: @dateHeaderHeight;
|
|
335
|
-
height: @dateHeaderHeight;
|
|
336
|
-
line-height: @dateHeaderHeight;
|
|
337
|
-
margin: auto;
|
|
338
|
-
display: flex;
|
|
339
|
-
justify-content: center;
|
|
340
|
-
align-items: center;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.wh_item_date {
|
|
344
|
-
width: @itemDateHeight;
|
|
345
|
-
height: @itemDateHeight;
|
|
346
|
-
line-height: @itemDateHeight;
|
|
347
|
-
margin: auto;
|
|
348
|
-
display: flex;
|
|
349
|
-
justify-content: center;
|
|
350
|
-
align-items: center;
|
|
351
|
-
flex-direction: column;
|
|
352
|
-
|
|
353
|
-
.wh_item_date_h1 {
|
|
354
|
-
margin-top: 4px;
|
|
355
|
-
width: 100%;
|
|
356
|
-
height: 30px;
|
|
357
|
-
line-height: 30px;
|
|
358
|
-
font-size: 28px;
|
|
359
|
-
}
|
|
360
|
-
.wh_item_date_h2 {
|
|
361
|
-
line-height: normal;
|
|
362
|
-
// max-width: 100%;
|
|
363
|
-
display: inline-block;
|
|
364
|
-
height: 30px;
|
|
365
|
-
font-size: 24px;
|
|
366
|
-
padding: 4px 10px;
|
|
367
|
-
white-space: nowrap;
|
|
368
|
-
overflow: hidden;
|
|
369
|
-
text-overflow: ellipsis;
|
|
370
|
-
transform: scale(0.9);
|
|
371
|
-
}
|
|
372
|
-
&__0 {
|
|
373
|
-
color: #cecece;
|
|
374
|
-
}
|
|
375
|
-
&__1 {
|
|
376
|
-
color: #ff5804;
|
|
377
|
-
background-color: #ffeee7;
|
|
378
|
-
}
|
|
379
|
-
&__2 {
|
|
380
|
-
color: #00ac00;
|
|
381
|
-
background-color: #e3fff4;
|
|
382
|
-
}
|
|
383
|
-
&__3 {
|
|
384
|
-
color: #7972fe;
|
|
385
|
-
background-color: #f0edff;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
.wh_chose_day {
|
|
389
|
-
.wh_item_date_h2 {
|
|
390
|
-
color: #fff !important;
|
|
391
|
-
background-color: rgba(0, 0, 0, 0) !important;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.wh_isToday {
|
|
396
|
-
.wh_item_date_h2 {
|
|
397
|
-
color: #fff !important;
|
|
398
|
-
background-color: rgba(0, 0, 0, 0) !important;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
.wh_top_changge .pre-warp {
|
|
402
|
-
flex: none;
|
|
403
|
-
flex-basis: 20px;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.wh_top_changge .next-warp {
|
|
407
|
-
flex: none;
|
|
408
|
-
flex-basis: 20px;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.wh_jiantou1 {
|
|
412
|
-
width: 48px;
|
|
413
|
-
height: 48px;
|
|
414
|
-
background-size: 30px 30px;
|
|
415
|
-
background-repeat: no-repeat;
|
|
416
|
-
background-position: center center;
|
|
417
|
-
background-image: url("./images/arrow@3x.png");
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.wh_jiantou1:active,
|
|
421
|
-
.wh_jiantou2:active {
|
|
422
|
-
border-color: #ddd;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
.wh_jiantou2 {
|
|
426
|
-
width: 48px;
|
|
427
|
-
height: 48px;
|
|
428
|
-
transform: rotate(-180deg);
|
|
429
|
-
background-size: 30px 30px;
|
|
430
|
-
background-repeat: no-repeat;
|
|
431
|
-
background-position: center center;
|
|
432
|
-
background-image: url("./images/arrow@3x.png");
|
|
433
|
-
}
|
|
434
|
-
.wh_content_item > .wh_isMark {
|
|
435
|
-
margin: auto;
|
|
436
|
-
border-radius: 100px;
|
|
437
|
-
background: #7972fe;
|
|
438
|
-
z-index: 2;
|
|
439
|
-
}
|
|
440
|
-
.wh_content_item .wh_other_dayhide {
|
|
441
|
-
color: #bfbfbf;
|
|
442
|
-
}
|
|
443
|
-
.wh_content_item .wh_want_dayhide {
|
|
444
|
-
color: #bfbfbf;
|
|
445
|
-
}
|
|
446
|
-
.wh_content_item .wh_isToday {
|
|
447
|
-
color: #fff;
|
|
448
|
-
background: #7972fe;
|
|
449
|
-
border-radius: 100px;
|
|
450
|
-
}
|
|
451
|
-
.wh_content_item .wh_chose_day {
|
|
452
|
-
background: #7972fe;
|
|
453
|
-
color: #fff;
|
|
454
|
-
border-radius: 100px;
|
|
455
|
-
}
|
|
456
|
-
.is-week {
|
|
457
|
-
background: @isWeekColor;
|
|
458
|
-
}
|
|
459
|
-
.is-before-half-week {
|
|
460
|
-
.wh_item_date {
|
|
461
|
-
color: #fff;
|
|
462
|
-
border-radius: 100px;
|
|
463
|
-
background: @selectColor;
|
|
464
|
-
}
|
|
465
|
-
background: linear-gradient(
|
|
466
|
-
to left,
|
|
467
|
-
white 51%,
|
|
468
|
-
white 100% #fff 0%,
|
|
469
|
-
#ecebff 50%
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
.is-after-half-week {
|
|
473
|
-
.wh_item_date {
|
|
474
|
-
color: #fff;
|
|
475
|
-
border-radius: 100px;
|
|
476
|
-
background: @selectColor;
|
|
477
|
-
}
|
|
478
|
-
background: linear-gradient(
|
|
479
|
-
to left,
|
|
480
|
-
#ecebff 51%,
|
|
481
|
-
white 0% #fff 100%,
|
|
482
|
-
white 50%
|
|
483
|
-
);
|
|
484
|
-
}
|
|
485
|
-
</style>
|
|
Binary file
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-calendar class="ks-daterange-select ks-calendar"
|
|
3
|
-
:default-date="currentDate"
|
|
4
|
-
ref="ksDaterangedSelect"
|
|
5
|
-
:poppable="false"
|
|
6
|
-
:show-confirm="false"
|
|
7
|
-
:show-title="false"
|
|
8
|
-
:show-subtitle="false"
|
|
9
|
-
:min-date="currentMin"
|
|
10
|
-
:max-date="currentMax"
|
|
11
|
-
:lazy-render="false"
|
|
12
|
-
:safe-area-inset-bottom="false"
|
|
13
|
-
:allow-same-day="true"
|
|
14
|
-
type="range"
|
|
15
|
-
@select="handleSelect" />
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import { formatToDate, formatToString } from './utils'
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
name: 'date-range-select',
|
|
23
|
-
props: {
|
|
24
|
-
defaultValue: {
|
|
25
|
-
type: Array,
|
|
26
|
-
default: () => ([])
|
|
27
|
-
},
|
|
28
|
-
min: [String, Number, Date],
|
|
29
|
-
max: [String, Number, Date]
|
|
30
|
-
},
|
|
31
|
-
data () {
|
|
32
|
-
return {
|
|
33
|
-
currentDate: [],
|
|
34
|
-
currentMin: new Date(),
|
|
35
|
-
currentMax: new Date()
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
created () {
|
|
39
|
-
this.init()
|
|
40
|
-
},
|
|
41
|
-
methods: {
|
|
42
|
-
init () {
|
|
43
|
-
if (this.defaultValue.length) {
|
|
44
|
-
this.currentDate = [formatToDate(this.defaultValue[0]), formatToDate(this.defaultValue[1])]
|
|
45
|
-
}
|
|
46
|
-
if (!this.min) {
|
|
47
|
-
let _date = new Date()
|
|
48
|
-
let y = _date.getFullYear()
|
|
49
|
-
let m = _date.getMonth() + 1
|
|
50
|
-
this.currentMin = (m - 6) < 1 ? new Date(y - 1, 12 + m - 5, 1) : new Date(y, m - 5, 1)
|
|
51
|
-
} else {
|
|
52
|
-
this.currentMin = formatToDate(this.min)
|
|
53
|
-
}
|
|
54
|
-
if (!this.max) {
|
|
55
|
-
let _date = new Date()
|
|
56
|
-
let y = _date.getFullYear()
|
|
57
|
-
let m = _date.getMonth() + 1
|
|
58
|
-
this.currentMax = (m + 6) > 12 ? new Date(y + 1, m + 6 - 12, 0) : new Date(y, m + 6, 0)
|
|
59
|
-
} else {
|
|
60
|
-
this.currentMax = formatToDate(this.max)
|
|
61
|
-
}
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
this.autoScroll()
|
|
64
|
-
})
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* @description 初始化时自动往上滚动 用于解决ios部分机型初始化日历时白屏问题
|
|
68
|
-
*/
|
|
69
|
-
autoScroll () {
|
|
70
|
-
this.$refs.ksDaterangedSelect.$refs.body.scrollTop -= 46
|
|
71
|
-
},
|
|
72
|
-
handleSelect (e) {
|
|
73
|
-
this.$emit('select', { date: e, str: [formatToString(e[0]), formatToString(e[1])] })
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</script>
|
|
78
|
-
|
|
79
|
-
<style lang="less">
|
|
80
|
-
.ks-daterange-select {
|
|
81
|
-
.van-calendar__day {
|
|
82
|
-
margin: 3px 0;
|
|
83
|
-
}
|
|
84
|
-
.van-calendar__day--middle {
|
|
85
|
-
color: #7972fe !important;
|
|
86
|
-
&::after {
|
|
87
|
-
top: 0 !important;
|
|
88
|
-
bottom: 0 !important;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
</style>
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="van-calendar__body ks-date-picker"
|
|
3
|
-
ref="body">
|
|
4
|
-
<div class="van-calendar__month"
|
|
5
|
-
v-for="y of years"
|
|
6
|
-
:key="y">
|
|
7
|
-
<div class="van-calendar__month-title">{{y}}年</div>
|
|
8
|
-
<div class="van-calendar__days">
|
|
9
|
-
<div class="van-calendar__day ks-month__day"
|
|
10
|
-
v-for="m of months"
|
|
11
|
-
:key="m"
|
|
12
|
-
:class="{
|
|
13
|
-
'van-calendar__day--disabled': (currentMin && +new Date(`${y}/${m}/1`) < currentMin) || (currentMax && +new Date(`${y}/${m}/1`) > currentMax)
|
|
14
|
-
}"
|
|
15
|
-
@click="handleSelect(y, m, (currentMin && +new Date(`${y}/${m}/1`) < currentMin) || (currentMax && +new Date(`${y}/${m}/1`) > currentMax))">
|
|
16
|
-
<div :class="{
|
|
17
|
-
'van-calendar__day--start': +currentStart === +new Date(`${y}/${m}/1`) && +currentEnd !== +new Date(`${y}/${m}/1`),
|
|
18
|
-
'van-calendar__day--end': +currentEnd === +new Date(`${y}/${m}/1`) && +currentStart !== +new Date(`${y}/${m}/1`),
|
|
19
|
-
'van-calendar__day--middle': +currentStart < +new Date(`${y}/${m}/1`) && +currentEnd > +new Date(`${y}/${m}/1`),
|
|
20
|
-
'van-calendar__day--start-end': +currentStart === +new Date(`${y}/${m}/1`) && +currentEnd === +new Date(`${y}/${m}/1`)
|
|
21
|
-
}">
|
|
22
|
-
{{m}}月
|
|
23
|
-
<div v-if="+currentStart === +new Date(`${y}/${m}/1`) || +currentEnd === +new Date(`${y}/${m}/1`)"
|
|
24
|
-
class="van-calendar__bottom-info">
|
|
25
|
-
{{
|
|
26
|
-
+currentStart === +new Date(`${y}/${m}/1`) && +currentEnd === +new Date(`${y}/${m}/1`)
|
|
27
|
-
? '开始/结束'
|
|
28
|
-
: +currentStart === +new Date(`${y}/${m}/1`) && +currentEnd !== +new Date(`${y}/${m}/1`)
|
|
29
|
-
? '开始'
|
|
30
|
-
: '结束'
|
|
31
|
-
}}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import { getRangeYears, foramtToMonth, formatToString } from './utils'
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
name: 'month-range-select',
|
|
45
|
-
props: {
|
|
46
|
-
defaultValue: {
|
|
47
|
-
type: Array,
|
|
48
|
-
default: () => ([])
|
|
49
|
-
},
|
|
50
|
-
yearRange: {
|
|
51
|
-
type: Array,
|
|
52
|
-
default: () => [new Date().getFullYear() - 5, new Date().getFullYear()],
|
|
53
|
-
},
|
|
54
|
-
horizontal: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false
|
|
57
|
-
},
|
|
58
|
-
min: [String, Number, Date],
|
|
59
|
-
max: [String, Number, Date]
|
|
60
|
-
},
|
|
61
|
-
data () {
|
|
62
|
-
return {
|
|
63
|
-
years: getRangeYears(this.yearRange),
|
|
64
|
-
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
65
|
-
currentStart: null,
|
|
66
|
-
currentEnd: null,
|
|
67
|
-
currentMin: null,
|
|
68
|
-
currentMax: null
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
created () {
|
|
72
|
-
this.init()
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
init () {
|
|
76
|
-
this.currentMin = this.min ? +foramtToMonth(this.min) : null
|
|
77
|
-
this.currentMax = this.max ? +foramtToMonth(this.max) : null
|
|
78
|
-
if (this.defaultValue.length === 2) {
|
|
79
|
-
this.currentStart = foramtToMonth(this.defaultValue[0])
|
|
80
|
-
this.currentEnd = foramtToMonth(this.defaultValue[1])
|
|
81
|
-
}
|
|
82
|
-
this.scrollInto()
|
|
83
|
-
},
|
|
84
|
-
scrollInto () {
|
|
85
|
-
setTimeout(() => {
|
|
86
|
-
if (this.defaultValue.length === 2) {
|
|
87
|
-
let top = this.$el.querySelector('.van-calendar__day--start') || this.$el.querySelector('.van-calendar__day--start-end')
|
|
88
|
-
this.$refs.body.scrollTop = top ? top.getBoundingClientRect().top + 80 : 0
|
|
89
|
-
} else {
|
|
90
|
-
if (this.$refs.body) {
|
|
91
|
-
this.$refs.body.scrollTop = 999
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, 200)
|
|
95
|
-
},
|
|
96
|
-
handleSelect (y, m, disabled) {
|
|
97
|
-
if (!disabled) {
|
|
98
|
-
let _month = foramtToMonth(`${y}/${m}`)
|
|
99
|
-
if (this.currentStart && !this.currentEnd && +this.currentStart <= +_month) {
|
|
100
|
-
this.currentEnd = _month
|
|
101
|
-
this.$emit('select', {
|
|
102
|
-
date: [this.currentStart, this.currentEnd],
|
|
103
|
-
str: [formatToString(this.currentStart, 'month'), formatToString(this.currentEnd, 'month')]
|
|
104
|
-
})
|
|
105
|
-
} else {
|
|
106
|
-
this.currentEnd = null
|
|
107
|
-
this.currentStart = _month
|
|
108
|
-
this.$emit('select', {
|
|
109
|
-
date: [this.currentStart, null],
|
|
110
|
-
str: [formatToString(this.currentStart, 'month'), '']
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<style lang="less">
|
|
120
|
-
@import url("./style.less");
|
|
121
|
-
.van-calendar__body {
|
|
122
|
-
height: 100%;
|
|
123
|
-
}
|
|
124
|
-
.ks-month__day {
|
|
125
|
-
width: 16.666%;
|
|
126
|
-
height: 50px;
|
|
127
|
-
}
|
|
128
|
-
</style>
|