提交 | 用户 | age
|
ebf7c8
|
1 |
import type { PropType, CSSProperties } from 'vue'; |
1c1755
|
2 |
import type { ModalWrapperProps } from './typing'; |
661db0
|
3 |
import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; |
dc09de
|
4 |
import { useI18n } from '/@/hooks/web/useI18n'; |
1c1755
|
5 |
|
962f90
|
6 |
const { t } = useI18n(); |
dc09de
|
7 |
|
2f6253
|
8 |
export const modalProps = { |
1c1755
|
9 |
visible: { type: Boolean }, |
V |
10 |
scrollTop: { type: Boolean, default: true }, |
|
11 |
height: { type: Number }, |
|
12 |
minHeight: { type: Number }, |
2f6253
|
13 |
// open drag |
1c1755
|
14 |
draggable: { type: Boolean, default: true }, |
V |
15 |
centered: { type: Boolean }, |
|
16 |
cancelText: { type: String, default: t('common.cancelText') }, |
|
17 |
okText: { type: String, default: t('common.okText') }, |
81baf1
|
18 |
|
2f6253
|
19 |
closeFunc: Function as PropType<() => Promise<boolean>>, |
陈 |
20 |
}; |
|
21 |
|
|
22 |
export const basicProps = Object.assign({}, modalProps, { |
1c1755
|
23 |
defaultFullscreen: { type: Boolean }, |
2f6253
|
24 |
// Can it be full screen |
1c1755
|
25 |
canFullscreen: { type: Boolean, default: true }, |
2f6253
|
26 |
// After enabling the wrapper, the bottom can be increased in height |
1c1755
|
27 |
wrapperFooterOffset: { type: Number, default: 0 }, |
2f6253
|
28 |
// Warm reminder message |
陈 |
29 |
helpMessage: [String, Array] as PropType<string | string[]>, |
ba068b
|
30 |
// Whether to setting wrapper |
1c1755
|
31 |
useWrapper: { type: Boolean, default: true }, |
V |
32 |
loading: { type: Boolean }, |
|
33 |
loadingTip: { type: String }, |
2f6253
|
34 |
/** |
陈 |
35 |
* @description: Show close button |
|
36 |
*/ |
1c1755
|
37 |
showCancelBtn: { type: Boolean, default: true }, |
2f6253
|
38 |
/** |
陈 |
39 |
* @description: Show confirmation button |
|
40 |
*/ |
1c1755
|
41 |
showOkBtn: { type: Boolean, default: true }, |
2f6253
|
42 |
|
ebf7c8
|
43 |
wrapperProps: Object as PropType<Partial<ModalWrapperProps>>, |
2f6253
|
44 |
|
ebf7c8
|
45 |
afterClose: Function as PropType<() => Promise<VueNode>>, |
2f6253
|
46 |
|
ebf7c8
|
47 |
bodyStyle: Object as PropType<CSSProperties>, |
2f6253
|
48 |
|
1c1755
|
49 |
closable: { type: Boolean, default: true }, |
2f6253
|
50 |
|
ebf7c8
|
51 |
closeIcon: Object as PropType<VueNode>, |
2f6253
|
52 |
|
1c1755
|
53 |
confirmLoading: { type: Boolean }, |
2f6253
|
54 |
|
1c1755
|
55 |
destroyOnClose: { type: Boolean }, |
2f6253
|
56 |
|
ebf7c8
|
57 |
footer: Object as PropType<VueNode>, |
2f6253
|
58 |
|
陈 |
59 |
getContainer: Function as PropType<() => any>, |
|
60 |
|
1c1755
|
61 |
mask: { type: Boolean, default: true }, |
2f6253
|
62 |
|
1c1755
|
63 |
maskClosable: { type: Boolean, default: true }, |
V |
64 |
keyboard: { type: Boolean, default: true }, |
2f6253
|
65 |
|
ebf7c8
|
66 |
maskStyle: Object as PropType<CSSProperties>, |
2f6253
|
67 |
|
1c1755
|
68 |
okType: { type: String, default: 'primary' }, |
2f6253
|
69 |
|
661db0
|
70 |
okButtonProps: Object as PropType<ButtonProps>, |
2f6253
|
71 |
|
661db0
|
72 |
cancelButtonProps: Object as PropType<ButtonProps>, |
2f6253
|
73 |
|
1c1755
|
74 |
title: { type: String }, |
2f6253
|
75 |
|
1c1755
|
76 |
visible: { type: Boolean }, |
2f6253
|
77 |
|
陈 |
78 |
width: [String, Number] as PropType<string | number>, |
|
79 |
|
1c1755
|
80 |
wrapClassName: { type: String }, |
2f6253
|
81 |
|
1c1755
|
82 |
zIndex: { type: Number }, |
2f6253
|
83 |
}); |