日期控件调整
Showing
2 changed files
with
61 additions
and
5 deletions
... | @@ -102,7 +102,7 @@ | ... | @@ -102,7 +102,7 @@ |
102 | <div class="down-arrow"></div> | 102 | <div class="down-arrow"></div> |
103 | <div class="cont"> | 103 | <div class="cont"> |
104 | <div class="ipt-date"> | 104 | <div class="ipt-date"> |
105 | <date-picker v-model="data.contactDate" :pluginActivity="pluginActivityHandler" :formatter="'dd-MM-yyyy'" :filtModel="['future','today']" :check="checkDate" :readonly="true" :cusStyle="{border:'none !important','background-color':'transparent !important','height':'58px', 'color':'#ff6839','font-weight':'bold','text-align': 'center'}"></date-picker> | 105 | <date-picker v-model="data.contactDate" :pluginActivity="pluginActivityHandler" :formatter="'dd-MM-yyyy'" :filtModel="['future']" :check="checkDate" :readonly="true" :cusStyle="{border:'none !important','background-color':'transparent !important','height':'58px', 'color':'#ff6839','font-weight':'bold','text-align': 'center'}"></date-picker> |
106 | </div> | 106 | </div> |
107 | </div> | 107 | </div> |
108 | </div> | 108 | </div> | ... | ... |
... | @@ -103,7 +103,7 @@ export default { | ... | @@ -103,7 +103,7 @@ export default { |
103 | visible: false, | 103 | visible: false, |
104 | hkHolidayDefine: { | 104 | hkHolidayDefine: { |
105 | // 公历假期,缺少复活节,缺少聖誕節後第一個周日 | 105 | // 公历假期,缺少复活节,缺少聖誕節後第一個周日 |
106 | gl: [[1, 1], [4, 10], [4, 11], [4, 30], [5, 1], [7, 1], [10, 1], [10, 2], [12, 25]], | 106 | gl: [[1, 1], [5, 1], [7, 1], [10, 1], [10, 2], [12, 25]], |
107 | // 农历假期,缺少清明节 | 107 | // 农历假期,缺少清明节 |
108 | nl: [[1, 1], [1, 2], [1, 3], [5, 5], [8, 15], [9, 9]], | 108 | nl: [[1, 1], [1, 2], [1, 3], [5, 5], [8, 15], [9, 9]], |
109 | // 清明节 | 109 | // 清明节 |
... | @@ -112,7 +112,40 @@ export default { | ... | @@ -112,7 +112,40 @@ export default { |
112 | ["2020", "2021", "2024", "2025", "2028", "2029", "2032", "2033", "2036", "2037"], | 112 | ["2020", "2021", "2024", "2025", "2028", "2029", "2032", "2033", "2036", "2037"], |
113 | // 4月5号 | 113 | // 4月5号 |
114 | ["2022", "2023", "2026", "2027", "2030", "2031", "2034", "2035", "2038", "2039"] | 114 | ["2022", "2023", "2026", "2027", "2030", "2031", "2034", "2035", "2038", "2039"] |
115 | ] | 115 | ], |
116 | pub: { | ||
117 | 2020: [[4, 10], [4, 11], [4, 12], [4, 13], [4, 30]], | ||
118 | 2021: [[4, 2], [4, 3], [4, 4], [4, 5], [5, 19]], | ||
119 | 2022: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 8]], | ||
120 | 2023: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 26]], | ||
121 | 2024: [[3, 29], [3, 30], [3, 31], [4, 1], [5, 15]], | ||
122 | 2025: [[4, 18], [4, 19], [4, 20], [4, 21], [5, 5]], | ||
123 | 2026: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 24]], | ||
124 | 2027: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 13]], | ||
125 | 2028: [[4, 14], [4, 15], [4, 16], [4, 17], [5, 2]], | ||
126 | 2029: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 20]], | ||
127 | 2030: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 9]], | ||
128 | 2031: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 28]], | ||
129 | 2032: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 16]], | ||
130 | 2033: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 6]], | ||
131 | 2034: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 25]], | ||
132 | 2035: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 15]], | ||
133 | 2036: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 3]], | ||
134 | 2037: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 22]], | ||
135 | 2038: [[4, 23], [4, 24], [4, 25], [4, 26], [5, 11]], | ||
136 | 2039: [[4, 8], [4, 9], [4, 10], [4, 11], [4, 30]], | ||
137 | 2040: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 18]], | ||
138 | 2041: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 7]], | ||
139 | 2042: [[4, 4], [4, 5], [4, 6], [4, 7], [5, 26]], | ||
140 | 2043: [[3, 27], [3, 28], [3, 29], [3, 30], [5, 16]], | ||
141 | 2044: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 5]], | ||
142 | 2045: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 24]], | ||
143 | 2046: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 13]], | ||
144 | 2047: [[4, 12], [4, 13], [4, 14], [4, 15], [5, 2]], | ||
145 | 2048: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 20]], | ||
146 | 2049: [[4, 16], [4, 17], [4, 18], [4, 19], [5, 9]], | ||
147 | 2050: [[4, 8], [4, 9], [4, 10], [4, 11], [5, 28]] | ||
148 | } | ||
116 | }, | 149 | }, |
117 | // 节假日,key是月份,value是日期列表 | 150 | // 节假日,key是月份,value是日期列表 |
118 | // holiday: { | 151 | // holiday: { |
... | @@ -171,6 +204,27 @@ export default { | ... | @@ -171,6 +204,27 @@ export default { |
171 | list.push(d); | 204 | list.push(d); |
172 | } | 205 | } |
173 | 206 | ||
207 | // 不能通过计算的公历 | ||
208 | let pubData = this.hkHolidayDefine.pub[year + ""]; | ||
209 | if (pubData) { | ||
210 | for (let index = 0; index < pubData.length; index++) { | ||
211 | let m = pubData[index][0]; | ||
212 | let d = pubData[index][1]; | ||
213 | |||
214 | // 如果是周六/周日,顺延到下周一 | ||
215 | let vals = this.checkWeeken(m, d); | ||
216 | m = vals[0]; | ||
217 | d = vals[1]; | ||
218 | |||
219 | let list = result[m]; | ||
220 | if (!list) { | ||
221 | result[m] = []; | ||
222 | list = result[m]; | ||
223 | } | ||
224 | list.push(d); | ||
225 | } | ||
226 | } | ||
227 | |||
174 | 228 | ||
175 | for (let index = 0; index < hkHolidayDefine.nl.length; index++) { | 229 | for (let index = 0; index < hkHolidayDefine.nl.length; index++) { |
176 | let m = hkHolidayDefine.nl[index][0]; | 230 | let m = hkHolidayDefine.nl[index][0]; |
... | @@ -432,8 +486,10 @@ export default { | ... | @@ -432,8 +486,10 @@ export default { |
432 | year: yearPage * 10 + index, | 486 | year: yearPage * 10 + index, |
433 | // disable: index == 0 || index == 11, | 487 | // disable: index == 0 || index == 11, |
434 | // gray: index == 0 || index == 11, | 488 | // gray: index == 0 || index == 11, |
435 | disable: index >= 10, | 489 | // disable: index >= 10, |
436 | gray: index >= 10, | 490 | // gray: index >= 10, |
491 | disable: false, | ||
492 | gray: false, | ||
437 | }); | 493 | }); |
438 | } | 494 | } |
439 | this.yearRange = `${yearPage * 10 + 0}-${yearPage * 10 + 9}` | 495 | this.yearRange = `${yearPage * 10 + 0}-${yearPage * 10 + 9}` | ... | ... |
-
Please register or sign in to post a comment