@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,213 +0,0 @@
|
|
|
1
|
-
import * as C from './constant'
|
|
2
|
-
|
|
3
|
-
// const IS_DAYJS = '$isDayjsObject'
|
|
4
|
-
// const isDayjs = d => d instanceof HrDayJs || !!(d && d[IS_DAYJS])
|
|
5
|
-
|
|
6
|
-
// 时间对象格式为文本格式
|
|
7
|
-
export const formatToString = (date, type) => {
|
|
8
|
-
if (!date) { return null }
|
|
9
|
-
|
|
10
|
-
let _date = new Date(date)
|
|
11
|
-
let y = _date.getFullYear()
|
|
12
|
-
let m = _date.getMonth() + 1
|
|
13
|
-
m = m < 10 ? '0' + m : m
|
|
14
|
-
let d = _date.getDate()
|
|
15
|
-
d = d < 10 ? '0' + d : d
|
|
16
|
-
return type === 'month' ? `${y}/${m}` : `${y}/${m}/${d}`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 字符串转换为时间
|
|
20
|
-
export const formatToDate = (date) => {
|
|
21
|
-
if (!date) { return null }
|
|
22
|
-
return new Date(typeof date === 'string' ? date.replace(/-/g, "/") : date)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 暴露出去的主函数
|
|
26
|
-
export const hrDayJs = (date) => {
|
|
27
|
-
return new HrDayJs(date)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 克隆
|
|
31
|
-
const wrapper = (date) => {
|
|
32
|
-
return hrDayJs(date)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class HrDayJs {
|
|
36
|
-
constructor(date) {
|
|
37
|
-
this.$d = formatToDate(date || new Date())
|
|
38
|
-
this.init()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
init () {
|
|
42
|
-
const { $d } = this
|
|
43
|
-
this.$y = $d.getFullYear()
|
|
44
|
-
this.$M = $d.getMonth()
|
|
45
|
-
this.$D = $d.getDate()
|
|
46
|
-
this.$W = $d.getDay()
|
|
47
|
-
this.$H = $d.getHours()
|
|
48
|
-
this.$m = $d.getMinutes()
|
|
49
|
-
this.$s = $d.getSeconds()
|
|
50
|
-
this.$ms = $d.getMilliseconds()
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
toString () {
|
|
54
|
-
return formatToString(this.$d)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
subtract (number, string) {
|
|
58
|
-
return this.add(number * -1, string)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
add (number, unit) {
|
|
62
|
-
number = Number(number) // eslint-disable-line no-param-reassign
|
|
63
|
-
const instanceFactorySet = (n) => {
|
|
64
|
-
const d = hrDayJs(this)
|
|
65
|
-
return wrapper(d.date(d.date() + Math.round(n * number)), this)
|
|
66
|
-
}
|
|
67
|
-
if (unit === C.M) {
|
|
68
|
-
return this.set(C.M, this.$M + number)
|
|
69
|
-
}
|
|
70
|
-
if (unit === C.Y) {
|
|
71
|
-
return this.set(C.Y, this.$y + number)
|
|
72
|
-
}
|
|
73
|
-
if (unit === C.D) {
|
|
74
|
-
return instanceFactorySet(1)
|
|
75
|
-
}
|
|
76
|
-
if (unit === C.W) {
|
|
77
|
-
return instanceFactorySet(7)
|
|
78
|
-
}
|
|
79
|
-
const step = {
|
|
80
|
-
[C.MIN]: C.MILLISECONDS_A_MINUTE,
|
|
81
|
-
[C.H]: C.MILLISECONDS_A_HOUR,
|
|
82
|
-
[C.S]: C.MILLISECONDS_A_SECOND
|
|
83
|
-
}[unit] || 1 // ms
|
|
84
|
-
|
|
85
|
-
const nextTimeStamp = this.$d.getTime() + (number * step)
|
|
86
|
-
return wrapper(nextTimeStamp)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
format (formatStr) {
|
|
90
|
-
let str = '-'
|
|
91
|
-
switch (formatStr) {
|
|
92
|
-
case 'YYYY/MM/DD': str = '/'; break;
|
|
93
|
-
}
|
|
94
|
-
return `${this.$y}${str}${this.formatNumber(this.$M + 1)}${str}${this.formatNumber(this.$D)}`
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
formatNumber (number) {
|
|
98
|
-
return number < 10 ? '0' + number : number
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
valueOf () {
|
|
102
|
-
return this.$d.getTime()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
clone () {
|
|
106
|
-
return wrapper(this.$d)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
set (string, int) {
|
|
110
|
-
return this.clone().$set(string, int)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
$set (unit, int) { // private set
|
|
114
|
-
const utcPad = `set${this.$u ? 'UTC' : ''}`
|
|
115
|
-
const name = {
|
|
116
|
-
[C.D]: `${utcPad}Date`,
|
|
117
|
-
[C.DATE]: `${utcPad}Date`,
|
|
118
|
-
[C.M]: `${utcPad}Month`,
|
|
119
|
-
[C.Y]: `${utcPad}FullYear`,
|
|
120
|
-
[C.H]: `${utcPad}Hours`,
|
|
121
|
-
[C.MIN]: `${utcPad}Minutes`,
|
|
122
|
-
[C.S]: `${utcPad}Seconds`,
|
|
123
|
-
[C.MS]: `${utcPad}Milliseconds`
|
|
124
|
-
}[unit]
|
|
125
|
-
const arg = unit === C.D ? this.$D + (int - this.$W) : int
|
|
126
|
-
if (unit === C.M || unit === C.Y) {
|
|
127
|
-
const date = this.clone().set(C.DATE, 1)
|
|
128
|
-
date.$d[name](arg)
|
|
129
|
-
date.init()
|
|
130
|
-
this.$d = date.set(C.DATE, Math.min(this.$D, date.daysInMonth())).$d
|
|
131
|
-
} else if (name) this.$d[name](arg)
|
|
132
|
-
|
|
133
|
-
this.init()
|
|
134
|
-
return this
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
startOf (unit, startOf) { // startOf -> endOf
|
|
138
|
-
const isStartOf = !(startOf === undefined) ? startOf : true
|
|
139
|
-
const instanceFactory = (d, m) => {
|
|
140
|
-
const ins = wrapper(this.$u ?
|
|
141
|
-
Date.UTC(this.$y, m, d) : new Date(this.$y, m, d), this)
|
|
142
|
-
return isStartOf ? ins : ins.endOf(C.D)
|
|
143
|
-
}
|
|
144
|
-
const instanceFactorySet = (method, slice) => {
|
|
145
|
-
const argumentStart = [0, 0, 0, 0]
|
|
146
|
-
const argumentEnd = [23, 59, 59, 999]
|
|
147
|
-
return wrapper(this.toDate()[method].apply( // eslint-disable-line prefer-spread
|
|
148
|
-
this.toDate('s'),
|
|
149
|
-
(isStartOf ? argumentStart : argumentEnd).slice(slice)
|
|
150
|
-
), this)
|
|
151
|
-
}
|
|
152
|
-
const { $W, $M, $D } = this
|
|
153
|
-
const utcPad = `set${this.$u ? 'UTC' : ''}`
|
|
154
|
-
switch (unit) {
|
|
155
|
-
case C.Y:
|
|
156
|
-
return isStartOf ? instanceFactory(1, 0) :
|
|
157
|
-
instanceFactory(31, 11)
|
|
158
|
-
case C.M:
|
|
159
|
-
return isStartOf ? instanceFactory(1, $M) :
|
|
160
|
-
instanceFactory(0, $M + 1)
|
|
161
|
-
case C.W: {
|
|
162
|
-
const weekStart = this.$locale().weekStart || 0
|
|
163
|
-
const gap = ($W < weekStart ? $W + 7 : $W) - weekStart
|
|
164
|
-
return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M)
|
|
165
|
-
}
|
|
166
|
-
case C.D:
|
|
167
|
-
case C.DATE:
|
|
168
|
-
return instanceFactorySet(`${utcPad}Hours`, 0)
|
|
169
|
-
case C.H:
|
|
170
|
-
return instanceFactorySet(`${utcPad}Minutes`, 1)
|
|
171
|
-
case C.MIN:
|
|
172
|
-
return instanceFactorySet(`${utcPad}Seconds`, 2)
|
|
173
|
-
case C.S:
|
|
174
|
-
return instanceFactorySet(`${utcPad}Milliseconds`, 3)
|
|
175
|
-
default:
|
|
176
|
-
return this.clone()
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
endOf (arg) {
|
|
181
|
-
return this.startOf(arg, false)
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
toDate () {
|
|
185
|
-
return new Date(this.valueOf())
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
daysInMonth () {
|
|
189
|
-
return this.endOf(C.M).$D
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
$g (input, get, set) {
|
|
193
|
-
if (input === undefined) return this[get]
|
|
194
|
-
return this.set(set, input)
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const proto = HrDayJs.prototype
|
|
199
|
-
hrDayJs.prototype = proto;
|
|
200
|
-
[
|
|
201
|
-
['$ms', C.MS],
|
|
202
|
-
['$s', C.S],
|
|
203
|
-
['$m', C.MIN],
|
|
204
|
-
['$H', C.H],
|
|
205
|
-
['$W', C.D],
|
|
206
|
-
['$M', C.M],
|
|
207
|
-
['$y', C.Y],
|
|
208
|
-
['$D', C.DATE]
|
|
209
|
-
].forEach((g) => {
|
|
210
|
-
proto[g[1]] = function (input) {
|
|
211
|
-
return this.$g(input, g[0], g[1])
|
|
212
|
-
}
|
|
213
|
-
})
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'HrConditionFiltratePopup',
|
|
4
|
-
components: {},
|
|
5
|
-
props: {
|
|
6
|
-
value: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default () {
|
|
9
|
-
return false
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
title: {
|
|
13
|
-
type: String,
|
|
14
|
-
default() {
|
|
15
|
-
return '筛选'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
container: {
|
|
19
|
-
type: String,
|
|
20
|
-
default() {
|
|
21
|
-
return '#app'
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
position: {
|
|
25
|
-
type: String,
|
|
26
|
-
default() {
|
|
27
|
-
return 'right'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
data () {
|
|
32
|
-
return {}
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
operationCondition (type) {
|
|
36
|
-
this.$emit('operation', type)
|
|
37
|
-
},
|
|
38
|
-
setisShowFiltrate (flag) {
|
|
39
|
-
this.$emit('input', flag)
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
render () {
|
|
43
|
-
// 主要内容
|
|
44
|
-
const renderFiltrateContent = () => {
|
|
45
|
-
return <div class="filtrate-content" id="hr-filtrate-content">
|
|
46
|
-
<header class="ksui-header">
|
|
47
|
-
<div class="ksui-nav">
|
|
48
|
-
<ks-nav-bar title={this.title}
|
|
49
|
-
left-arrow={true}
|
|
50
|
-
onClick-left={() => { this.setisShowFiltrate(false) }}>
|
|
51
|
-
</ks-nav-bar>
|
|
52
|
-
</div>
|
|
53
|
-
</header>
|
|
54
|
-
<div class="content-main ksui-body">
|
|
55
|
-
{ this.$slots.default || '' }
|
|
56
|
-
</div>
|
|
57
|
-
<div class="content-footer">
|
|
58
|
-
<span class="footer-button reset" onClick={this.operationCondition.bind(this, 10)}>重置</span>
|
|
59
|
-
<span class="footer-button" onClick={this.operationCondition.bind(this, 20)}>确定</span>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return <div class="hr-condition-filtrate">
|
|
65
|
-
<ks-popup
|
|
66
|
-
value={this.value}
|
|
67
|
-
onInput={(value) => { this.setisShowFiltrate(value) }}
|
|
68
|
-
get-container={this.container}
|
|
69
|
-
position={this.position}>
|
|
70
|
-
{renderFiltrateContent()}
|
|
71
|
-
</ks-popup>
|
|
72
|
-
</div>
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<style scoped lang="less">
|
|
78
|
-
.filtrate-content {
|
|
79
|
-
width: 330px;
|
|
80
|
-
height: 100%;
|
|
81
|
-
border-radius: 12px 0px 0px 12px;
|
|
82
|
-
box-sizing: border-box;
|
|
83
|
-
.ksui-nav {
|
|
84
|
-
.van-nav-bar {
|
|
85
|
-
display: flex;
|
|
86
|
-
padding: 0 16px;
|
|
87
|
-
flex-direction: row;
|
|
88
|
-
align-items: center;
|
|
89
|
-
.van-icon.van-icon-arrow-left.van-nav-bar__arrow {
|
|
90
|
-
font-size: 22px !important;
|
|
91
|
-
font-weight: 500;
|
|
92
|
-
color: #000;
|
|
93
|
-
}
|
|
94
|
-
.van-nav-bar__left,
|
|
95
|
-
.van-nav-bar__right {
|
|
96
|
-
position: static;
|
|
97
|
-
font-size: 22px;
|
|
98
|
-
font-weight: 500;
|
|
99
|
-
color: #000;
|
|
100
|
-
}
|
|
101
|
-
.van-nav-bar__left {
|
|
102
|
-
display: flex;
|
|
103
|
-
justify-content: flex-start;
|
|
104
|
-
flex: 0 0 22px;
|
|
105
|
-
margin-right: 4px;
|
|
106
|
-
}
|
|
107
|
-
.van-nav-bar__title {
|
|
108
|
-
margin: 0;
|
|
109
|
-
flex: 0 0 auto;
|
|
110
|
-
height: auto;
|
|
111
|
-
line-height: auto;
|
|
112
|
-
|
|
113
|
-
// & > a.light {
|
|
114
|
-
// border: 1px solid #7972fe;
|
|
115
|
-
// }
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
.ksui-header {
|
|
120
|
-
background: #fff !important;
|
|
121
|
-
}
|
|
122
|
-
.content-main {
|
|
123
|
-
padding: 16px;
|
|
124
|
-
overflow-y: scroll !important;
|
|
125
|
-
padding-bottom: 90px;
|
|
126
|
-
height: 100%;
|
|
127
|
-
.main-item {
|
|
128
|
-
margin-bottom: 8px;
|
|
129
|
-
.item-title {
|
|
130
|
-
line-height: 20px;
|
|
131
|
-
margin-bottom: 12px;
|
|
132
|
-
font-size: 14px;
|
|
133
|
-
font-weight: 600;
|
|
134
|
-
color: #03050d;
|
|
135
|
-
text-align: left;
|
|
136
|
-
.title-black {
|
|
137
|
-
font-size: 14px;
|
|
138
|
-
font-weight: normal;
|
|
139
|
-
color: #6e6d72;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
.item-condition {
|
|
143
|
-
display: flex;
|
|
144
|
-
flex-wrap: wrap;
|
|
145
|
-
justify-content: flex-start;
|
|
146
|
-
.condition-item {
|
|
147
|
-
width: calc((100% - 16px) / 3);
|
|
148
|
-
height: 28px;
|
|
149
|
-
border-radius: 8px;
|
|
150
|
-
box-sizing: border-box;
|
|
151
|
-
background: #f7f8fa;
|
|
152
|
-
text-align: center;
|
|
153
|
-
line-height: 26px;
|
|
154
|
-
margin-bottom: 12px;
|
|
155
|
-
margin-right: 8px;
|
|
156
|
-
color: #03050d;
|
|
157
|
-
font-size: 12px;
|
|
158
|
-
position: relative;
|
|
159
|
-
}
|
|
160
|
-
.condition-item.active {
|
|
161
|
-
// border: 1px solid rgba(121, 114, 254, 0.8);
|
|
162
|
-
background: rgba(121, 114, 254, 0.08);
|
|
163
|
-
color: #7972fe;
|
|
164
|
-
&::after {
|
|
165
|
-
content: " ";
|
|
166
|
-
position: absolute;
|
|
167
|
-
left: 0;
|
|
168
|
-
top: 0;
|
|
169
|
-
width: 200%;
|
|
170
|
-
height: 200%;
|
|
171
|
-
border: 1px solid #7972fe;
|
|
172
|
-
border-radius: 16px;
|
|
173
|
-
-webkit-transform-origin: 0 0;
|
|
174
|
-
transform-origin: 0 0;
|
|
175
|
-
-webkit-transform: scale(0.5);
|
|
176
|
-
transform: scale(0.5);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.condition-item:nth-child(3n) {
|
|
181
|
-
margin-right: 0;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
.content-footer {
|
|
187
|
-
position: absolute;
|
|
188
|
-
bottom: 0;
|
|
189
|
-
left: 0;
|
|
190
|
-
padding: 8px 36px;
|
|
191
|
-
display: flex;
|
|
192
|
-
width: 100%;
|
|
193
|
-
box-sizing: border-box;
|
|
194
|
-
background: #fff;
|
|
195
|
-
.footer-button {
|
|
196
|
-
flex: 1;
|
|
197
|
-
border-radius: 8px;
|
|
198
|
-
background: #7972fe;
|
|
199
|
-
font-size: 16px;
|
|
200
|
-
line-height: 22px;
|
|
201
|
-
color: #ffffff;
|
|
202
|
-
text-align: center;
|
|
203
|
-
line-height: 40px;
|
|
204
|
-
}
|
|
205
|
-
.footer-button.reset {
|
|
206
|
-
color: #7972fe;
|
|
207
|
-
// border: solid #7972fe 1px;
|
|
208
|
-
background: #fff;
|
|
209
|
-
margin-right: 18px;
|
|
210
|
-
position: relative;
|
|
211
|
-
&::after {
|
|
212
|
-
content: " ";
|
|
213
|
-
position: absolute;
|
|
214
|
-
left: 0;
|
|
215
|
-
top: 0;
|
|
216
|
-
width: 200%;
|
|
217
|
-
height: 200%;
|
|
218
|
-
border: 1px solid #7972fe;
|
|
219
|
-
border-radius: 16px;
|
|
220
|
-
-webkit-transform-origin: 0 0;
|
|
221
|
-
transform-origin: 0 0;
|
|
222
|
-
-webkit-transform: scale(0.5);
|
|
223
|
-
transform: scale(0.5);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
.van-popup {
|
|
229
|
-
height: 100%;
|
|
230
|
-
overflow: hidden;
|
|
231
|
-
}
|
|
232
|
-
.ios .content-footer,
|
|
233
|
-
.ipx .content-footer {
|
|
234
|
-
padding-top: 28px;
|
|
235
|
-
}
|
|
236
|
-
</style>
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ks-date-picker ks-daterange-select">
|
|
3
|
-
<van-calendar class="ks-daterange-select"
|
|
4
|
-
:class="canelFlag ? 'ks-daterange-select-canel' : ''"
|
|
5
|
-
ref="calendar"
|
|
6
|
-
:default-date="currentDate"
|
|
7
|
-
:poppable="false"
|
|
8
|
-
:show-confirm="false"
|
|
9
|
-
:show-title="false"
|
|
10
|
-
:show-subtitle="false"
|
|
11
|
-
:min-date="currentMin"
|
|
12
|
-
:max-date="currentMax"
|
|
13
|
-
:lazy-render="false"
|
|
14
|
-
:allow-same-day="true"
|
|
15
|
-
:formatter="formatter"
|
|
16
|
-
row-height="44"
|
|
17
|
-
type="range"
|
|
18
|
-
@select="handleSelect" />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import { formatToDate, formatToString } from './utils'
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
name: 'date-range-select',
|
|
28
|
-
props: {
|
|
29
|
-
defaultValue: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: () => ([])
|
|
32
|
-
},
|
|
33
|
-
formatter: [Function, Object],
|
|
34
|
-
min: [String, Number, Date],
|
|
35
|
-
max: [String, Number, Date]
|
|
36
|
-
},
|
|
37
|
-
data () {
|
|
38
|
-
return {
|
|
39
|
-
currentDate: [],
|
|
40
|
-
currentMin: new Date(),
|
|
41
|
-
currentMax: new Date(),
|
|
42
|
-
canelFlag: true,
|
|
43
|
-
scrollTop: 0
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
mounted () {
|
|
47
|
-
this.init()
|
|
48
|
-
},
|
|
49
|
-
mounted () {
|
|
50
|
-
// this.reset([new Date(), new Date()])
|
|
51
|
-
},
|
|
52
|
-
methods: {
|
|
53
|
-
init () {
|
|
54
|
-
if (this.defaultValue.length) {
|
|
55
|
-
this.currentDate = [formatToDate(this.defaultValue[0]), formatToDate(this.defaultValue[1])]
|
|
56
|
-
}
|
|
57
|
-
if (!this.min) {
|
|
58
|
-
let _date = new Date()
|
|
59
|
-
let y = _date.getFullYear()
|
|
60
|
-
let m = _date.getMonth() + 1
|
|
61
|
-
this.currentMin = (m - 6) < 1 ? new Date(y - 1, 12 + m - 5, 1) : new Date(y, m - 5, 1)
|
|
62
|
-
} else {
|
|
63
|
-
this.currentMin = formatToDate(this.min)
|
|
64
|
-
}
|
|
65
|
-
if (!this.max) {
|
|
66
|
-
let _date = new Date()
|
|
67
|
-
let y = _date.getFullYear()
|
|
68
|
-
let m = _date.getMonth() + 1
|
|
69
|
-
this.currentMax = (m + 6) > 12 ? new Date(y + 1, m + 6 - 12, 0) : new Date(y, m + 6, 0)
|
|
70
|
-
} else {
|
|
71
|
-
this.currentMax = formatToDate(this.max)
|
|
72
|
-
}
|
|
73
|
-
this.scrollToView()
|
|
74
|
-
},
|
|
75
|
-
handleSelect (e) {
|
|
76
|
-
this.$emit('select', { date: e, str: [formatToString(e[0]), formatToString(e[1])] })
|
|
77
|
-
this.canelFlag = false
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
scrollToView () {
|
|
81
|
-
setTimeout(() => {
|
|
82
|
-
this.$nextTick(() => {
|
|
83
|
-
this.autoScroll()
|
|
84
|
-
})
|
|
85
|
-
}, 30);
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* @description 初始化时自动往上滚动 用于解决ios部分机型初始化日历时白屏问题
|
|
89
|
-
*/
|
|
90
|
-
autoScroll () {
|
|
91
|
-
const scrollTop = this.$refs && this.$refs.calendar.$refs.body.scrollTop
|
|
92
|
-
this.scrollTop = scrollTop > 2 ? scrollTop : this.scrollTop
|
|
93
|
-
this.$refs.calendar.$refs.body.scrollTop = this.scrollTop - 2
|
|
94
|
-
},
|
|
95
|
-
// 滚动到某个日期
|
|
96
|
-
scrollToDate (date) {
|
|
97
|
-
console.log('scrollToDate date :>> ', date);
|
|
98
|
-
this.$refs && this.$refs['calendar'].scrollToDate(date)
|
|
99
|
-
},
|
|
100
|
-
// 重置
|
|
101
|
-
reset (date = null) {
|
|
102
|
-
this.$refs.calendar.defaultDate = [
|
|
103
|
-
new Date(),
|
|
104
|
-
new Date()
|
|
105
|
-
]
|
|
106
|
-
|
|
107
|
-
this.$refs && this.$refs['calendar'].reset(date)
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
</script>
|
|
113
|
-
|
|
114
|
-
<style lang="less">
|
|
115
|
-
@import url("./style.less");
|
|
116
|
-
.ks-daterange-select {
|
|
117
|
-
height: 100%;
|
|
118
|
-
.van-calendar__day {
|
|
119
|
-
margin: 3px 0;
|
|
120
|
-
}
|
|
121
|
-
.van-calendar__day--middle {
|
|
122
|
-
color: #7972fe !important;
|
|
123
|
-
&::after {
|
|
124
|
-
top: 0 !important;
|
|
125
|
-
bottom: 0 !important;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
.van-calendar__day--start,
|
|
129
|
-
.van-calendar__day--end {
|
|
130
|
-
margin-left: calc((14.285% - 44px) / 2);
|
|
131
|
-
margin-right: calc((14.285% - 44px) / 2);
|
|
132
|
-
}
|
|
133
|
-
.van-calendar__day--start-end {
|
|
134
|
-
margin-left: calc((14.285% - 54px) / 2);
|
|
135
|
-
margin-right: calc((14.285% - 54px) / 2);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
.ks-daterange-select-canel {
|
|
139
|
-
.van-calendar__day--start,
|
|
140
|
-
.van-calendar__day--end {
|
|
141
|
-
margin-left: calc((14.285% - 44px) / 2);
|
|
142
|
-
margin-right: calc((14.285% - 44px) / 2);
|
|
143
|
-
background-color: transparent;
|
|
144
|
-
color: #333;
|
|
145
|
-
}
|
|
146
|
-
.van-calendar__day--start-end {
|
|
147
|
-
margin-left: calc((14.285% - 54px) / 2);
|
|
148
|
-
margin-right: calc((14.285% - 54px) / 2);
|
|
149
|
-
background-color: transparent;
|
|
150
|
-
color: #333;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
</style>
|