@kyfe/hroa-ui 1.0.5 → 1.0.7

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.
Files changed (226) hide show
  1. package/dist/hroa-ui.common.js +2927 -2545
  2. package/dist/hroa-ui.css +1 -1
  3. package/dist/hroa-ui.umd.js +2927 -2545
  4. package/dist/hroa-ui.umd.min.js +2 -2
  5. package/dist/img/header.7e31b1d5.png +0 -0
  6. package/lib/hr-add-list/index.js +1 -1
  7. package/lib/hr-bottom-button/index.js +1 -1
  8. package/lib/hr-breadcrumb/index.js +1 -1
  9. package/lib/hr-button/index.js +1 -1
  10. package/lib/hr-checkbox/index.css +1 -0
  11. package/lib/hr-checkbox/index.js +1 -0
  12. package/lib/hr-checkbox-group/index.css +1 -0
  13. package/lib/hr-checkbox-group/index.js +1 -0
  14. package/lib/hr-clipboard/index.js +1 -1
  15. package/lib/hr-collapse-card/index.js +1 -1
  16. package/lib/hr-condition-filtrate/index.js +1 -1
  17. package/lib/hr-condition-filtrate-popup/index.js +1 -1
  18. package/lib/hr-date-filter/index.css +1 -0
  19. package/lib/hr-date-filter/index.js +1 -0
  20. package/lib/hr-dropdown-date/index.css +1 -1
  21. package/lib/hr-dropdown-date/index.js +1 -1
  22. package/lib/hr-elasticity-box/index.js +1 -1
  23. package/lib/hr-elasticity-box-item/index.js +1 -1
  24. package/lib/hr-emotional-picture/index.js +1 -1
  25. package/lib/hr-employee-choose/index.js +1 -1
  26. package/lib/hr-file-list/index.css +1 -1
  27. package/lib/hr-file-list/index.js +1 -1
  28. package/lib/hr-full-screen/index.js +1 -1
  29. package/lib/hr-img-list/index.css +1 -1
  30. package/lib/hr-img-list/index.js +1 -1
  31. package/lib/hr-info-card/index.js +1 -1
  32. package/lib/hr-information/index.js +1 -1
  33. package/lib/hr-license-plate-number/index.js +1 -1
  34. package/lib/hr-module-card/index.js +1 -1
  35. package/lib/hr-multiterm-choose/index.css +1 -1
  36. package/lib/hr-multiterm-choose/index.js +1 -1
  37. package/lib/hr-no-data/index.js +1 -1
  38. package/lib/hr-notice-bar/index.js +1 -1
  39. package/lib/hr-notification-dialog/index.css +1 -0
  40. package/lib/hr-notification-dialog/index.js +1 -0
  41. package/lib/hr-open-ks/index.js +1 -1
  42. package/lib/hr-pager/index.css +1 -1
  43. package/lib/hr-pager/index.js +1 -1
  44. package/lib/hr-popup/index.js +1 -1
  45. package/lib/hr-preview-file/index.js +1 -1
  46. package/lib/hr-radiobox/index.css +1 -0
  47. package/lib/hr-radiobox/index.js +1 -0
  48. package/lib/hr-radiobox-group/index.css +1 -0
  49. package/lib/hr-radiobox-group/index.js +1 -0
  50. package/lib/hr-rate/index.js +1 -1
  51. package/lib/hr-reason-textarea/index.js +1 -1
  52. package/lib/hr-search-input/index.js +1 -1
  53. package/lib/hr-search-tips/index.css +1 -0
  54. package/lib/hr-search-tips/index.js +9 -0
  55. package/lib/hr-select/index.js +1 -1
  56. package/lib/hr-select-list/index.js +1 -1
  57. package/lib/hr-single-choose/index.css +1 -1
  58. package/lib/hr-single-choose/index.js +1 -1
  59. package/lib/hr-slide-pager/index.css +1 -1
  60. package/lib/hr-slide-pager/index.js +1 -1
  61. package/lib/hr-sort/index.js +1 -1
  62. package/lib/hr-stack-image/index.js +1 -1
  63. package/lib/hr-tab-nav/index.js +1 -1
  64. package/lib/hr-time-picker/index.css +1 -0
  65. package/lib/hr-time-picker/index.js +1 -0
  66. package/lib/hr-view-item/index.js +1 -1
  67. package/lib/hr-virtual-list/index.css +1 -0
  68. package/lib/hr-virtual-list/index.js +1 -0
  69. package/lib/img/header.7e31b1d5.png +0 -0
  70. package/lib/index/index.css +1 -1
  71. package/lib/index/index.js +2 -2
  72. package/lib/utils/index.js +1 -1
  73. package/package.json +17 -10
  74. package/lib/getJsModule/index.css +0 -1
  75. package/lib/getJsModule/index.js +0 -9
  76. package/packages/getJsModule.js +0 -11
  77. package/packages/hr-add-list/image/add.svg +0 -1
  78. package/packages/hr-add-list/image/close.svg +0 -1
  79. package/packages/hr-add-list/index.js +0 -7
  80. package/packages/hr-add-list/src/index.vue +0 -125
  81. 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
  82. package/packages/hr-bottom-button/index.js +0 -7
  83. package/packages/hr-bottom-button/src/index.vue +0 -128
  84. package/packages/hr-breadcrumb/index.js +0 -3
  85. package/packages/hr-breadcrumb/src/index.vue +0 -87
  86. package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
  87. package/packages/hr-button/index.js +0 -13
  88. package/packages/hr-button/src/hr-button.vue +0 -39
  89. package/packages/hr-clipboard/index.js +0 -8
  90. package/packages/hr-clipboard/src/index.vue +0 -46
  91. package/packages/hr-clipboard/src/util.js +0 -9
  92. package/packages/hr-collapse-card/index.js +0 -3
  93. package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
  94. package/packages/hr-collapse-card/src/index.vue +0 -151
  95. package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
  96. package/packages/hr-condition-filtrate/enum/index.js +0 -11
  97. package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
  98. package/packages/hr-condition-filtrate/index.js +0 -7
  99. package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
  100. package/packages/hr-condition-filtrate/src/index.vue +0 -246
  101. package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
  102. package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
  103. package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
  104. package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
  105. package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
  106. package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
  107. package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
  108. package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
  109. package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
  110. package/packages/hr-condition-filtrate-popup/index.js +0 -7
  111. package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
  112. package/packages/hr-dropdown-date/index.js +0 -7
  113. package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
  114. package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
  115. package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
  116. package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
  117. package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
  118. package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
  119. package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
  120. package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
  121. package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
  122. package/packages/hr-dropdown-date/src/index.vue +0 -482
  123. package/packages/hr-dropdown-date/src/week.js +0 -194
  124. package/packages/hr-elasticity-box/index.js +0 -7
  125. package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
  126. package/packages/hr-elasticity-box/src/index.vue +0 -52
  127. package/packages/hr-elasticity-box-item/index.js +0 -7
  128. package/packages/hr-emotional-picture/index.js +0 -7
  129. package/packages/hr-emotional-picture/src/index.vue +0 -66
  130. package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
  131. package/packages/hr-employee-choose/index.js +0 -7
  132. package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
  133. package/packages/hr-employee-choose/src/index.vue +0 -119
  134. package/packages/hr-file-list/index.js +0 -3
  135. package/packages/hr-file-list/src/file-type/other.vue +0 -45
  136. package/packages/hr-file-list/src/file-type/picture.vue +0 -38
  137. package/packages/hr-file-list/src/file-type/video.vue +0 -60
  138. package/packages/hr-file-list/src/index.vue +0 -246
  139. package/packages/hr-file-list/src/utils/enum.js +0 -95
  140. package/packages/hr-file-list/src/utils/fun.js +0 -16
  141. package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
  142. package/packages/hr-full-screen/index.js +0 -7
  143. package/packages/hr-full-screen/src/index.vue +0 -117
  144. package/packages/hr-img-list/index.js +0 -3
  145. package/packages/hr-img-list/src/index.vue +0 -144
  146. package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
  147. package/packages/hr-info-card/index.js +0 -7
  148. package/packages/hr-info-card/src/index.vue +0 -67
  149. package/packages/hr-information/index.js +0 -7
  150. package/packages/hr-information/src/index.vue +0 -72
  151. package/packages/hr-license-plate-number/index.js +0 -8
  152. package/packages/hr-license-plate-number/src/enum.js +0 -44
  153. package/packages/hr-license-plate-number/src/index.vue +0 -164
  154. package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
  155. package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
  156. package/packages/hr-module-card/index.js +0 -13
  157. package/packages/hr-module-card/src/index.vue +0 -132
  158. 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
  159. package/packages/hr-multiterm-choose/index.js +0 -8
  160. package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
  161. package/packages/hr-multiterm-choose/src/index.vue +0 -225
  162. package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
  163. package/packages/hr-no-data/index.js +0 -7
  164. package/packages/hr-no-data/src/index.vue +0 -48
  165. package/packages/hr-notice-bar/index.js +0 -7
  166. package/packages/hr-notice-bar/src/bem.js +0 -38
  167. package/packages/hr-notice-bar/src/index.js +0 -52
  168. package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
  169. package/packages/hr-open-ks/index.js +0 -7
  170. package/packages/hr-open-ks/src/icon.png +0 -0
  171. package/packages/hr-open-ks/src/index.vue +0 -97
  172. package/packages/hr-open-ks/src/util.js +0 -31
  173. package/packages/hr-pager/images/next-page.png +0 -0
  174. package/packages/hr-pager/images/prev-page.png +0 -0
  175. package/packages/hr-pager/index.js +0 -7
  176. package/packages/hr-pager/src/index.vue +0 -96
  177. 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
  178. package/packages/hr-popup/index.js +0 -3
  179. package/packages/hr-popup/src/index.vue +0 -64
  180. package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
  181. package/packages/hr-preview-file/index.js +0 -7
  182. package/packages/hr-preview-file/src/index.vue +0 -58
  183. package/packages/hr-preview-file/src/util.js +0 -50
  184. package/packages/hr-rate/index.js +0 -7
  185. package/packages/hr-rate/src/index.vue +0 -42
  186. 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
  187. package/packages/hr-reason-textarea/index.js +0 -7
  188. package/packages/hr-reason-textarea/src/index.vue +0 -128
  189. package/packages/hr-search-input/image/input-close-icon.png +0 -0
  190. package/packages/hr-search-input/image/search-icon.png +0 -0
  191. package/packages/hr-search-input/index.js +0 -8
  192. package/packages/hr-search-input/src/index.vue +0 -144
  193. package/packages/hr-select/index.js +0 -7
  194. package/packages/hr-select/src/index.vue +0 -41
  195. package/packages/hr-select-list/index.js +0 -3
  196. package/packages/hr-select-list/src/index.vue +0 -214
  197. 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
  198. package/packages/hr-single-choose/index.js +0 -8
  199. package/packages/hr-single-choose/src/index.vue +0 -196
  200. package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
  201. package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
  202. package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
  203. package/packages/hr-slide-pager/guide/index.vue +0 -59
  204. package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
  205. package/packages/hr-slide-pager/index.js +0 -7
  206. package/packages/hr-slide-pager/src/index.vue +0 -381
  207. 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
  208. package/packages/hr-sort/index.js +0 -3
  209. package/packages/hr-sort/src/main.vue +0 -133
  210. package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
  211. package/packages/hr-stack-image/index.js +0 -3
  212. package/packages/hr-stack-image/src/main.vue +0 -77
  213. 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
  214. package/packages/hr-tab-nav/index.js +0 -8
  215. package/packages/hr-tab-nav/src/index.vue +0 -190
  216. package/packages/hr-view-item/index.js +0 -13
  217. package/packages/hr-view-item/src/index.vue +0 -89
  218. package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
  219. package/packages/index.js +0 -23
  220. package/packages/utils/directive/common.js +0 -0
  221. package/packages/utils/directive/index.js +0 -2
  222. package/packages/utils/directive/specific.js +0 -54
  223. package/packages/utils/index.js +0 -7
  224. package/packages/utils/tool/common.js +0 -65
  225. package/packages/utils/tool/index.js +0 -2
  226. package/packages/utils/tool/specific.js +0 -0
