@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.
Files changed (246) hide show
  1. package/dist/hroa-ui.common.js +2344 -2381
  2. package/dist/hroa-ui.css +1 -1
  3. package/dist/hroa-ui.umd.js +2344 -2381
  4. package/dist/hroa-ui.umd.min.js +2 -2
  5. package/lib/h5-iaa/hr-assistant-profile/demo/index.css +1 -0
  6. package/lib/h5-iaa/hr-assistant-profile/demo/index.js +1 -0
  7. package/lib/hr-add-list/index.js +1 -1
  8. package/lib/hr-bottom-button/index.js +1 -1
  9. package/lib/hr-breadcrumb/index.js +2 -2
  10. package/lib/hr-button/index.js +1 -1
  11. package/lib/hr-checkbox/index.js +1 -1
  12. package/lib/hr-checkbox-group/index.js +1 -1
  13. package/lib/hr-clipboard/index.js +1 -1
  14. package/lib/hr-collapse-card/index.js +1 -1
  15. package/lib/hr-condition-filtrate/index.js +1 -1
  16. package/lib/hr-condition-filtrate-popup/index.js +1 -1
  17. package/lib/hr-date-filter/index.css +1 -1
  18. package/lib/hr-date-filter/index.js +1 -1
  19. package/lib/hr-dropdown-date/index.css +1 -1
  20. package/lib/hr-dropdown-date/index.js +1 -1
  21. package/lib/hr-elasticity-box/index.js +1 -1
  22. package/lib/hr-elasticity-box-item/index.js +1 -1
  23. package/lib/hr-emotional-picture/index.js +1 -1
  24. package/lib/hr-employee-choose/index.js +1 -1
  25. package/lib/hr-file-list/index.js +1 -1
  26. package/lib/hr-full-screen/index.js +1 -1
  27. package/lib/hr-img-list/index.css +1 -1
  28. package/lib/hr-img-list/index.js +1 -1
  29. package/lib/hr-info-card/index.js +1 -1
  30. package/lib/hr-information/index.js +1 -1
  31. package/lib/hr-license-plate-number/index.js +1 -1
  32. package/lib/hr-module-card/index.js +1 -1
  33. package/lib/hr-multiterm-choose/index.css +1 -1
  34. package/lib/hr-multiterm-choose/index.js +1 -1
  35. package/lib/hr-no-data/index.js +1 -1
  36. package/lib/hr-notice-bar/index.js +1 -1
  37. package/lib/hr-notification-dialog/index.js +1 -1
  38. package/lib/hr-open-ks/index.js +1 -1
  39. package/lib/hr-pager/index.js +1 -1
  40. package/lib/hr-popup/index.js +1 -1
  41. package/lib/hr-preview-file/index.js +1 -1
  42. package/lib/hr-radiobox/index.js +1 -1
  43. package/lib/hr-radiobox-group/index.js +1 -1
  44. package/lib/hr-rate/index.js +1 -1
  45. package/lib/hr-reason-textarea/index.js +1 -1
  46. package/lib/hr-search-input/index.js +1 -1
  47. package/lib/hr-search-tips/index.js +2 -2
  48. package/lib/hr-select/index.js +1 -1
  49. package/lib/hr-select-list/index.js +2 -2
  50. package/lib/hr-single-choose/index.css +1 -1
  51. package/lib/hr-single-choose/index.js +1 -1
  52. package/lib/hr-slide-pager/index.js +1 -1
  53. package/lib/hr-sort/index.js +1 -1
  54. package/lib/hr-stack-image/index.js +1 -1
  55. package/lib/hr-tab-nav/index.js +1 -1
  56. package/lib/hr-time-picker/index.js +1 -1
  57. package/lib/hr-view-item/index.js +1 -1
  58. package/lib/hr-virtual-list/index.js +1 -1
  59. package/lib/index/index.css +1 -1
  60. package/lib/index/index.js +2 -2
  61. package/lib/utils/index.js +1 -1
  62. package/package.json +82 -71
  63. package/lib/getJsModule/index.css +0 -1
  64. package/lib/getJsModule/index.js +0 -9
  65. package/packages/getJsModule.js +0 -11
  66. package/packages/hr-add-list/image/add.svg +0 -1
  67. package/packages/hr-add-list/image/close.svg +0 -1
  68. package/packages/hr-add-list/index.js +0 -7
  69. package/packages/hr-add-list/src/index.vue +0 -125
  70. 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
  71. package/packages/hr-bottom-button/index.js +0 -7
  72. package/packages/hr-bottom-button/src/index.vue +0 -128
  73. package/packages/hr-breadcrumb/index.js +0 -3
  74. package/packages/hr-breadcrumb/src/index.vue +0 -87
  75. package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
  76. package/packages/hr-button/index.js +0 -13
  77. package/packages/hr-button/src/hr-button.vue +0 -39
  78. package/packages/hr-checkbox/index.js +0 -8
  79. package/packages/hr-checkbox/src/active-icon.png +0 -0
  80. package/packages/hr-checkbox/src/checkbox-group.vue +0 -74
  81. package/packages/hr-checkbox/src/checkbox.vue +0 -226
  82. package/packages/hr-checkbox/src/data.js +0 -46
  83. 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
  84. package/packages/hr-checkbox-group/index.js +0 -8
  85. package/packages/hr-clipboard/index.js +0 -8
  86. package/packages/hr-clipboard/src/index.vue +0 -46
  87. package/packages/hr-clipboard/src/util.js +0 -9
  88. package/packages/hr-collapse-card/index.js +0 -3
  89. package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
  90. package/packages/hr-collapse-card/src/index.vue +0 -151
  91. package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
  92. package/packages/hr-condition-filtrate/enum/index.js +0 -11
  93. package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
  94. package/packages/hr-condition-filtrate/index.js +0 -7
  95. package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
  96. package/packages/hr-condition-filtrate/src/index.vue +0 -246
  97. package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
  98. package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
  99. package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
  100. package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
  101. package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
  102. package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
  103. package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
  104. package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
  105. package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
  106. package/packages/hr-condition-filtrate-popup/index.js +0 -7
  107. package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
  108. package/packages/hr-date-filter/index.js +0 -7
  109. package/packages/hr-date-filter/src/date-select.vue +0 -153
  110. package/packages/hr-date-filter/src/index.vue +0 -243
  111. package/packages/hr-date-filter/src/style.less +0 -130
  112. package/packages/hr-date-filter/src/utils.js +0 -109
  113. package/packages/hr-dropdown-date/index.js +0 -7
  114. package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
  115. package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
  116. package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
  117. package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
  118. package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
  119. package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
  120. package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
  121. package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
  122. package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
  123. package/packages/hr-dropdown-date/src/index.vue +0 -482
  124. package/packages/hr-dropdown-date/src/week.js +0 -194
  125. package/packages/hr-elasticity-box/index.js +0 -7
  126. package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
  127. package/packages/hr-elasticity-box/src/index.vue +0 -52
  128. package/packages/hr-elasticity-box-item/index.js +0 -7
  129. package/packages/hr-emotional-picture/index.js +0 -7
  130. package/packages/hr-emotional-picture/src/index.vue +0 -66
  131. package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
  132. package/packages/hr-employee-choose/index.js +0 -7
  133. package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
  134. package/packages/hr-employee-choose/src/index.vue +0 -119
  135. package/packages/hr-file-list/index.js +0 -3
  136. package/packages/hr-file-list/src/file-type/other.vue +0 -45
  137. package/packages/hr-file-list/src/file-type/picture.vue +0 -38
  138. package/packages/hr-file-list/src/file-type/video.vue +0 -60
  139. package/packages/hr-file-list/src/index.vue +0 -246
  140. package/packages/hr-file-list/src/utils/enum.js +0 -95
  141. package/packages/hr-file-list/src/utils/fun.js +0 -16
  142. package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
  143. package/packages/hr-full-screen/index.js +0 -7
  144. package/packages/hr-full-screen/src/index.vue +0 -117
  145. package/packages/hr-img-list/index.js +0 -3
  146. package/packages/hr-img-list/src/index.vue +0 -144
  147. package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
  148. package/packages/hr-info-card/index.js +0 -7
  149. package/packages/hr-info-card/src/index.vue +0 -67
  150. package/packages/hr-information/index.js +0 -7
  151. package/packages/hr-information/src/index.vue +0 -72
  152. package/packages/hr-license-plate-number/index.js +0 -8
  153. package/packages/hr-license-plate-number/src/enum.js +0 -44
  154. package/packages/hr-license-plate-number/src/index.vue +0 -164
  155. package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
  156. package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
  157. package/packages/hr-module-card/index.js +0 -13
  158. package/packages/hr-module-card/src/index.vue +0 -132
  159. 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
  160. package/packages/hr-multiterm-choose/index.js +0 -8
  161. package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
  162. package/packages/hr-multiterm-choose/src/index.vue +0 -224
  163. package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
  164. package/packages/hr-no-data/index.js +0 -7
  165. package/packages/hr-no-data/src/index.vue +0 -48
  166. package/packages/hr-notice-bar/index.js +0 -7
  167. package/packages/hr-notice-bar/src/bem.js +0 -38
  168. package/packages/hr-notice-bar/src/index.js +0 -52
  169. package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
  170. package/packages/hr-notification-dialog/images/header.png +0 -0
  171. package/packages/hr-notification-dialog/index.js +0 -7
  172. package/packages/hr-notification-dialog/src/index.vue +0 -293
  173. 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
  174. package/packages/hr-open-ks/index.js +0 -7
  175. package/packages/hr-open-ks/src/icon.png +0 -0
  176. package/packages/hr-open-ks/src/index.vue +0 -97
  177. package/packages/hr-open-ks/src/util.js +0 -31
  178. package/packages/hr-pager/images/next-page.png +0 -0
  179. package/packages/hr-pager/images/prev-page.png +0 -0
  180. package/packages/hr-pager/index.js +0 -7
  181. package/packages/hr-pager/src/index.vue +0 -120
  182. 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
  183. package/packages/hr-popup/index.js +0 -3
  184. package/packages/hr-popup/src/index.vue +0 -64
  185. package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
  186. package/packages/hr-preview-file/index.js +0 -7
  187. package/packages/hr-preview-file/src/index.vue +0 -58
  188. package/packages/hr-preview-file/src/util.js +0 -50
  189. package/packages/hr-radiobox/index.js +0 -8
  190. package/packages/hr-radiobox/src/data.js +0 -46
  191. package/packages/hr-radiobox/src/radiobox-group.vue +0 -64
  192. package/packages/hr-radiobox/src/radiobox.vue +0 -191
  193. package/packages/hr-radiobox-group/index.js +0 -8
  194. package/packages/hr-rate/index.js +0 -7
  195. package/packages/hr-rate/src/index.vue +0 -42
  196. 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
  197. package/packages/hr-reason-textarea/index.js +0 -7
  198. package/packages/hr-reason-textarea/src/index.vue +0 -128
  199. package/packages/hr-search-input/image/input-close-icon.png +0 -0
  200. package/packages/hr-search-input/image/search-icon.png +0 -0
  201. package/packages/hr-search-input/index.js +0 -8
  202. package/packages/hr-search-input/src/index.vue +0 -144
  203. package/packages/hr-search-tips/index.js +0 -3
  204. package/packages/hr-search-tips/src/index.vue +0 -213
  205. 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
  206. package/packages/hr-select/index.js +0 -7
  207. package/packages/hr-select/src/index.vue +0 -41
  208. package/packages/hr-select-list/index.js +0 -3
  209. package/packages/hr-select-list/src/index.vue +0 -214
  210. 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
  211. package/packages/hr-single-choose/index.js +0 -8
  212. package/packages/hr-single-choose/src/index.vue +0 -195
  213. package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
  214. package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
  215. package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
  216. package/packages/hr-slide-pager/guide/index.vue +0 -59
  217. package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
  218. package/packages/hr-slide-pager/index.js +0 -7
  219. package/packages/hr-slide-pager/src/index.vue +0 -374
  220. 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
  221. package/packages/hr-sort/index.js +0 -3
  222. package/packages/hr-sort/src/main.vue +0 -133
  223. package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
  224. package/packages/hr-stack-image/index.js +0 -3
  225. package/packages/hr-stack-image/src/main.vue +0 -77
  226. 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
  227. package/packages/hr-tab-nav/index.js +0 -8
  228. package/packages/hr-tab-nav/src/index.vue +0 -190
  229. package/packages/hr-time-picker/index.js +0 -3
  230. package/packages/hr-time-picker/src/index.vue +0 -85
  231. package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
  232. package/packages/hr-view-item/index.js +0 -13
  233. package/packages/hr-view-item/src/index.vue +0 -89
  234. package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
  235. package/packages/hr-virtual-list/index.js +0 -7
  236. package/packages/hr-virtual-list/src/cc-item.vue +0 -105
  237. package/packages/hr-virtual-list/src/index.vue +0 -227
  238. package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
  239. package/packages/index.js +0 -23
  240. package/packages/utils/directive/common.js +0 -0
  241. package/packages/utils/directive/index.js +0 -2
  242. package/packages/utils/directive/specific.js +0 -54
  243. package/packages/utils/index.js +0 -7
  244. package/packages/utils/tool/common.js +0 -65
  245. package/packages/utils/tool/index.js +0 -2
  246. package/packages/utils/tool/specific.js +0 -0
