uview-plus 3.1.22 → 3.1.24
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/changelog.md +6 -0
- package/components/u-calendar/month.vue +1 -1
- package/components/u-calendar/u-calendar.vue +1 -1
- package/components/u-calendar/util.js +86 -86
- package/components/u-datetime-picker/u-datetime-picker.vue +1 -1
- package/components/u-parse/node/node.vue +576 -500
- package/components/u-parse/parser.js +1250 -992
- package/components/u-parse/props.js +4 -3
- package/components/u-parse/u-parse.vue +461 -336
- package/libs/config/props.js +190 -190
- package/libs/mixin/mixin.js +6 -3
- package/package.json +1 -1
- package/components/u-parse/parser-es-module.js +0 -1122
package/changelog.md
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
import mixin from '../../libs/mixin/mixin.js';
|
|
36
36
|
import defprops from '../../libs/config/props';
|
|
37
37
|
// import dayjs from '../../libs/util/dayjs.js';
|
|
38
|
-
import dayjs from 'dayjs'
|
|
38
|
+
import dayjs from 'dayjs/ems/index.js'
|
|
39
39
|
export default {
|
|
40
40
|
name: 'u-calendar-month',
|
|
41
41
|
mixins: [mpMixin, mixin],
|
|
@@ -69,7 +69,7 @@ import uMonth from './month.vue'
|
|
|
69
69
|
import props from './props.js'
|
|
70
70
|
import util from './util.js'
|
|
71
71
|
// import dayjs from '../../libs/util/dayjs.js'
|
|
72
|
-
import dayjs from 'dayjs'
|
|
72
|
+
import dayjs from 'dayjs/ems/index.js'
|
|
73
73
|
import Calendar from '../../libs/util/calendar.js'
|
|
74
74
|
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
75
75
|
import mixin from '../../libs/mixin/mixin.js'
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import dayjs from 'dayjs'
|
|
2
|
-
export default {
|
|
3
|
-
methods: {
|
|
4
|
-
// 设置月份数据
|
|
5
|
-
setMonth() {
|
|
6
|
-
// 月初是周几
|
|
7
|
-
const day = dayjs(this.date).date(1).day()
|
|
8
|
-
const start = day == 0 ? 6 : day - 1
|
|
9
|
-
|
|
10
|
-
// 本月天数
|
|
11
|
-
const days = dayjs(this.date).endOf('month').format('D')
|
|
12
|
-
|
|
13
|
-
// 上个月天数
|
|
14
|
-
const prevDays = dayjs(this.date).endOf('month').subtract(1, 'month').format('D')
|
|
15
|
-
|
|
16
|
-
// 日期数据
|
|
17
|
-
const arr = []
|
|
18
|
-
// 清空表格
|
|
19
|
-
this.month = []
|
|
20
|
-
|
|
21
|
-
// 添加上月数据
|
|
22
|
-
arr.push(
|
|
23
|
-
...new Array(start).fill(1).map((e, i) => {
|
|
24
|
-
const day = prevDays - start + i + 1
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
value: day,
|
|
28
|
-
disabled: true,
|
|
29
|
-
date: dayjs(this.date).subtract(1, 'month').date(day).format('YYYY-MM-DD')
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
// 添加本月数据
|
|
35
|
-
arr.push(
|
|
36
|
-
...new Array(days - 0).fill(1).map((e, i) => {
|
|
37
|
-
const day = i + 1
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
value: day,
|
|
41
|
-
date: dayjs(this.date).date(day).format('YYYY-MM-DD')
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// 添加下个月
|
|
47
|
-
arr.push(
|
|
48
|
-
...new Array(42 - days - start).fill(1).map((e, i) => {
|
|
49
|
-
const day = i + 1
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
value: day,
|
|
53
|
-
disabled: true,
|
|
54
|
-
date: dayjs(this.date).add(1, 'month').date(day).format('YYYY-MM-DD')
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
// 分割数组
|
|
60
|
-
for (let n = 0; n < arr.length; n += 7) {
|
|
61
|
-
this.month.push(
|
|
62
|
-
arr.slice(n, n + 7).map((e, i) => {
|
|
63
|
-
e.index = i + n
|
|
64
|
-
|
|
65
|
-
// 自定义信息
|
|
66
|
-
const custom = this.customList.find((c) => c.date == e.date)
|
|
67
|
-
|
|
68
|
-
// 农历
|
|
69
|
-
if (this.lunar) {
|
|
70
|
-
const {
|
|
71
|
-
IDayCn,
|
|
72
|
-
IMonthCn
|
|
73
|
-
} = this.getLunar(e.date)
|
|
74
|
-
e.lunar = IDayCn == '初一' ? IMonthCn : IDayCn
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
...e,
|
|
79
|
-
...custom
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
import dayjs from 'dayjs/ems/index.js'
|
|
2
|
+
export default {
|
|
3
|
+
methods: {
|
|
4
|
+
// 设置月份数据
|
|
5
|
+
setMonth() {
|
|
6
|
+
// 月初是周几
|
|
7
|
+
const day = dayjs(this.date).date(1).day()
|
|
8
|
+
const start = day == 0 ? 6 : day - 1
|
|
9
|
+
|
|
10
|
+
// 本月天数
|
|
11
|
+
const days = dayjs(this.date).endOf('month').format('D')
|
|
12
|
+
|
|
13
|
+
// 上个月天数
|
|
14
|
+
const prevDays = dayjs(this.date).endOf('month').subtract(1, 'month').format('D')
|
|
15
|
+
|
|
16
|
+
// 日期数据
|
|
17
|
+
const arr = []
|
|
18
|
+
// 清空表格
|
|
19
|
+
this.month = []
|
|
20
|
+
|
|
21
|
+
// 添加上月数据
|
|
22
|
+
arr.push(
|
|
23
|
+
...new Array(start).fill(1).map((e, i) => {
|
|
24
|
+
const day = prevDays - start + i + 1
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
value: day,
|
|
28
|
+
disabled: true,
|
|
29
|
+
date: dayjs(this.date).subtract(1, 'month').date(day).format('YYYY-MM-DD')
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
// 添加本月数据
|
|
35
|
+
arr.push(
|
|
36
|
+
...new Array(days - 0).fill(1).map((e, i) => {
|
|
37
|
+
const day = i + 1
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
value: day,
|
|
41
|
+
date: dayjs(this.date).date(day).format('YYYY-MM-DD')
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// 添加下个月
|
|
47
|
+
arr.push(
|
|
48
|
+
...new Array(42 - days - start).fill(1).map((e, i) => {
|
|
49
|
+
const day = i + 1
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
value: day,
|
|
53
|
+
disabled: true,
|
|
54
|
+
date: dayjs(this.date).add(1, 'month').date(day).format('YYYY-MM-DD')
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
// 分割数组
|
|
60
|
+
for (let n = 0; n < arr.length; n += 7) {
|
|
61
|
+
this.month.push(
|
|
62
|
+
arr.slice(n, n + 7).map((e, i) => {
|
|
63
|
+
e.index = i + n
|
|
64
|
+
|
|
65
|
+
// 自定义信息
|
|
66
|
+
const custom = this.customList.find((c) => c.date == e.date)
|
|
67
|
+
|
|
68
|
+
// 农历
|
|
69
|
+
if (this.lunar) {
|
|
70
|
+
const {
|
|
71
|
+
IDayCn,
|
|
72
|
+
IMonthCn
|
|
73
|
+
} = this.getLunar(e.date)
|
|
74
|
+
e.lunar = IDayCn == '初一' ? IMonthCn : IDayCn
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
...e,
|
|
79
|
+
...custom
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
35
35
|
import mixin from '../../libs/mixin/mixin.js';
|
|
36
36
|
// import dayjs from '../../libs/util/dayjs.js';
|
|
37
|
-
import dayjs from 'dayjs'
|
|
37
|
+
import dayjs from 'dayjs/ems/index.js'
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* DatetimePicker 时间日期选择器
|