@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,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,7 +0,0 @@
1
- import HrDropDownDate from './src/index.vue'
2
-
3
- HrDropDownDate.install = function (Vue) {
4
- Vue.component(HrDropDownDate.name, HrDropDownDate)
5
- }
6
-
7
- export default HrDropDownDate
@@ -1,128 +0,0 @@
1
- export default {
2
- // 当某月的天数
3
- getDaysInOneMonth (date) {
4
- const year = date.getFullYear()
5
- const month = date.getMonth() + 1
6
- const d = new Date(year, month, 0)
7
- return d.getDate()
8
- },
9
- // 向前空几个
10
- getMonthweek (date) {
11
- const year = date.getFullYear()
12
- const month = date.getMonth() + 1
13
- const dateFirstOne = new Date(year + '/' + month + '/1')
14
- return this.sundayStart ?
15
- dateFirstOne.getDay() == 0 ? 7 : dateFirstOne.getDay() :
16
- dateFirstOne.getDay() == 0 ? 6 : dateFirstOne.getDay() - 1
17
- },
18
- /**
19
- * 获取当前日期上个月或者下个月
20
- */
21
- getOtherMonth (date, str = 'nextMonth') {
22
- const timeArray = this.dateFormat(date).split('/')
23
- const year = timeArray[0]
24
- const month = timeArray[1]
25
- const day = timeArray[2]
26
- let year2 = year
27
- let month2
28
- if (str === 'nextMonth') {
29
- month2 = parseInt(month) + 1
30
- if (month2 == 13) {
31
- year2 = parseInt(year2) + 1
32
- month2 = 1
33
- }
34
- } else {
35
- month2 = parseInt(month) - 1
36
- if (month2 == 0) {
37
- year2 = parseInt(year2) - 1
38
- month2 = 12
39
- }
40
- }
41
- let day2 = day
42
- const days2 = new Date(year2, month2, 0).getDate()
43
- if (day2 > days2) {
44
- day2 = days2
45
- }
46
- if (month2 < 10) {
47
- month2 = '0' + month2
48
- }
49
- if (day2 < 10) {
50
- day2 = '0' + day2
51
- }
52
- const t2 = year2 + '/' + month2 + '/' + day2
53
- return new Date(t2)
54
- },
55
- // 上个月末尾的一些日期
56
- getLeftArr (date) {
57
- const arr = []
58
- const leftNum = this.getMonthweek(date)
59
- const num = this.getDaysInOneMonth(this.getOtherMonth(date, 'preMonth')) - leftNum + 1
60
- const preDate = this.getOtherMonth(date, 'preMonth')
61
- // 上个月多少开始
62
- for (let i = 0; i < leftNum; i++) {
63
- const nowTime = preDate.getFullYear() + '/' + (preDate.getMonth() + 1) + '/' + (num + i)
64
- const timestamp = (new Date(nowTime)).getTime()
65
- arr.push({
66
- id: num + i,
67
- timestamp: timestamp,
68
- date: nowTime,
69
- isToday: false,
70
- otherMonth: 'preMonth',
71
- })
72
- }
73
- return arr
74
- },
75
- // 下个月末尾的一些日期
76
- getRightArr (date) {
77
- const arr = []
78
- const nextDate = this.getOtherMonth(date, 'nextMonth')
79
- const leftLength = this.getDaysInOneMonth(date) + this.getMonthweek(date)
80
- const _length = 7 - leftLength % 7
81
- for (let i = 0; i < _length; i++) {
82
- const nowTime = nextDate.getFullYear() + '/' + (nextDate.getMonth() + 1) + '/' + (i + 1)
83
- const timestamp = (new Date(nowTime)).getTime()
84
- arr.push({
85
- id: i + 1,
86
- timestamp: timestamp,
87
- date: nowTime,
88
- isToday: false,
89
- otherMonth: 'nextMonth',
90
- })
91
- }
92
- return arr
93
- },
94
- // format日期
95
- dateFormat (date) {
96
- if (typeof date === 'string') {
97
- date = new Date(date.replace(/-/g, '/'))
98
- }
99
- return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate()
100
- },
101
- // 获取某月的列表不包括上月和下月
102
- getMonthListNoOther (date) {
103
- const arr = []
104
- const num = this.getDaysInOneMonth(date)
105
- const year = date.getFullYear()
106
- const month = date.getMonth() + 1
107
- const toDay = this.dateFormat(new Date())
108
-
109
- for (let i = 0; i < num; i++) {
110
- const nowTime = year + '/' + month + '/' + (i + 1)
111
- const timestamp = (new Date(nowTime)).getTime()
112
- arr.push({
113
- id: i + 1,
114
- timestamp: timestamp,
115
- date: nowTime,
116
- isToday: toDay === nowTime,
117
- otherMonth: 'nowMonth',
118
- })
119
- }
120
- return arr
121
- },
122
- // 获取某月的列表 用于渲染
123
- getMonthList (date) {
124
- return [...this.getLeftArr(date), ...this.getMonthListNoOther(date), ...this.getRightArr(date)]
125
- },
126
- // 默认是周一开始
127
- sundayStart: false,
128
- }