@@ -1,195 +0,0 @@
1
- <script>
2
- export default {
3
- name: 'HrSingleChoose',
4
- props: {
5
- list: {
6
- type: Array,
7
- default () {
8
- return [
9
- {
10
- label: '课程类型',
11
- value: 10
12
- },
13
- {
14
- label: '课程类型2',
15
- value: 20
16
- },
17
- {
18
- label: '课程类型3',
19
- value: 30
20
- },
21
- {
22
- label: '课程类型4',
23
- value: 40
24
- }
25
- ]
26
- }
27
- },
28
- title: {
29
- type: String,
30
- default () {
31
- return ''
32
- }
33
- },
34
- isShowAll: {
35
- type: Boolean,
36
- default () {
37
- return false
38
- }
39
- },
40
- divideeQually: {
41
- type: Number,
42
- default () {
43
- return 3
44
- }
45
- },
46
- margin: {
47
- type: Number,
48
- default () {
49
- return 12
50
- }
51
- },
52
- marginBottom: {
53
- type: Number,
54
- default () {
55
- return this.margin
56
- }
57
- },
58
- selfAdaption: {
59
- type: Boolean,
60
- default () {
61
- return false
62
- }
63
- },
64
- checkValue: {
65
- type: [String, Number],
66
- default () {
67
- return -1
68
- }
69
- }
70
- },
71
- data () {
72
- return {
73
- active: -1
74
- }
75
- },
76
- created () {
77
- this.init()
78
- },
79
- computed: {
80
- filterList () {
81
- return this.isShowAll ? [{ label: '全部', value: 0 }].concat(this.list) : this.list
82
- }
83
- },
84
- watch: {
85
- checkValue: {
86
- handler (newValue) {
87
- this.initActive(newValue)
88
- },
89
- immediate: true
90
- }
91
- },
92
- methods: {
93
- init () {
94
- this.initState()
95
- },
96
- initState () {
97
- },
98
- initActive (newValue) {
99
- this.active = newValue
100
- },
101
- select (value, index) {
102
- this.active = this.active === value ? -1 : value
103
- this.$emit('select', this.filterList[index])
104
- },
105
- },
106
- render () {
107
- const width = this.selfAdaption ? null : `calc((100% - ${this.margin * (this.divideeQually - 1)}px) / ${this.divideeQually})`
108
- const marginBottom = `${this.marginBottom}px`
109
- return <div class="single-choose">
110
- {
111
- this.title && <div class="choose-title">{this.title}</div>
112
- }
113
- <div class="choose-condition">
114
- {
115
- this.filterList.map((item, index) => {
116
- const marginRight = this.selfAdaption ? `${this.margin}px` : `${(this.index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
117
- const { value, label } = item
118
- return <div
119
- onClick={this.select.bind(this, value, index)}
120
- style={{ width, marginRight, marginBottom }}
121
- class={[
122
- 'condition-item',
123
- 'ellipsis',
124
- this.active === value && 'active',
125
- ]}>
126
- {label}
127
- </div>
128
- })
129
- }
130
- </div>
131
- </div>
132
- }
133
- }
134
- </script>
135
-
136
- <style scoped lang="less">
137
- .ellipsis {
138
- overflow: hidden;
139
- white-space: nowrap;
140
- text-overflow: ellipsis;
141
- }
142
- .single-choose {
143
- .choose-title {
144
- line-height: 20px;
145
- margin-bottom: 12px;
146
- text-align: left;
147
- font-size: 14px;
148
- font-weight: 600;
149
- color: #03050d;
150
- .title-black {
151
- font-size: 14px;
152
- font-weight: normal;
153
- color: #6e6d72;
154
- }
155
- }
156
- .choose-condition {
157
- display: flex;
158
- flex-wrap: wrap;
159
- justify-content: flex-start;
160
- .condition-item {
161
- // width: calc((100% - 16px) / 3);
162
- height: 28px;
163
- border-radius: 8px;
164
- box-sizing: border-box;
165
- background: #f7f8fa;
166
- text-align: center;
167
- line-height: 27px;
168
- color: #03050d;
169
- font-size: 12px;
170
- padding: 0 8px;
171
- position: relative;
172
- }
173
- .condition-item.active {
174
- // border: 1px solid rgba(121, 114, 254, 0.8);
175
- background: rgba(121, 114, 254, 0.08);
176
- color: #7972fe;
177
- &::after {
178
- content: " ";
179
- position: absolute;
180
- left: 0;
181
- top: 0;
182
- width: calc(200% - 2px);
183
- height: calc(200% - 2px);
184
- border: 1px solid #7972fe;
185
- border-radius: 16px;
186
- box-sizing: border-box;
187
- -webkit-transform-origin: 0 0;
188
- transform-origin: 0 0;
189
- -webkit-transform: scale(0.5);
190
- transform: scale(0.5);
191
- }
192
- }
193
- }
194
- }
195
- </style>
@@ -1,59 +0,0 @@
1
- <template>
2
- <div class="slide-pager-guide">
3
- <div class="content-box">
4
- <div class="arrow-img">
5
- <img src="./image/turn-left.png">
6
- <img src="./image/turn-right.png">
7
- </div>
8
-
9
- <div class="tips">左右滑动可切换上下篇</div>
10
-
11
- <van-button type="primary"
12
- style="width: 128px; height: 40px;"
13
- @click="$emit('markRead')">知道了</van-button>
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- export default {
20
- }
21
- </script>
22
-
23
- <style lang="less" scoped>
24
- .slide-pager-guide {
25
- position: fixed;
26
- left: 0;
27
- top: 0;
28
- height: 100%;
29
- width: 100%;
30
- z-index: 999;
31
- // opacity: 1;
32
- /* 中性色/蒙层#000000-70% */
33
- background: rgba(0, 0, 0, 0.7);
34
- display: flex;
35
- align-items: center;
36
- justify-content: center;
37
-
38
- .content-box {
39
- display: flex;
40
- flex-direction: column;
41
- align-items: center;
42
- justify-content: center;
43
- }
44
-
45
- .arrow-img {
46
- display: flex;
47
- align-items: center;
48
- justify-content: space-around;
49
- > img {
50
- width: 28%;
51
- }
52
- }
53
- .tips {
54
- margin: 60px 0;
55
- font-size: 32px;
56
- color: #ffffff;
57
- }
58
- }
59
- </style>
@@ -1,7 +0,0 @@
1
- import hrSlidePager from './src/index.vue'
2
-
3
- hrSlidePager.install = function (Vue) {
4
- Vue.component(hrSlidePager.name, hrSlidePager);
5
- };
6
-
7
- export default hrSlidePager;
@@ -1,374 +0,0 @@
1
- <template>
2
- <div class="hr-slide-pager"
3
- ref="swiper">
4
- <div class="shadow left"
5
- ref="left"
6
- :style="{ width: leftShadowWidth + 'px' }">
7
- <span v-show="leftShadowWidth > threshold"
8
- class="text">向右滑动可切换上一{{ unitName }}</span>
9
- </div>
10
-
11
- <div class="shadow right"
12
- ref="right"
13
- :style="{ width: rightShadowWidth + 'px' }">
14
- <span v-show="rightShadowWidth > threshold"
15
- class="text">向左滑动可切换下一{{ unitName }}</span>
16
- </div>
17
-
18
- <guide v-if="isShowNoviceGuide && isShowGuide"
19
- @markRead="markRead" />
20
- </div>
21
- </template>
22
-
23
- <script>
24
- import { debounce, ksStorage } from '../../utils/tool/index'
25
- import guide from '../guide/index.vue'
26
-
27
- // 新手指引标识
28
- const GuideVersion = 'SlidePagerGuideVersion_V2'
29
-
30
- export default {
31
- name: 'hr-slide-pager',
32
- components: {
33
- guide
34
- },
35
- props: {
36
- // 当前id
37
- currentId: {
38
- type: [String, Number],
39
- default: ''
40
- },
41
- // 需分页的id集合
42
- ids: {
43
- type: Array,
44
- default: () => []
45
- },
46
- // 切换上下周周报时是否冻结分页器,用于保留当前分页id
47
- isFreeze: {
48
- type: Boolean,
49
- default: false
50
- },
51
- // 是否可以切换分页的钩子,为true可切换,为false不可切换
52
- canTurnPageFn: {
53
- type: Function,
54
- default () {
55
- return () => true
56
- }
57
- },
58
- // 是否禁用翻页
59
- disabled: {
60
- type: Boolean,
61
- default: false
62
- },
63
- // 滑动翻页的阈值 (即滑动多远距离后触发翻页动作 单位:px)
64
- threshold: {
65
- type: Number,
66
- default: 60
67
- },
68
- // 监听触摸的容器
69
- container: {
70
- type: String,
71
- default: '.hr-slide-pager'
72
- },
73
- // 分页器单位名称 【页|篇...】
74
- unitName: {
75
- type: String,
76
- default: '篇'
77
- },
78
- // 是否展示新手指引
79
- isShowNoviceGuide: {
80
- type: Boolean,
81
- default: false
82
- }
83
- },
84
- data () {
85
- return {
86
- startX: 0,
87
- startY: 0,
88
- leftShadowWidth: 0, // 左边界阴影宽度
89
- rightShadowWidth: 0, // 右边界阴影宽度
90
- currentIndex: 0, // 当前分页器索引
91
- isSelectTextNow: false, // 当前是否正在选择文本
92
- isShowGuide: false, // 是否展示新手指引
93
- pageTurning: false, // 当前是否翻页中
94
- }
95
- },
96
- created () {
97
- this.judgeIsShowGuide() // 2个迭代后移除,避免app清空标识导致状态丢失
98
- this.nextPage = debounce(this.nextPage, 100)
99
- this.prevPage = debounce(this.prevPage, 100)
100
- },
101
- mounted () {
102
- this.addEventForContainer()
103
- },
104
- computed: {
105
- // 下一页是否禁用
106
- nextDisabled () {
107
- return this.currentIndex >= this.ids.length - 1
108
- },
109
- // 上一页是否禁用
110
- prevDisabled () {
111
- return this.currentIndex <= 0
112
- },
113
- // 是否禁用翻页器
114
- disabledSlider () {
115
- // 禁用的场景 传入的disabled || 用户正在选择文本 || 翻页中 || ids数量小于2
116
- return this.disabled || this.isSelectTextNow || this.pageTurning || this.ids.length < 2
117
- }
118
- },
119
- watch: {
120
- currentId: {
121
- handler () {
122
- this.getCurrentIndex()
123
- },
124
- immediate: true
125
- },
126
- ids: {
127
- handler () {
128
- this.getCurrentIndex()
129
- },
130
- immediate: true
131
- },
132
- },
133
- methods: {
134
- /**
135
- * @description 给指定容器添加触摸监听事件
136
- */
137
- addEventForContainer () {
138
- this.$nextTick(() => {
139
- let containerDom = document.querySelector(`${this.container}`)
140
- containerDom.addEventListener('touchstart', this.handleTouchStart)
141
- containerDom.addEventListener('touchmove', this.handleTouchMove)
142
- containerDom.addEventListener('touchend', this.handleTouchEnd)
143
- containerDom.addEventListener('touchcancel', this.handleTouchEnd)
144
- })
145
- },
146
- /**
147
- * @description 判断是否展示新手指引
148
- */
149
- async judgeIsShowGuide () {
150
- let res = await ksStorage.getItem(GuideVersion)
151
- this.isShowGuide = res !== '10'
152
- },
153
- /**
154
- * @description 新手指引标记已读
155
- */
156
- markRead () {
157
- this.isShowGuide = false
158
- ksStorage.setItem(GuideVersion, '10')
159
- },
160
- /**
161
- * @description 获取当前页面是否用户正在选择文本
162
- */
163
- judgeIsSelectText () {
164
- setTimeout(() => {
165
- this.isSelectTextNow = !!window.getSelection().toString()
166
- })
167
- },
168
- /**
169
- * @description 重置触摸状态
170
- */
171
- resetTouchStatus () {
172
- setTimeout(() => {
173
- cancelAnimationFrame(this.animationId)
174
- this.animationId = null
175
- this.leftShadowWidth = 0
176
- this.rightShadowWidth = 0
177
- }, 100)
178
- },
179
- /**
180
- * @description 获取当前id在ids的索引
181
- */
182
- getCurrentIndex () {
183
- // 切换上下周周报时,冻结分页器后不响应id变化处理
184
- if (this.ids && !this.isFreeze) {
185
- this.currentIndex = this.ids.findIndex(v => +v === +this.currentId)
186
- }
187
- },
188
- /**
189
- * @description 手指触摸开始(记录触发的xy轴坐标)
190
- * @param {*} event
191
- */
192
- handleTouchStart (event) {
193
- if (this.disabledSlider) return
194
-
195
- console.log('handleTouchStart------🐸🐸🐸🐸')
196
- this.startX = event.touches[0].clientX
197
- this.startY = event.touches[0].clientY
198
- },
199
- /**
200
- * @description 手指触摸移动事件 (用于绘制翻页动画效果)
201
- * @param {*} event
202
- */
203
- handleTouchMove (event) {
204
- if (this.disabledSlider) return
205
-
206
- const deltaX = event.touches[0].clientX - this.startX
207
- const deltaY = event.touches[0].clientY - this.startY
208
-
209
- if ((Math.abs(deltaX) > Math.abs(deltaY))) {
210
- if (deltaX > 0) {
211
- this.animationId = requestAnimationFrame(() => {
212
- this.rightShadowWidth = 0
213
- this.leftShadowWidth = Math.min(deltaX, 80)
214
- })
215
- } else if (deltaX < 0) {
216
- this.animationId = requestAnimationFrame(() => {
217
- this.leftShadowWidth = 0
218
- this.rightShadowWidth = Math.min(-deltaX, 80)
219
- })
220
- }
221
- }
222
- },
223
- /**
224
- * @description 手指触摸结束 (决定是否触发翻页事件)
225
- * @param {*} event
226
- */
227
- handleTouchEnd (event) {
228
- this.judgeIsSelectText()
229
-
230
- if (this.disabledSlider) return
231
-
232
- console.log('handleTouchEnd-----💥💥💥💥💥💥')
233
-
234
- const deltaX = event.changedTouches[0].clientX - this.startX
235
- const deltaY = event.changedTouches[0].clientY - this.startY
236
- console.log('handleTouchEnd----', deltaX, deltaY)
237
-
238
- if (Math.abs(deltaX) > Math.abs(deltaY)) {
239
- if (deltaX > this.threshold) {
240
- if (!this.prevDisabled) {
241
- console.log('左滑-----🚀🚀🚀🚀')
242
- this.prevPage()
243
- } else {
244
- window.vant.Toast(`已经到第一${this.unitName}~`)
245
- }
246
-
247
- } else if (deltaX < -this.threshold) {
248
- if (!this.nextDisabled) {
249
- console.log('右滑-----🐸🐸🐸🐸')
250
- this.nextPage()
251
- } else {
252
- window.vant.Toast(`已经到最后一${this.unitName}~`)
253
- }
254
- }
255
- }
256
-
257
- this.resetTouchStatus()
258
- },
259
- /**
260
- * @description 维护是否翻页中状态
261
- */
262
- setPageTurningStatus () {
263
- if (this.timer) return
264
- this.pageTurning = true
265
- this.timer = setTimeout(() => {
266
- this.pageTurning = false
267
- if (this.timer) {
268
- clearTimeout(this.timer)
269
- this.timer = null
270
- }
271
- }, 500)
272
- },
273
- /**
274
- * @descrition 下一页
275
- */
276
- async nextPage () {
277
- this.setPageTurningStatus()
278
- // 校验切分页钩子,判断是否可切换分页
279
- let isLimitSwitch = await this.isLimitSwitchPage()
280
-
281
- if (isLimitSwitch || this.nextDisabled) {
282
- return
283
- }
284
- this.currentIndex++
285
- this.$emit('turnPage', this.ids[this.currentIndex])
286
- },
287
- /**
288
- * @descrition 上一页
289
- */
290
- async prevPage () {
291
- this.setPageTurningStatus()
292
- // 校验切分页钩子,判断是否可切换分页
293
- let isLimitSwitch = await this.isLimitSwitchPage()
294
-
295
- if (isLimitSwitch || this.prevDisabled) {
296
- return
297
- }
298
- this.currentIndex--
299
- this.$emit('turnPage', this.ids[this.currentIndex])
300
- },
301
- /**
302
- * @description 校验是否可切换分页钩子
303
- * @returns {Boolean} true-禁止切换 false-可切换
304
- */
305
- async isLimitSwitchPage () {
306
- // 钩子存在,并且不可切换分页
307
- if (this.canTurnPageFn && typeof this.canTurnPageFn === 'function') {
308
- let canSwitchPage = await this.canTurnPageFn()
309
- if (!canSwitchPage) {
310
- return true
311
- }
312
- }
313
- }
314
- }
315
- };
316
- </script>
317
-
318
- <style lang="less">
319
- .hr-slide-pager {
320
- transform: translate3d(0, 0, 1);
321
- z-index: 999;
322
- overflow: hidden;
323
-
324
- .shadow {
325
- position: absolute;
326
- top: 44px;
327
- height: 100%;
328
- z-index: 9;
329
- display: flex;
330
- align-items: center;
331
- justify-content: center;
332
- transition: all 0.1s;
333
- overflow: hidden;
334
- opacity: 0.9;
335
- &::before {
336
- content: "";
337
- width: 100%;
338
- height: 100%;
339
- position: absolute;
340
- z-index: -1;
341
- opacity: 0.9;
342
- background: #ffffff;
343
- filter: blur(10px);
344
- }
345
- .text {
346
- filter: blur(0);
347
- display: inline-block;
348
- width: 10px;
349
- color: #888ea6;
350
- font-size: 13px;
351
- }
352
- }
353
-
354
- .left {
355
- left: 0;
356
- }
357
-
358
- .right {
359
- right: 0;
360
- }
361
- }
362
-
363
- .ios {
364
- .hr-slide-pager .shadow {
365
- top: 64px;
366
- }
367
- }
368
-
369
- .ios.ipx {
370
- .hr-slide-pager .shadow {
371
- top: 88px !important;
372
- }
373
- }
374
- </style>
@@ -1,3 +0,0 @@
1
- import HrSort from './src/main'
2
-
3
- export default HrSort