evui 3.3.36 → 3.3.39
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/LICENSE +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
|
@@ -1,661 +1,661 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ev-calendar-wrapper">
|
|
3
|
-
<div class="ev-calendar-date-area">
|
|
4
|
-
<div class="ev-calendar-header">
|
|
5
|
-
<div @click="clickPrevNextBtn('main', 'prev')">
|
|
6
|
-
<i class="ev-icon-s-arrow-left move-month-arrow" />
|
|
7
|
-
</div>
|
|
8
|
-
<span class="ev-calendar-year">{{ mainCalendarPageInfo.year }}</span>
|
|
9
|
-
<span class="ev-calendar-month">{{ mainCalendarMonth }}</span>
|
|
10
|
-
<div @click="clickPrevNextBtn('main', 'next')">
|
|
11
|
-
<i
|
|
12
|
-
:class="[
|
|
13
|
-
'ev-icon-s-arrow-right move-month-arrow',
|
|
14
|
-
{ disabled: isContinuousMonths },
|
|
15
|
-
]"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="ev-calendar-body">
|
|
20
|
-
<table
|
|
21
|
-
:key="'main_calendar_table'"
|
|
22
|
-
class="ev-calendar-table"
|
|
23
|
-
>
|
|
24
|
-
<thead>
|
|
25
|
-
<tr>
|
|
26
|
-
<th
|
|
27
|
-
v-for="dayOfTheWeek in dayOfTheWeekList"
|
|
28
|
-
:key="dayOfTheWeek"
|
|
29
|
-
>
|
|
30
|
-
{{ dayOfTheWeek }}
|
|
31
|
-
</th>
|
|
32
|
-
</tr>
|
|
33
|
-
</thead>
|
|
34
|
-
<tbody
|
|
35
|
-
@wheel.prevent="wheelMonth('main', $event)"
|
|
36
|
-
>
|
|
37
|
-
<tr
|
|
38
|
-
v-for="weekInfo in mainCalendarTableInfo"
|
|
39
|
-
:key="weekInfo"
|
|
40
|
-
>
|
|
41
|
-
<td
|
|
42
|
-
v-for="dateInfo in weekInfo"
|
|
43
|
-
:key="dateInfo"
|
|
44
|
-
class="ev-calendar-date-td"
|
|
45
|
-
:class="[
|
|
46
|
-
{ [dateInfo.monthType]: !!dateInfo.monthType },
|
|
47
|
-
{ today: dateInfo.isToday },
|
|
48
|
-
{ selected: dateInfo.isSelected },
|
|
49
|
-
]"
|
|
50
|
-
@click="clickDate('main', dateInfo)"
|
|
51
|
-
@[`${calendarEventName}`]="onMousemoveDate('main', $event)"
|
|
52
|
-
>
|
|
53
|
-
<div>
|
|
54
|
-
<span>
|
|
55
|
-
{{ dateInfo.date }}
|
|
56
|
-
</span>
|
|
57
|
-
</div>
|
|
58
|
-
</td>
|
|
59
|
-
</tr>
|
|
60
|
-
</tbody>
|
|
61
|
-
</table>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div
|
|
66
|
-
v-if="['dateTime', 'dateTimeRange'].includes(mode)"
|
|
67
|
-
class="ev-calendar-time-area"
|
|
68
|
-
>
|
|
69
|
-
<div class="ev-calendar-time-side">
|
|
70
|
-
<div
|
|
71
|
-
v-for="hmsType in ['HOUR', 'MIN', 'SEC']"
|
|
72
|
-
:key="`${hmsType}_TITLE`"
|
|
73
|
-
>
|
|
74
|
-
{{ hmsType }}
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="ev-calendar-time-center">
|
|
78
|
-
<template
|
|
79
|
-
v-for="timeType in ['hour', 'min', 'sec']"
|
|
80
|
-
:key="`${timeType}_table`"
|
|
81
|
-
>
|
|
82
|
-
<table class="ev-calendar-time-table">
|
|
83
|
-
<tbody
|
|
84
|
-
@wheel.prevent="wheelTime('main', timeType, $event)"
|
|
85
|
-
>
|
|
86
|
-
<tr
|
|
87
|
-
v-for="i in 3"
|
|
88
|
-
:key="`${timeType}_${i}_tr`"
|
|
89
|
-
>
|
|
90
|
-
<td
|
|
91
|
-
v-for="j in 4"
|
|
92
|
-
:key="`${timeType}_${i}_${j}_td`"
|
|
93
|
-
class="ev-calendar-time-td"
|
|
94
|
-
:class="{
|
|
95
|
-
selected: getTimeInfo(timeType, i, j, 'main').isSelected,
|
|
96
|
-
disabled: preventTimeEventType.main[timeType]
|
|
97
|
-
|| getTimeInfo(timeType, i, j, 'main').isDisabled,
|
|
98
|
-
}"
|
|
99
|
-
@click="clickTime('main', timeType, i, j)"
|
|
100
|
-
>
|
|
101
|
-
<div> {{ getTimeInfo(timeType, i, j, 'main').num }} </div>
|
|
102
|
-
</td>
|
|
103
|
-
</tr>
|
|
104
|
-
</tbody>
|
|
105
|
-
</table>
|
|
106
|
-
</template>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="ev-calendar-time-side">
|
|
109
|
-
<template
|
|
110
|
-
v-for="hmsType in ['hour', 'min', 'sec']"
|
|
111
|
-
:key="`${hmsType}_btn_area`"
|
|
112
|
-
>
|
|
113
|
-
<div
|
|
114
|
-
v-for="arrowType in ['up', 'down']"
|
|
115
|
-
:key="`${hmsType}_${arrowType}_btn`"
|
|
116
|
-
:class="hmsType === 'hour' ? 'arrow-hour' : 'arrow-other'"
|
|
117
|
-
@click="clickHmsBtn('main', hmsType, arrowType)"
|
|
118
|
-
>
|
|
119
|
-
<i
|
|
120
|
-
:class="[
|
|
121
|
-
`ev-icon-arrow-${arrowType}`,
|
|
122
|
-
{ disabled: preventTimeEventType.main[hmsType] }
|
|
123
|
-
]" />
|
|
124
|
-
</div>
|
|
125
|
-
</template>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div
|
|
130
|
-
v-if="['dateRange', 'dateTimeRange'].includes(mode)"
|
|
131
|
-
class="ev-calendar-date-area"
|
|
132
|
-
>
|
|
133
|
-
<div class="ev-calendar-header">
|
|
134
|
-
<div @click="clickPrevNextBtn('expanded', 'prev')">
|
|
135
|
-
<i
|
|
136
|
-
:class="[
|
|
137
|
-
'ev-icon-s-arrow-left move-month-arrow',
|
|
138
|
-
{ disabled: isContinuousMonths },
|
|
139
|
-
]"
|
|
140
|
-
/>
|
|
141
|
-
</div>
|
|
142
|
-
<span class="ev-calendar-year">{{ expandedCalendarPageInfo.year }}</span>
|
|
143
|
-
<span class="ev-calendar-month">{{ expandedCalendarMonth }}</span>
|
|
144
|
-
<div @click="clickPrevNextBtn('expanded', 'next')">
|
|
145
|
-
<i class="ev-icon-s-arrow-right move-month-arrow" />
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
<div class="ev-calendar-body">
|
|
149
|
-
<table
|
|
150
|
-
:key="'expanded_calendar_table'"
|
|
151
|
-
class="ev-calendar-table"
|
|
152
|
-
>
|
|
153
|
-
<thead>
|
|
154
|
-
<tr>
|
|
155
|
-
<th
|
|
156
|
-
v-for="dayOfTheWeek in dayOfTheWeekList"
|
|
157
|
-
:key="dayOfTheWeek"
|
|
158
|
-
>
|
|
159
|
-
{{ dayOfTheWeek }}
|
|
160
|
-
</th>
|
|
161
|
-
</tr>
|
|
162
|
-
</thead>
|
|
163
|
-
<tbody
|
|
164
|
-
@wheel.prevent="wheelMonth('expanded', $event)"
|
|
165
|
-
>
|
|
166
|
-
<tr
|
|
167
|
-
v-for="weekInfo in expandedCalendarTableInfo"
|
|
168
|
-
:key="weekInfo"
|
|
169
|
-
>
|
|
170
|
-
<td
|
|
171
|
-
v-for="dateInfo in weekInfo"
|
|
172
|
-
:key="dateInfo"
|
|
173
|
-
class="ev-calendar-date-td"
|
|
174
|
-
:class="[
|
|
175
|
-
{ [dateInfo.monthType]: !!dateInfo.monthType },
|
|
176
|
-
{ today: dateInfo.isToday },
|
|
177
|
-
{ selected: dateInfo.isSelected },
|
|
178
|
-
]"
|
|
179
|
-
@click="clickDate('expanded', dateInfo)"
|
|
180
|
-
@[`${calendarEventName}`]="onMousemoveDate('expanded', $event)"
|
|
181
|
-
>
|
|
182
|
-
<div>
|
|
183
|
-
<span>
|
|
184
|
-
{{ dateInfo.date }}
|
|
185
|
-
</span>
|
|
186
|
-
</div>
|
|
187
|
-
</td>
|
|
188
|
-
</tr>
|
|
189
|
-
</tbody>
|
|
190
|
-
</table>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
<div
|
|
195
|
-
v-if="mode === 'dateTimeRange'"
|
|
196
|
-
class="ev-calendar-time-area"
|
|
197
|
-
>
|
|
198
|
-
<div class="ev-calendar-time-side">
|
|
199
|
-
<div
|
|
200
|
-
v-for="hmsType in ['HOUR', 'MIN', 'SEC']"
|
|
201
|
-
:key="`${hmsType}_TITLE`"
|
|
202
|
-
>
|
|
203
|
-
{{ hmsType }}
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
<div class="ev-calendar-time-center">
|
|
207
|
-
<template
|
|
208
|
-
v-for="timeType in ['hour', 'min', 'sec']"
|
|
209
|
-
:key="`${timeType}_table`"
|
|
210
|
-
>
|
|
211
|
-
<table class="ev-calendar-time-table">
|
|
212
|
-
<tbody
|
|
213
|
-
@wheel.prevent="wheelTime('expanded', timeType, $event)"
|
|
214
|
-
>
|
|
215
|
-
<tr
|
|
216
|
-
v-for="i in 3"
|
|
217
|
-
:key="`${timeType}_${i}_tr`"
|
|
218
|
-
>
|
|
219
|
-
<td
|
|
220
|
-
v-for="j in 4"
|
|
221
|
-
:key="`${timeType}_${i}_${j}_td`"
|
|
222
|
-
class="ev-calendar-time-td"
|
|
223
|
-
:class="{
|
|
224
|
-
selected: getTimeInfo(timeType, i, j, 'expanded').isSelected,
|
|
225
|
-
disabled: preventTimeEventType.expanded[timeType]
|
|
226
|
-
|| getTimeInfo(timeType, i, j, 'expanded').isDisabled,
|
|
227
|
-
}"
|
|
228
|
-
@click="clickTime('expanded', timeType, i, j)"
|
|
229
|
-
>
|
|
230
|
-
<div> {{ getTimeInfo(timeType, i, j, 'expanded').num }} </div>
|
|
231
|
-
</td>
|
|
232
|
-
</tr>
|
|
233
|
-
</tbody>
|
|
234
|
-
</table>
|
|
235
|
-
</template>
|
|
236
|
-
</div>
|
|
237
|
-
<div class="ev-calendar-time-side">
|
|
238
|
-
<template
|
|
239
|
-
v-for="hmsType in ['hour', 'min', 'sec']"
|
|
240
|
-
:key="`${hmsType}_btn_area`"
|
|
241
|
-
>
|
|
242
|
-
<div
|
|
243
|
-
v-for="arrowType in ['up', 'down']"
|
|
244
|
-
:key="`${hmsType}_${arrowType}_btn`"
|
|
245
|
-
:class="hmsType === 'hour' ? 'arrow-hour' : 'arrow-other'"
|
|
246
|
-
@click="clickHmsBtn('expanded', hmsType, arrowType)"
|
|
247
|
-
>
|
|
248
|
-
<i
|
|
249
|
-
:class="[
|
|
250
|
-
`ev-icon-arrow-${arrowType}`,
|
|
251
|
-
{ disabled: preventTimeEventType.expanded[hmsType] }
|
|
252
|
-
]" />
|
|
253
|
-
</div>
|
|
254
|
-
</template>
|
|
255
|
-
</div>
|
|
256
|
-
</div>
|
|
257
|
-
</div>
|
|
258
|
-
</template>
|
|
259
|
-
|
|
260
|
-
<script>
|
|
261
|
-
import { useModel, useCalendarDate, useEvent } from './uses';
|
|
262
|
-
|
|
263
|
-
export default {
|
|
264
|
-
name: 'EvCalendar',
|
|
265
|
-
props: {
|
|
266
|
-
modelValue: {
|
|
267
|
-
type: [String, Array],
|
|
268
|
-
default: '',
|
|
269
|
-
validator: (value) => {
|
|
270
|
-
const dateReg = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/);
|
|
271
|
-
const dateTimeReg = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);
|
|
272
|
-
if (Array.isArray(value)) {
|
|
273
|
-
return value.every(v => !!(!v
|
|
274
|
-
|| (v.length === 10 && dateReg.exec(v)))
|
|
275
|
-
|| (v.length === 19 && dateTimeReg.exec(v)));
|
|
276
|
-
}
|
|
277
|
-
return !!(!value
|
|
278
|
-
|| (value.length === 10 && dateReg.exec(value))
|
|
279
|
-
|| (value.length === 19 && dateTimeReg.exec(value)));
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
mode: {
|
|
283
|
-
type: String,
|
|
284
|
-
default: 'date',
|
|
285
|
-
validator: value => ['date', 'dateTime', 'dateMulti', 'dateRange', 'dateTimeRange']
|
|
286
|
-
.indexOf(value) !== -1,
|
|
287
|
-
},
|
|
288
|
-
monthNotation: {
|
|
289
|
-
type: String,
|
|
290
|
-
default: 'fullName',
|
|
291
|
-
validator: value => ['fullName', 'abbrName', 'numberName', 'korName']
|
|
292
|
-
.indexOf(value) !== -1,
|
|
293
|
-
},
|
|
294
|
-
dayOfTheWeekNotation: {
|
|
295
|
-
type: String,
|
|
296
|
-
default: 'abbrUpperName',
|
|
297
|
-
validator: value => ['abbrUpperName', 'abbrLowerName', 'abbrPascalName', 'abbrKorName']
|
|
298
|
-
.indexOf(value) !== -1,
|
|
299
|
-
},
|
|
300
|
-
options: {
|
|
301
|
-
type: Object,
|
|
302
|
-
default: () => ({
|
|
303
|
-
multiType: 'date',
|
|
304
|
-
limit: 1,
|
|
305
|
-
}),
|
|
306
|
-
validator: ({ multiType, multiDayLimit, disabledDate, timeFormat }) => {
|
|
307
|
-
const timeReg = new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);
|
|
308
|
-
return (multiType ? ['weekday', 'week', 'date'].indexOf(multiType) !== -1 : true)
|
|
309
|
-
&& (multiDayLimit ? typeof multiDayLimit === 'number' && multiDayLimit > 0 : true)
|
|
310
|
-
&& (disabledDate ? (typeof disabledDate === 'function' || Array.isArray(disabledDate)) : true)
|
|
311
|
-
&& Array.isArray(timeFormat)
|
|
312
|
-
? timeFormat.every(v => !!(!v || timeReg.exec(v)))
|
|
313
|
-
: !!(!timeFormat || (timeReg.exec(timeFormat)));
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
},
|
|
317
|
-
emits: {
|
|
318
|
-
'update:modelValue': [Array, String],
|
|
319
|
-
},
|
|
320
|
-
setup(props) {
|
|
321
|
-
const {
|
|
322
|
-
selectedValue,
|
|
323
|
-
mainCalendarPageInfo,
|
|
324
|
-
expandedCalendarPageInfo,
|
|
325
|
-
mainCalendarMonth,
|
|
326
|
-
expandedCalendarMonth,
|
|
327
|
-
dayOfTheWeekList,
|
|
328
|
-
isContinuousMonths,
|
|
329
|
-
} = useModel();
|
|
330
|
-
|
|
331
|
-
const {
|
|
332
|
-
mainCalendarTableInfo,
|
|
333
|
-
expandedCalendarTableInfo,
|
|
334
|
-
mainTimeTableInfo,
|
|
335
|
-
expandedTimeTableInfo,
|
|
336
|
-
setCalendarDate,
|
|
337
|
-
setHmsTime,
|
|
338
|
-
getTimeInfo,
|
|
339
|
-
} = useCalendarDate({
|
|
340
|
-
selectedValue,
|
|
341
|
-
mainCalendarPageInfo,
|
|
342
|
-
expandedCalendarPageInfo,
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
const {
|
|
346
|
-
clickPrevNextBtn,
|
|
347
|
-
clickDate,
|
|
348
|
-
clickHmsBtn,
|
|
349
|
-
clickTime,
|
|
350
|
-
wheelMonth,
|
|
351
|
-
wheelTime,
|
|
352
|
-
calendarEventName,
|
|
353
|
-
onMousemoveDate,
|
|
354
|
-
preventTimeEventType,
|
|
355
|
-
} = useEvent({
|
|
356
|
-
selectedValue,
|
|
357
|
-
mainCalendarPageInfo,
|
|
358
|
-
expandedCalendarPageInfo,
|
|
359
|
-
mainTimeTableInfo,
|
|
360
|
-
expandedTimeTableInfo,
|
|
361
|
-
setCalendarDate,
|
|
362
|
-
setHmsTime,
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
setCalendarDate('main');
|
|
366
|
-
if (['dateRange', 'dateTimeRange'].includes(props.mode)) {
|
|
367
|
-
setCalendarDate('expanded');
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (['dateTime', 'dateTimeRange'].includes(props.mode)) {
|
|
371
|
-
setHmsTime();
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
return {
|
|
375
|
-
selectedValue,
|
|
376
|
-
mainCalendarPageInfo,
|
|
377
|
-
expandedCalendarPageInfo,
|
|
378
|
-
mainCalendarMonth,
|
|
379
|
-
expandedCalendarMonth,
|
|
380
|
-
dayOfTheWeekList,
|
|
381
|
-
isContinuousMonths,
|
|
382
|
-
|
|
383
|
-
mainCalendarTableInfo,
|
|
384
|
-
expandedCalendarTableInfo,
|
|
385
|
-
mainTimeTableInfo,
|
|
386
|
-
expandedTimeTableInfo,
|
|
387
|
-
getTimeInfo,
|
|
388
|
-
|
|
389
|
-
clickPrevNextBtn,
|
|
390
|
-
clickDate,
|
|
391
|
-
clickHmsBtn,
|
|
392
|
-
clickTime,
|
|
393
|
-
wheelMonth,
|
|
394
|
-
wheelTime,
|
|
395
|
-
calendarEventName,
|
|
396
|
-
onMousemoveDate,
|
|
397
|
-
preventTimeEventType,
|
|
398
|
-
};
|
|
399
|
-
},
|
|
400
|
-
};
|
|
401
|
-
</script>
|
|
402
|
-
|
|
403
|
-
<style lang="scss">
|
|
404
|
-
@import '../../style/index.scss';
|
|
405
|
-
|
|
406
|
-
.ev-calendar-wrapper {
|
|
407
|
-
display: inline-flex;
|
|
408
|
-
height: 100%;
|
|
409
|
-
box-sizing: border-box;
|
|
410
|
-
flex-direction: row;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.ev-calendar-date-area {
|
|
414
|
-
&:not(:first-child) {
|
|
415
|
-
border-left: 1px solid;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.ev-calendar-header {
|
|
420
|
-
display: flex;
|
|
421
|
-
height: 40px;
|
|
422
|
-
padding: 10px 8px;
|
|
423
|
-
|
|
424
|
-
div {
|
|
425
|
-
width: 20px;
|
|
426
|
-
flex: 1;
|
|
427
|
-
text-align: center;
|
|
428
|
-
cursor: pointer;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.move-month-arrow {
|
|
432
|
-
width: 20px;
|
|
433
|
-
height: 20px;
|
|
434
|
-
line-height: 20px;
|
|
435
|
-
color: #606266;
|
|
436
|
-
text-align: center;
|
|
437
|
-
&:hover {
|
|
438
|
-
color: #3C81F6;
|
|
439
|
-
}
|
|
440
|
-
&.disabled {
|
|
441
|
-
color: #C0C4CC;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
span {
|
|
446
|
-
flex: 2;
|
|
447
|
-
text-align: center;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
.ev-calendar-body {
|
|
452
|
-
padding: 10px 8px 8px;
|
|
453
|
-
flex: 1;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.ev-calendar-table {
|
|
457
|
-
width: 280px;
|
|
458
|
-
table-layout: fixed;
|
|
459
|
-
font-size: 12px;
|
|
460
|
-
border-collapse: collapse;
|
|
461
|
-
border-spacing: 0;
|
|
462
|
-
text-align: center;
|
|
463
|
-
user-select: none;
|
|
464
|
-
|
|
465
|
-
th {
|
|
466
|
-
height: 30px;
|
|
467
|
-
color: #606266;
|
|
468
|
-
font-weight: 400;
|
|
469
|
-
border-bottom: 1px solid #EBEEF5;
|
|
470
|
-
}
|
|
471
|
-
td {
|
|
472
|
-
height: 40px;
|
|
473
|
-
color: #606266;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
.ev-calendar-date-td {
|
|
478
|
-
color: #606266;
|
|
479
|
-
|
|
480
|
-
& div {
|
|
481
|
-
height: 30px;
|
|
482
|
-
line-height: 30px;
|
|
483
|
-
padding: 3px 0;
|
|
484
|
-
margin: 5px auto;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
&.prev,
|
|
488
|
-
&.next {
|
|
489
|
-
color: #C0C4CC;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
&.today {
|
|
493
|
-
font-weight: bold;
|
|
494
|
-
color: #409EFF;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
& span {
|
|
498
|
-
display: block;
|
|
499
|
-
width: 24px;
|
|
500
|
-
height: 24px;
|
|
501
|
-
line-height: 24px;
|
|
502
|
-
margin: auto;
|
|
503
|
-
border-radius: 50%;
|
|
504
|
-
text-align: center;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
&.selected span {
|
|
508
|
-
color: #FFFFFF;
|
|
509
|
-
background-color: #409EFF;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
&.selected.start-date > div {
|
|
513
|
-
width: 35px;
|
|
514
|
-
margin: 5px 0 5px auto;
|
|
515
|
-
padding-right: 5px;
|
|
516
|
-
border-top-left-radius: 30px;
|
|
517
|
-
border-bottom-left-radius: 30px;
|
|
518
|
-
}
|
|
519
|
-
&.selected.end-date > div {
|
|
520
|
-
width: 35px;
|
|
521
|
-
margin: 5px auto 5px 0;
|
|
522
|
-
padding-left: 5px;
|
|
523
|
-
border-top-right-radius: 30px;
|
|
524
|
-
border-bottom-right-radius: 30px;
|
|
525
|
-
}
|
|
526
|
-
&.selected.start-end-date > div {
|
|
527
|
-
width: 30px;
|
|
528
|
-
margin: 5px auto;
|
|
529
|
-
border-radius: 30px;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
&:hover {
|
|
533
|
-
color: #409EFF;
|
|
534
|
-
cursor: pointer;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
&.disabled {
|
|
538
|
-
background-color: #EEF0F3;
|
|
539
|
-
opacity: 1;
|
|
540
|
-
color: #C0C4CC;
|
|
541
|
-
|
|
542
|
-
&:hover {
|
|
543
|
-
cursor: not-allowed;
|
|
544
|
-
}
|
|
545
|
-
&.selected:hover {
|
|
546
|
-
cursor: pointer !important;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
&.in-range:not(.next):not(.prev) div {
|
|
551
|
-
background-color: #F2F6FC;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.ev-calendar-time {
|
|
556
|
-
&-area {
|
|
557
|
-
display: flex;
|
|
558
|
-
width: 195px;
|
|
559
|
-
flex-direction: row;
|
|
560
|
-
border-left: 1px solid #EBEEF5;
|
|
561
|
-
color: #606266;
|
|
562
|
-
box-sizing: content-box;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
.ev-calendar-time-td {
|
|
567
|
-
&:hover {
|
|
568
|
-
color: #409EFF;
|
|
569
|
-
cursor: pointer;
|
|
570
|
-
}
|
|
571
|
-
&.selected {
|
|
572
|
-
display: flex;
|
|
573
|
-
height: 100%;
|
|
574
|
-
justify-content: center;
|
|
575
|
-
align-items: center;
|
|
576
|
-
}
|
|
577
|
-
&.selected div {
|
|
578
|
-
width: 24px;
|
|
579
|
-
height: 24px;
|
|
580
|
-
line-height: 24px;
|
|
581
|
-
border-radius: 50%;
|
|
582
|
-
color: #FFFFFF;
|
|
583
|
-
background-color: #409EFF;
|
|
584
|
-
text-align: center;
|
|
585
|
-
}
|
|
586
|
-
&.disabled {
|
|
587
|
-
background-color: #EEF0F3;
|
|
588
|
-
opacity: 1;
|
|
589
|
-
color: #C0C4CC;
|
|
590
|
-
|
|
591
|
-
&:hover {
|
|
592
|
-
cursor: not-allowed;
|
|
593
|
-
}
|
|
594
|
-
&.selected:hover {
|
|
595
|
-
cursor: pointer !important;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
.ev-calendar-time-side {
|
|
601
|
-
font-size: 10px;
|
|
602
|
-
text-align: center;
|
|
603
|
-
background-color: #E5E5E5;
|
|
604
|
-
|
|
605
|
-
&:first-child {
|
|
606
|
-
width: 35px;
|
|
607
|
-
|
|
608
|
-
& div {
|
|
609
|
-
height: 110px;
|
|
610
|
-
line-height: 110px;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
&:last-child {
|
|
615
|
-
width: 30px;
|
|
616
|
-
|
|
617
|
-
&:hover {
|
|
618
|
-
color: #409EFF;
|
|
619
|
-
cursor: pointer;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
& div {
|
|
623
|
-
height: 55px;
|
|
624
|
-
line-height: 55px;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
& div:not(:last-child) {
|
|
629
|
-
border-bottom: 1px solid #EBEEF5;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
& div > .disabled {
|
|
633
|
-
color: #C0C4CC;
|
|
634
|
-
}
|
|
635
|
-
& div > .disabled:hover {
|
|
636
|
-
color: #C0C4CC;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
.ev-calendar-time-center {
|
|
640
|
-
width: 132px;
|
|
641
|
-
height: 100%;
|
|
642
|
-
text-align: center;
|
|
643
|
-
font-size: 12px;
|
|
644
|
-
|
|
645
|
-
& table:not(:last-child) {
|
|
646
|
-
border-bottom: 1px solid #EBEEF5;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
.ev-calendar-time-table {
|
|
650
|
-
width: 132px;
|
|
651
|
-
height: 110px;
|
|
652
|
-
table-layout: fixed;
|
|
653
|
-
border-collapse: collapse;
|
|
654
|
-
border-spacing: 0;
|
|
655
|
-
user-select: none;
|
|
656
|
-
|
|
657
|
-
tr {
|
|
658
|
-
height: 33px;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ev-calendar-wrapper">
|
|
3
|
+
<div class="ev-calendar-date-area">
|
|
4
|
+
<div class="ev-calendar-header">
|
|
5
|
+
<div @click="clickPrevNextBtn('main', 'prev')">
|
|
6
|
+
<i class="ev-icon-s-arrow-left move-month-arrow" />
|
|
7
|
+
</div>
|
|
8
|
+
<span class="ev-calendar-year">{{ mainCalendarPageInfo.year }}</span>
|
|
9
|
+
<span class="ev-calendar-month">{{ mainCalendarMonth }}</span>
|
|
10
|
+
<div @click="clickPrevNextBtn('main', 'next')">
|
|
11
|
+
<i
|
|
12
|
+
:class="[
|
|
13
|
+
'ev-icon-s-arrow-right move-month-arrow',
|
|
14
|
+
{ disabled: isContinuousMonths },
|
|
15
|
+
]"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="ev-calendar-body">
|
|
20
|
+
<table
|
|
21
|
+
:key="'main_calendar_table'"
|
|
22
|
+
class="ev-calendar-table"
|
|
23
|
+
>
|
|
24
|
+
<thead>
|
|
25
|
+
<tr>
|
|
26
|
+
<th
|
|
27
|
+
v-for="dayOfTheWeek in dayOfTheWeekList"
|
|
28
|
+
:key="dayOfTheWeek"
|
|
29
|
+
>
|
|
30
|
+
{{ dayOfTheWeek }}
|
|
31
|
+
</th>
|
|
32
|
+
</tr>
|
|
33
|
+
</thead>
|
|
34
|
+
<tbody
|
|
35
|
+
@wheel.prevent="wheelMonth('main', $event)"
|
|
36
|
+
>
|
|
37
|
+
<tr
|
|
38
|
+
v-for="weekInfo in mainCalendarTableInfo"
|
|
39
|
+
:key="weekInfo"
|
|
40
|
+
>
|
|
41
|
+
<td
|
|
42
|
+
v-for="dateInfo in weekInfo"
|
|
43
|
+
:key="dateInfo"
|
|
44
|
+
class="ev-calendar-date-td"
|
|
45
|
+
:class="[
|
|
46
|
+
{ [dateInfo.monthType]: !!dateInfo.monthType },
|
|
47
|
+
{ today: dateInfo.isToday },
|
|
48
|
+
{ selected: dateInfo.isSelected },
|
|
49
|
+
]"
|
|
50
|
+
@click="clickDate('main', dateInfo)"
|
|
51
|
+
@[`${calendarEventName}`]="onMousemoveDate('main', $event)"
|
|
52
|
+
>
|
|
53
|
+
<div>
|
|
54
|
+
<span>
|
|
55
|
+
{{ dateInfo.date }}
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</tbody>
|
|
61
|
+
</table>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div
|
|
66
|
+
v-if="['dateTime', 'dateTimeRange'].includes(mode)"
|
|
67
|
+
class="ev-calendar-time-area"
|
|
68
|
+
>
|
|
69
|
+
<div class="ev-calendar-time-side">
|
|
70
|
+
<div
|
|
71
|
+
v-for="hmsType in ['HOUR', 'MIN', 'SEC']"
|
|
72
|
+
:key="`${hmsType}_TITLE`"
|
|
73
|
+
>
|
|
74
|
+
{{ hmsType }}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="ev-calendar-time-center">
|
|
78
|
+
<template
|
|
79
|
+
v-for="timeType in ['hour', 'min', 'sec']"
|
|
80
|
+
:key="`${timeType}_table`"
|
|
81
|
+
>
|
|
82
|
+
<table class="ev-calendar-time-table">
|
|
83
|
+
<tbody
|
|
84
|
+
@wheel.prevent="wheelTime('main', timeType, $event)"
|
|
85
|
+
>
|
|
86
|
+
<tr
|
|
87
|
+
v-for="i in 3"
|
|
88
|
+
:key="`${timeType}_${i}_tr`"
|
|
89
|
+
>
|
|
90
|
+
<td
|
|
91
|
+
v-for="j in 4"
|
|
92
|
+
:key="`${timeType}_${i}_${j}_td`"
|
|
93
|
+
class="ev-calendar-time-td"
|
|
94
|
+
:class="{
|
|
95
|
+
selected: getTimeInfo(timeType, i, j, 'main').isSelected,
|
|
96
|
+
disabled: preventTimeEventType.main[timeType]
|
|
97
|
+
|| getTimeInfo(timeType, i, j, 'main').isDisabled,
|
|
98
|
+
}"
|
|
99
|
+
@click="clickTime('main', timeType, i, j)"
|
|
100
|
+
>
|
|
101
|
+
<div> {{ getTimeInfo(timeType, i, j, 'main').num }} </div>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
</template>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="ev-calendar-time-side">
|
|
109
|
+
<template
|
|
110
|
+
v-for="hmsType in ['hour', 'min', 'sec']"
|
|
111
|
+
:key="`${hmsType}_btn_area`"
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
v-for="arrowType in ['up', 'down']"
|
|
115
|
+
:key="`${hmsType}_${arrowType}_btn`"
|
|
116
|
+
:class="hmsType === 'hour' ? 'arrow-hour' : 'arrow-other'"
|
|
117
|
+
@click="clickHmsBtn('main', hmsType, arrowType)"
|
|
118
|
+
>
|
|
119
|
+
<i
|
|
120
|
+
:class="[
|
|
121
|
+
`ev-icon-arrow-${arrowType}`,
|
|
122
|
+
{ disabled: preventTimeEventType.main[hmsType] }
|
|
123
|
+
]" />
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div
|
|
130
|
+
v-if="['dateRange', 'dateTimeRange'].includes(mode)"
|
|
131
|
+
class="ev-calendar-date-area"
|
|
132
|
+
>
|
|
133
|
+
<div class="ev-calendar-header">
|
|
134
|
+
<div @click="clickPrevNextBtn('expanded', 'prev')">
|
|
135
|
+
<i
|
|
136
|
+
:class="[
|
|
137
|
+
'ev-icon-s-arrow-left move-month-arrow',
|
|
138
|
+
{ disabled: isContinuousMonths },
|
|
139
|
+
]"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
<span class="ev-calendar-year">{{ expandedCalendarPageInfo.year }}</span>
|
|
143
|
+
<span class="ev-calendar-month">{{ expandedCalendarMonth }}</span>
|
|
144
|
+
<div @click="clickPrevNextBtn('expanded', 'next')">
|
|
145
|
+
<i class="ev-icon-s-arrow-right move-month-arrow" />
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="ev-calendar-body">
|
|
149
|
+
<table
|
|
150
|
+
:key="'expanded_calendar_table'"
|
|
151
|
+
class="ev-calendar-table"
|
|
152
|
+
>
|
|
153
|
+
<thead>
|
|
154
|
+
<tr>
|
|
155
|
+
<th
|
|
156
|
+
v-for="dayOfTheWeek in dayOfTheWeekList"
|
|
157
|
+
:key="dayOfTheWeek"
|
|
158
|
+
>
|
|
159
|
+
{{ dayOfTheWeek }}
|
|
160
|
+
</th>
|
|
161
|
+
</tr>
|
|
162
|
+
</thead>
|
|
163
|
+
<tbody
|
|
164
|
+
@wheel.prevent="wheelMonth('expanded', $event)"
|
|
165
|
+
>
|
|
166
|
+
<tr
|
|
167
|
+
v-for="weekInfo in expandedCalendarTableInfo"
|
|
168
|
+
:key="weekInfo"
|
|
169
|
+
>
|
|
170
|
+
<td
|
|
171
|
+
v-for="dateInfo in weekInfo"
|
|
172
|
+
:key="dateInfo"
|
|
173
|
+
class="ev-calendar-date-td"
|
|
174
|
+
:class="[
|
|
175
|
+
{ [dateInfo.monthType]: !!dateInfo.monthType },
|
|
176
|
+
{ today: dateInfo.isToday },
|
|
177
|
+
{ selected: dateInfo.isSelected },
|
|
178
|
+
]"
|
|
179
|
+
@click="clickDate('expanded', dateInfo)"
|
|
180
|
+
@[`${calendarEventName}`]="onMousemoveDate('expanded', $event)"
|
|
181
|
+
>
|
|
182
|
+
<div>
|
|
183
|
+
<span>
|
|
184
|
+
{{ dateInfo.date }}
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
</td>
|
|
188
|
+
</tr>
|
|
189
|
+
</tbody>
|
|
190
|
+
</table>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div
|
|
195
|
+
v-if="mode === 'dateTimeRange'"
|
|
196
|
+
class="ev-calendar-time-area"
|
|
197
|
+
>
|
|
198
|
+
<div class="ev-calendar-time-side">
|
|
199
|
+
<div
|
|
200
|
+
v-for="hmsType in ['HOUR', 'MIN', 'SEC']"
|
|
201
|
+
:key="`${hmsType}_TITLE`"
|
|
202
|
+
>
|
|
203
|
+
{{ hmsType }}
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="ev-calendar-time-center">
|
|
207
|
+
<template
|
|
208
|
+
v-for="timeType in ['hour', 'min', 'sec']"
|
|
209
|
+
:key="`${timeType}_table`"
|
|
210
|
+
>
|
|
211
|
+
<table class="ev-calendar-time-table">
|
|
212
|
+
<tbody
|
|
213
|
+
@wheel.prevent="wheelTime('expanded', timeType, $event)"
|
|
214
|
+
>
|
|
215
|
+
<tr
|
|
216
|
+
v-for="i in 3"
|
|
217
|
+
:key="`${timeType}_${i}_tr`"
|
|
218
|
+
>
|
|
219
|
+
<td
|
|
220
|
+
v-for="j in 4"
|
|
221
|
+
:key="`${timeType}_${i}_${j}_td`"
|
|
222
|
+
class="ev-calendar-time-td"
|
|
223
|
+
:class="{
|
|
224
|
+
selected: getTimeInfo(timeType, i, j, 'expanded').isSelected,
|
|
225
|
+
disabled: preventTimeEventType.expanded[timeType]
|
|
226
|
+
|| getTimeInfo(timeType, i, j, 'expanded').isDisabled,
|
|
227
|
+
}"
|
|
228
|
+
@click="clickTime('expanded', timeType, i, j)"
|
|
229
|
+
>
|
|
230
|
+
<div> {{ getTimeInfo(timeType, i, j, 'expanded').num }} </div>
|
|
231
|
+
</td>
|
|
232
|
+
</tr>
|
|
233
|
+
</tbody>
|
|
234
|
+
</table>
|
|
235
|
+
</template>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="ev-calendar-time-side">
|
|
238
|
+
<template
|
|
239
|
+
v-for="hmsType in ['hour', 'min', 'sec']"
|
|
240
|
+
:key="`${hmsType}_btn_area`"
|
|
241
|
+
>
|
|
242
|
+
<div
|
|
243
|
+
v-for="arrowType in ['up', 'down']"
|
|
244
|
+
:key="`${hmsType}_${arrowType}_btn`"
|
|
245
|
+
:class="hmsType === 'hour' ? 'arrow-hour' : 'arrow-other'"
|
|
246
|
+
@click="clickHmsBtn('expanded', hmsType, arrowType)"
|
|
247
|
+
>
|
|
248
|
+
<i
|
|
249
|
+
:class="[
|
|
250
|
+
`ev-icon-arrow-${arrowType}`,
|
|
251
|
+
{ disabled: preventTimeEventType.expanded[hmsType] }
|
|
252
|
+
]" />
|
|
253
|
+
</div>
|
|
254
|
+
</template>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</template>
|
|
259
|
+
|
|
260
|
+
<script>
|
|
261
|
+
import { useModel, useCalendarDate, useEvent } from './uses';
|
|
262
|
+
|
|
263
|
+
export default {
|
|
264
|
+
name: 'EvCalendar',
|
|
265
|
+
props: {
|
|
266
|
+
modelValue: {
|
|
267
|
+
type: [String, Array],
|
|
268
|
+
default: '',
|
|
269
|
+
validator: (value) => {
|
|
270
|
+
const dateReg = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/);
|
|
271
|
+
const dateTimeReg = new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);
|
|
272
|
+
if (Array.isArray(value)) {
|
|
273
|
+
return value.every(v => !!(!v
|
|
274
|
+
|| (v.length === 10 && dateReg.exec(v)))
|
|
275
|
+
|| (v.length === 19 && dateTimeReg.exec(v)));
|
|
276
|
+
}
|
|
277
|
+
return !!(!value
|
|
278
|
+
|| (value.length === 10 && dateReg.exec(value))
|
|
279
|
+
|| (value.length === 19 && dateTimeReg.exec(value)));
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
mode: {
|
|
283
|
+
type: String,
|
|
284
|
+
default: 'date',
|
|
285
|
+
validator: value => ['date', 'dateTime', 'dateMulti', 'dateRange', 'dateTimeRange']
|
|
286
|
+
.indexOf(value) !== -1,
|
|
287
|
+
},
|
|
288
|
+
monthNotation: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: 'fullName',
|
|
291
|
+
validator: value => ['fullName', 'abbrName', 'numberName', 'korName']
|
|
292
|
+
.indexOf(value) !== -1,
|
|
293
|
+
},
|
|
294
|
+
dayOfTheWeekNotation: {
|
|
295
|
+
type: String,
|
|
296
|
+
default: 'abbrUpperName',
|
|
297
|
+
validator: value => ['abbrUpperName', 'abbrLowerName', 'abbrPascalName', 'abbrKorName']
|
|
298
|
+
.indexOf(value) !== -1,
|
|
299
|
+
},
|
|
300
|
+
options: {
|
|
301
|
+
type: Object,
|
|
302
|
+
default: () => ({
|
|
303
|
+
multiType: 'date',
|
|
304
|
+
limit: 1,
|
|
305
|
+
}),
|
|
306
|
+
validator: ({ multiType, multiDayLimit, disabledDate, timeFormat }) => {
|
|
307
|
+
const timeReg = new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);
|
|
308
|
+
return (multiType ? ['weekday', 'week', 'date'].indexOf(multiType) !== -1 : true)
|
|
309
|
+
&& (multiDayLimit ? typeof multiDayLimit === 'number' && multiDayLimit > 0 : true)
|
|
310
|
+
&& (disabledDate ? (typeof disabledDate === 'function' || Array.isArray(disabledDate)) : true)
|
|
311
|
+
&& Array.isArray(timeFormat)
|
|
312
|
+
? timeFormat.every(v => !!(!v || timeReg.exec(v)))
|
|
313
|
+
: !!(!timeFormat || (timeReg.exec(timeFormat)));
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
emits: {
|
|
318
|
+
'update:modelValue': [Array, String],
|
|
319
|
+
},
|
|
320
|
+
setup(props) {
|
|
321
|
+
const {
|
|
322
|
+
selectedValue,
|
|
323
|
+
mainCalendarPageInfo,
|
|
324
|
+
expandedCalendarPageInfo,
|
|
325
|
+
mainCalendarMonth,
|
|
326
|
+
expandedCalendarMonth,
|
|
327
|
+
dayOfTheWeekList,
|
|
328
|
+
isContinuousMonths,
|
|
329
|
+
} = useModel();
|
|
330
|
+
|
|
331
|
+
const {
|
|
332
|
+
mainCalendarTableInfo,
|
|
333
|
+
expandedCalendarTableInfo,
|
|
334
|
+
mainTimeTableInfo,
|
|
335
|
+
expandedTimeTableInfo,
|
|
336
|
+
setCalendarDate,
|
|
337
|
+
setHmsTime,
|
|
338
|
+
getTimeInfo,
|
|
339
|
+
} = useCalendarDate({
|
|
340
|
+
selectedValue,
|
|
341
|
+
mainCalendarPageInfo,
|
|
342
|
+
expandedCalendarPageInfo,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
const {
|
|
346
|
+
clickPrevNextBtn,
|
|
347
|
+
clickDate,
|
|
348
|
+
clickHmsBtn,
|
|
349
|
+
clickTime,
|
|
350
|
+
wheelMonth,
|
|
351
|
+
wheelTime,
|
|
352
|
+
calendarEventName,
|
|
353
|
+
onMousemoveDate,
|
|
354
|
+
preventTimeEventType,
|
|
355
|
+
} = useEvent({
|
|
356
|
+
selectedValue,
|
|
357
|
+
mainCalendarPageInfo,
|
|
358
|
+
expandedCalendarPageInfo,
|
|
359
|
+
mainTimeTableInfo,
|
|
360
|
+
expandedTimeTableInfo,
|
|
361
|
+
setCalendarDate,
|
|
362
|
+
setHmsTime,
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
setCalendarDate('main');
|
|
366
|
+
if (['dateRange', 'dateTimeRange'].includes(props.mode)) {
|
|
367
|
+
setCalendarDate('expanded');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (['dateTime', 'dateTimeRange'].includes(props.mode)) {
|
|
371
|
+
setHmsTime();
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return {
|
|
375
|
+
selectedValue,
|
|
376
|
+
mainCalendarPageInfo,
|
|
377
|
+
expandedCalendarPageInfo,
|
|
378
|
+
mainCalendarMonth,
|
|
379
|
+
expandedCalendarMonth,
|
|
380
|
+
dayOfTheWeekList,
|
|
381
|
+
isContinuousMonths,
|
|
382
|
+
|
|
383
|
+
mainCalendarTableInfo,
|
|
384
|
+
expandedCalendarTableInfo,
|
|
385
|
+
mainTimeTableInfo,
|
|
386
|
+
expandedTimeTableInfo,
|
|
387
|
+
getTimeInfo,
|
|
388
|
+
|
|
389
|
+
clickPrevNextBtn,
|
|
390
|
+
clickDate,
|
|
391
|
+
clickHmsBtn,
|
|
392
|
+
clickTime,
|
|
393
|
+
wheelMonth,
|
|
394
|
+
wheelTime,
|
|
395
|
+
calendarEventName,
|
|
396
|
+
onMousemoveDate,
|
|
397
|
+
preventTimeEventType,
|
|
398
|
+
};
|
|
399
|
+
},
|
|
400
|
+
};
|
|
401
|
+
</script>
|
|
402
|
+
|
|
403
|
+
<style lang="scss">
|
|
404
|
+
@import '../../style/index.scss';
|
|
405
|
+
|
|
406
|
+
.ev-calendar-wrapper {
|
|
407
|
+
display: inline-flex;
|
|
408
|
+
height: 100%;
|
|
409
|
+
box-sizing: border-box;
|
|
410
|
+
flex-direction: row;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.ev-calendar-date-area {
|
|
414
|
+
&:not(:first-child) {
|
|
415
|
+
border-left: 1px solid;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.ev-calendar-header {
|
|
420
|
+
display: flex;
|
|
421
|
+
height: 40px;
|
|
422
|
+
padding: 10px 8px;
|
|
423
|
+
|
|
424
|
+
div {
|
|
425
|
+
width: 20px;
|
|
426
|
+
flex: 1;
|
|
427
|
+
text-align: center;
|
|
428
|
+
cursor: pointer;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.move-month-arrow {
|
|
432
|
+
width: 20px;
|
|
433
|
+
height: 20px;
|
|
434
|
+
line-height: 20px;
|
|
435
|
+
color: #606266;
|
|
436
|
+
text-align: center;
|
|
437
|
+
&:hover {
|
|
438
|
+
color: #3C81F6;
|
|
439
|
+
}
|
|
440
|
+
&.disabled {
|
|
441
|
+
color: #C0C4CC;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
span {
|
|
446
|
+
flex: 2;
|
|
447
|
+
text-align: center;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.ev-calendar-body {
|
|
452
|
+
padding: 10px 8px 8px;
|
|
453
|
+
flex: 1;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.ev-calendar-table {
|
|
457
|
+
width: 280px;
|
|
458
|
+
table-layout: fixed;
|
|
459
|
+
font-size: 12px;
|
|
460
|
+
border-collapse: collapse;
|
|
461
|
+
border-spacing: 0;
|
|
462
|
+
text-align: center;
|
|
463
|
+
user-select: none;
|
|
464
|
+
|
|
465
|
+
th {
|
|
466
|
+
height: 30px;
|
|
467
|
+
color: #606266;
|
|
468
|
+
font-weight: 400;
|
|
469
|
+
border-bottom: 1px solid #EBEEF5;
|
|
470
|
+
}
|
|
471
|
+
td {
|
|
472
|
+
height: 40px;
|
|
473
|
+
color: #606266;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.ev-calendar-date-td {
|
|
478
|
+
color: #606266;
|
|
479
|
+
|
|
480
|
+
& div {
|
|
481
|
+
height: 30px;
|
|
482
|
+
line-height: 30px;
|
|
483
|
+
padding: 3px 0;
|
|
484
|
+
margin: 5px auto;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
&.prev,
|
|
488
|
+
&.next {
|
|
489
|
+
color: #C0C4CC;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
&.today {
|
|
493
|
+
font-weight: bold;
|
|
494
|
+
color: #409EFF;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
& span {
|
|
498
|
+
display: block;
|
|
499
|
+
width: 24px;
|
|
500
|
+
height: 24px;
|
|
501
|
+
line-height: 24px;
|
|
502
|
+
margin: auto;
|
|
503
|
+
border-radius: 50%;
|
|
504
|
+
text-align: center;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
&.selected span {
|
|
508
|
+
color: #FFFFFF;
|
|
509
|
+
background-color: #409EFF;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
&.selected.start-date > div {
|
|
513
|
+
width: 35px;
|
|
514
|
+
margin: 5px 0 5px auto;
|
|
515
|
+
padding-right: 5px;
|
|
516
|
+
border-top-left-radius: 30px;
|
|
517
|
+
border-bottom-left-radius: 30px;
|
|
518
|
+
}
|
|
519
|
+
&.selected.end-date > div {
|
|
520
|
+
width: 35px;
|
|
521
|
+
margin: 5px auto 5px 0;
|
|
522
|
+
padding-left: 5px;
|
|
523
|
+
border-top-right-radius: 30px;
|
|
524
|
+
border-bottom-right-radius: 30px;
|
|
525
|
+
}
|
|
526
|
+
&.selected.start-end-date > div {
|
|
527
|
+
width: 30px;
|
|
528
|
+
margin: 5px auto;
|
|
529
|
+
border-radius: 30px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
&:hover {
|
|
533
|
+
color: #409EFF;
|
|
534
|
+
cursor: pointer;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
&.disabled {
|
|
538
|
+
background-color: #EEF0F3;
|
|
539
|
+
opacity: 1;
|
|
540
|
+
color: #C0C4CC;
|
|
541
|
+
|
|
542
|
+
&:hover {
|
|
543
|
+
cursor: not-allowed;
|
|
544
|
+
}
|
|
545
|
+
&.selected:hover {
|
|
546
|
+
cursor: pointer !important;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
&.in-range:not(.next):not(.prev) div {
|
|
551
|
+
background-color: #F2F6FC;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.ev-calendar-time {
|
|
556
|
+
&-area {
|
|
557
|
+
display: flex;
|
|
558
|
+
width: 195px;
|
|
559
|
+
flex-direction: row;
|
|
560
|
+
border-left: 1px solid #EBEEF5;
|
|
561
|
+
color: #606266;
|
|
562
|
+
box-sizing: content-box;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.ev-calendar-time-td {
|
|
567
|
+
&:hover {
|
|
568
|
+
color: #409EFF;
|
|
569
|
+
cursor: pointer;
|
|
570
|
+
}
|
|
571
|
+
&.selected {
|
|
572
|
+
display: flex;
|
|
573
|
+
height: 100%;
|
|
574
|
+
justify-content: center;
|
|
575
|
+
align-items: center;
|
|
576
|
+
}
|
|
577
|
+
&.selected div {
|
|
578
|
+
width: 24px;
|
|
579
|
+
height: 24px;
|
|
580
|
+
line-height: 24px;
|
|
581
|
+
border-radius: 50%;
|
|
582
|
+
color: #FFFFFF;
|
|
583
|
+
background-color: #409EFF;
|
|
584
|
+
text-align: center;
|
|
585
|
+
}
|
|
586
|
+
&.disabled {
|
|
587
|
+
background-color: #EEF0F3;
|
|
588
|
+
opacity: 1;
|
|
589
|
+
color: #C0C4CC;
|
|
590
|
+
|
|
591
|
+
&:hover {
|
|
592
|
+
cursor: not-allowed;
|
|
593
|
+
}
|
|
594
|
+
&.selected:hover {
|
|
595
|
+
cursor: pointer !important;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.ev-calendar-time-side {
|
|
601
|
+
font-size: 10px;
|
|
602
|
+
text-align: center;
|
|
603
|
+
background-color: #E5E5E5;
|
|
604
|
+
|
|
605
|
+
&:first-child {
|
|
606
|
+
width: 35px;
|
|
607
|
+
|
|
608
|
+
& div {
|
|
609
|
+
height: 110px;
|
|
610
|
+
line-height: 110px;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
&:last-child {
|
|
615
|
+
width: 30px;
|
|
616
|
+
|
|
617
|
+
&:hover {
|
|
618
|
+
color: #409EFF;
|
|
619
|
+
cursor: pointer;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
& div {
|
|
623
|
+
height: 55px;
|
|
624
|
+
line-height: 55px;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
& div:not(:last-child) {
|
|
629
|
+
border-bottom: 1px solid #EBEEF5;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
& div > .disabled {
|
|
633
|
+
color: #C0C4CC;
|
|
634
|
+
}
|
|
635
|
+
& div > .disabled:hover {
|
|
636
|
+
color: #C0C4CC;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
.ev-calendar-time-center {
|
|
640
|
+
width: 132px;
|
|
641
|
+
height: 100%;
|
|
642
|
+
text-align: center;
|
|
643
|
+
font-size: 12px;
|
|
644
|
+
|
|
645
|
+
& table:not(:last-child) {
|
|
646
|
+
border-bottom: 1px solid #EBEEF5;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
.ev-calendar-time-table {
|
|
650
|
+
width: 132px;
|
|
651
|
+
height: 110px;
|
|
652
|
+
table-layout: fixed;
|
|
653
|
+
border-collapse: collapse;
|
|
654
|
+
border-spacing: 0;
|
|
655
|
+
user-select: none;
|
|
656
|
+
|
|
657
|
+
tr {
|
|
658
|
+
height: 33px;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
</style>
|