@@ -1,380 +0,0 @@
1
- <script>
2
- import DateRangeSelect from './date-range-select.vue'
3
- import { hrDayJs } from './utils/tools'
4
- import { DATE_SHORTCUT_PARAMS } from '../../enum/index.js'
5
-
6
-
7
- export default {
8
- name: 'TimeSelector',
9
- components: {
10
- DateRangeSelect,
11
- },
12
- props: {
13
- comItem: {
14
- type: Object,
15
- default: () => ({})
16
- },
17
- type: {
18
- type: String,
19
- default: 'daterange'
20
- },
21
- min: {
22
- type: String,
23
- default: '2020/01/01'
24
- },
25
- isTab: { // 是否显示快捷按钮
26
- type: Boolean,
27
- default: true
28
- },
29
- defaultValue: {
30
- type: Number,
31
- default: 1
32
- },
33
- defaultType: {
34
- type: String,
35
- default: 'month'
36
- },
37
- title: {
38
- type: String,
39
- default () {
40
- return '请选择'
41
- }
42
- },
43
- },
44
- data () {
45
- return {
46
- startDate: '',
47
- endDate: '',
48
- show: false,
49
- defaultDate: [],
50
- active: '',
51
- maxDate: hrDayJs(new Date())
52
- .subtract(-1, 'month')
53
- .format('YYYY/MM/DD'),
54
- selectValue: [],
55
- dateKey: 1
56
- }
57
- },
58
- mounted () {
59
- this.initDate();
60
- },
61
- methods: {
62
- handleChoose (active) {
63
- const param = DATE_SHORTCUT_PARAMS[active]
64
- const { count, type } = param
65
- this.startDate = hrDayJs().subtract(count, type).format('YYYY/MM/DD')
66
- this.endDate = hrDayJs().format('YYYY/MM/DD')
67
- this.active = active
68
- this.defaultDate = [this.startDate + ' 00:00:00', this.endDate + ' 23:59:59']
69
- this.$emit('input', this.defaultDate)
70
- },
71
- initDate () {
72
- let startDate = hrDayJs(new Date()).subtract(this.defaultValue, this.defaultType).format('YYYY/MM')
73
- let endDate = hrDayJs(new Date()).format('YYYY/MM/DD')
74
- this.defaultDate = [startDate + '/01 00:00:00', endDate + ' 23:59:59']
75
- this.selectValue = { str: [startDate, endDate] }
76
- this.startDate = null
77
- this.endDate = null
78
- this.active = ''
79
- // this.comItem.value = []
80
- },
81
- closePop () {
82
- this.show = false
83
- },
84
- showPop () {
85
- this.show = true
86
- },
87
- // 校验时间差
88
- timeDifference (date1, date2) {
89
- date1 = new Date(date1)
90
- date2 = new Date(date2)
91
- var newYear = date1.getFullYear()
92
- var newMonth = date1.getMonth() + 2
93
- if (newMonth >= 11) {
94
- newYear += 1
95
- newMonth -= 11
96
- date1.setFullYear(newYear)
97
- date1.setMonth(newMonth - 1)
98
- } else {
99
- date1.setFullYear(newYear)
100
- date1.setMonth(newMonth)
101
- }
102
- if (date1.getTime() >= date2.getTime()) {
103
- return true
104
- } else {
105
- return false
106
- }
107
- },
108
- // 时间选择器确认事件
109
- onSelect (value) {
110
- this.selectValue = value
111
- },
112
- submit () {
113
- console.log('submit', this.selectValue)
114
- let value = this.selectValue
115
- if (value.str && value.str.length && value.str[1]) {
116
- let res = this.timeDifference(value.str[0] + ' 00:00:00', value.str[1] + ' 00:00:00')
117
- if (res) {
118
- this.startDate = value.str[0]
119
- this.endDate = value.str[1]
120
- let val = [value.str[0] + ' 00:00:00', value.str[1] + ' 23:59:59']
121
- this.defaultDate = val
122
- this.$emit('input', val)
123
- this.active = ''
124
- this.show = false
125
- } else {
126
- this.$toast('选择时间不能超过2个月')
127
- }
128
-
129
- } else {
130
- this.$toast('请选择结束时间')
131
- }
132
- },
133
- reset () {
134
- this.initDate()
135
- this.dateKey++
136
- }
137
- },
138
- render () {
139
- {/* 渲染时间范围选择框 */ }
140
- const renderRangeInputBox = () => {
141
- return <div class="input-box">
142
- <span>{this.startDate}</span>
143
- <span class="mid-key"> - </span>
144
- <span>{this.endDate}</span>
145
- </div>
146
- }
147
-
148
- {/* 渲染单个时间选择框 */ }
149
- const renderInputBox = () => {
150
- return <div class="input-box">
151
- <span>{this.defaultDate}</span>
152
- </div>
153
- }
154
-
155
- {/* 快捷选项 */ }
156
- const renderSelectorShortcutBox = () => {
157
- return <div class="selector-shortcut">
158
- {
159
- Object.keys(DATE_SHORTCUT_PARAMS).map((key) => {
160
- return <div class={["shortcut-item", key == this.active ? 'active' : '']}
161
- onClick={this.handleChoose.bind(this, key)}
162
- key={key}>{DATE_SHORTCUT_PARAMS[key].text}</div>
163
- })
164
- }
165
- </div>
166
- }
167
-
168
- return <div class="time-selector">
169
- {/* 头部 */}
170
- <div class="selector-title">{this.title}</div>
171
- {/* 选择框 */}
172
- <div class="selector-input" onClick={this.showPop}>
173
- {this.type == 'daterange' && renderRangeInputBox()}
174
- {this.type == 'date' && renderInputBox()}
175
- <span class="input-icon"></span>
176
- </div>
177
- {/* 是否显示快捷按钮 */}
178
- {this.isTab && renderSelectorShortcutBox()}
179
- {/* 时间选择框 */}
180
- <div class="selector-popup">
181
- <van-popup
182
- value={this.show}
183
- onInput={(value) => { this.show = value }}
184
- style="height: 100%"
185
- get-container="body"
186
- position="right">
187
- <div class="popup-date">
188
- <header class="ksui-header">
189
- <div class="back-icon" onClick={() => { this.show = false }}>
190
- <van-icon size={15} name="arrow-left" />
191
- <span>选择时间段</span>
192
- </div>
193
- </header>
194
- <div class="date-content">
195
- <DateRangeSelect defaultValue={this.defaultDate}
196
- v-show={this.show}
197
- key={this.dateKey}
198
- min={this.min}
199
- max={this.maxDate}
200
- ref="dateRangeSelect"
201
- onSelect={this.onSelect} />
202
- </div>
203
- <div class="date-footer">
204
- <van-button type="default" onClick={this.reset} class="footer-btn left-btn">重置</van-button>
205
- <van-button type="primary" onClick={this.submit} class="footer-btn">确定</van-button>
206
- </div>
207
- </div >
208
- </van-popup>
209
- </div>
210
- </div >
211
- }
212
- }
213
- </script>
214
-
215
- <style lang="less" scoped>
216
- /deep/.van-calendar__body {
217
- .van-calendar__day--disabled {
218
- color: #ccc;
219
- }
220
- }
221
- /deep/.ksui-header {
222
- .back-icon {
223
- font-weight: 600 !important;
224
- font-size: 16px !important;
225
- .van-icon {
226
- font-weight: 600 !important;
227
- }
228
- }
229
- }
230
- .time-selector {
231
- width: 100%;
232
- text-align: center;
233
- line-height: 38px;
234
- .selector-title {
235
- line-height: 20px;
236
- margin-bottom: 12px;
237
- text-align: left;
238
- font-size: 14px;
239
- font-weight: 600;
240
- color: #03050d;
241
- .title-black {
242
- font-size: 14px;
243
- font-weight: normal;
244
- color: #6e6d72;
245
- }
246
- }
247
- .selector-input {
248
- background: #f3f4f6;
249
- border-radius: 8px;
250
- color: #232323;
251
- display: flex;
252
- justify-content: space-between;
253
- padding: 0 20px;
254
- align-items: center;
255
- line-height: 32px;
256
- .input-box {
257
- font-size: 14px;
258
- color: #333333;
259
- display: flex;
260
- justify-content: space-between;
261
- width: 100%;
262
- span {
263
- flex: 3;
264
- }
265
- .mid-key {
266
- flex: 1;
267
- }
268
- }
269
- .input-icon {
270
- display: inline-block;
271
- width: 14px;
272
- height: 14px;
273
- background: url("./images/date-icon.png") no-repeat;
274
- background-size: 100%;
275
- }
276
- }
277
- .selector-shortcut {
278
- display: flex;
279
- flex-wrap: wrap;
280
- // justify-content: space-between;
281
- justify-content: flex-start;
282
-
283
- margin-top: 12px;
284
- .shortcut-item {
285
- width: calc((100% - 16px) / 3);
286
- text-align: center;
287
- background: #f3f4f6;
288
- border-radius: 8px;
289
- margin-bottom: 11px;
290
- margin-right: 8px;
291
- line-height: 28px;
292
- font-size: 12px;
293
- color: #03050d;
294
-
295
- &.active {
296
- // border: 1px solid #7972fe;
297
- background: rgba(121, 114, 254, 0.08);
298
- color: #7972fe;
299
- position: relative;
300
- &::after {
301
- content: " ";
302
- position: absolute;
303
- left: 0;
304
- top: 0;
305
- width: 200%;
306
- height: 200%;
307
- border: 1px solid #7972fe;
308
- border-radius: 16px;
309
- -webkit-transform-origin: 0 0;
310
- transform-origin: 0 0;
311
- -webkit-transform: scale(0.5);
312
- transform: scale(0.5);
313
- }
314
- }
315
- }
316
- .shortcut-item:nth-child(3n) {
317
- margin-right: 0;
318
- }
319
- }
320
- }
321
- .popup-date {
322
- .back-icon {
323
- font-size: 14px;
324
- color: #03050d;
325
- font-weight: 500;
326
- display: inline-block;
327
- padding: 12px;
328
- i {
329
- position: relative;
330
- top: -1px;
331
- }
332
- span {
333
- margin-left: 2px;
334
- position: relative;
335
- top: -3px;
336
- }
337
- }
338
- /deep/ .van-calendar__bottom-info {
339
- bottom: 1px !important;
340
- }
341
- }
342
- .date-footer {
343
- width: 100%;
344
- padding: 14px 20px;
345
- // height: 64px;
346
- flex-shrink: 0;
347
- display: flex;
348
- justify-content: space-around;
349
- align-items: center;
350
- overflow: hidden;
351
- box-sizing: border-box;
352
- .footer-btn {
353
- height: 36px;
354
- width: 44%;
355
- border-radius: 8px;
356
- height: 40px;
357
- }
358
- .left-btn {
359
- color: #8b83fc;
360
- position: relative;
361
- border: none;
362
- font-size: 16px;
363
- height: 40px;
364
- &::after {
365
- content: " ";
366
- position: absolute;
367
- left: 0;
368
- top: 0;
369
- width: 200%;
370
- height: 200%;
371
- border: 1px solid #7972fe;
372
- border-radius: 16px;
373
- -webkit-transform-origin: 0 0;
374
- transform-origin: 0 0;
375
- -webkit-transform: scale(0.5);
376
- transform: scale(0.5);
377
- }
378
- }
379
- }
380
- </style>
@@ -1,30 +0,0 @@
1
- export const SECONDS_A_MINUTE = 60
2
- export const SECONDS_A_HOUR = SECONDS_A_MINUTE * 60
3
- export const SECONDS_A_DAY = SECONDS_A_HOUR * 24
4
- export const SECONDS_A_WEEK = SECONDS_A_DAY * 7
5
-
6
- export const MILLISECONDS_A_SECOND = 1e3
7
- export const MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND
8
- export const MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND
9
- export const MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND
10
- export const MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND
11
-
12
- // English locales
13
- export const MS = 'millisecond'
14
- export const S = 'second'
15
- export const MIN = 'minute'
16
- export const H = 'hour'
17
- export const D = 'day'
18
- export const W = 'week'
19
- export const M = 'month'
20
- export const Q = 'quarter'
21
- export const Y = 'year'
22
- export const DATE = 'date'
23
-
24
- export const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ'
25
-
26
- export const INVALID_DATE_STRING = 'Invalid Date'
27
-
28
- // regex
29
- export const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/
30
- export const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g
@@ -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,7 +0,0 @@
1
- import HrConditionFiltratePopup from './src/index.vue'
2
-
3
- HrConditionFiltratePopup.install = function (Vue) {
4
- Vue.component(HrConditionFiltratePopup.name, HrConditionFiltratePopup)
5
- }
6
-
7
- export default HrConditionFiltratePopup