uview-plus 3.1.50 → 3.1.52
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 +10 -10
- package/changelog.md +18 -1
- package/components/u-action-sheet/props.js +10 -11
- package/components/u-album/props.js +11 -12
- package/components/u-alert/props.js +8 -9
- package/components/u-avatar/props.js +14 -15
- package/components/u-avatar-group/props.js +9 -10
- package/components/u-back-top/props.js +10 -11
- package/components/u-back-top/u-back-top.vue +1 -1
- package/components/u-badge/props.js +14 -15
- package/components/u-badge/u-badge.vue +1 -1
- package/components/u-button/props.js +28 -29
- package/components/u-button/u-button.vue +6 -6
- package/components/u-button/vue.scss +8 -7
- package/components/u-calendar/month.vue +1 -1
- package/components/u-calendar/props.js +27 -28
- package/components/u-car-keyboard/props.js +0 -1
- package/components/u-car-keyboard/u-car-keyboard.vue +1 -1
- package/components/u-cell/props.js +17 -18
- package/components/u-cell/u-cell.vue +14 -4
- package/components/u-cell-group/props.js +2 -3
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-checkbox/props.js +13 -14
- package/components/u-checkbox/u-checkbox.vue +1 -1
- package/components/u-checkbox-group/props.js +16 -17
- package/components/u-circle-progress/props.js +1 -2
- package/components/u-code/props.js +6 -7
- package/components/u-code/u-code.vue +5 -0
- package/components/u-code-input/props.js +16 -17
- package/components/u-col/props.js +5 -6
- package/components/u-collapse/props.js +3 -4
- package/components/u-collapse-item/props.js +11 -12
- package/components/u-column-notice/props.js +10 -11
- package/components/u-copy/u-copy.vue +70 -0
- package/components/u-count-down/props.js +4 -5
- package/components/u-count-down/u-count-down.vue +6 -1
- package/components/u-count-to/props.js +11 -12
- package/components/u-datetime-picker/props.js +37 -25
- package/components/u-datetime-picker/u-datetime-picker.vue +58 -3
- package/components/u-divider/props.js +8 -9
- package/components/u-dropdown/props.js +0 -1
- package/components/u-dropdown-item/props.js +0 -1
- package/components/u-empty/props.js +11 -12
- package/components/u-form/props.js +8 -9
- package/components/u-form/u-form.vue +1 -1
- package/components/u-form-item/props.js +13 -9
- package/components/u-form-item/u-form-item.vue +1 -0
- package/components/u-gap/props.js +4 -5
- package/components/u-gap/u-gap.vue +5 -4
- package/components/u-grid/props.js +3 -4
- package/components/u-grid-item/props.js +2 -3
- package/components/u-grid-item/u-grid-item.vue +5 -0
- package/components/u-icon/props.js +17 -18
- package/components/u-icon/u-icon.vue +9 -6
- package/components/u-image/props.js +16 -17
- package/components/u-image/u-image.vue +1 -1
- package/components/u-index-anchor/props.js +5 -6
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-item/props.js +0 -1
- package/components/u-index-item/u-index-item.vue +1 -1
- package/components/u-index-list/props.js +5 -6
- package/components/u-index-list/u-index-list.vue +3 -2
- package/components/u-input/props.js +35 -36
- package/components/u-input/u-input.vue +10 -4
- package/components/u-keyboard/props.js +16 -17
- package/components/u-line/props.js +6 -7
- package/components/u-line-progress/props.js +5 -6
- package/components/u-link/props.js +7 -8
- package/components/u-list/props.js +14 -15
- package/components/u-list-item/props.js +1 -2
- package/components/u-loading-icon/props.js +11 -12
- package/components/u-loading-page/props.js +9 -10
- package/components/u-loadmore/props.js +18 -19
- package/components/u-modal/props.js +16 -17
- package/components/u-navbar/props.js +16 -17
- package/components/u-no-network/props.js +3 -4
- package/components/u-notice-bar/props.js +13 -14
- package/components/u-notify/props.js +9 -10
- package/components/u-notify/u-notify.vue +5 -0
- package/components/u-number-box/props.js +22 -23
- package/components/u-number-box/u-number-box.vue +21 -1
- package/components/u-number-keyboard/props.js +3 -4
- package/components/u-overlay/props.js +4 -5
- package/components/u-parse/props.js +8 -9
- package/components/u-parse/u-parse.vue +6 -1
- package/components/u-picker/props.js +16 -17
- package/components/u-picker-column/props.js +0 -1
- package/components/u-popup/props.js +15 -16
- package/components/u-qrcode/qrcode.js +1206 -0
- package/components/u-qrcode/u-qrcode.vue +199 -0
- package/components/u-radio/props.js +13 -14
- package/components/u-radio-group/props.js +17 -18
- package/components/u-rate/props.js +14 -15
- package/components/u-read-more/props.js +8 -9
- package/components/u-row/props.js +3 -4
- package/components/u-row-notice/props.js +7 -8
- package/components/u-row-notice/u-row-notice.vue +5 -0
- package/components/u-safe-bottom/props.js +0 -1
- package/components/u-scroll-list/props.js +6 -7
- package/components/u-search/props.js +24 -25
- package/components/u-skeleton/props.js +11 -12
- package/components/u-slider/props.js +11 -12
- package/components/u-status-bar/props.js +1 -2
- package/components/u-status-bar/u-status-bar.vue +1 -1
- package/components/u-steps/props.js +7 -8
- package/components/u-steps/u-steps.vue +1 -1
- package/components/u-steps-item/props.js +4 -5
- package/components/u-steps-item/u-steps-item.vue +1 -1
- package/components/u-sticky/props.js +6 -7
- package/components/u-sticky/u-sticky.vue +5 -0
- package/components/u-subsection/props.js +9 -10
- package/components/u-subsection/u-subsection.vue +2 -2
- package/components/u-swipe-action/props.js +1 -2
- package/components/u-swipe-action-item/nvue.js +5 -0
- package/components/u-swipe-action-item/props.js +6 -7
- package/components/u-swiper/props.js +24 -25
- package/components/u-swiper-indicator/props.js +5 -6
- package/components/u-switch/props.js +11 -12
- package/components/u-tabbar/props.js +8 -9
- package/components/u-tabbar-item/props.js +6 -7
- package/components/u-table/props.js +0 -1
- package/components/u-tabs/props.js +12 -13
- package/components/u-tabs-item/props.js +0 -1
- package/components/u-tag/props.js +15 -16
- package/components/u-td/props.js +0 -1
- package/components/u-text/props.js +21 -22
- package/components/u-textarea/props.js +23 -24
- package/components/u-toast/u-toast.vue +5 -0
- package/components/u-toolbar/props.js +6 -7
- package/components/u-tooltip/props.js +11 -12
- package/components/u-tooltip/u-tooltip.vue +0 -28
- package/components/u-tr/props.js +0 -1
- package/components/u-transition/props.js +4 -5
- package/components/u-transition/transition.js +8 -9
- package/components/u-transition/u-transition.vue +1 -1
- package/components/u-upload/props.js +22 -23
- package/components/u-upload/u-upload.vue +1 -1
- package/index.js +6 -6
- package/libs/config/props/actionSheet.js +1 -1
- package/libs/config/props/album.js +1 -1
- package/libs/config/props/avatarGroup.js +1 -1
- package/libs/config/props/backtop.js +2 -2
- package/libs/config/props/badge.js +1 -1
- package/libs/config/props/calendar.js +3 -3
- package/libs/config/props/checkboxGroup.js +1 -1
- package/libs/config/props/datetimePicker.js +1 -1
- package/libs/config/props/form.js +3 -3
- package/libs/config/props/formItem.js +1 -0
- package/libs/config/props/indexList.js +1 -1
- package/libs/config/props/noticeBar.js +1 -1
- package/libs/config/props/picker.js +2 -2
- package/libs/config/props/popup.js +1 -1
- package/libs/config/props/search.js +2 -2
- package/libs/config/props/slider.js +1 -1
- package/libs/config/props/swiper.js +1 -1
- package/libs/config/props/tabs.js +7 -7
- package/libs/config/props/text.js +2 -2
- package/libs/config/props/toast.js +1 -1
- package/libs/config/props/tooltip.js +1 -1
- package/libs/config/props/upload.js +3 -3
- package/libs/css/components.scss +11 -1
- package/libs/css/flex.scss +103 -101
- package/libs/function/colorGradient.js +8 -8
- package/libs/function/debounce.js +2 -2
- package/libs/function/digit.js +5 -5
- package/libs/function/index.js +29 -29
- package/libs/function/test.js +28 -28
- package/libs/function/throttle.js +2 -2
- package/package.json +4 -3
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
4
3
|
// 倒计时时长,单位ms
|
|
5
4
|
time: {
|
|
6
5
|
type: [String, Number],
|
|
7
|
-
default:
|
|
6
|
+
default: () => uni.$u.props.countDown.time
|
|
8
7
|
},
|
|
9
8
|
// 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
|
|
10
9
|
format: {
|
|
11
10
|
type: String,
|
|
12
|
-
default:
|
|
11
|
+
default: () => uni.$u.props.countDown.format
|
|
13
12
|
},
|
|
14
13
|
// 是否自动开始倒计时
|
|
15
14
|
autoStart: {
|
|
16
15
|
type: Boolean,
|
|
17
|
-
default:
|
|
16
|
+
default: () => uni.$u.props.countDown.autoStart
|
|
18
17
|
},
|
|
19
18
|
// 是否展示毫秒倒计时
|
|
20
19
|
millisecond: {
|
|
21
20
|
type: Boolean,
|
|
22
|
-
default:
|
|
21
|
+
default: () => uni.$u.props.countDown.millisecond
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/**
|
|
19
19
|
* u-count-down 倒计时
|
|
20
20
|
* @description 该组件一般使用于某个活动的截止时间上,通过数字的变化,给用户明确的时间感受,提示用户进行某一个行为操作。
|
|
21
|
-
* @tutorial https://
|
|
21
|
+
* @tutorial https://uview-plus.jiangruyi.com/components/countDown.html
|
|
22
22
|
* @property {String | Number} time 倒计时时长,单位ms (默认 0 )
|
|
23
23
|
* @property {String} format 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 (默认 'HH:mm:ss' )
|
|
24
24
|
* @property {Boolean} autoStart 是否自动开始倒计时 (默认 true )
|
|
@@ -141,7 +141,12 @@
|
|
|
141
141
|
this.timer = null
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
+
// #ifdef VUE2
|
|
144
145
|
beforeDestroy() {
|
|
146
|
+
// #endif
|
|
147
|
+
// #ifdef VUE3
|
|
148
|
+
beforeUnmount() {
|
|
149
|
+
// #endif
|
|
145
150
|
this.clearTimeout()
|
|
146
151
|
}
|
|
147
152
|
}
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
4
3
|
// 开始的数值,默认从0增长到某一个数
|
|
5
4
|
startVal: {
|
|
6
5
|
type: [String, Number],
|
|
7
|
-
default:
|
|
6
|
+
default: () => uni.$u.props.countTo.startVal
|
|
8
7
|
},
|
|
9
8
|
// 要滚动的目标数值,必须
|
|
10
9
|
endVal: {
|
|
11
10
|
type: [String, Number],
|
|
12
|
-
default:
|
|
11
|
+
default: () => uni.$u.props.countTo.endVal
|
|
13
12
|
},
|
|
14
13
|
// 滚动到目标数值的动画持续时间,单位为毫秒(ms)
|
|
15
14
|
duration: {
|
|
16
15
|
type: [String, Number],
|
|
17
|
-
default:
|
|
16
|
+
default: () => uni.$u.props.countTo.duration
|
|
18
17
|
},
|
|
19
18
|
// 设置数值后是否自动开始滚动
|
|
20
19
|
autoplay: {
|
|
21
20
|
type: Boolean,
|
|
22
|
-
default:
|
|
21
|
+
default: () => uni.$u.props.countTo.autoplay
|
|
23
22
|
},
|
|
24
23
|
// 要显示的小数位数
|
|
25
24
|
decimals: {
|
|
26
25
|
type: [String, Number],
|
|
27
|
-
default:
|
|
26
|
+
default: () => uni.$u.props.countTo.decimals
|
|
28
27
|
},
|
|
29
28
|
// 是否在即将到达目标数值的时候,使用缓慢滚动的效果
|
|
30
29
|
useEasing: {
|
|
31
30
|
type: Boolean,
|
|
32
|
-
default:
|
|
31
|
+
default: () => uni.$u.props.countTo.useEasing
|
|
33
32
|
},
|
|
34
33
|
// 十进制分割
|
|
35
34
|
decimal: {
|
|
36
35
|
type: [String, Number],
|
|
37
|
-
default:
|
|
36
|
+
default: () => uni.$u.props.countTo.decimal
|
|
38
37
|
},
|
|
39
38
|
// 字体颜色
|
|
40
39
|
color: {
|
|
41
40
|
type: String,
|
|
42
|
-
default:
|
|
41
|
+
default: () => uni.$u.props.countTo.color
|
|
43
42
|
},
|
|
44
43
|
// 字体大小
|
|
45
44
|
fontSize: {
|
|
46
45
|
type: [String, Number],
|
|
47
|
-
default:
|
|
46
|
+
default: () => uni.$u.props.countTo.fontSize
|
|
48
47
|
},
|
|
49
48
|
// 是否加粗字体
|
|
50
49
|
bold: {
|
|
51
50
|
type: Boolean,
|
|
52
|
-
default:
|
|
51
|
+
default: () => uni.$u.props.countTo.bold
|
|
53
52
|
},
|
|
54
53
|
// 千位分隔符,类似金额的分割(¥23,321.05中的",")
|
|
55
54
|
separator: {
|
|
56
55
|
type: String,
|
|
57
|
-
default:
|
|
56
|
+
default: () => uni.$u.props.countTo.separator
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -1,131 +1,143 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
3
|
+
// 是否显示input
|
|
4
|
+
hasInput: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: () => false
|
|
7
|
+
},
|
|
8
|
+
placeholder: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: () => '请选择'
|
|
11
|
+
},
|
|
12
|
+
format: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: () => ''
|
|
15
|
+
},
|
|
4
16
|
// 是否打开组件
|
|
5
17
|
show: {
|
|
6
18
|
type: Boolean,
|
|
7
|
-
default:
|
|
19
|
+
default: () => uni.$u.props.datetimePicker.show
|
|
8
20
|
},
|
|
9
21
|
// 弹出的方向,可选值为 top bottom right left center
|
|
10
22
|
popupMode: {
|
|
11
23
|
type: String,
|
|
12
|
-
default:
|
|
24
|
+
default: () => uni.$u.props.picker.popupMode
|
|
13
25
|
},
|
|
14
26
|
// 是否展示顶部的操作栏
|
|
15
27
|
showToolbar: {
|
|
16
28
|
type: Boolean,
|
|
17
|
-
default:
|
|
29
|
+
default: () => uni.$u.props.datetimePicker.showToolbar
|
|
18
30
|
},
|
|
19
31
|
// #ifdef VUE2
|
|
20
32
|
// 绑定值
|
|
21
33
|
value: {
|
|
22
34
|
type: [String, Number],
|
|
23
|
-
default:
|
|
35
|
+
default: () => uni.$u.props.datetimePicker.value
|
|
24
36
|
},
|
|
25
37
|
// #endif
|
|
26
38
|
// #ifdef VUE3
|
|
27
39
|
// 绑定值
|
|
28
40
|
modelValue: {
|
|
29
41
|
type: [String, Number],
|
|
30
|
-
default:
|
|
42
|
+
default: () => uni.$u.props.datetimePicker.value
|
|
31
43
|
},
|
|
32
44
|
// #endif
|
|
33
45
|
// 顶部标题
|
|
34
46
|
title: {
|
|
35
47
|
type: String,
|
|
36
|
-
default:
|
|
48
|
+
default: () => uni.$u.props.datetimePicker.title
|
|
37
49
|
},
|
|
38
50
|
// 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
|
|
39
51
|
mode: {
|
|
40
52
|
type: String,
|
|
41
|
-
default:
|
|
53
|
+
default: () => uni.$u.props.datetimePicker.mode
|
|
42
54
|
},
|
|
43
55
|
// 可选的最大时间
|
|
44
56
|
maxDate: {
|
|
45
57
|
type: Number,
|
|
46
58
|
// 最大默认值为后10年
|
|
47
|
-
default:
|
|
59
|
+
default: () => uni.$u.props.datetimePicker.maxDate
|
|
48
60
|
},
|
|
49
61
|
// 可选的最小时间
|
|
50
62
|
minDate: {
|
|
51
63
|
type: Number,
|
|
52
64
|
// 最小默认值为前10年
|
|
53
|
-
default:
|
|
65
|
+
default: () => uni.$u.props.datetimePicker.minDate
|
|
54
66
|
},
|
|
55
67
|
// 可选的最小小时,仅mode=time有效
|
|
56
68
|
minHour: {
|
|
57
69
|
type: Number,
|
|
58
|
-
default:
|
|
70
|
+
default: () => uni.$u.props.datetimePicker.minHour
|
|
59
71
|
},
|
|
60
72
|
// 可选的最大小时,仅mode=time有效
|
|
61
73
|
maxHour: {
|
|
62
74
|
type: Number,
|
|
63
|
-
default:
|
|
75
|
+
default: () => uni.$u.props.datetimePicker.maxHour
|
|
64
76
|
},
|
|
65
77
|
// 可选的最小分钟,仅mode=time有效
|
|
66
78
|
minMinute: {
|
|
67
79
|
type: Number,
|
|
68
|
-
default:
|
|
80
|
+
default: () => uni.$u.props.datetimePicker.minMinute
|
|
69
81
|
},
|
|
70
82
|
// 可选的最大分钟,仅mode=time有效
|
|
71
83
|
maxMinute: {
|
|
72
84
|
type: Number,
|
|
73
|
-
default:
|
|
85
|
+
default: () => uni.$u.props.datetimePicker.maxMinute
|
|
74
86
|
},
|
|
75
87
|
// 选项过滤函数
|
|
76
88
|
filter: {
|
|
77
89
|
type: [Function, null],
|
|
78
|
-
default:
|
|
90
|
+
default: () => uni.$u.props.datetimePicker.filter
|
|
79
91
|
},
|
|
80
92
|
// 选项格式化函数
|
|
81
93
|
formatter: {
|
|
82
94
|
type: [Function, null],
|
|
83
|
-
default:
|
|
95
|
+
default: () => uni.$u.props.datetimePicker.formatter
|
|
84
96
|
},
|
|
85
97
|
// 是否显示加载中状态
|
|
86
98
|
loading: {
|
|
87
99
|
type: Boolean,
|
|
88
|
-
default:
|
|
100
|
+
default: () => uni.$u.props.datetimePicker.loading
|
|
89
101
|
},
|
|
90
102
|
// 各列中,单个选项的高度
|
|
91
103
|
itemHeight: {
|
|
92
104
|
type: [String, Number],
|
|
93
|
-
default:
|
|
105
|
+
default: () => uni.$u.props.datetimePicker.itemHeight
|
|
94
106
|
},
|
|
95
107
|
// 取消按钮的文字
|
|
96
108
|
cancelText: {
|
|
97
109
|
type: String,
|
|
98
|
-
default:
|
|
110
|
+
default: () => uni.$u.props.datetimePicker.cancelText
|
|
99
111
|
},
|
|
100
112
|
// 确认按钮的文字
|
|
101
113
|
confirmText: {
|
|
102
114
|
type: String,
|
|
103
|
-
default:
|
|
115
|
+
default: () => uni.$u.props.datetimePicker.confirmText
|
|
104
116
|
},
|
|
105
117
|
// 取消按钮的颜色
|
|
106
118
|
cancelColor: {
|
|
107
119
|
type: String,
|
|
108
|
-
default:
|
|
120
|
+
default: () => uni.$u.props.datetimePicker.cancelColor
|
|
109
121
|
},
|
|
110
122
|
// 确认按钮的颜色
|
|
111
123
|
confirmColor: {
|
|
112
124
|
type: String,
|
|
113
|
-
default:
|
|
125
|
+
default: () => uni.$u.props.datetimePicker.confirmColor
|
|
114
126
|
},
|
|
115
127
|
// 每列中可见选项的数量
|
|
116
128
|
visibleItemCount: {
|
|
117
129
|
type: [String, Number],
|
|
118
|
-
default:
|
|
130
|
+
default: () => uni.$u.props.datetimePicker.visibleItemCount
|
|
119
131
|
},
|
|
120
132
|
// 是否允许点击遮罩关闭选择器
|
|
121
133
|
closeOnClickOverlay: {
|
|
122
134
|
type: Boolean,
|
|
123
|
-
default:
|
|
135
|
+
default: () => uni.$u.props.datetimePicker.closeOnClickOverlay
|
|
124
136
|
},
|
|
125
137
|
// 各列的默认索引
|
|
126
138
|
defaultIndex: {
|
|
127
139
|
type: Array,
|
|
128
|
-
default:
|
|
140
|
+
default: () => uni.$u.props.datetimePicker.defaultIndex
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
143
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<view v-if="hasInput">
|
|
3
|
+
<u-input
|
|
4
|
+
:placeholder="placeholder"
|
|
5
|
+
border="surround"
|
|
6
|
+
v-model="inputValue"
|
|
7
|
+
@click="showByClickInput = !showByClickInput"
|
|
8
|
+
></u-input>
|
|
9
|
+
</view>
|
|
2
10
|
<u-picker
|
|
3
11
|
ref="picker"
|
|
4
|
-
:show="show"
|
|
12
|
+
:show="show || (hasInput && showByClickInput)"
|
|
5
13
|
:popupMode="popupMode"
|
|
6
14
|
:closeOnClickOverlay="closeOnClickOverlay"
|
|
7
15
|
:columns="columns"
|
|
@@ -43,7 +51,7 @@
|
|
|
43
51
|
* @tutorial https://ijry.github.io/uview-plus/components/datetimePicker.html
|
|
44
52
|
* @property {Boolean} show 用于控制选择器的弹出与收起 ( 默认 false )
|
|
45
53
|
* @property {Boolean} showToolbar 是否显示顶部的操作栏 ( 默认 true )
|
|
46
|
-
* @property {String | Number}
|
|
54
|
+
* @property {String | Number} modelValue 绑定值
|
|
47
55
|
* @property {String} title 顶部标题
|
|
48
56
|
* @property {String} mode 展示格式 mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择 ( 默认 ‘datetime )
|
|
49
57
|
* @property {Number} maxDate 可选的最大时间 默认值为后10年
|
|
@@ -74,6 +82,9 @@
|
|
|
74
82
|
mixins: [mpMixin, mixin, props],
|
|
75
83
|
data() {
|
|
76
84
|
return {
|
|
85
|
+
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
|
86
|
+
inputValue: '', // 表单显示值
|
|
87
|
+
showByClickInput: false, // 是否在hasInput模式下显示日期选择弹唱
|
|
77
88
|
columns: [],
|
|
78
89
|
innerDefaultIndex: [],
|
|
79
90
|
innerFormatter: (type, value) => value
|
|
@@ -88,6 +99,7 @@
|
|
|
88
99
|
// #ifdef VUE3
|
|
89
100
|
modelValue(newValue) {
|
|
90
101
|
this.init()
|
|
102
|
+
this.getInputValue()
|
|
91
103
|
},
|
|
92
104
|
// #endif
|
|
93
105
|
// #ifdef VUE2
|
|
@@ -112,6 +124,34 @@
|
|
|
112
124
|
emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue'],
|
|
113
125
|
// #endif
|
|
114
126
|
methods: {
|
|
127
|
+
getInputValue(newValue) {
|
|
128
|
+
if (this.mode == 'time') {
|
|
129
|
+
this.inputValue = newValue
|
|
130
|
+
} else {
|
|
131
|
+
if (this.format) {
|
|
132
|
+
this.inputValue = dayjs(newValue).format(this.format)
|
|
133
|
+
} else {
|
|
134
|
+
let format = ''
|
|
135
|
+
switch (this.mode) {
|
|
136
|
+
case 'date':
|
|
137
|
+
format = 'YYYY-MM-DD'
|
|
138
|
+
break;
|
|
139
|
+
case 'year-month':
|
|
140
|
+
format = 'YYYY-MM'
|
|
141
|
+
break;
|
|
142
|
+
case 'datetime':
|
|
143
|
+
format = 'YYYY-MM-DD HH:mm'
|
|
144
|
+
break;
|
|
145
|
+
case 'time':
|
|
146
|
+
format = 'HH:mm'
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
this.inputValue = dayjs(newValue).format(format)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
115
155
|
init() {
|
|
116
156
|
// #ifdef VUE3
|
|
117
157
|
this.innerValue = this.correctValue(this.modelValue)
|
|
@@ -133,6 +173,9 @@
|
|
|
133
173
|
},
|
|
134
174
|
// 点击工具栏的取消按钮
|
|
135
175
|
cancel() {
|
|
176
|
+
if (this.hasInput) {
|
|
177
|
+
this.showByClickInput = false
|
|
178
|
+
}
|
|
136
179
|
this.$emit('cancel')
|
|
137
180
|
},
|
|
138
181
|
// 点击工具栏的确定按钮
|
|
@@ -141,12 +184,17 @@
|
|
|
141
184
|
value: this.innerValue,
|
|
142
185
|
mode: this.mode
|
|
143
186
|
})
|
|
187
|
+
|
|
144
188
|
// #ifdef VUE3
|
|
145
189
|
this.$emit('update:modelValue', this.innerValue)
|
|
146
190
|
// #endif
|
|
147
191
|
// #ifdef VUE2
|
|
148
192
|
this.$emit('input', this.innerValue)
|
|
149
193
|
// #endif
|
|
194
|
+
if (this.hasInput) {
|
|
195
|
+
this.getInputValue(this.innerValue)
|
|
196
|
+
this.showByClickInput = false
|
|
197
|
+
}
|
|
150
198
|
},
|
|
151
199
|
//用正则截取输出值,当出现多组数字时,抛出错误
|
|
152
200
|
intercept(e,type){
|
|
@@ -214,7 +262,7 @@
|
|
|
214
262
|
setTimeout(() => {
|
|
215
263
|
this.updateIndexs(value)
|
|
216
264
|
}, 0);
|
|
217
|
-
|
|
265
|
+
|
|
218
266
|
},
|
|
219
267
|
// 更新索引
|
|
220
268
|
updateIndexs(value) {
|
|
@@ -268,6 +316,13 @@
|
|
|
268
316
|
// 进行过滤
|
|
269
317
|
if (this.filter) {
|
|
270
318
|
values = this.filter(type, values)
|
|
319
|
+
if (!values || (values && values.length == 0)) {
|
|
320
|
+
uni.showToast({
|
|
321
|
+
title: '日期filter结果不能为空',
|
|
322
|
+
icon: 'error',
|
|
323
|
+
mask: true
|
|
324
|
+
})
|
|
325
|
+
}
|
|
271
326
|
}
|
|
272
327
|
return { type, values }
|
|
273
328
|
})
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
4
3
|
// 是否虚线
|
|
5
4
|
dashed: {
|
|
6
5
|
type: Boolean,
|
|
7
|
-
default:
|
|
6
|
+
default: () => uni.$u.props.divider.dashed
|
|
8
7
|
},
|
|
9
8
|
// 是否细线
|
|
10
9
|
hairline: {
|
|
11
10
|
type: Boolean,
|
|
12
|
-
default:
|
|
11
|
+
default: () => uni.$u.props.divider.hairline
|
|
13
12
|
},
|
|
14
13
|
// 是否以点替代文字,优先于text字段起作用
|
|
15
14
|
dot: {
|
|
16
15
|
type: Boolean,
|
|
17
|
-
default:
|
|
16
|
+
default: () => uni.$u.props.divider.dot
|
|
18
17
|
},
|
|
19
18
|
// 内容文本的位置,left-左边,center-中间,right-右边
|
|
20
19
|
textPosition: {
|
|
21
20
|
type: String,
|
|
22
|
-
default:
|
|
21
|
+
default: () => uni.$u.props.divider.textPosition
|
|
23
22
|
},
|
|
24
23
|
// 文本内容
|
|
25
24
|
text: {
|
|
26
25
|
type: [String, Number],
|
|
27
|
-
default:
|
|
26
|
+
default: () => uni.$u.props.divider.text
|
|
28
27
|
},
|
|
29
28
|
// 文本大小
|
|
30
29
|
textSize: {
|
|
31
30
|
type: [String, Number],
|
|
32
|
-
default:
|
|
31
|
+
default: () => uni.$u.props.divider.textSize
|
|
33
32
|
},
|
|
34
33
|
// 文本颜色
|
|
35
34
|
textColor: {
|
|
36
35
|
type: String,
|
|
37
|
-
default:
|
|
36
|
+
default: () => uni.$u.props.divider.textColor
|
|
38
37
|
},
|
|
39
38
|
// 线条颜色
|
|
40
39
|
lineColor: {
|
|
41
40
|
type: String,
|
|
42
|
-
default:
|
|
41
|
+
default: () => uni.$u.props.divider.lineColor
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
4
3
|
// 内置图标名称,或图片路径,建议绝对路径
|
|
5
4
|
icon: {
|
|
6
5
|
type: String,
|
|
7
|
-
default:
|
|
6
|
+
default: () => uni.$u.props.empty.icon
|
|
8
7
|
},
|
|
9
8
|
// 提示文字
|
|
10
9
|
text: {
|
|
11
10
|
type: String,
|
|
12
|
-
default:
|
|
11
|
+
default: () => uni.$u.props.empty.text
|
|
13
12
|
},
|
|
14
13
|
// 文字颜色
|
|
15
14
|
textColor: {
|
|
16
15
|
type: String,
|
|
17
|
-
default:
|
|
16
|
+
default: () => uni.$u.props.empty.textColor
|
|
18
17
|
},
|
|
19
18
|
// 文字大小
|
|
20
19
|
textSize: {
|
|
21
20
|
type: [String, Number],
|
|
22
|
-
default:
|
|
21
|
+
default: () => uni.$u.props.empty.textSize
|
|
23
22
|
},
|
|
24
23
|
// 图标的颜色
|
|
25
24
|
iconColor: {
|
|
26
25
|
type: String,
|
|
27
|
-
default:
|
|
26
|
+
default: () => uni.$u.props.empty.iconColor
|
|
28
27
|
},
|
|
29
28
|
// 图标的大小
|
|
30
29
|
iconSize: {
|
|
31
30
|
type: [String, Number],
|
|
32
|
-
default:
|
|
31
|
+
default: () => uni.$u.props.empty.iconSize
|
|
33
32
|
},
|
|
34
33
|
// 选择预置的图标类型
|
|
35
34
|
mode: {
|
|
36
35
|
type: String,
|
|
37
|
-
default:
|
|
36
|
+
default: () => uni.$u.props.empty.mode
|
|
38
37
|
},
|
|
39
38
|
// 图标宽度,单位px
|
|
40
39
|
width: {
|
|
41
40
|
type: [String, Number],
|
|
42
|
-
default:
|
|
41
|
+
default: () => uni.$u.props.empty.width
|
|
43
42
|
},
|
|
44
43
|
// 图标高度,单位px
|
|
45
44
|
height: {
|
|
46
45
|
type: [String, Number],
|
|
47
|
-
default:
|
|
46
|
+
default: () => uni.$u.props.empty.height
|
|
48
47
|
},
|
|
49
48
|
// 是否显示组件
|
|
50
49
|
show: {
|
|
51
50
|
type: Boolean,
|
|
52
|
-
default:
|
|
51
|
+
default: () => uni.$u.props.empty.show
|
|
53
52
|
},
|
|
54
53
|
// 组件距离上一个元素之间的距离,默认px单位
|
|
55
54
|
marginTop: {
|
|
56
55
|
type: [String, Number],
|
|
57
|
-
default:
|
|
56
|
+
default: () => uni.$u.props.empty.marginTop
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import defprops from '../../libs/config/props';
|
|
2
1
|
export default {
|
|
3
2
|
props: {
|
|
4
3
|
// 当前form的需要验证字段的集合
|
|
5
4
|
model: {
|
|
6
5
|
type: Object,
|
|
7
|
-
default:
|
|
6
|
+
default: () => uni.$u.props.form.model
|
|
8
7
|
},
|
|
9
8
|
// 验证规则
|
|
10
9
|
rules: {
|
|
11
10
|
type: [Object, Function, Array],
|
|
12
|
-
default:
|
|
11
|
+
default: () => uni.$u.props.form.rules
|
|
13
12
|
},
|
|
14
13
|
// 有错误时的提示方式,message-提示信息,toast-进行toast提示
|
|
15
14
|
// border-bottom-下边框呈现红色,none-无提示
|
|
16
15
|
errorType: {
|
|
17
16
|
type: String,
|
|
18
|
-
default:
|
|
17
|
+
default: () => uni.$u.props.form.errorType
|
|
19
18
|
},
|
|
20
19
|
// 是否显示表单域的下划线边框
|
|
21
20
|
borderBottom: {
|
|
22
21
|
type: Boolean,
|
|
23
|
-
default:
|
|
22
|
+
default: () => uni.$u.props.form.borderBottom
|
|
24
23
|
},
|
|
25
24
|
// label的位置,left-左边,top-上边
|
|
26
25
|
labelPosition: {
|
|
27
26
|
type: String,
|
|
28
|
-
default:
|
|
27
|
+
default: () => uni.$u.props.form.labelPosition
|
|
29
28
|
},
|
|
30
29
|
// label的宽度,单位px
|
|
31
30
|
labelWidth: {
|
|
32
31
|
type: [String, Number],
|
|
33
|
-
default:
|
|
32
|
+
default: () => uni.$u.props.form.labelWidth
|
|
34
33
|
},
|
|
35
34
|
// lable字体的对齐方式
|
|
36
35
|
labelAlign: {
|
|
37
36
|
type: String,
|
|
38
|
-
default:
|
|
37
|
+
default: () => uni.$u.props.form.labelAlign
|
|
39
38
|
},
|
|
40
39
|
// lable的样式,对象形式
|
|
41
40
|
labelStyle: {
|
|
42
41
|
type: Object,
|
|
43
|
-
default:
|
|
42
|
+
default: () => uni.$u.props.form.labelStyle
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
const propertyName =
|
|
147
147
|
propertyChain[propertyChain.length - 1];
|
|
148
148
|
|
|
149
|
-
const rule = this.formRules[child.prop];
|
|
149
|
+
const rule = this.formRules[child.rule || child.prop];
|
|
150
150
|
// 如果不存在对应的规则,直接返回,否则校验器会报错
|
|
151
151
|
if (!rule) return;
|
|
152
152
|
// rule规则可为数组形式,也可为对象形式,此处拼接成为数组
|