Commit 2407b3368c3fc5128bbfced98a1d2c70fa3e02e0
1 parent
9abf1763
fix: some error
Showing
28 changed files
with
359 additions
and
101 deletions
CHANGELOG.zh_CN.md
... | ... | @@ -22,12 +22,14 @@ |
22 | 22 | - 添加部分注释 |
23 | 23 | - pwa 图标补充 |
24 | 24 | - types 类型调整 |
25 | +- 升级`ant-design-vue`到`beta.11`,并修改带来的已知问题 | |
25 | 26 | |
26 | 27 | ### 🐛 Bug Fixes |
27 | 28 | |
28 | 29 | - 修复本地代理 post 接口到 https 地址超时错误 |
29 | 30 | - 修复 modal 在不显示 footer 的时候全屏高度计算问题 |
30 | 31 | - 修复表单重置未删除校验信息错误 |
32 | +- 修复顶部菜单分割模式样式问题 | |
31 | 33 | |
32 | 34 | ## 2.0.0-rc.6 (2020-10-28) |
33 | 35 | ... | ... |
package.json
src/components/Drawer/src/BasicDrawer.tsx
1 | 1 | import { Drawer, Row, Col, Button } from 'ant-design-vue'; |
2 | -import { | |
3 | - defineComponent, | |
4 | - ref, | |
5 | - computed, | |
6 | - watchEffect, | |
7 | - watch, | |
8 | - unref, | |
9 | - // getCurrentInstance, | |
10 | - nextTick, | |
11 | - toRaw, | |
12 | -} from 'vue'; | |
2 | +import { defineComponent, ref, computed, watchEffect, watch, unref, nextTick, toRaw } from 'vue'; | |
13 | 3 | import { BasicTitle } from '/@/components/Basic'; |
14 | -// import { ScrollContainer, ScrollContainerOptions } from '/@/components/Container/index'; | |
15 | 4 | import { FullLoading } from '/@/components/Loading/index'; |
16 | 5 | |
17 | 6 | import { getSlot } from '/@/utils/helper/tsxHelper'; |
... | ... | @@ -21,8 +10,6 @@ import { DrawerInstance, DrawerProps } from './types'; |
21 | 10 | import { basicProps } from './props'; |
22 | 11 | import { isFunction, isNumber } from '/@/utils/is'; |
23 | 12 | import { LeftOutlined } from '@ant-design/icons-vue'; |
24 | -// import { appStore } from '/@/store/modules/app'; | |
25 | -// import { useRouter } from 'vue-router'; | |
26 | 13 | import { buildUUID } from '/@/utils/uuid'; |
27 | 14 | import { deepMerge } from '/@/utils'; |
28 | 15 | import './index.less'; |
... | ... | @@ -38,7 +25,6 @@ export default defineComponent({ |
38 | 25 | const visibleRef = ref(false); |
39 | 26 | const propsRef = ref<Partial<DrawerProps> | null>(null); |
40 | 27 | |
41 | - // 自定义title组件:获得title | |
42 | 28 | const getMergeProps = computed((): any => { |
43 | 29 | return deepMerge(toRaw(props), unref(propsRef)); |
44 | 30 | }); |
... | ... | @@ -68,9 +54,11 @@ export default defineComponent({ |
68 | 54 | } |
69 | 55 | return opt; |
70 | 56 | }); |
57 | + | |
71 | 58 | watchEffect(() => { |
72 | 59 | visibleRef.value = props.visible; |
73 | 60 | }); |
61 | + | |
74 | 62 | watch( |
75 | 63 | () => visibleRef.value, |
76 | 64 | (visible) => { |
... | ... | @@ -83,6 +71,15 @@ export default defineComponent({ |
83 | 71 | } |
84 | 72 | ); |
85 | 73 | |
74 | + // 底部按钮自定义实现, | |
75 | + const getFooterHeight = computed(() => { | |
76 | + const { footerHeight, showFooter }: DrawerProps = unref(getProps); | |
77 | + if (showFooter && footerHeight) { | |
78 | + return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`; | |
79 | + } | |
80 | + return `0px`; | |
81 | + }); | |
82 | + | |
86 | 83 | // 取消事件 |
87 | 84 | async function onClose(e: any) { |
88 | 85 | const { closeFunc } = unref(getProps); |
... | ... | @@ -103,14 +100,6 @@ export default defineComponent({ |
103 | 100 | } |
104 | 101 | } |
105 | 102 | |
106 | - // 底部按钮自定义实现, | |
107 | - const getFooterHeight = computed(() => { | |
108 | - const { footerHeight, showFooter }: DrawerProps = unref(getProps); | |
109 | - if (showFooter && footerHeight) { | |
110 | - return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`; | |
111 | - } | |
112 | - return `0px`; | |
113 | - }); | |
114 | 103 | function renderFooter() { |
115 | 104 | const { |
116 | 105 | showCancelBtn, |
... | ... | @@ -171,11 +160,13 @@ export default defineComponent({ |
171 | 160 | )} |
172 | 161 | </Col> |
173 | 162 | )} |
163 | + | |
174 | 164 | {title && ( |
175 | 165 | <Col style="flex:1" class={[`${prefixCls}__detail-title`, 'ellipsis', 'px-2']}> |
176 | 166 | {() => title} |
177 | 167 | </Col> |
178 | 168 | )} |
169 | + | |
179 | 170 | {getSlot(slots, 'titleToolbar')} |
180 | 171 | </> |
181 | 172 | )} |
... | ... | @@ -208,22 +199,22 @@ export default defineComponent({ |
208 | 199 | title: () => renderHeader(), |
209 | 200 | default: () => ( |
210 | 201 | <> |
211 | - <FullLoading | |
212 | - absolute | |
213 | - class={[!unref(getProps).loading ? 'hidden' : '']} | |
214 | - tip="加载中..." | |
215 | - /> | |
216 | 202 | <div |
217 | 203 | ref={scrollRef} |
218 | 204 | {...attrs} |
219 | - data-id="123" | |
220 | 205 | style={{ |
206 | + position: 'relative', | |
221 | 207 | height: `calc(100% - ${footerHeight})`, |
222 | 208 | overflow: 'auto', |
223 | 209 | padding: '16px', |
224 | 210 | paddingBottom: '30px', |
225 | 211 | }} |
226 | 212 | > |
213 | + <FullLoading | |
214 | + absolute | |
215 | + tip="加载中..." | |
216 | + class={[!unref(getProps).loading ? 'hidden' : '']} | |
217 | + /> | |
227 | 218 | {getSlot(slots, 'default')} |
228 | 219 | </div> |
229 | 220 | {renderFooter()} | ... | ... |
src/components/Drawer/src/types.ts
1 | -import type { Button } from 'ant-design-vue/types/button/button'; | |
1 | +import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes'; | |
2 | 2 | import type { CSSProperties, VNodeChild } from 'vue'; |
3 | 3 | import type { ScrollContainerOptions } from '/@/components/Container/index'; |
4 | 4 | |
... | ... | @@ -47,13 +47,13 @@ export interface DrawerFooterProps { |
47 | 47 | * The ok button props, follow jsx rules |
48 | 48 | * @type object |
49 | 49 | */ |
50 | - okButtonProps: { props: Button; on: {} }; | |
50 | + okButtonProps: { props: ButtonProps; on: {} }; | |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * The cancel button props, follow jsx rules |
54 | 54 | * @type object |
55 | 55 | */ |
56 | - cancelButtonProps: { props: Button; on: {} }; | |
56 | + cancelButtonProps: { props: ButtonProps; on: {} }; | |
57 | 57 | /** |
58 | 58 | * Whether to apply loading visual effect for OK button or not |
59 | 59 | * @default false | ... | ... |
src/components/Form/src/hooks/useForm.ts
... | ... | @@ -4,8 +4,9 @@ import { isInSetup } from '/@/utils/helper/vueHelper'; |
4 | 4 | import { isProdMode } from '/@/utils/env'; |
5 | 5 | |
6 | 6 | import type { FormProps, FormActionType, UseFormReturnType, FormSchema } from '../types/form'; |
7 | -import type { NamePath } from 'ant-design-vue/types/form/form-item'; | |
8 | -import type { ValidateFields } from 'ant-design-vue/types/form/form'; | |
7 | +import type { NamePath } from 'ant-design-vue/lib/form/interface'; | |
8 | + | |
9 | +export declare type ValidateFields = (nameList?: NamePath[]) => Promise<any>; | |
9 | 10 | |
10 | 11 | export function useForm(props?: Partial<FormProps>): UseFormReturnType { |
11 | 12 | isInSetup(); | ... | ... |
src/components/Form/src/hooks/useFormAction.ts
1 | 1 | import type { ComputedRef, Ref } from 'vue'; |
2 | -import type { FormProps, FormSchema } from '../types/form'; | |
3 | -import type { Form as FormType } from 'ant-design-vue/types/form/form'; | |
4 | -import type { NamePath } from 'ant-design-vue/types/form/form-item'; | |
2 | +import type { FormProps, FormSchema, FormActionType } from '../types/form'; | |
3 | +import type { NamePath } from 'ant-design-vue/lib/form/interface'; | |
5 | 4 | |
6 | 5 | import { unref, toRaw } from 'vue'; |
7 | 6 | |
... | ... | @@ -17,7 +16,7 @@ interface UseFormActionContext { |
17 | 16 | getSchema: ComputedRef<FormSchema[]>; |
18 | 17 | formModel: any; |
19 | 18 | defaultValueRef: Ref<any>; |
20 | - formElRef: Ref<FormType>; | |
19 | + formElRef: Ref<FormActionType>; | |
21 | 20 | schemaRef: Ref<FormSchema[]>; |
22 | 21 | handleFormValues: Fn; |
23 | 22 | actionState: { | ... | ... |
src/components/Form/src/types/form.ts
1 | -import type { Form, NamePath, ValidationRule } from 'ant-design-vue/types/form/form'; | |
1 | +import type { NamePath, RuleObject } from 'ant-design-vue/lib/form/interface'; | |
2 | 2 | import type { VNode } from 'vue'; |
3 | 3 | import type { BasicButtonProps } from '/@/components/Button/types'; |
4 | 4 | import type { FormItem } from './formItem'; |
... | ... | @@ -17,7 +17,7 @@ export interface ButtonProps extends BasicButtonProps { |
17 | 17 | text?: string; |
18 | 18 | } |
19 | 19 | |
20 | -export interface FormActionType extends Form { | |
20 | +export interface FormActionType { | |
21 | 21 | submit: () => Promise<void>; |
22 | 22 | setFieldsValue: <T>(values: T) => void; |
23 | 23 | resetFields: () => Promise<any>; |
... | ... | @@ -29,6 +29,7 @@ export interface FormActionType extends Form { |
29 | 29 | appendSchemaByField: (schema: FormSchema, prefixField?: string) => void; |
30 | 30 | validateFields: (nameList?: NamePath[]) => Promise<any>; |
31 | 31 | validate: (nameList?: NamePath[]) => Promise<any>; |
32 | + scrollToField: (name: NamePath, options?: ScrollOptions) => void; | |
32 | 33 | } |
33 | 34 | export type RegisterFn = (formInstance: FormActionType) => void; |
34 | 35 | |
... | ... | @@ -113,7 +114,7 @@ export interface FormSchema { |
113 | 114 | componentProps?: any; |
114 | 115 | |
115 | 116 | // 校验规则 |
116 | - rules?: ValidationRule[]; | |
117 | + rules?: RuleObject[]; | |
117 | 118 | // 校验信息是否加入label |
118 | 119 | rulesMessageJoinLabel?: boolean; |
119 | 120 | |
... | ... | @@ -150,7 +151,7 @@ export interface FormSchema { |
150 | 151 | |
151 | 152 | dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); |
152 | 153 | |
153 | - dynamicRules?: (renderCallbackParams: RenderCallbackParams) => ValidationRule[]; | |
154 | + dynamicRules?: (renderCallbackParams: RenderCallbackParams) => RuleObject[]; | |
154 | 155 | } |
155 | 156 | export interface HelpComponentProps { |
156 | 157 | maxWidth: string; | ... | ... |
src/components/Form/src/types/formItem.ts
1 | -import type { NamePath } from 'ant-design-vue/types/form/form-item'; | |
2 | -import type { Col } from 'ant-design-vue/types/grid/col'; | |
1 | +import type { NamePath } from 'ant-design-vue/lib/form/interface'; | |
2 | +import type { ColProps } from 'ant-design-vue/lib/grid/Col'; | |
3 | 3 | import type { VNodeChild } from 'vue'; |
4 | 4 | |
5 | 5 | export interface FormItem { |
... | ... | @@ -39,7 +39,7 @@ export interface FormItem { |
39 | 39 | * The layout of label. You can set span offset to something like {span: 3, offset: 12} or sm: {span: 3, offset: 12} same as with <Col> |
40 | 40 | * @type Col |
41 | 41 | */ |
42 | - labelCol?: Col; | |
42 | + labelCol?: ColProps; | |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Whether provided or not, it will be generated by the validation rule. |
... | ... | @@ -58,7 +58,7 @@ export interface FormItem { |
58 | 58 | * The layout for input controls, same as labelCol |
59 | 59 | * @type Col |
60 | 60 | */ |
61 | - wrapperCol?: Col; | |
61 | + wrapperCol?: ColProps; | |
62 | 62 | /** |
63 | 63 | * Set sub label htmlFor. |
64 | 64 | */ | ... | ... |
src/components/Form/src/types/index.ts
src/components/Menu/src/SearchInput.vue
... | ... | @@ -69,8 +69,7 @@ |
69 | 69 | margin: 12px 9px; |
70 | 70 | |
71 | 71 | &__search--dark { |
72 | - // .setPlaceholder('.ant-input',#fff); | |
73 | - | |
72 | + .ant-input-affix-wrapper, | |
74 | 73 | .ant-input { |
75 | 74 | .set-bg(); |
76 | 75 | |
... | ... | @@ -91,6 +90,7 @@ |
91 | 90 | } |
92 | 91 | |
93 | 92 | &__search--light { |
93 | + .ant-input-affix-wrapper, | |
94 | 94 | .ant-input { |
95 | 95 | color: @text-color-base; |
96 | 96 | background: #fff; | ... | ... |
src/components/Menu/src/index.less
src/components/Modal/src/provideModal.ts
src/components/Table/src/components/renderFooter.tsx
1 | 1 | import { Table } from 'ant-design-vue'; |
2 | -import { TableRowSelection } from 'ant-design-vue/types/table/table'; | |
3 | 2 | import { cloneDeep } from 'lodash-es'; |
4 | 3 | import { unref, ComputedRef } from 'vue'; |
5 | -import { BasicColumn } from '../types/table'; | |
6 | 4 | import { isFunction } from '/@/utils/is'; |
5 | +import type { BasicColumn, TableRowSelection } from '../types/table'; | |
6 | + | |
7 | 7 | export default ({ |
8 | 8 | scroll = {}, |
9 | 9 | columnsRef, |
... | ... | @@ -17,7 +17,7 @@ export default ({ |
17 | 17 | summaryFunc: any; |
18 | 18 | rowKey?: string; |
19 | 19 | dataSourceRef: ComputedRef<any[]>; |
20 | - rowSelectionRef: ComputedRef<TableRowSelection<any> | null>; | |
20 | + rowSelectionRef: ComputedRef<TableRowSelection | null>; | |
21 | 21 | }) => { |
22 | 22 | if (!summaryFunc) { |
23 | 23 | return; | ... | ... |
src/components/Table/src/const.ts
src/components/Table/src/hooks/useRowSelection.ts
1 | 1 | import { computed, ref, unref, ComputedRef } from 'vue'; |
2 | -import { BasicTableProps } from '../types/table'; | |
3 | -import { TableRowSelection } from 'ant-design-vue/types/table/table'; | |
2 | +import type { BasicTableProps, TableRowSelection } from '../types/table'; | |
4 | 3 | import { useProps } from './useProps'; |
5 | 4 | |
6 | 5 | /* eslint-disable */ |
... | ... | @@ -10,7 +9,7 @@ export function useRowSelection(refProps: ComputedRef<BasicTableProps>, emit: Em |
10 | 9 | const selectedRowKeysRef = ref<string[]>([]); |
11 | 10 | const selectedRowRef = ref<any[]>([]); |
12 | 11 | |
13 | - const getRowSelectionRef = computed((): TableRowSelection<any> | null => { | |
12 | + const getRowSelectionRef = computed((): TableRowSelection | null => { | |
14 | 13 | const rowSelection = unref(propsRef).rowSelection; |
15 | 14 | if (!rowSelection) { |
16 | 15 | return null; | ... | ... |
src/components/Table/src/props.ts
1 | 1 | import type { PropType } from 'vue'; |
2 | 2 | import type { PaginationProps } from './types/pagination'; |
3 | -import type { BasicColumn, FetchSetting, TableSetting } from './types/table'; | |
4 | 3 | import type { |
4 | + BasicColumn, | |
5 | + FetchSetting, | |
6 | + TableSetting, | |
5 | 7 | SorterResult, |
6 | 8 | TableCustomRecord, |
7 | 9 | TableRowSelection, |
8 | -} from 'ant-design-vue/types/table/table'; | |
10 | +} from './types/table'; | |
9 | 11 | import type { FormProps } from '/@/components/Form/index'; |
10 | 12 | import { DEFAULT_SORT_FN, FETCH_SETTING } from './const'; |
11 | 13 | |
... | ... | @@ -127,7 +129,7 @@ export const basicProps = { |
127 | 129 | default: 0, |
128 | 130 | }, |
129 | 131 | rowSelection: { |
130 | - type: Object as PropType<TableRowSelection<any> | null>, | |
132 | + type: Object as PropType<TableRowSelection | null>, | |
131 | 133 | default: null, |
132 | 134 | }, |
133 | 135 | title: { | ... | ... |
src/components/Table/src/types/column.ts
0 → 100644
1 | +import { VNodeChild } from 'vue'; | |
2 | + | |
3 | +export interface ColumnFilterItem { | |
4 | + text?: string; | |
5 | + value?: string; | |
6 | + children?: any; | |
7 | +} | |
8 | + | |
9 | +export declare type SortOrder = 'ascend' | 'descend'; | |
10 | + | |
11 | +export interface RecordProps<T> { | |
12 | + text: any; | |
13 | + record: T; | |
14 | + index: number; | |
15 | +} | |
16 | + | |
17 | +export interface FilterDropdownProps { | |
18 | + prefixCls?: string; | |
19 | + setSelectedKeys?: (selectedKeys: string[]) => void; | |
20 | + selectedKeys?: string[]; | |
21 | + confirm?: () => void; | |
22 | + clearFilters?: () => void; | |
23 | + filters?: ColumnFilterItem[]; | |
24 | + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; | |
25 | + visible?: boolean; | |
26 | +} | |
27 | + | |
28 | +export declare type CustomRenderFunction<T> = (record: RecordProps<T>) => VNodeChild | JSX.Element; | |
29 | + | |
30 | +export interface ColumnProps<T> { | |
31 | + /** | |
32 | + * specify how content is aligned | |
33 | + * @default 'left' | |
34 | + * @type string | |
35 | + */ | |
36 | + align?: 'left' | 'right' | 'center'; | |
37 | + | |
38 | + /** | |
39 | + * ellipsize cell content, not working with sorter and filters for now. | |
40 | + * tableLayout would be fixed when ellipsis is true. | |
41 | + * @default false | |
42 | + * @type boolean | |
43 | + */ | |
44 | + ellipsis?: boolean; | |
45 | + | |
46 | + /** | |
47 | + * Span of this column's title | |
48 | + * @type number | |
49 | + */ | |
50 | + colSpan?: number; | |
51 | + | |
52 | + /** | |
53 | + * Display field of the data record, could be set like a.b.c | |
54 | + * @type string | |
55 | + */ | |
56 | + dataIndex?: string; | |
57 | + | |
58 | + /** | |
59 | + * Default filtered values | |
60 | + * @type string[] | |
61 | + */ | |
62 | + defaultFilteredValue?: string[]; | |
63 | + | |
64 | + /** | |
65 | + * Default order of sorted values: 'ascend' 'descend' null | |
66 | + * @type string | |
67 | + */ | |
68 | + defaultSortOrder?: SortOrder; | |
69 | + | |
70 | + /** | |
71 | + * Customized filter overlay | |
72 | + * @type any (slot) | |
73 | + */ | |
74 | + filterDropdown?: | |
75 | + | VNodeChild | |
76 | + | JSX.Element | |
77 | + | ((props: FilterDropdownProps) => VNodeChild | JSX.Element); | |
78 | + | |
79 | + /** | |
80 | + * Whether filterDropdown is visible | |
81 | + * @type boolean | |
82 | + */ | |
83 | + filterDropdownVisible?: boolean; | |
84 | + | |
85 | + /** | |
86 | + * Whether the dataSource is filtered | |
87 | + * @default false | |
88 | + * @type boolean | |
89 | + */ | |
90 | + filtered?: boolean; | |
91 | + | |
92 | + /** | |
93 | + * Controlled filtered value, filter icon will highlight | |
94 | + * @type string[] | |
95 | + */ | |
96 | + filteredValue?: string[]; | |
97 | + | |
98 | + /** | |
99 | + * Customized filter icon | |
100 | + * @default false | |
101 | + * @type any | |
102 | + */ | |
103 | + filterIcon?: boolean | VNodeChild | JSX.Element; | |
104 | + | |
105 | + /** | |
106 | + * Whether multiple filters can be selected | |
107 | + * @default true | |
108 | + * @type boolean | |
109 | + */ | |
110 | + filterMultiple?: boolean; | |
111 | + | |
112 | + /** | |
113 | + * Filter menu config | |
114 | + * @type object[] | |
115 | + */ | |
116 | + filters?: ColumnFilterItem[]; | |
117 | + | |
118 | + /** | |
119 | + * Set column to be fixed: true(same as left) 'left' 'right' | |
120 | + * @default false | |
121 | + * @type boolean | string | |
122 | + */ | |
123 | + fixed?: boolean | 'left' | 'right'; | |
124 | + | |
125 | + /** | |
126 | + * Unique key of this column, you can ignore this prop if you've set a unique dataIndex | |
127 | + * @type string | |
128 | + */ | |
129 | + key?: string; | |
130 | + | |
131 | + /** | |
132 | + * Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config | |
133 | + * @type Function | ScopedSlot | |
134 | + */ | |
135 | + customRender?: CustomRenderFunction<T> | VNodeChild | JSX.Element; | |
136 | + | |
137 | + /** | |
138 | + * Sort function for local sort, see Array.sort's compareFunction. If you need sort buttons only, set to true | |
139 | + * @type boolean | Function | |
140 | + */ | |
141 | + sorter?: boolean | Function; | |
142 | + | |
143 | + /** | |
144 | + * Order of sorted values: 'ascend' 'descend' false | |
145 | + * @type boolean | string | |
146 | + */ | |
147 | + sortOrder?: boolean | SortOrder; | |
148 | + | |
149 | + /** | |
150 | + * supported sort way, could be 'ascend', 'descend' | |
151 | + * @default ['ascend', 'descend'] | |
152 | + * @type string[] | |
153 | + */ | |
154 | + sortDirections?: SortOrder[]; | |
155 | + | |
156 | + /** | |
157 | + * Title of this column | |
158 | + * @type any (string | slot) | |
159 | + */ | |
160 | + title?: VNodeChild | JSX.Element; | |
161 | + | |
162 | + /** | |
163 | + * Width of this column | |
164 | + * @type string | number | |
165 | + */ | |
166 | + width?: string | number; | |
167 | + | |
168 | + /** | |
169 | + * Set props on per cell | |
170 | + * @type Function | |
171 | + */ | |
172 | + customCell?: (record: T, rowIndex: number) => object; | |
173 | + | |
174 | + /** | |
175 | + * Set props on per header cell | |
176 | + * @type object | |
177 | + */ | |
178 | + customHeaderCell?: (column: ColumnProps<T>) => object; | |
179 | + | |
180 | + /** | |
181 | + * Callback executed when the confirm filter button is clicked, Use as a filter event when using template or jsx | |
182 | + * @type Function | |
183 | + */ | |
184 | + onFilter?: (value: any, record: T) => boolean; | |
185 | + | |
186 | + /** | |
187 | + * Callback executed when filterDropdownVisible is changed, Use as a filterDropdownVisible event when using template or jsx | |
188 | + * @type Function | |
189 | + */ | |
190 | + onFilterDropdownVisibleChange?: (visible: boolean) => void; | |
191 | + | |
192 | + /** | |
193 | + * When using columns, you can use this property to configure the properties that support the slot, | |
194 | + * such as slots: { filterIcon: 'XXX'} | |
195 | + * @type object | |
196 | + */ | |
197 | + slots?: Record<string, string>; | |
198 | +} | ... | ... |
src/components/Table/src/types/pagination.ts
1 | +import Pagination from 'ant-design-vue/lib/pagination'; | |
1 | 2 | import { VNodeChild } from 'vue'; |
2 | -import { PaginationRenderProps } from 'ant-design-vue/types/pagination'; | |
3 | + | |
4 | +interface PaginationRenderProps { | |
5 | + page: number; | |
6 | + type: 'page' | 'prev' | 'next'; | |
7 | + originalElement: any; | |
8 | +} | |
9 | + | |
10 | +export declare class PaginationConfig extends Pagination { | |
11 | + position?: 'top' | 'bottom' | 'both'; | |
12 | +} | |
3 | 13 | export interface PaginationProps { |
4 | 14 | /** |
5 | 15 | * total number of data items | ... | ... |
src/components/Table/src/types/table.ts
1 | -import { VNodeChild } from 'vue'; | |
2 | -import { PaginationProps } from './pagination'; | |
3 | -import { FormProps } from '/@/components/Form/index'; | |
4 | -import { | |
5 | - ExpandedRowRenderRecord, | |
6 | - PaginationConfig, | |
7 | - SorterResult, | |
8 | - TableCurrentDataSource, | |
9 | - TableCustomRecord, | |
10 | - TableRowSelection, | |
11 | -} from 'ant-design-vue/types/table/table'; | |
12 | -import { ColumnProps } from 'ant-design-vue/types/table/column'; | |
1 | +import type { VNodeChild } from 'vue'; | |
2 | +import type { PaginationProps } from './pagination'; | |
3 | +import type { FormProps } from '/@/components/Form/index'; | |
4 | +import type { IColumnProps, ITableRowSelection } from 'ant-design-vue/lib/table/interface'; | |
13 | 5 | import { ComponentType } from './componentType'; |
6 | +import { ColumnProps } from './column'; | |
14 | 7 | export declare type SortOrder = 'ascend' | 'descend'; |
8 | +export interface TableCurrentDataSource<T = any> { | |
9 | + currentDataSource: T[]; | |
10 | +} | |
11 | + | |
12 | +export interface TableRowSelection<T = any> extends ITableRowSelection { | |
13 | + /** | |
14 | + * Callback executed when selected rows change | |
15 | + * @type Function | |
16 | + */ | |
17 | + onChange?: (selectedRowKeys: string[] | number[], selectedRows: T[]) => any; | |
18 | + | |
19 | + /** | |
20 | + * Callback executed when select/deselect one row | |
21 | + * @type FunctionT | |
22 | + */ | |
23 | + onSelect?: (record: T, selected: boolean, selectedRows: Object[], nativeEvent: Event) => any; | |
24 | + | |
25 | + /** | |
26 | + * Callback executed when select/deselect all rows | |
27 | + * @type Function | |
28 | + */ | |
29 | + onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => any; | |
30 | + | |
31 | + /** | |
32 | + * Callback executed when row selection is inverted | |
33 | + * @type Function | |
34 | + */ | |
35 | + onSelectInvert?: (selectedRows: string[] | number[]) => any; | |
36 | +} | |
37 | + | |
38 | +export interface TableCustomRecord<T> { | |
39 | + record?: T; | |
40 | + index?: number; | |
41 | +} | |
42 | + | |
43 | +export interface ExpandedRowRenderRecord<T> extends TableCustomRecord<T> { | |
44 | + indent?: number; | |
45 | + expanded?: boolean; | |
46 | +} | |
15 | 47 | export interface ColumnFilterItem { |
16 | 48 | text?: string; |
17 | 49 | value?: string; |
18 | 50 | children?: any; |
19 | 51 | } |
20 | 52 | |
53 | +export interface TableCustomRecord<T = any> { | |
54 | + record?: T; | |
55 | + index?: number; | |
56 | +} | |
57 | + | |
58 | +export interface SorterResult<T> { | |
59 | + column: ColumnProps<T>; | |
60 | + order: SortOrder; | |
61 | + field: string; | |
62 | + columnKey: string; | |
63 | +} | |
64 | + | |
21 | 65 | export interface RenderEditableCellParams { |
22 | 66 | dataIndex: string; |
23 | 67 | component?: ComponentType; |
... | ... | @@ -231,7 +275,7 @@ export interface BasicTableProps<T = any> { |
231 | 275 | * Row selection config |
232 | 276 | * @type object |
233 | 277 | */ |
234 | - rowSelection?: TableRowSelection<T>; | |
278 | + rowSelection?: TableRowSelection; | |
235 | 279 | |
236 | 280 | /** |
237 | 281 | * Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area. |
... | ... | @@ -265,7 +309,7 @@ export interface BasicTableProps<T = any> { |
265 | 309 | * Set props on per header row |
266 | 310 | * @type Function |
267 | 311 | */ |
268 | - customHeaderRow?: (column: ColumnProps<T>, index: number) => object; | |
312 | + customHeaderRow?: (column: IColumnProps, index: number) => object; | |
269 | 313 | |
270 | 314 | /** |
271 | 315 | * Set props on per row |
... | ... | @@ -305,12 +349,7 @@ export interface BasicTableProps<T = any> { |
305 | 349 | * @param sorter |
306 | 350 | * @param currentDataSource |
307 | 351 | */ |
308 | - onChange?: ( | |
309 | - pagination: PaginationConfig, | |
310 | - filters: Partial<Record<keyof T, string[]>>, | |
311 | - sorter: SorterResult<T>, | |
312 | - extra: TableCurrentDataSource<T> | |
313 | - ) => void; | |
352 | + onChange?: (pagination: any, filters: any, sorter: any, extra: any) => void; | |
314 | 353 | |
315 | 354 | /** |
316 | 355 | * Callback executed when the row expand icon is clicked |
... | ... | @@ -327,7 +366,7 @@ export interface BasicTableProps<T = any> { |
327 | 366 | onExpandedRowsChange?: (expandedRows: string[] | number[]) => void; |
328 | 367 | } |
329 | 368 | |
330 | -export interface BasicColumn<T = any> extends ColumnProps<T> { | |
369 | +export interface BasicColumn extends IColumnProps { | |
331 | 370 | children?: BasicColumn[]; |
332 | 371 | // |
333 | 372 | flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION'; | ... | ... |
src/design/ant/index.less
src/setup/ant-design-vue/index.ts
src/views/dashboard/analysis/components/FlowAnalysis.tsx
... | ... | @@ -11,7 +11,7 @@ export default defineComponent({ |
11 | 11 | return ( |
12 | 12 | <Row> |
13 | 13 | {() => ( |
14 | - <div> | |
14 | + <> | |
15 | 15 | <Col md={24} lg={8}> |
16 | 16 | {() => ( |
17 | 17 | <CollapseContainer |
... | ... | @@ -56,7 +56,7 @@ export default defineComponent({ |
56 | 56 | </CollapseContainer> |
57 | 57 | )} |
58 | 58 | </Col> |
59 | - </div> | |
59 | + </> | |
60 | 60 | )} |
61 | 61 | </Row> |
62 | 62 | ); | ... | ... |
src/views/dashboard/workbench/components/ProdTotal.vue
src/views/demo/feat/i18n/index.vue
... | ... | @@ -4,10 +4,10 @@ |
4 | 4 | <Divider /> |
5 | 5 | 国际化信息: {{ t('hello') }} |
6 | 6 | <Divider /> |
7 | - <a-button :type="localeRef === 'zhCN' ? 'primary' : ''" @click="localeRef = 'zhCN'"> | |
7 | + <a-button :type="localeRef === 'zhCN' ? 'primary' : 'default'" @click="localeRef = 'zhCN'"> | |
8 | 8 | 中文 |
9 | 9 | </a-button> |
10 | - <a-button :type="localeRef === 'en' ? 'primary' : ''" @click="localeRef = 'en'"> | |
10 | + <a-button :type="localeRef === 'en' ? 'primary' : 'default'" @click="localeRef = 'en'"> | |
11 | 11 | 英文 |
12 | 12 | </a-button> |
13 | 13 | <Divider /> | ... | ... |
src/views/demo/permission/front/Btn.vue
... | ... | @@ -14,10 +14,10 @@ |
14 | 14 | <div class="mt-4"> |
15 | 15 | 权限切换(请先切换权限模式为前端角色权限模式): |
16 | 16 | <a-button-group> |
17 | - <a-button @click="changeRole(RoleEnum.SUPER)" :type="isSuper ? 'primary' : ''"> | |
17 | + <a-button @click="changeRole(RoleEnum.SUPER)" :type="isSuper ? 'primary' : 'default'"> | |
18 | 18 | {{ RoleEnum.SUPER }} |
19 | 19 | </a-button> |
20 | - <a-button @click="changeRole(RoleEnum.TEST)" :type="isTest ? 'primary' : ''"> | |
20 | + <a-button @click="changeRole(RoleEnum.TEST)" :type="isTest ? 'primary' : 'default'"> | |
21 | 21 | {{ RoleEnum.TEST }} |
22 | 22 | </a-button> |
23 | 23 | </a-button-group> | ... | ... |
src/views/demo/permission/front/index.vue
... | ... | @@ -14,10 +14,10 @@ |
14 | 14 | <div class="mt-4"> |
15 | 15 | 权限切换(请先切换权限模式为前端角色权限模式): |
16 | 16 | <a-button-group> |
17 | - <a-button @click="changeRole(RoleEnum.SUPER)" :type="isSuper ? 'primary' : ''"> | |
17 | + <a-button @click="changeRole(RoleEnum.SUPER)" :type="isSuper ? 'primary' : 'default'"> | |
18 | 18 | {{ RoleEnum.SUPER }} |
19 | 19 | </a-button> |
20 | - <a-button @click="changeRole(RoleEnum.TEST)" :type="isTest ? 'primary' : ''"> | |
20 | + <a-button @click="changeRole(RoleEnum.TEST)" :type="isTest ? 'primary' : 'default'"> | |
21 | 21 | {{ RoleEnum.TEST }} |
22 | 22 | </a-button> |
23 | 23 | </a-button-group> | ... | ... |
src/views/sys/login/Login.vue
yarn.lock
... | ... | @@ -1830,10 +1830,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: |
1830 | 1830 | dependencies: |
1831 | 1831 | color-convert "^2.0.1" |
1832 | 1832 | |
1833 | -ant-design-vue@^2.0.0-beta.10: | |
1834 | - version "2.0.0-beta.10" | |
1835 | - resolved "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-2.0.0-beta.10.tgz#66ecfe029458b12d276139bd7fe27a4624af3c75" | |
1836 | - integrity sha512-32ZewKAvFBboluvBMsO7Y15LEWxnh2SO/J/h9Sq1qUEXqVt/HXwyg1KmFnSz2kc5j6Av5UtVjLu8rzHdZAOtTw== | |
1833 | +ant-design-vue@^2.0.0-beta.11: | |
1834 | + version "2.0.0-beta.11" | |
1835 | + resolved "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-2.0.0-beta.11.tgz#00c9c7c3f2452cba6853380b8d36dea3ed160771" | |
1836 | + integrity sha512-6jWT4w/AklYTH80tmG6EHhh7yPbaMFSXUHF14UZdQE+Cm7i5nJVJmRc5RkpmS8QiS3pmXU2UpR0zIo7VmwOmnA== | |
1837 | 1837 | dependencies: |
1838 | 1838 | "@ant-design-vue/use" "^0.0.1-0" |
1839 | 1839 | "@ant-design/icons-vue" "^5.1.5" |
... | ... | @@ -1861,6 +1861,7 @@ ant-design-vue@^2.0.0-beta.10: |
1861 | 1861 | scroll-into-view-if-needed "^2.2.25" |
1862 | 1862 | shallow-equal "^1.0.0" |
1863 | 1863 | shallowequal "^1.0.2" |
1864 | + vue-types "^3.0.0" | |
1864 | 1865 | warning "^4.0.0" |
1865 | 1866 | |
1866 | 1867 | any-promise@^1.0.0, any-promise@^1.1.0: |
... | ... | @@ -4666,6 +4667,11 @@ is-plain-obj@^2.0.0: |
4666 | 4667 | resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" |
4667 | 4668 | integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== |
4668 | 4669 | |
4670 | +is-plain-object@3.0.1: | |
4671 | + version "3.0.1" | |
4672 | + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" | |
4673 | + integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g== | |
4674 | + | |
4669 | 4675 | is-plain-object@^2.0.3, is-plain-object@^2.0.4: |
4670 | 4676 | version "2.0.4" |
4671 | 4677 | resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" |
... | ... | @@ -8263,6 +8269,13 @@ vue-router@^4.0.0-rc.1: |
8263 | 8269 | resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.0-rc.1.tgz#42f41315849163a1243886c9aa6d7c14f24fd003" |
8264 | 8270 | integrity sha512-N3SSOIiRFo1/D6EkHGuahUSuyDvFhKizN5zVXkALX7wv0hYYndV49KwzRF5lKsAIt+OlDl7y+sNmwNewb7a4iw== |
8265 | 8271 | |
8272 | +vue-types@^3.0.0: | |
8273 | + version "3.0.1" | |
8274 | + resolved "https://registry.npmjs.org/vue-types/-/vue-types-3.0.1.tgz#20e9baae8673de8093d0a989234695d08d544be0" | |
8275 | + integrity sha512-UbvbzPu8DNzZRfMB1RDTFKBB6seMm80scMFdP+GkKaw00EugC3cjq9AtlS4y258vDkpAe9HfqbRO4cp63qVHXQ== | |
8276 | + dependencies: | |
8277 | + is-plain-object "3.0.1" | |
8278 | + | |
8266 | 8279 | vue@^3.0.2: |
8267 | 8280 | version "3.0.2" |
8268 | 8281 | resolved "https://registry.npmjs.org/vue/-/vue-3.0.2.tgz#9d5b7b2983f35e64a34d13c7c9d6831239feca3c" | ... | ... |