npmapps 1.0.6 → 1.0.8
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/README.md +3 -1
- package/app/snippet-generator-master.zip +0 -0
- package/app/xukmtof0kwy8zflvqn6h8chypsusvopw.upxs +0 -0
- package/package.json +1 -1
- package/app/calendar/README.md +0 -329
- package/app/calendar/customCalendar.vue +0 -327
- package/app/calendar/data.js +0 -177
- package/app/calendar/index.vue +0 -116
- package/app/dialogFnJsx/DialogForm.vue +0 -51
- package/app/dialogFnJsx/README.md +0 -98
- package/app/dialogFnJsx/com.vue +0 -74
- package/app/dialogFnJsx/com11.vue +0 -31
- package/app/dialogFnJsx/examples.vue +0 -205
- package/app/dialogFnJsx/index.js +0 -59
- package/app/dialogFnJsx/index.vue +0 -91
package/README.md
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/app/calendar/README.md
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
# Vue 年度日历组件
|
|
2
|
-
|
|
3
|
-
基于 Element UI Calendar 组件封装的年度日历组件,支持按年份查看所有月份的日历,并具有节假日显示、今日标记等功能。
|
|
4
|
-
|
|
5
|
-
## 功能特点
|
|
6
|
-
|
|
7
|
-
- 年度视图:一次性展示全年12个月的日历
|
|
8
|
-
- 节假日标记:支持显示法定节假日和调休工作日
|
|
9
|
-
- 今日标记:突出显示当前日期
|
|
10
|
-
- 日期选择:支持点击选择具体日期
|
|
11
|
-
- 响应式布局:自适应不同屏幕尺寸
|
|
12
|
-
- 优雅动效:悬浮效果和过渡动画
|
|
13
|
-
- 农历日期:支持显示农历日期信息
|
|
14
|
-
- 自定义样式:提供丰富的样式定制选项
|
|
15
|
-
|
|
16
|
-
## 安装
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# 确保已安装Element UI
|
|
20
|
-
npm install element-ui --save
|
|
21
|
-
|
|
22
|
-
# 复制组件到你的项目中
|
|
23
|
-
cp -r calendar/ src/components/
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## 使用方法
|
|
27
|
-
|
|
28
|
-
### 基础用法
|
|
29
|
-
|
|
30
|
-
最简单的使用方式,仅显示日历并处理日期点击事件:
|
|
31
|
-
|
|
32
|
-
```vue
|
|
33
|
-
<template>
|
|
34
|
-
<calendar @date-click="handleDateClick" />
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script>
|
|
38
|
-
import calendar from '@/components/calendar/index.vue'
|
|
39
|
-
|
|
40
|
-
export default {
|
|
41
|
-
components: {
|
|
42
|
-
calendar
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
handleDateClick(date) {
|
|
46
|
-
console.log('选择的日期:', date)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
</script>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 自定义节假日
|
|
54
|
-
|
|
55
|
-
使用自定义节假日数据,实现节假日和调休日的显示:
|
|
56
|
-
|
|
57
|
-
```vue
|
|
58
|
-
<template>
|
|
59
|
-
<calendar
|
|
60
|
-
:holiday="holidayData"
|
|
61
|
-
@date-click="handleDateClick"
|
|
62
|
-
/>
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<script>
|
|
66
|
-
import calendar from '@/components/calendar/index.vue'
|
|
67
|
-
|
|
68
|
-
export default {
|
|
69
|
-
components: {
|
|
70
|
-
calendar
|
|
71
|
-
},
|
|
72
|
-
data() {
|
|
73
|
-
return {
|
|
74
|
-
holidayData: [
|
|
75
|
-
{
|
|
76
|
-
type: 'holiday',
|
|
77
|
-
name: '元旦',
|
|
78
|
-
date: '2024-01-01',
|
|
79
|
-
lunarDate: '腊月十一'
|
|
80
|
-
},
|
|
81
|
-
// 更多节假日数据...
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
methods: {
|
|
86
|
-
handleDateClick(date) {
|
|
87
|
-
this.$message.success(`选择的日期:${date.day}`)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
</script>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 高级配置
|
|
95
|
-
|
|
96
|
-
展示如何使用更多配置选项来自定义日历的行为和外观:
|
|
97
|
-
|
|
98
|
-
```vue
|
|
99
|
-
<template>
|
|
100
|
-
<calendar
|
|
101
|
-
:holiday="holidayData"
|
|
102
|
-
:showWorkday="true"
|
|
103
|
-
:showToday="true"
|
|
104
|
-
:clickable="true"
|
|
105
|
-
:isNextOrPrevClick="false"
|
|
106
|
-
@date-click="handleDateClick"
|
|
107
|
-
>
|
|
108
|
-
<template #year-picker>
|
|
109
|
-
<div class="custom-year-picker">
|
|
110
|
-
<el-button @click="prevYear">上一年</el-button>
|
|
111
|
-
<span>{{ currentYear }}年</span>
|
|
112
|
-
<el-button @click="nextYear">下一年</el-button>
|
|
113
|
-
</div>
|
|
114
|
-
</template>
|
|
115
|
-
</calendar>
|
|
116
|
-
</template>
|
|
117
|
-
|
|
118
|
-
<script>
|
|
119
|
-
import calendar from '@/components/calendar/index.vue'
|
|
120
|
-
|
|
121
|
-
export default {
|
|
122
|
-
components: {
|
|
123
|
-
calendar
|
|
124
|
-
},
|
|
125
|
-
data() {
|
|
126
|
-
return {
|
|
127
|
-
currentYear: new Date().getFullYear(),
|
|
128
|
-
holidayData: []
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
methods: {
|
|
132
|
-
handleDateClick(date) {
|
|
133
|
-
this.$message.success(`选择的日期:${date.day}`)
|
|
134
|
-
},
|
|
135
|
-
prevYear() {
|
|
136
|
-
this.currentYear--
|
|
137
|
-
},
|
|
138
|
-
nextYear() {
|
|
139
|
-
this.currentYear++
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
</script>
|
|
144
|
-
|
|
145
|
-
<style scoped>
|
|
146
|
-
.custom-year-picker {
|
|
147
|
-
display: flex;
|
|
148
|
-
justify-content: center;
|
|
149
|
-
align-items: center;
|
|
150
|
-
gap: 10px;
|
|
151
|
-
margin-bottom: 20px;
|
|
152
|
-
}
|
|
153
|
-
</style>
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## 组件 API
|
|
157
|
-
|
|
158
|
-
### Calendar Props
|
|
159
|
-
|
|
160
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
161
|
-
|------|------|------|--------|
|
|
162
|
-
| year | 当前显示的年份 | Date | new Date() |
|
|
163
|
-
| holiday | 节假日数据 | Array | [] |
|
|
164
|
-
| showWorkday | 是否显示工作日标记 | Boolean | true |
|
|
165
|
-
| showToday | 是否显示今日标记 | Boolean | true |
|
|
166
|
-
| clickable | 是否允许点击日期 | Boolean | true |
|
|
167
|
-
| isNextOrPrevClick | 是否禁用上下月份日期点击 | Boolean | false |
|
|
168
|
-
|
|
169
|
-
### Calendar Events
|
|
170
|
-
|
|
171
|
-
| 事件名 | 说明 | 回调参数 |
|
|
172
|
-
|--------|------|----------|
|
|
173
|
-
| date-click | 点击日期时触发 | data: { day: 'YYYY-MM-DD' } |
|
|
174
|
-
| year-change | 年份变化时触发 | year: Number |
|
|
175
|
-
|
|
176
|
-
### Calendar Slots
|
|
177
|
-
|
|
178
|
-
| 插槽名 | 说明 |
|
|
179
|
-
|--------|------|
|
|
180
|
-
| year-picker | 自定义年份选择器 |
|
|
181
|
-
| date-cell | 自定义日期单元格内容 |
|
|
182
|
-
|
|
183
|
-
### 节假日数据格式
|
|
184
|
-
|
|
185
|
-
```javascript
|
|
186
|
-
{
|
|
187
|
-
type: 'holiday', // 类型:holiday-节假日,workday-调休工作日
|
|
188
|
-
name: '春节', // 节日名称
|
|
189
|
-
date: '2024-02-10', // 日期,格式:YYYY-MM-DD
|
|
190
|
-
lunarDate: '正月初一' // 农历日期(可选)
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## 样式定制
|
|
195
|
-
|
|
196
|
-
### 基础样式覆盖
|
|
197
|
-
|
|
198
|
-
```css
|
|
199
|
-
/* 日历容器 */
|
|
200
|
-
.calendar-container {
|
|
201
|
-
padding: 20px;
|
|
202
|
-
background: #fff;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/* 年份选择器 */
|
|
206
|
-
.year-picker {
|
|
207
|
-
margin-bottom: 20px;
|
|
208
|
-
text-align: center;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/* 月份网格 */
|
|
212
|
-
.calendar-grid {
|
|
213
|
-
display: grid;
|
|
214
|
-
grid-template-columns: repeat(auto-fill, minmax(300px, 500px));
|
|
215
|
-
gap: 50px;
|
|
216
|
-
justify-content: center;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/* 单个月份容器 */
|
|
220
|
-
.calendar-item {
|
|
221
|
-
background-color: #fff;
|
|
222
|
-
border-radius: 8px;
|
|
223
|
-
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
224
|
-
transition: all 0.3s ease;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/* 日期单元格 */
|
|
228
|
-
.calendar-cell {
|
|
229
|
-
height: 100%;
|
|
230
|
-
padding: 8px;
|
|
231
|
-
cursor: pointer;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/* 今日标记 */
|
|
235
|
-
.today-mark {
|
|
236
|
-
background-color: #409EFF;
|
|
237
|
-
color: #fff;
|
|
238
|
-
border-radius: 50%;
|
|
239
|
-
padding: 2px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/* 节假日信息 */
|
|
243
|
-
.holiday-info {
|
|
244
|
-
font-size: 12px;
|
|
245
|
-
color: #E6A23C;
|
|
246
|
-
}
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### 主题定制
|
|
250
|
-
|
|
251
|
-
可以通过修改CSS变量来快速更改主题色:
|
|
252
|
-
|
|
253
|
-
```css
|
|
254
|
-
:root {
|
|
255
|
-
--calendar-primary-color: #409EFF;
|
|
256
|
-
--calendar-holiday-color: #E6A23C;
|
|
257
|
-
--calendar-workday-color: #67C23A;
|
|
258
|
-
--calendar-text-color: #303133;
|
|
259
|
-
--calendar-border-radius: 8px;
|
|
260
|
-
--calendar-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
## 注意事项
|
|
265
|
-
|
|
266
|
-
1. 确保项目中已正确安装并配置 Element UI
|
|
267
|
-
2. 节假日数据需要按照指定格式提供,建议使用专门的节假日API或数据服务
|
|
268
|
-
3. 组件使用响应式布局,会根据屏幕尺寸自动调整显示方式
|
|
269
|
-
4. 如需禁用某些日期的选择,可以通过传入disabledDate函数来实现
|
|
270
|
-
5. 农历日期显示为可选功能,需要额外的农历转换库支持
|
|
271
|
-
|
|
272
|
-
## 常见问题
|
|
273
|
-
|
|
274
|
-
### Q: 如何禁用特定日期?
|
|
275
|
-
|
|
276
|
-
```vue
|
|
277
|
-
<template>
|
|
278
|
-
<calendar :disabled-date="disabledDate" />
|
|
279
|
-
</template>
|
|
280
|
-
|
|
281
|
-
<script>
|
|
282
|
-
export default {
|
|
283
|
-
methods: {
|
|
284
|
-
disabledDate(date) {
|
|
285
|
-
return date.getTime() < Date.now() - 8.64e7; // 禁用今天之前的日期
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
</script>
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Q: 如何自定义日期单元格的内容?
|
|
293
|
-
|
|
294
|
-
```vue
|
|
295
|
-
<template>
|
|
296
|
-
<calendar>
|
|
297
|
-
<template #date-cell="{ date, data }">
|
|
298
|
-
<div class="custom-cell">
|
|
299
|
-
<span>{{ data.day.split('-')[2] }}</span>
|
|
300
|
-
<small>{{ getCustomContent(date) }}</small>
|
|
301
|
-
</div>
|
|
302
|
-
</template>
|
|
303
|
-
</calendar>
|
|
304
|
-
</template>
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### Q: 如何添加自定义事件标记?
|
|
308
|
-
|
|
309
|
-
```vue
|
|
310
|
-
<template>
|
|
311
|
-
<calendar :events="eventList" />
|
|
312
|
-
</template>
|
|
313
|
-
|
|
314
|
-
<script>
|
|
315
|
-
export default {
|
|
316
|
-
data() {
|
|
317
|
-
return {
|
|
318
|
-
eventList: [
|
|
319
|
-
{
|
|
320
|
-
date: '2024-01-15',
|
|
321
|
-
type: 'meeting',
|
|
322
|
-
content: '项目会议'
|
|
323
|
-
}
|
|
324
|
-
]
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
</script>
|
|
329
|
-
```
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-calendar
|
|
3
|
-
v-model="value"
|
|
4
|
-
:class="[
|
|
5
|
-
{ 'hide-button-group': !showButtonGroup },
|
|
6
|
-
{ 'next-or-prev-click': !isNextOrPrevClick },
|
|
7
|
-
]"
|
|
8
|
-
:first-day-of-week="7"
|
|
9
|
-
>
|
|
10
|
-
<template slot="dateCell" slot-scope="{ date, data }">
|
|
11
|
-
<div
|
|
12
|
-
:class="[
|
|
13
|
-
'calendar-cell',
|
|
14
|
-
handleClass(date, data),
|
|
15
|
-
{ selected: isSelected(data.day) },
|
|
16
|
-
]"
|
|
17
|
-
@click="handleDateClick(data)"
|
|
18
|
-
>
|
|
19
|
-
<div class="date">
|
|
20
|
-
{{ parseInt(data.day.split("-")[2]) }}
|
|
21
|
-
<span v-if="isToday(data.day)" class="today-mark">今</span>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="holiday-info">{{ getHolidayInfo(data.day) }}</div>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
</el-calendar>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
/**
|
|
31
|
-
* @description 自定义日历组件,基于Element UI的Calendar组件封装
|
|
32
|
-
* 支持节假日显示、今日标记、日期选择等功能
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* <custom-calendar
|
|
36
|
-
* :date="new Date()"
|
|
37
|
-
* :holiday="holidayList"
|
|
38
|
-
* @date-click="handleDateClick"
|
|
39
|
-
* />
|
|
40
|
-
*/
|
|
41
|
-
export default {
|
|
42
|
-
data() {
|
|
43
|
-
return {
|
|
44
|
-
value: this.date,
|
|
45
|
-
selectedDate: null,
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
props: {
|
|
49
|
-
/**
|
|
50
|
-
* 日历当前显示的日期
|
|
51
|
-
* @type {Date}
|
|
52
|
-
* @default new Date()
|
|
53
|
-
*/
|
|
54
|
-
date: {
|
|
55
|
-
type: Date,
|
|
56
|
-
default: () => new Date(),
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* 是否显示日历顶部的按钮组(上个月、下个月等)
|
|
60
|
-
* @type {Boolean}
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
showButtonGroup: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: true,
|
|
66
|
-
},
|
|
67
|
-
/**
|
|
68
|
-
* 是否显示工作日标记
|
|
69
|
-
* @type {Boolean}
|
|
70
|
-
* @default true
|
|
71
|
-
*/
|
|
72
|
-
showWorkday: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: true,
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* 节假日数据数组
|
|
78
|
-
* @type {Array<{date: string, type: string, name: string, lunarDate: string}>}
|
|
79
|
-
* @default []
|
|
80
|
-
*/
|
|
81
|
-
holiday: {
|
|
82
|
-
type: Array,
|
|
83
|
-
default: () => [],
|
|
84
|
-
},
|
|
85
|
-
/**
|
|
86
|
-
* 是否允许点击日期
|
|
87
|
-
* @type {Boolean}
|
|
88
|
-
* @default true
|
|
89
|
-
*/
|
|
90
|
-
clickable: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: true,
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* 是否显示今日标记
|
|
96
|
-
* @type {Boolean}
|
|
97
|
-
* @default true
|
|
98
|
-
*/
|
|
99
|
-
showToday: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: true,
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
isNextOrPrevClick: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
default: false,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
methods: {
|
|
110
|
-
/**
|
|
111
|
-
* 处理日期单元格的样式类
|
|
112
|
-
* @param {Date} date - 日期对象
|
|
113
|
-
* @param {Object} data - 日期数据对象
|
|
114
|
-
* @returns {string} 样式类名
|
|
115
|
-
*/
|
|
116
|
-
handleClass(date, data) {
|
|
117
|
-
let classes = [];
|
|
118
|
-
const d = this.holiday.find((item) => item.date === data.day);
|
|
119
|
-
if (d) {
|
|
120
|
-
classes.push(d.type);
|
|
121
|
-
}
|
|
122
|
-
if (this.showToday && this.isToday(data.day)) {
|
|
123
|
-
classes.push("is-today");
|
|
124
|
-
}
|
|
125
|
-
return classes.join(" ");
|
|
126
|
-
},
|
|
127
|
-
/**
|
|
128
|
-
* 获取农历日期
|
|
129
|
-
* @param {string} day - 日期字符串 (YYYY-MM-DD)
|
|
130
|
-
* @returns {string} 农历日期
|
|
131
|
-
*/
|
|
132
|
-
getLunarDate(day) {
|
|
133
|
-
const d = this.holiday.find((item) => item.date === day);
|
|
134
|
-
return d ? d.lunarDate : "";
|
|
135
|
-
},
|
|
136
|
-
/**
|
|
137
|
-
* 获取节假日信息
|
|
138
|
-
* @param {string} day - 日期字符串 (YYYY-MM-DD)
|
|
139
|
-
* @returns {string} 节假日名称或工作日标记
|
|
140
|
-
*/
|
|
141
|
-
getHolidayInfo(day) {
|
|
142
|
-
const d = this.holiday.find((item) => item.date === day);
|
|
143
|
-
if (d) {
|
|
144
|
-
return d.name;
|
|
145
|
-
}
|
|
146
|
-
return this.showWorkday ? "班" : "";
|
|
147
|
-
},
|
|
148
|
-
/**
|
|
149
|
-
* 处理日期点击事件
|
|
150
|
-
* @param {string} day - 日期字符串 (YYYY-MM-DD)
|
|
151
|
-
* @fires date-click
|
|
152
|
-
*/
|
|
153
|
-
handleDateClick(data) {
|
|
154
|
-
if (!this.clickable) return;
|
|
155
|
-
this.selectedDate = data.day;
|
|
156
|
-
this.$emit("date-click", data);
|
|
157
|
-
},
|
|
158
|
-
/**
|
|
159
|
-
* 判断日期是否被选中
|
|
160
|
-
* @param {string} day - 日期字符串 (YYYY-MM-DD)
|
|
161
|
-
* @returns {boolean} 是否选中
|
|
162
|
-
*/
|
|
163
|
-
isSelected(day) {
|
|
164
|
-
return this.selectedDate === day;
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* 判断是否为今天
|
|
168
|
-
* @param {string} day - 日期字符串 (YYYY-MM-DD)
|
|
169
|
-
* @returns {boolean} 是否为今天
|
|
170
|
-
*/
|
|
171
|
-
isToday(day) {
|
|
172
|
-
const today = new Date();
|
|
173
|
-
const year = today.getFullYear();
|
|
174
|
-
const month = String(today.getMonth() + 1).padStart(2, "0");
|
|
175
|
-
const date = String(today.getDate()).padStart(2, "0");
|
|
176
|
-
const todayStr = `${year}-${month}-${date}`;
|
|
177
|
-
return day === todayStr;
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
computed: {},
|
|
181
|
-
mounted() {},
|
|
182
|
-
};
|
|
183
|
-
</script>
|
|
184
|
-
|
|
185
|
-
<style scoped>
|
|
186
|
-
.next-or-prev-click :deep(.el-calendar-table__row td.prev) {
|
|
187
|
-
pointer-events: none;
|
|
188
|
-
}
|
|
189
|
-
.next-or-prev-click :deep(.el-calendar-table__row td.next) {
|
|
190
|
-
pointer-events: none;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/* 隐藏日历顶部按钮组 */
|
|
194
|
-
.hide-button-group :deep(.el-calendar__button-group) {
|
|
195
|
-
display: none;
|
|
196
|
-
}
|
|
197
|
-
/* 日历单元格基础样式 */
|
|
198
|
-
:deep(.el-calendar-day) {
|
|
199
|
-
height: 60px;
|
|
200
|
-
padding: 2px;
|
|
201
|
-
}
|
|
202
|
-
:deep(.el-calendar-day) /* 日历单元格容器样式 */
|
|
203
|
-
.calendar-cell {
|
|
204
|
-
height: 100%;
|
|
205
|
-
display: flex;
|
|
206
|
-
flex-direction: column;
|
|
207
|
-
align-items: center;
|
|
208
|
-
justify-content: space-between;
|
|
209
|
-
box-sizing: border-box;
|
|
210
|
-
padding: 2px !important;
|
|
211
|
-
}
|
|
212
|
-
/* 日期数字样式 */
|
|
213
|
-
.calendar-cell .date {
|
|
214
|
-
font-size: 16px;
|
|
215
|
-
font-weight: bold;
|
|
216
|
-
transition: transform 0.3s ease;
|
|
217
|
-
display: flex;
|
|
218
|
-
align-items: center;
|
|
219
|
-
justify-content: center;
|
|
220
|
-
gap: 2px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/* 今日标记样式 */
|
|
224
|
-
.calendar-cell .today-mark {
|
|
225
|
-
font-size: 12px;
|
|
226
|
-
color: #409eff;
|
|
227
|
-
font-weight: normal;
|
|
228
|
-
}
|
|
229
|
-
.calendar-cell:hover .date {
|
|
230
|
-
transform: scale(1.3);
|
|
231
|
-
}
|
|
232
|
-
/* 农历日期样式 */
|
|
233
|
-
.calendar-cell .lunar-date {
|
|
234
|
-
font-size: 12px;
|
|
235
|
-
color: #666;
|
|
236
|
-
transition: transform 0.3s ease;
|
|
237
|
-
}
|
|
238
|
-
.calendar-cell:hover .lunar-date {
|
|
239
|
-
transform: scale(0.8);
|
|
240
|
-
}
|
|
241
|
-
/* 节假日信息样式 */
|
|
242
|
-
.calendar-cell .holiday-info {
|
|
243
|
-
font-size: 12px;
|
|
244
|
-
margin-top: 2px;
|
|
245
|
-
transition: transform 0.3s ease;
|
|
246
|
-
}
|
|
247
|
-
.calendar-cell:hover .holiday-info {
|
|
248
|
-
transform: scale(0.8);
|
|
249
|
-
}
|
|
250
|
-
/* 日历单元格容器样式 */
|
|
251
|
-
.calendar-cell {
|
|
252
|
-
transition: all 0.3s ease;
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
position: relative;
|
|
255
|
-
padding: 4px;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/* .calendar-cell:hover::after {
|
|
259
|
-
content: attr(data-tooltip);
|
|
260
|
-
position: absolute;
|
|
261
|
-
bottom: 100%;
|
|
262
|
-
left: 50%;
|
|
263
|
-
transform: translateX(-50%);
|
|
264
|
-
padding: 4px 8px;
|
|
265
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
266
|
-
color: white;
|
|
267
|
-
border-radius: 4px;
|
|
268
|
-
font-size: 12px;
|
|
269
|
-
white-space: nowrap;
|
|
270
|
-
z-index: 1000;
|
|
271
|
-
} */
|
|
272
|
-
|
|
273
|
-
/* 节假日背景样式 */
|
|
274
|
-
.holiday {
|
|
275
|
-
background-color: #e7f5ff;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.holiday:hover {
|
|
279
|
-
background-color: #cce7ff;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/* 周末背景样式 */
|
|
283
|
-
.weekend {
|
|
284
|
-
background-color: #ebfbee;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.weekend:hover {
|
|
288
|
-
background-color: #d7f5dc;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/* 选中日期样式 */
|
|
292
|
-
.calendar-cell.selected {
|
|
293
|
-
background-color: #e7f5ff !important;
|
|
294
|
-
/* color: white !important; */
|
|
295
|
-
}
|
|
296
|
-
/* .calendar-cell.selected .holiday-info {
|
|
297
|
-
transform: scale(0.8);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.calendar-cell.selected .date {
|
|
301
|
-
transform: scale(1.3);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.calendar-cell.selected .lunar-date {
|
|
305
|
-
transform: scale(0.8);
|
|
306
|
-
} */
|
|
307
|
-
|
|
308
|
-
.calendar-cell.selected .holiday-info {
|
|
309
|
-
/* color: white; */
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/* 今日单元格样式 */
|
|
313
|
-
.calendar-cell.is-today {
|
|
314
|
-
background-color: #f4fce3;
|
|
315
|
-
/* border: 1px solid #ffa940; */
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.calendar-cell.is-today:hover {
|
|
319
|
-
background-color: #e9fac8;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/* 覆盖Element UI默认的选中样式 */
|
|
323
|
-
:deep(.el-calendar-table td.is-selected) {
|
|
324
|
-
background-color: transparent;
|
|
325
|
-
color: inherit;
|
|
326
|
-
}
|
|
327
|
-
</style>
|