hy-app 0.6.4 → 0.6.6
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/attributes.json +1 -1
- package/components/hy-address-picker/hy-address-picker.vue +249 -249
- package/components/hy-address-picker/props.ts +103 -103
- package/components/hy-button/hy-button.vue +320 -289
- package/components/hy-button/props.ts +143 -143
- package/components/hy-button/typing.d.ts +43 -35
- package/components/hy-calendar/header.vue +58 -58
- package/components/hy-calendar/hy-calendar.vue +8 -6
- package/components/hy-calendar/month.vue +402 -402
- package/components/hy-calendar/props.ts +169 -169
- package/components/hy-calendar/typing.d.ts +47 -45
- package/components/hy-cell-item/hy-cell-item.vue +161 -161
- package/components/hy-cell-item/props.ts +59 -59
- package/components/hy-check-button/hy-check-button.vue +135 -135
- package/components/hy-code-input/hy-code-input.vue +231 -231
- package/components/hy-code-input/props.ts +90 -90
- package/components/hy-config-provider/hy-config-provider.vue +53 -53
- package/components/hy-config-provider/props.ts +30 -30
- package/components/hy-coupon/hy-coupon.vue +183 -183
- package/components/hy-coupon/props.ts +108 -108
- package/components/hy-datetime-picker/hy-datetime-picker.vue +41 -55
- package/components/hy-datetime-picker/props.ts +144 -144
- package/components/hy-datetime-picker/typing.d.ts +2 -0
- package/components/hy-divider/props.ts +83 -83
- package/components/hy-empty/icon.ts +72 -72
- package/components/hy-folding-panel/hy-folding-panel-group.vue +162 -162
- package/components/hy-form/hy-form.vue +220 -220
- package/components/hy-icon/hy-icon.vue +112 -112
- package/components/hy-index-bar/hy-index-bar.vue +185 -185
- package/components/hy-index-bar/index.scss +64 -64
- package/components/hy-index-bar/props.ts +94 -94
- package/components/hy-index-bar/typing.d.ts +36 -36
- package/components/hy-input/hy-input.vue +333 -333
- package/components/hy-input/props.ts +186 -186
- package/components/hy-modal/hy-modal.vue +211 -211
- package/components/hy-modal/props.ts +94 -94
- package/components/hy-modal/typing.d.ts +16 -16
- package/components/hy-notice-bar/hy-row-notice.vue +121 -121
- package/components/hy-notify/hy-notify.vue +174 -174
- package/components/hy-number-step/hy-number-step.vue +367 -367
- package/components/hy-overlay/hy-overlay.vue +61 -61
- package/components/hy-overlay/props.ts +38 -38
- package/components/hy-pagination/hy-pagination.vue +136 -136
- package/components/hy-pagination/props.ts +58 -58
- package/components/hy-parse/hy-parse.vue +550 -550
- package/components/hy-parse/node/node.vue +781 -781
- package/components/hy-parse/parser.js +1455 -1455
- package/components/hy-parse/props.ts +19 -19
- package/components/hy-parse/typing.d.ts +68 -68
- package/components/hy-picker/hy-picker.vue +435 -435
- package/components/hy-picker/props.ts +122 -122
- package/components/hy-picker/typing.d.ts +38 -38
- package/components/hy-qrcode/props.ts +72 -72
- package/components/hy-qrcode/qrcode.js.bak +1433 -1433
- package/components/hy-radio/props.ts +97 -97
- package/components/hy-read-more/props.ts +48 -48
- package/components/hy-search/props.ts +133 -133
- package/components/hy-signature/canvasHelper.ts +51 -51
- package/components/hy-signature/props.ts +121 -121
- package/components/hy-skeleton/hy-skeleton.vue +142 -142
- package/components/hy-skeleton/props.ts +46 -46
- package/components/hy-skeleton/typing.d.ts +31 -31
- package/components/hy-steps/hy-steps.vue +275 -275
- package/components/hy-steps/typing.d.ts +25 -25
- package/components/hy-swiper/hy-swiper.vue +3 -3
- package/components/hy-swiper/index.scss +5 -5
- package/components/hy-swiper/props.ts +0 -1
- package/components/hy-table/hy-table.vue +630 -630
- package/components/hy-table/props.ts +62 -62
- package/components/hy-table/typing.d.ts +29 -29
- package/components/hy-tabs/hy-tabs.vue +336 -335
- package/components/hy-tabs/props.ts +84 -77
- package/components/hy-tag/hy-tag.vue +173 -173
- package/components/hy-tag/props.ts +89 -89
- package/components/hy-text/hy-text.vue +237 -237
- package/components/hy-text/props.ts +115 -115
- package/components/hy-textarea/hy-textarea.vue +198 -198
- package/components/hy-toast/hy-toast.vue +200 -200
- package/components/hy-toast/props.ts +3 -3
- package/components/hy-transition/hy-transition.vue +157 -157
- package/components/hy-transition/props.ts +32 -32
- package/components/hy-upload/hy-upload.vue +384 -384
- package/components/hy-watermark/hy-watermark.vue +1058 -1058
- package/components/hy-watermark/props.ts +109 -109
- package/global.d.ts +94 -94
- package/libs/api/http.ts +119 -119
- package/libs/composables/index.ts +8 -8
- package/libs/composables/useMessage.ts +149 -149
- package/libs/composables/useToast.ts +45 -45
- package/libs/composables/useTranslate.ts +10 -10
- package/libs/css/_config.scss +5 -5
- package/libs/index.ts +8 -8
- package/libs/locale/index.ts +32 -32
- package/libs/locale/lang/en-US.ts +84 -84
- package/libs/locale/lang/zh-CN.ts +87 -87
- package/libs/typing/index.ts +2 -2
- package/libs/typing/modules/common.d.ts +139 -139
- package/libs/typing/modules/form.ts +176 -176
- package/libs/typing/modules/http.d.ts +19 -19
- package/libs/typing/modules/index.d.ts +12 -12
- package/libs/utils/inside.ts +340 -340
- package/libs/utils/inspect.ts +140 -140
- package/libs/utils/utils.ts +525 -525
- package/package.json +81 -81
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
-
import type { HyButtonProps } from '../hy-button/typing'
|
|
3
|
-
|
|
4
|
-
const couponProps = {
|
|
5
|
-
/** 优惠券标题 */
|
|
6
|
-
title: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: ''
|
|
9
|
-
},
|
|
10
|
-
/**
|
|
11
|
-
* 优惠券类型:moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
|
|
12
|
-
* @values moneyOff,discount,fixedAmount
|
|
13
|
-
* */
|
|
14
|
-
type: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: ''
|
|
17
|
-
},
|
|
18
|
-
/** 金额底部优惠券类型文字描述 */
|
|
19
|
-
typeText: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
/** 优惠券状态 */
|
|
24
|
-
status: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
/** 优惠券禁用状态 */
|
|
29
|
-
disabledStatus: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: () => ['']
|
|
32
|
-
},
|
|
33
|
-
/** 优惠券描述备注 */
|
|
34
|
-
description: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: ''
|
|
37
|
-
},
|
|
38
|
-
/** 描述省略行数,none不省略,1代表一行省略 */
|
|
39
|
-
desEllipsis: {
|
|
40
|
-
type: [String, Number],
|
|
41
|
-
default: 'none'
|
|
42
|
-
},
|
|
43
|
-
/** 优惠券金额 */
|
|
44
|
-
amount: {
|
|
45
|
-
type: [String, Number],
|
|
46
|
-
default: ''
|
|
47
|
-
},
|
|
48
|
-
/** 优惠券单位,没有就用默认值 */
|
|
49
|
-
unit: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: ''
|
|
52
|
-
},
|
|
53
|
-
/** 优惠券开始时间 */
|
|
54
|
-
startDate: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: ''
|
|
57
|
-
},
|
|
58
|
-
/** 优惠券结束时间 */
|
|
59
|
-
endDate: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: ''
|
|
62
|
-
},
|
|
63
|
-
/** 时间格式 */
|
|
64
|
-
format: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: 'yyyy-MM-dd'
|
|
67
|
-
},
|
|
68
|
-
/** 日期描述,没有日期描述就用开始时间到结束时间 */
|
|
69
|
-
dateDesc: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: ''
|
|
72
|
-
},
|
|
73
|
-
/** 背景色 */
|
|
74
|
-
bgColor: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: ''
|
|
77
|
-
},
|
|
78
|
-
/** 是否显示阴影 */
|
|
79
|
-
boxShadow: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: false
|
|
82
|
-
},
|
|
83
|
-
/**
|
|
84
|
-
* 按钮类型
|
|
85
|
-
* @values test,button,none
|
|
86
|
-
* */
|
|
87
|
-
btnMode: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: 'button'
|
|
90
|
-
},
|
|
91
|
-
/** 按钮文字 */
|
|
92
|
-
btnText: {
|
|
93
|
-
type: String,
|
|
94
|
-
default: '立即领取'
|
|
95
|
-
},
|
|
96
|
-
buttonProp: {
|
|
97
|
-
type: Object as PropType<HyButtonProps>,
|
|
98
|
-
default: () => ({})
|
|
99
|
-
},
|
|
100
|
-
/** 定义需要用到的外部样式 */
|
|
101
|
-
customStyle: {
|
|
102
|
-
type: Object as PropType<CSSProperties>
|
|
103
|
-
},
|
|
104
|
-
/** 自定义外部类名 */
|
|
105
|
-
customClass: String
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export default couponProps
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
+
import type { HyButtonProps } from '../hy-button/typing'
|
|
3
|
+
|
|
4
|
+
const couponProps = {
|
|
5
|
+
/** 优惠券标题 */
|
|
6
|
+
title: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ''
|
|
9
|
+
},
|
|
10
|
+
/**
|
|
11
|
+
* 优惠券类型:moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
|
|
12
|
+
* @values moneyOff,discount,fixedAmount
|
|
13
|
+
* */
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ''
|
|
17
|
+
},
|
|
18
|
+
/** 金额底部优惠券类型文字描述 */
|
|
19
|
+
typeText: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
/** 优惠券状态 */
|
|
24
|
+
status: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
/** 优惠券禁用状态 */
|
|
29
|
+
disabledStatus: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => ['']
|
|
32
|
+
},
|
|
33
|
+
/** 优惠券描述备注 */
|
|
34
|
+
description: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
/** 描述省略行数,none不省略,1代表一行省略 */
|
|
39
|
+
desEllipsis: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
default: 'none'
|
|
42
|
+
},
|
|
43
|
+
/** 优惠券金额 */
|
|
44
|
+
amount: {
|
|
45
|
+
type: [String, Number],
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
/** 优惠券单位,没有就用默认值 */
|
|
49
|
+
unit: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ''
|
|
52
|
+
},
|
|
53
|
+
/** 优惠券开始时间 */
|
|
54
|
+
startDate: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
/** 优惠券结束时间 */
|
|
59
|
+
endDate: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
/** 时间格式 */
|
|
64
|
+
format: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: 'yyyy-MM-dd'
|
|
67
|
+
},
|
|
68
|
+
/** 日期描述,没有日期描述就用开始时间到结束时间 */
|
|
69
|
+
dateDesc: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ''
|
|
72
|
+
},
|
|
73
|
+
/** 背景色 */
|
|
74
|
+
bgColor: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ''
|
|
77
|
+
},
|
|
78
|
+
/** 是否显示阴影 */
|
|
79
|
+
boxShadow: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* 按钮类型
|
|
85
|
+
* @values test,button,none
|
|
86
|
+
* */
|
|
87
|
+
btnMode: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'button'
|
|
90
|
+
},
|
|
91
|
+
/** 按钮文字 */
|
|
92
|
+
btnText: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: '立即领取'
|
|
95
|
+
},
|
|
96
|
+
buttonProp: {
|
|
97
|
+
type: Object as PropType<HyButtonProps>,
|
|
98
|
+
default: () => ({})
|
|
99
|
+
},
|
|
100
|
+
/** 定义需要用到的外部样式 */
|
|
101
|
+
customStyle: {
|
|
102
|
+
type: Object as PropType<CSSProperties>
|
|
103
|
+
},
|
|
104
|
+
/** 自定义外部类名 */
|
|
105
|
+
customClass: String
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default couponProps
|
|
@@ -219,9 +219,7 @@ const times = (n: number, iteratee: Function) => {
|
|
|
219
219
|
* */
|
|
220
220
|
const close = () => {
|
|
221
221
|
if (props.closeOnClickOverlay) {
|
|
222
|
-
|
|
223
|
-
showByClickInput.value = false
|
|
224
|
-
}
|
|
222
|
+
props.hasInput ? (showByClickInput.value = false) : emit('update:show', false)
|
|
225
223
|
emit('close')
|
|
226
224
|
}
|
|
227
225
|
}
|
|
@@ -230,37 +228,54 @@ const close = () => {
|
|
|
230
228
|
* 点击工具栏的取消按钮
|
|
231
229
|
* */
|
|
232
230
|
const cancel = () => {
|
|
233
|
-
|
|
234
|
-
showByClickInput.value = false
|
|
235
|
-
}
|
|
231
|
+
props.hasInput ? (showByClickInput.value = false) : emit('update:show', false)
|
|
236
232
|
emit('cancel')
|
|
237
233
|
}
|
|
238
234
|
|
|
235
|
+
/**
|
|
236
|
+
* 根据索引和列数据获取选中值
|
|
237
|
+
* */
|
|
238
|
+
const getSelectValue = (indexs: number[], values: any[][]): string | number => {
|
|
239
|
+
let selectValue: string | number = ''
|
|
240
|
+
if (validModes.has(props.mode) && props.mode !== DateModeEnum.MONTH_DAY) {
|
|
241
|
+
selectValue = `${intercept(values[0][indexs[0]])}:${intercept(values[1][indexs[1]])}`
|
|
242
|
+
} else if (props.mode === DateModeEnum.MONTH_DAY) {
|
|
243
|
+
selectValue = `${intercept(values[0][indexs[0]])}-${intercept(values[1][indexs[1]])}`
|
|
244
|
+
} else {
|
|
245
|
+
const year = parseInt(intercept(values[0][indexs[0]], 'year'))
|
|
246
|
+
const month = parseInt(intercept(values[1][indexs[1]]))
|
|
247
|
+
let date = parseInt(values[2] ? intercept(values[2][indexs[2]]) : 1)
|
|
248
|
+
let hour = 0,
|
|
249
|
+
minute = 0,
|
|
250
|
+
second = 0
|
|
251
|
+
const maxDate = dayjs(`${year}-${month}`).daysInMonth()
|
|
252
|
+
date = Math.min(maxDate, date)
|
|
253
|
+
if (props.mode === DateModeEnum.DATETIME) {
|
|
254
|
+
hour = parseInt(intercept(values[3][indexs[3]]))
|
|
255
|
+
minute = parseInt(intercept(values[4][indexs[4]]))
|
|
256
|
+
second = parseInt(intercept(values[5][indexs[5]]))
|
|
257
|
+
}
|
|
258
|
+
selectValue = Number(new Date(year, month - 1, date, hour, minute, second))
|
|
259
|
+
}
|
|
260
|
+
return correctValue(selectValue)
|
|
261
|
+
}
|
|
262
|
+
|
|
239
263
|
/**
|
|
240
264
|
* 点击工具栏的确定按钮
|
|
241
265
|
* */
|
|
242
266
|
const confirm = () => {
|
|
243
|
-
//如果用户还没有触发过change
|
|
244
267
|
if (!innerValue.value) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
)
|
|
251
|
-
|
|
252
|
-
} else {
|
|
253
|
-
//否则默认都选中第一个
|
|
254
|
-
arr = Array(columns.value.length).fill(0)
|
|
255
|
-
}
|
|
256
|
-
console.log(arr)
|
|
257
|
-
getInputValue(arr)
|
|
258
|
-
}
|
|
259
|
-
emit('update:modelValue', innerValue.value)
|
|
260
|
-
if (props.hasInput) {
|
|
261
|
-
getInputValue(innerValue.value)
|
|
262
|
-
showByClickInput.value = false
|
|
268
|
+
const indexs =
|
|
269
|
+
innerDefaultIndex.value.length > 0
|
|
270
|
+
? innerDefaultIndex.value
|
|
271
|
+
: Array(columns.value.length).fill(0)
|
|
272
|
+
const values = columns.value.map((column: any[]) => column)
|
|
273
|
+
const selectValue = getSelectValue(indexs, values)
|
|
274
|
+
innerValue.value = selectValue
|
|
263
275
|
}
|
|
276
|
+
getInputValue(innerValue.value)
|
|
277
|
+
emit('update:modelValue', inputValue.value)
|
|
278
|
+
props.hasInput ? (showByClickInput.value = false) : emit('update:show', false)
|
|
264
279
|
emit('confirm', {
|
|
265
280
|
value: innerValue.value,
|
|
266
281
|
mode: props.mode
|
|
@@ -292,38 +307,9 @@ const intercept = (e: any, type?: string) => {
|
|
|
292
307
|
* */
|
|
293
308
|
const change = (e: any) => {
|
|
294
309
|
const { indexs, values } = e
|
|
295
|
-
|
|
296
|
-
if (validModes.has(props.mode) && props.mode !== DateModeEnum.MONTH_DAY) {
|
|
297
|
-
// 根据value各列索引,从各列数组中,取出当前时间的选中值
|
|
298
|
-
selectValue = `${intercept(values[0][indexs[0]])}:${intercept(values[1][indexs[1]])}`
|
|
299
|
-
} else if (props.mode === DateModeEnum.MONTH_DAY) {
|
|
300
|
-
// 根据value各列索引,从各列数组中,取出当前时间的选中值
|
|
301
|
-
selectValue = `${intercept(values[0][indexs[0]])}-${intercept(values[1][indexs[1]])}`
|
|
302
|
-
} else {
|
|
303
|
-
// 将选择的值转为数值,比如'03'转为数值的3,'2019'转为数值的2019
|
|
304
|
-
const year = parseInt(intercept(values[0][indexs[0]], 'year'))
|
|
305
|
-
const month = parseInt(intercept(values[1][indexs[1]]))
|
|
306
|
-
let date = parseInt(values[2] ? intercept(values[2][indexs[2]]) : 1)
|
|
307
|
-
let hour = 0,
|
|
308
|
-
minute = 0,
|
|
309
|
-
second = 0
|
|
310
|
-
// 此月份的最大天数
|
|
311
|
-
const maxDate = dayjs(`${year}-${month}`).daysInMonth()
|
|
312
|
-
// 不允许超过maxDate值
|
|
313
|
-
date = Math.min(maxDate, date)
|
|
314
|
-
if (props.mode === DateModeEnum.DATETIME) {
|
|
315
|
-
hour = parseInt(intercept(values[3][indexs[3]]))
|
|
316
|
-
minute = parseInt(intercept(values[4][indexs[4]]))
|
|
317
|
-
second = parseInt(intercept(values[5][indexs[5]]))
|
|
318
|
-
}
|
|
319
|
-
// 转为时间模式
|
|
320
|
-
selectValue = Number(new Date(year, month - 1, date, hour, minute, second))
|
|
321
|
-
}
|
|
322
|
-
// 取出准确的合法值,防止超越边界的情况
|
|
323
|
-
selectValue = correctValue(selectValue)
|
|
310
|
+
const selectValue = getSelectValue(indexs, values)
|
|
324
311
|
innerValue.value = selectValue
|
|
325
312
|
updateColumnValue(selectValue)
|
|
326
|
-
// 发出change时间,value为当前选中的时间戳
|
|
327
313
|
emit('change', {
|
|
328
314
|
value: selectValue,
|
|
329
315
|
mode: props.mode
|
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
import { DateModeEnum, useTranslate } from '../../libs'
|
|
2
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
3
|
-
import type { HyInputProps } from '../hy-input/typing'
|
|
4
|
-
|
|
5
|
-
const { t } = useTranslate('datetimePicker')
|
|
6
|
-
|
|
7
|
-
const datetimePickerProps = {
|
|
8
|
-
/** 用于控制选择器的弹出和收起 */
|
|
9
|
-
show: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: false
|
|
12
|
-
},
|
|
13
|
-
/**
|
|
14
|
-
* 弹出层弹出方向
|
|
15
|
-
* @values bottom,top
|
|
16
|
-
* */
|
|
17
|
-
popupMode: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: 'bottom'
|
|
20
|
-
},
|
|
21
|
-
/** 是否显示顶部的操作栏 */
|
|
22
|
-
showToolbar: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: true
|
|
25
|
-
},
|
|
26
|
-
/** 绑定值 */
|
|
27
|
-
modelValue: {
|
|
28
|
-
type: [String, Number, Date],
|
|
29
|
-
default: ''
|
|
30
|
-
},
|
|
31
|
-
/** 顶部标题 */
|
|
32
|
-
title: String,
|
|
33
|
-
/**
|
|
34
|
-
* 展示格式 mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
|
|
35
|
-
* @values date,time,year-month,datetime
|
|
36
|
-
* */
|
|
37
|
-
mode: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: DateModeEnum.DATETIME
|
|
40
|
-
},
|
|
41
|
-
/** 可选的最大时间 默认值为后10年 */
|
|
42
|
-
maxDate: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: new Date(new Date().getFullYear() + 10, 0, 1).getTime()
|
|
45
|
-
},
|
|
46
|
-
/** 可选的最小时间 默认值为前10年 */
|
|
47
|
-
minDate: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: new Date(new Date().getFullYear() - 10, 0, 1).getTime()
|
|
50
|
-
},
|
|
51
|
-
/** 可选的最小小时,仅mode=time有效 */
|
|
52
|
-
minHour: {
|
|
53
|
-
type: Number,
|
|
54
|
-
default: 0
|
|
55
|
-
},
|
|
56
|
-
/** 可选的最大小时,仅mode=time有效 */
|
|
57
|
-
maxHour: {
|
|
58
|
-
type: Number,
|
|
59
|
-
default: 23
|
|
60
|
-
},
|
|
61
|
-
/** 可选的最小分钟,仅mode=time有效 */
|
|
62
|
-
minMinute: {
|
|
63
|
-
type: Number,
|
|
64
|
-
default: 0
|
|
65
|
-
},
|
|
66
|
-
/** 可选的最大分钟,仅mode=time有效 */
|
|
67
|
-
maxMinute: {
|
|
68
|
-
type: Number,
|
|
69
|
-
default: 59
|
|
70
|
-
},
|
|
71
|
-
/** 选项过滤函数 */
|
|
72
|
-
filter: Function,
|
|
73
|
-
/** 选项格式化函数 */
|
|
74
|
-
formatter: Function,
|
|
75
|
-
/** 是否显示加载中状态 */
|
|
76
|
-
loading: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: false
|
|
79
|
-
},
|
|
80
|
-
/** 各列中,单个选项的高度 */
|
|
81
|
-
itemHeight: {
|
|
82
|
-
type: Number,
|
|
83
|
-
default: 44
|
|
84
|
-
},
|
|
85
|
-
/** 取消按钮的文字 */
|
|
86
|
-
cancelText: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: () => t('cancel')
|
|
89
|
-
},
|
|
90
|
-
/** 确认按钮的文字 */
|
|
91
|
-
confirmText: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: () => t('confirm')
|
|
94
|
-
},
|
|
95
|
-
/** 取消按钮的颜色 */
|
|
96
|
-
cancelColor: {
|
|
97
|
-
type: String,
|
|
98
|
-
default: '#909193'
|
|
99
|
-
},
|
|
100
|
-
/** 确认按钮的颜色 */
|
|
101
|
-
confirmColor: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: '#3c9cff'
|
|
104
|
-
},
|
|
105
|
-
/** 每列中可见选项的数量 */
|
|
106
|
-
visibleItemCount: {
|
|
107
|
-
type: Number,
|
|
108
|
-
default: 5
|
|
109
|
-
},
|
|
110
|
-
/** 是否允许点击遮罩关闭选择器 */
|
|
111
|
-
closeOnClickOverlay: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: false
|
|
114
|
-
},
|
|
115
|
-
/** 各列的默认索引 */
|
|
116
|
-
defaultIndex: {
|
|
117
|
-
type: Array,
|
|
118
|
-
default: () => []
|
|
119
|
-
},
|
|
120
|
-
/** 输入框是否显示边框 */
|
|
121
|
-
hasInput: {
|
|
122
|
-
type: Boolean,
|
|
123
|
-
default: false
|
|
124
|
-
},
|
|
125
|
-
/** 输入框集合属性 */
|
|
126
|
-
input: {
|
|
127
|
-
type: Object as PropType<HyInputProps>
|
|
128
|
-
},
|
|
129
|
-
/** 自定义时间格式 */
|
|
130
|
-
format: String,
|
|
131
|
-
/** 右边插槽 */
|
|
132
|
-
toolbarRightSlot: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
default: false
|
|
135
|
-
},
|
|
136
|
-
/** 定义需要用到的外部样式 */
|
|
137
|
-
customStyle: {
|
|
138
|
-
type: Object as PropType<CSSProperties>
|
|
139
|
-
},
|
|
140
|
-
/** 自定义外部类名 */
|
|
141
|
-
customClass: String
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export default datetimePickerProps
|
|
1
|
+
import { DateModeEnum, useTranslate } from '../../libs'
|
|
2
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
3
|
+
import type { HyInputProps } from '../hy-input/typing'
|
|
4
|
+
|
|
5
|
+
const { t } = useTranslate('datetimePicker')
|
|
6
|
+
|
|
7
|
+
const datetimePickerProps = {
|
|
8
|
+
/** 用于控制选择器的弹出和收起 */
|
|
9
|
+
show: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* 弹出层弹出方向
|
|
15
|
+
* @values bottom,top
|
|
16
|
+
* */
|
|
17
|
+
popupMode: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'bottom'
|
|
20
|
+
},
|
|
21
|
+
/** 是否显示顶部的操作栏 */
|
|
22
|
+
showToolbar: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
/** 绑定值 */
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: [String, Number, Date],
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
/** 顶部标题 */
|
|
32
|
+
title: String,
|
|
33
|
+
/**
|
|
34
|
+
* 展示格式 mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
|
|
35
|
+
* @values date,time,year-month,datetime
|
|
36
|
+
* */
|
|
37
|
+
mode: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: DateModeEnum.DATETIME
|
|
40
|
+
},
|
|
41
|
+
/** 可选的最大时间 默认值为后10年 */
|
|
42
|
+
maxDate: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: new Date(new Date().getFullYear() + 10, 0, 1).getTime()
|
|
45
|
+
},
|
|
46
|
+
/** 可选的最小时间 默认值为前10年 */
|
|
47
|
+
minDate: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: new Date(new Date().getFullYear() - 10, 0, 1).getTime()
|
|
50
|
+
},
|
|
51
|
+
/** 可选的最小小时,仅mode=time有效 */
|
|
52
|
+
minHour: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 0
|
|
55
|
+
},
|
|
56
|
+
/** 可选的最大小时,仅mode=time有效 */
|
|
57
|
+
maxHour: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: 23
|
|
60
|
+
},
|
|
61
|
+
/** 可选的最小分钟,仅mode=time有效 */
|
|
62
|
+
minMinute: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: 0
|
|
65
|
+
},
|
|
66
|
+
/** 可选的最大分钟,仅mode=time有效 */
|
|
67
|
+
maxMinute: {
|
|
68
|
+
type: Number,
|
|
69
|
+
default: 59
|
|
70
|
+
},
|
|
71
|
+
/** 选项过滤函数 */
|
|
72
|
+
filter: Function,
|
|
73
|
+
/** 选项格式化函数 */
|
|
74
|
+
formatter: Function,
|
|
75
|
+
/** 是否显示加载中状态 */
|
|
76
|
+
loading: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
/** 各列中,单个选项的高度 */
|
|
81
|
+
itemHeight: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 44
|
|
84
|
+
},
|
|
85
|
+
/** 取消按钮的文字 */
|
|
86
|
+
cancelText: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: () => t('cancel')
|
|
89
|
+
},
|
|
90
|
+
/** 确认按钮的文字 */
|
|
91
|
+
confirmText: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: () => t('confirm')
|
|
94
|
+
},
|
|
95
|
+
/** 取消按钮的颜色 */
|
|
96
|
+
cancelColor: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: '#909193'
|
|
99
|
+
},
|
|
100
|
+
/** 确认按钮的颜色 */
|
|
101
|
+
confirmColor: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: '#3c9cff'
|
|
104
|
+
},
|
|
105
|
+
/** 每列中可见选项的数量 */
|
|
106
|
+
visibleItemCount: {
|
|
107
|
+
type: Number,
|
|
108
|
+
default: 5
|
|
109
|
+
},
|
|
110
|
+
/** 是否允许点击遮罩关闭选择器 */
|
|
111
|
+
closeOnClickOverlay: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false
|
|
114
|
+
},
|
|
115
|
+
/** 各列的默认索引 */
|
|
116
|
+
defaultIndex: {
|
|
117
|
+
type: Array,
|
|
118
|
+
default: () => []
|
|
119
|
+
},
|
|
120
|
+
/** 输入框是否显示边框 */
|
|
121
|
+
hasInput: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false
|
|
124
|
+
},
|
|
125
|
+
/** 输入框集合属性 */
|
|
126
|
+
input: {
|
|
127
|
+
type: Object as PropType<HyInputProps>
|
|
128
|
+
},
|
|
129
|
+
/** 自定义时间格式 */
|
|
130
|
+
format: String,
|
|
131
|
+
/** 右边插槽 */
|
|
132
|
+
toolbarRightSlot: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false
|
|
135
|
+
},
|
|
136
|
+
/** 定义需要用到的外部样式 */
|
|
137
|
+
customStyle: {
|
|
138
|
+
type: Object as PropType<CSSProperties>
|
|
139
|
+
},
|
|
140
|
+
/** 自定义外部类名 */
|
|
141
|
+
customClass: String
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default datetimePickerProps
|