Commit 2407b3368c3fc5128bbfced98a1d2c70fa3e02e0

Authored by vben
1 parent 9abf1763

fix: some error

CHANGELOG.zh_CN.md
@@ -22,12 +22,14 @@ @@ -22,12 +22,14 @@
22 - 添加部分注释 22 - 添加部分注释
23 - pwa 图标补充 23 - pwa 图标补充
24 - types 类型调整 24 - types 类型调整
  25 +- 升级`ant-design-vue`到`beta.11`,并修改带来的已知问题
25 26
26 ### 🐛 Bug Fixes 27 ### 🐛 Bug Fixes
27 28
28 - 修复本地代理 post 接口到 https 地址超时错误 29 - 修复本地代理 post 接口到 https 地址超时错误
29 - 修复 modal 在不显示 footer 的时候全屏高度计算问题 30 - 修复 modal 在不显示 footer 的时候全屏高度计算问题
30 - 修复表单重置未删除校验信息错误 31 - 修复表单重置未删除校验信息错误
  32 +- 修复顶部菜单分割模式样式问题
31 33
32 ## 2.0.0-rc.6 (2020-10-28) 34 ## 2.0.0-rc.6 (2020-10-28)
33 35
package.json
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 }, 22 },
23 "dependencies": { 23 "dependencies": {
24 "@iconify/iconify": "^2.0.0-rc.1", 24 "@iconify/iconify": "^2.0.0-rc.1",
25 - "ant-design-vue": "^2.0.0-beta.10", 25 + "ant-design-vue": "^2.0.0-beta.11",
26 "apexcharts": "^3.22.0", 26 "apexcharts": "^3.22.0",
27 "axios": "^0.21.0", 27 "axios": "^0.21.0",
28 "echarts": "^4.9.0", 28 "echarts": "^4.9.0",
src/components/Drawer/src/BasicDrawer.tsx
1 import { Drawer, Row, Col, Button } from 'ant-design-vue'; 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 import { BasicTitle } from '/@/components/Basic'; 3 import { BasicTitle } from '/@/components/Basic';
14 -// import { ScrollContainer, ScrollContainerOptions } from '/@/components/Container/index';  
15 import { FullLoading } from '/@/components/Loading/index'; 4 import { FullLoading } from '/@/components/Loading/index';
16 5
17 import { getSlot } from '/@/utils/helper/tsxHelper'; 6 import { getSlot } from '/@/utils/helper/tsxHelper';
@@ -21,8 +10,6 @@ import { DrawerInstance, DrawerProps } from './types'; @@ -21,8 +10,6 @@ import { DrawerInstance, DrawerProps } from './types';
21 import { basicProps } from './props'; 10 import { basicProps } from './props';
22 import { isFunction, isNumber } from '/@/utils/is'; 11 import { isFunction, isNumber } from '/@/utils/is';
23 import { LeftOutlined } from '@ant-design/icons-vue'; 12 import { LeftOutlined } from '@ant-design/icons-vue';
24 -// import { appStore } from '/@/store/modules/app';  
25 -// import { useRouter } from 'vue-router';  
26 import { buildUUID } from '/@/utils/uuid'; 13 import { buildUUID } from '/@/utils/uuid';
27 import { deepMerge } from '/@/utils'; 14 import { deepMerge } from '/@/utils';
28 import './index.less'; 15 import './index.less';
@@ -38,7 +25,6 @@ export default defineComponent({ @@ -38,7 +25,6 @@ export default defineComponent({
38 const visibleRef = ref(false); 25 const visibleRef = ref(false);
39 const propsRef = ref<Partial<DrawerProps> | null>(null); 26 const propsRef = ref<Partial<DrawerProps> | null>(null);
40 27
41 - // 自定义title组件:获得title  
42 const getMergeProps = computed((): any => { 28 const getMergeProps = computed((): any => {
43 return deepMerge(toRaw(props), unref(propsRef)); 29 return deepMerge(toRaw(props), unref(propsRef));
44 }); 30 });
@@ -68,9 +54,11 @@ export default defineComponent({ @@ -68,9 +54,11 @@ export default defineComponent({
68 } 54 }
69 return opt; 55 return opt;
70 }); 56 });
  57 +
71 watchEffect(() => { 58 watchEffect(() => {
72 visibleRef.value = props.visible; 59 visibleRef.value = props.visible;
73 }); 60 });
  61 +
74 watch( 62 watch(
75 () => visibleRef.value, 63 () => visibleRef.value,
76 (visible) => { 64 (visible) => {
@@ -83,6 +71,15 @@ export default defineComponent({ @@ -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 async function onClose(e: any) { 84 async function onClose(e: any) {
88 const { closeFunc } = unref(getProps); 85 const { closeFunc } = unref(getProps);
@@ -103,14 +100,6 @@ export default defineComponent({ @@ -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 function renderFooter() { 103 function renderFooter() {
115 const { 104 const {
116 showCancelBtn, 105 showCancelBtn,
@@ -171,11 +160,13 @@ export default defineComponent({ @@ -171,11 +160,13 @@ export default defineComponent({
171 )} 160 )}
172 </Col> 161 </Col>
173 )} 162 )}
  163 +
174 {title && ( 164 {title && (
175 <Col style="flex:1" class={[`${prefixCls}__detail-title`, 'ellipsis', 'px-2']}> 165 <Col style="flex:1" class={[`${prefixCls}__detail-title`, 'ellipsis', 'px-2']}>
176 {() => title} 166 {() => title}
177 </Col> 167 </Col>
178 )} 168 )}
  169 +
179 {getSlot(slots, 'titleToolbar')} 170 {getSlot(slots, 'titleToolbar')}
180 </> 171 </>
181 )} 172 )}
@@ -208,22 +199,22 @@ export default defineComponent({ @@ -208,22 +199,22 @@ export default defineComponent({
208 title: () => renderHeader(), 199 title: () => renderHeader(),
209 default: () => ( 200 default: () => (
210 <> 201 <>
211 - <FullLoading  
212 - absolute  
213 - class={[!unref(getProps).loading ? 'hidden' : '']}  
214 - tip="加载中..."  
215 - />  
216 <div 202 <div
217 ref={scrollRef} 203 ref={scrollRef}
218 {...attrs} 204 {...attrs}
219 - data-id="123"  
220 style={{ 205 style={{
  206 + position: 'relative',
221 height: `calc(100% - ${footerHeight})`, 207 height: `calc(100% - ${footerHeight})`,
222 overflow: 'auto', 208 overflow: 'auto',
223 padding: '16px', 209 padding: '16px',
224 paddingBottom: '30px', 210 paddingBottom: '30px',
225 }} 211 }}
226 > 212 >
  213 + <FullLoading
  214 + absolute
  215 + tip="加载中..."
  216 + class={[!unref(getProps).loading ? 'hidden' : '']}
  217 + />
227 {getSlot(slots, 'default')} 218 {getSlot(slots, 'default')}
228 </div> 219 </div>
229 {renderFooter()} 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 import type { CSSProperties, VNodeChild } from 'vue'; 2 import type { CSSProperties, VNodeChild } from 'vue';
3 import type { ScrollContainerOptions } from '/@/components/Container/index'; 3 import type { ScrollContainerOptions } from '/@/components/Container/index';
4 4
@@ -47,13 +47,13 @@ export interface DrawerFooterProps { @@ -47,13 +47,13 @@ export interface DrawerFooterProps {
47 * The ok button props, follow jsx rules 47 * The ok button props, follow jsx rules
48 * @type object 48 * @type object
49 */ 49 */
50 - okButtonProps: { props: Button; on: {} }; 50 + okButtonProps: { props: ButtonProps; on: {} };
51 51
52 /** 52 /**
53 * The cancel button props, follow jsx rules 53 * The cancel button props, follow jsx rules
54 * @type object 54 * @type object
55 */ 55 */
56 - cancelButtonProps: { props: Button; on: {} }; 56 + cancelButtonProps: { props: ButtonProps; on: {} };
57 /** 57 /**
58 * Whether to apply loading visual effect for OK button or not 58 * Whether to apply loading visual effect for OK button or not
59 * @default false 59 * @default false
src/components/Form/src/hooks/useForm.ts
@@ -4,8 +4,9 @@ import { isInSetup } from &#39;/@/utils/helper/vueHelper&#39;; @@ -4,8 +4,9 @@ import { isInSetup } from &#39;/@/utils/helper/vueHelper&#39;;
4 import { isProdMode } from '/@/utils/env'; 4 import { isProdMode } from '/@/utils/env';
5 5
6 import type { FormProps, FormActionType, UseFormReturnType, FormSchema } from '../types/form'; 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 export function useForm(props?: Partial<FormProps>): UseFormReturnType { 11 export function useForm(props?: Partial<FormProps>): UseFormReturnType {
11 isInSetup(); 12 isInSetup();
src/components/Form/src/hooks/useFormAction.ts
1 import type { ComputedRef, Ref } from 'vue'; 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 import { unref, toRaw } from 'vue'; 5 import { unref, toRaw } from 'vue';
7 6
@@ -17,7 +16,7 @@ interface UseFormActionContext { @@ -17,7 +16,7 @@ interface UseFormActionContext {
17 getSchema: ComputedRef<FormSchema[]>; 16 getSchema: ComputedRef<FormSchema[]>;
18 formModel: any; 17 formModel: any;
19 defaultValueRef: Ref<any>; 18 defaultValueRef: Ref<any>;
20 - formElRef: Ref<FormType>; 19 + formElRef: Ref<FormActionType>;
21 schemaRef: Ref<FormSchema[]>; 20 schemaRef: Ref<FormSchema[]>;
22 handleFormValues: Fn; 21 handleFormValues: Fn;
23 actionState: { 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 import type { VNode } from 'vue'; 2 import type { VNode } from 'vue';
3 import type { BasicButtonProps } from '/@/components/Button/types'; 3 import type { BasicButtonProps } from '/@/components/Button/types';
4 import type { FormItem } from './formItem'; 4 import type { FormItem } from './formItem';
@@ -17,7 +17,7 @@ export interface ButtonProps extends BasicButtonProps { @@ -17,7 +17,7 @@ export interface ButtonProps extends BasicButtonProps {
17 text?: string; 17 text?: string;
18 } 18 }
19 19
20 -export interface FormActionType extends Form { 20 +export interface FormActionType {
21 submit: () => Promise<void>; 21 submit: () => Promise<void>;
22 setFieldsValue: <T>(values: T) => void; 22 setFieldsValue: <T>(values: T) => void;
23 resetFields: () => Promise<any>; 23 resetFields: () => Promise<any>;
@@ -29,6 +29,7 @@ export interface FormActionType extends Form { @@ -29,6 +29,7 @@ export interface FormActionType extends Form {
29 appendSchemaByField: (schema: FormSchema, prefixField?: string) => void; 29 appendSchemaByField: (schema: FormSchema, prefixField?: string) => void;
30 validateFields: (nameList?: NamePath[]) => Promise<any>; 30 validateFields: (nameList?: NamePath[]) => Promise<any>;
31 validate: (nameList?: NamePath[]) => Promise<any>; 31 validate: (nameList?: NamePath[]) => Promise<any>;
  32 + scrollToField: (name: NamePath, options?: ScrollOptions) => void;
32 } 33 }
33 export type RegisterFn = (formInstance: FormActionType) => void; 34 export type RegisterFn = (formInstance: FormActionType) => void;
34 35
@@ -113,7 +114,7 @@ export interface FormSchema { @@ -113,7 +114,7 @@ export interface FormSchema {
113 componentProps?: any; 114 componentProps?: any;
114 115
115 // 校验规则 116 // 校验规则
116 - rules?: ValidationRule[]; 117 + rules?: RuleObject[];
117 // 校验信息是否加入label 118 // 校验信息是否加入label
118 rulesMessageJoinLabel?: boolean; 119 rulesMessageJoinLabel?: boolean;
119 120
@@ -150,7 +151,7 @@ export interface FormSchema { @@ -150,7 +151,7 @@ export interface FormSchema {
150 151
151 dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); 152 dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
152 153
153 - dynamicRules?: (renderCallbackParams: RenderCallbackParams) => ValidationRule[]; 154 + dynamicRules?: (renderCallbackParams: RenderCallbackParams) => RuleObject[];
154 } 155 }
155 export interface HelpComponentProps { 156 export interface HelpComponentProps {
156 maxWidth: string; 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 import type { VNodeChild } from 'vue'; 3 import type { VNodeChild } from 'vue';
4 4
5 export interface FormItem { 5 export interface FormItem {
@@ -39,7 +39,7 @@ export interface FormItem { @@ -39,7 +39,7 @@ export interface FormItem {
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> 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 * @type Col 40 * @type Col
41 */ 41 */
42 - labelCol?: Col; 42 + labelCol?: ColProps;
43 43
44 /** 44 /**
45 * Whether provided or not, it will be generated by the validation rule. 45 * Whether provided or not, it will be generated by the validation rule.
@@ -58,7 +58,7 @@ export interface FormItem { @@ -58,7 +58,7 @@ export interface FormItem {
58 * The layout for input controls, same as labelCol 58 * The layout for input controls, same as labelCol
59 * @type Col 59 * @type Col
60 */ 60 */
61 - wrapperCol?: Col; 61 + wrapperCol?: ColProps;
62 /** 62 /**
63 * Set sub label htmlFor. 63 * Set sub label htmlFor.
64 */ 64 */
src/components/Form/src/types/index.ts
1 -import { ColSpanType } from 'ant-design-vue/types/grid/col';  
2 - 1 +type ColSpanType = number | string;
3 export interface ColEx { 2 export interface ColEx {
4 style?: any; 3 style?: any;
5 /** 4 /**
src/components/Menu/src/SearchInput.vue
@@ -69,8 +69,7 @@ @@ -69,8 +69,7 @@
69 margin: 12px 9px; 69 margin: 12px 9px;
70 70
71 &__search--dark { 71 &__search--dark {
72 - // .setPlaceholder('.ant-input',#fff);  
73 - 72 + .ant-input-affix-wrapper,
74 .ant-input { 73 .ant-input {
75 .set-bg(); 74 .set-bg();
76 75
@@ -91,6 +90,7 @@ @@ -91,6 +90,7 @@
91 } 90 }
92 91
93 &__search--light { 92 &__search--light {
  93 + .ant-input-affix-wrapper,
94 .ant-input { 94 .ant-input {
95 color: @text-color-base; 95 color: @text-color-base;
96 background: #fff; 96 background: #fff;
src/components/Menu/src/index.less
@@ -105,8 +105,8 @@ @@ -105,8 +105,8 @@
105 &.ant-menu-light { 105 &.ant-menu-light {
106 .ant-menu-item { 106 .ant-menu-item {
107 &.basic-menu-item__level1 { 107 &.basic-menu-item__level1 {
108 - height: 46px;  
109 - line-height: 46px; 108 + height: 38px;
  109 + line-height: 38px;
110 } 110 }
111 } 111 }
112 112
src/components/Modal/src/provideModal.ts
@@ -7,5 +7,5 @@ export function provideModal(redoHeight: Fn) { @@ -7,5 +7,5 @@ export function provideModal(redoHeight: Fn) {
7 } 7 }
8 8
9 export function injectModal(): Fn { 9 export function injectModal(): Fn {
10 - return inject(key) as Fn; 10 + return inject(key, () => {}) as Fn;
11 } 11 }
src/components/Table/src/components/renderFooter.tsx
1 import { Table } from 'ant-design-vue'; 1 import { Table } from 'ant-design-vue';
2 -import { TableRowSelection } from 'ant-design-vue/types/table/table';  
3 import { cloneDeep } from 'lodash-es'; 2 import { cloneDeep } from 'lodash-es';
4 import { unref, ComputedRef } from 'vue'; 3 import { unref, ComputedRef } from 'vue';
5 -import { BasicColumn } from '../types/table';  
6 import { isFunction } from '/@/utils/is'; 4 import { isFunction } from '/@/utils/is';
  5 +import type { BasicColumn, TableRowSelection } from '../types/table';
  6 +
7 export default ({ 7 export default ({
8 scroll = {}, 8 scroll = {},
9 columnsRef, 9 columnsRef,
@@ -17,7 +17,7 @@ export default ({ @@ -17,7 +17,7 @@ export default ({
17 summaryFunc: any; 17 summaryFunc: any;
18 rowKey?: string; 18 rowKey?: string;
19 dataSourceRef: ComputedRef<any[]>; 19 dataSourceRef: ComputedRef<any[]>;
20 - rowSelectionRef: ComputedRef<TableRowSelection<any> | null>; 20 + rowSelectionRef: ComputedRef<TableRowSelection | null>;
21 }) => { 21 }) => {
22 if (!summaryFunc) { 22 if (!summaryFunc) {
23 return; 23 return;
src/components/Table/src/const.ts
1 -import { SorterResult } from 'ant-design-vue/types/table/table'; 1 +import type { SorterResult } from './types/table';
2 2
3 export const ROW_KEY = 'key'; 3 export const ROW_KEY = 'key';
4 4
src/components/Table/src/hooks/useRowSelection.ts
1 import { computed, ref, unref, ComputedRef } from 'vue'; 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 import { useProps } from './useProps'; 3 import { useProps } from './useProps';
5 4
6 /* eslint-disable */ 5 /* eslint-disable */
@@ -10,7 +9,7 @@ export function useRowSelection(refProps: ComputedRef&lt;BasicTableProps&gt;, emit: Em @@ -10,7 +9,7 @@ export function useRowSelection(refProps: ComputedRef&lt;BasicTableProps&gt;, emit: Em
10 const selectedRowKeysRef = ref<string[]>([]); 9 const selectedRowKeysRef = ref<string[]>([]);
11 const selectedRowRef = ref<any[]>([]); 10 const selectedRowRef = ref<any[]>([]);
12 11
13 - const getRowSelectionRef = computed((): TableRowSelection<any> | null => { 12 + const getRowSelectionRef = computed((): TableRowSelection | null => {
14 const rowSelection = unref(propsRef).rowSelection; 13 const rowSelection = unref(propsRef).rowSelection;
15 if (!rowSelection) { 14 if (!rowSelection) {
16 return null; 15 return null;
src/components/Table/src/props.ts
1 import type { PropType } from 'vue'; 1 import type { PropType } from 'vue';
2 import type { PaginationProps } from './types/pagination'; 2 import type { PaginationProps } from './types/pagination';
3 -import type { BasicColumn, FetchSetting, TableSetting } from './types/table';  
4 import type { 3 import type {
  4 + BasicColumn,
  5 + FetchSetting,
  6 + TableSetting,
5 SorterResult, 7 SorterResult,
6 TableCustomRecord, 8 TableCustomRecord,
7 TableRowSelection, 9 TableRowSelection,
8 -} from 'ant-design-vue/types/table/table'; 10 +} from './types/table';
9 import type { FormProps } from '/@/components/Form/index'; 11 import type { FormProps } from '/@/components/Form/index';
10 import { DEFAULT_SORT_FN, FETCH_SETTING } from './const'; 12 import { DEFAULT_SORT_FN, FETCH_SETTING } from './const';
11 13
@@ -127,7 +129,7 @@ export const basicProps = { @@ -127,7 +129,7 @@ export const basicProps = {
127 default: 0, 129 default: 0,
128 }, 130 },
129 rowSelection: { 131 rowSelection: {
130 - type: Object as PropType<TableRowSelection<any> | null>, 132 + type: Object as PropType<TableRowSelection | null>,
131 default: null, 133 default: null,
132 }, 134 },
133 title: { 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 import { VNodeChild } from 'vue'; 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 export interface PaginationProps { 13 export interface PaginationProps {
4 /** 14 /**
5 * total number of data items 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 import { ComponentType } from './componentType'; 5 import { ComponentType } from './componentType';
  6 +import { ColumnProps } from './column';
14 export declare type SortOrder = 'ascend' | 'descend'; 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 export interface ColumnFilterItem { 47 export interface ColumnFilterItem {
16 text?: string; 48 text?: string;
17 value?: string; 49 value?: string;
18 children?: any; 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 export interface RenderEditableCellParams { 65 export interface RenderEditableCellParams {
22 dataIndex: string; 66 dataIndex: string;
23 component?: ComponentType; 67 component?: ComponentType;
@@ -231,7 +275,7 @@ export interface BasicTableProps&lt;T = any&gt; { @@ -231,7 +275,7 @@ export interface BasicTableProps&lt;T = any&gt; {
231 * Row selection config 275 * Row selection config
232 * @type object 276 * @type object
233 */ 277 */
234 - rowSelection?: TableRowSelection<T>; 278 + rowSelection?: TableRowSelection;
235 279
236 /** 280 /**
237 * Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area. 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&lt;T = any&gt; { @@ -265,7 +309,7 @@ export interface BasicTableProps&lt;T = any&gt; {
265 * Set props on per header row 309 * Set props on per header row
266 * @type Function 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 * Set props on per row 315 * Set props on per row
@@ -305,12 +349,7 @@ export interface BasicTableProps&lt;T = any&gt; { @@ -305,12 +349,7 @@ export interface BasicTableProps&lt;T = any&gt; {
305 * @param sorter 349 * @param sorter
306 * @param currentDataSource 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 * Callback executed when the row expand icon is clicked 355 * Callback executed when the row expand icon is clicked
@@ -327,7 +366,7 @@ export interface BasicTableProps&lt;T = any&gt; { @@ -327,7 +366,7 @@ export interface BasicTableProps&lt;T = any&gt; {
327 onExpandedRowsChange?: (expandedRows: string[] | number[]) => void; 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 children?: BasicColumn[]; 370 children?: BasicColumn[];
332 // 371 //
333 flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION'; 372 flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION';
src/design/ant/index.less
@@ -2,6 +2,10 @@ @@ -2,6 +2,10 @@
2 @import './input.less'; 2 @import './input.less';
3 @import './btn.less'; 3 @import './btn.less';
4 4
  5 +.ant-col {
  6 + width: 100%;
  7 +}
  8 +
5 // ================================= 9 // =================================
6 // ==============descriptions======= 10 // ==============descriptions=======
7 // ================================= 11 // =================================
src/setup/ant-design-vue/index.ts
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 import type { App } from 'vue'; 3 import type { App } from 'vue';
4 4
5 import { Form, Input } from 'ant-design-vue'; 5 import { Form, Input } from 'ant-design-vue';
6 -import 'ant-design-vue/dist/antd.css'; 6 +import 'ant-design-vue/dist/antd.less';
7 7
8 import './spin'; 8 import './spin';
9 9
src/views/dashboard/analysis/components/FlowAnalysis.tsx
@@ -11,7 +11,7 @@ export default defineComponent({ @@ -11,7 +11,7 @@ export default defineComponent({
11 return ( 11 return (
12 <Row> 12 <Row>
13 {() => ( 13 {() => (
14 - <div> 14 + <>
15 <Col md={24} lg={8}> 15 <Col md={24} lg={8}>
16 {() => ( 16 {() => (
17 <CollapseContainer 17 <CollapseContainer
@@ -56,7 +56,7 @@ export default defineComponent({ @@ -56,7 +56,7 @@ export default defineComponent({
56 </CollapseContainer> 56 </CollapseContainer>
57 )} 57 )}
58 </Col> 58 </Col>
59 - </div> 59 + </>
60 )} 60 )}
61 </Row> 61 </Row>
62 ); 62 );
src/views/dashboard/workbench/components/ProdTotal.vue
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 29
30 &__item { 30 &__item {
31 display: inline-block; 31 display: inline-block;
32 - width: calc(25% - 8px); 32 + flex: 0 0 calc(25% - 8px);
33 padding: 20px 10px; 33 padding: 20px 10px;
34 margin-right: 8px; 34 margin-right: 8px;
35 border-radius: 4px; 35 border-radius: 4px;
src/views/demo/feat/i18n/index.vue
@@ -4,10 +4,10 @@ @@ -4,10 +4,10 @@
4 <Divider /> 4 <Divider />
5 国际化信息: {{ t('hello') }} 5 国际化信息: {{ t('hello') }}
6 <Divider /> 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 </a-button> 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 </a-button> 12 </a-button>
13 <Divider /> 13 <Divider />
src/views/demo/permission/front/Btn.vue
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 <div class="mt-4"> 14 <div class="mt-4">
15 权限切换(请先切换权限模式为前端角色权限模式): 15 权限切换(请先切换权限模式为前端角色权限模式):
16 <a-button-group> 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 {{ RoleEnum.SUPER }} 18 {{ RoleEnum.SUPER }}
19 </a-button> 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 {{ RoleEnum.TEST }} 21 {{ RoleEnum.TEST }}
22 </a-button> 22 </a-button>
23 </a-button-group> 23 </a-button-group>
src/views/demo/permission/front/index.vue
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 <div class="mt-4"> 14 <div class="mt-4">
15 权限切换(请先切换权限模式为前端角色权限模式): 15 权限切换(请先切换权限模式为前端角色权限模式):
16 <a-button-group> 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 {{ RoleEnum.SUPER }} 18 {{ RoleEnum.SUPER }}
19 </a-button> 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 {{ RoleEnum.TEST }} 21 {{ RoleEnum.TEST }}
22 </a-button> 22 </a-button>
23 </a-button-group> 23 </a-button-group>
src/views/sys/login/Login.vue
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 type="primary" 29 type="primary"
30 size="large" 30 size="large"
31 class="rounded-sm" 31 class="rounded-sm"
32 - block 32 + :block="true"
33 @click="login" 33 @click="login"
34 :loading="formState.loading" 34 :loading="formState.loading"
35 >登录</a-button 35 >登录</a-button
yarn.lock
@@ -1830,10 +1830,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: @@ -1830,10 +1830,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
1830 dependencies: 1830 dependencies:
1831 color-convert "^2.0.1" 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 dependencies: 1837 dependencies:
1838 "@ant-design-vue/use" "^0.0.1-0" 1838 "@ant-design-vue/use" "^0.0.1-0"
1839 "@ant-design/icons-vue" "^5.1.5" 1839 "@ant-design/icons-vue" "^5.1.5"
@@ -1861,6 +1861,7 @@ ant-design-vue@^2.0.0-beta.10: @@ -1861,6 +1861,7 @@ ant-design-vue@^2.0.0-beta.10:
1861 scroll-into-view-if-needed "^2.2.25" 1861 scroll-into-view-if-needed "^2.2.25"
1862 shallow-equal "^1.0.0" 1862 shallow-equal "^1.0.0"
1863 shallowequal "^1.0.2" 1863 shallowequal "^1.0.2"
  1864 + vue-types "^3.0.0"
1864 warning "^4.0.0" 1865 warning "^4.0.0"
1865 1866
1866 any-promise@^1.0.0, any-promise@^1.1.0: 1867 any-promise@^1.0.0, any-promise@^1.1.0:
@@ -4666,6 +4667,11 @@ is-plain-obj@^2.0.0: @@ -4666,6 +4667,11 @@ is-plain-obj@^2.0.0:
4666 resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" 4667 resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
4667 integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== 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 is-plain-object@^2.0.3, is-plain-object@^2.0.4: 4675 is-plain-object@^2.0.3, is-plain-object@^2.0.4:
4670 version "2.0.4" 4676 version "2.0.4"
4671 resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" 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,6 +8269,13 @@ vue-router@^4.0.0-rc.1:
8263 resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.0-rc.1.tgz#42f41315849163a1243886c9aa6d7c14f24fd003" 8269 resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.0-rc.1.tgz#42f41315849163a1243886c9aa6d7c14f24fd003"
8264 integrity sha512-N3SSOIiRFo1/D6EkHGuahUSuyDvFhKizN5zVXkALX7wv0hYYndV49KwzRF5lKsAIt+OlDl7y+sNmwNewb7a4iw== 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 vue@^3.0.2: 8279 vue@^3.0.2:
8267 version "3.0.2" 8280 version "3.0.2"
8268 resolved "https://registry.npmjs.org/vue/-/vue-3.0.2.tgz#9d5b7b2983f35e64a34d13c7c9d6831239feca3c" 8281 resolved "https://registry.npmjs.org/vue/-/vue-3.0.2.tgz#9d5b7b2983f35e64a34d13c7c9d6831239feca3c"