@teamix/pro 1.4.25-bugfix → 1.4.25-bugfix.2
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/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +78506 -59443
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +13 -6
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -95
- package/es/actions/index.d.ts +7 -0
- package/es/actions/index.js +93 -153
- package/es/actions/index.scss +6 -1
- package/es/actions/link.js +3 -5
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +61 -100
- package/es/card/index.scss +15 -0
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/card/xconsole.scss +3 -0
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +11 -26
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +117 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/es/form/ProForm/addCascadeEffect.js +203 -0
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +30 -38
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +26 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/global.scss +3 -1
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +18 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +66 -119
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +17 -27
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +61 -86
- package/es/info/typing.d.ts +2 -0
- package/es/info/utils/index.js +0 -11
- package/es/next-xconsole.scss +34 -0
- package/es/nocode/configurators/ProTable.js +1 -22
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +5 -30
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +40 -76
- package/es/page-header/index.scss +2 -1
- package/es/page-header/xconsole.scss +5 -0
- package/es/sidebar/components/sidebar-container/index.js +54 -69
- package/es/sidebar/components/sidebar-container/index.scss +21 -14
- package/es/sidebar/components/tree/index.js +100 -138
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +42 -84
- package/es/sidebar/components/tree-node/index.scss +6 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +72 -95
- package/es/sidebar/typing.d.ts +4 -0
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +392 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/Filter/index.d.ts +6 -3
- package/es/table/components/Filter/index.js +115 -128
- package/es/table/components/Layout/index.js +32 -47
- package/es/table/components/Layout/index.scss +2 -1
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +88 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.d.ts +1 -0
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +52 -0
- package/es/table/components/ToolBar/DensityIcon.js +19 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +87 -125
- package/es/table/components/ToolBar/FullScreenIcon.js +7 -62
- package/es/table/components/ToolBar/Fullscreen.js +25 -28
- package/es/table/components/ToolBar/RefreshIcon.js +162 -27
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +130 -38
- package/es/table/components/ToolBar/index.scss +49 -3
- package/es/table/index.js +455 -423
- package/es/table/index.scss +8 -0
- package/es/table/typing.d.ts +125 -6
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +39 -79
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +13 -16
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/table/utils/util.d.ts +5 -0
- package/es/table/utils/util.js +19 -0
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +25 -65
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/xconsole.scss +503 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -89
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +55 -112
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +7 -0
- package/lib/actions/index.js +115 -184
- package/lib/actions/index.scss +6 -1
- package/lib/actions/link.js +1 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.js +8 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +61 -127
- package/lib/card/index.scss +15 -0
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/card/xconsole.scss +3 -0
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +11 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +116 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/lib/form/ProForm/addCascadeEffect.js +210 -0
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +30 -60
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +1 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +26 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/global.scss +3 -1
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -40
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +66 -134
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +17 -39
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +61 -101
- package/lib/info/typing.d.ts +2 -0
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/next-xconsole.scss +34 -0
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +1 -24
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +3 -35
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +39 -90
- package/lib/page-header/index.scss +2 -1
- package/lib/page-header/xconsole.scss +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +54 -81
- package/lib/sidebar/components/sidebar-container/index.scss +21 -14
- package/lib/sidebar/components/tree/index.js +100 -152
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +42 -100
- package/lib/sidebar/components/tree-node/index.scss +6 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +79 -111
- package/lib/sidebar/typing.d.ts +4 -0
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +402 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.d.ts +6 -3
- package/lib/table/components/Filter/index.js +114 -137
- package/lib/table/components/Layout/index.js +32 -60
- package/lib/table/components/Layout/index.scss +2 -1
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +99 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.d.ts +1 -0
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +60 -0
- package/lib/table/components/ToolBar/DensityIcon.js +19 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +86 -136
- package/lib/table/components/ToolBar/FullScreenIcon.js +10 -74
- package/lib/table/components/ToolBar/Fullscreen.js +25 -35
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -36
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +133 -47
- package/lib/table/components/ToolBar/index.scss +49 -3
- package/lib/table/index.js +454 -445
- package/lib/table/index.scss +8 -0
- package/lib/table/typing.d.ts +125 -6
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +39 -92
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +13 -21
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/table/utils/util.d.ts +5 -0
- package/lib/table/utils/util.js +25 -0
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +25 -76
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/xconsole.scss +503 -0
- package/package.json +1 -1
package/es/table/index.scss
CHANGED
@@ -89,6 +89,14 @@ $fullscreenPadding: 24px;
|
|
89
89
|
color: var(--table-sort-color-current, #0064c8);
|
90
90
|
}
|
91
91
|
}
|
92
|
+
.next-table-empty {
|
93
|
+
padding: 0;
|
94
|
+
}
|
95
|
+
.next-table-wrap-empty {
|
96
|
+
.next-table-body tr td{
|
97
|
+
border-bottom: 0;
|
98
|
+
}
|
99
|
+
}
|
92
100
|
}
|
93
101
|
|
94
102
|
.teamix-pro-table-footer-suction {
|
package/es/table/typing.d.ts
CHANGED
@@ -2,13 +2,14 @@
|
|
2
2
|
* ProTable 类型定义
|
3
3
|
*/
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
|
-
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
5
|
+
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem, EmptyContentProps } from '../field';
|
6
6
|
import { QueryFilterProps, ProFormType } from '../form';
|
7
7
|
import { ProActionGroupProps, ProActionButtonProps } from '../actions';
|
8
8
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
9
|
import { HeaderProps as ProTableHeaderProps } from '../field';
|
10
|
-
import { Method } from 'axios';
|
10
|
+
import { Method, AxiosRequestConfig } from 'axios';
|
11
11
|
import React from 'react';
|
12
|
+
import { ProCardProps } from '../card';
|
12
13
|
declare type IFieldRenderProps = keyof ProFieldRenderProps;
|
13
14
|
/** 列record函数 */
|
14
15
|
declare type ProTableCellFunProp = (value: any, index: number, record: any, ...others: any) => any;
|
@@ -57,9 +58,11 @@ export declare type ProTableColumnProps = {
|
|
57
58
|
dataIndex?: string | string[];
|
58
59
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
59
60
|
format?: string;
|
61
|
+
/** 多级表头 **/
|
62
|
+
children?: ProTableColumnProps[];
|
60
63
|
/** ProField 其他配置项 */
|
61
64
|
props?: any;
|
62
|
-
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
65
|
+
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode' | 'children'>;
|
63
66
|
export declare type ProColumnProps = ProTableColumnProps;
|
64
67
|
export declare type ProTableProps = {
|
65
68
|
/** ProColums 定义,取代 Table 的 columns */
|
@@ -75,9 +78,9 @@ export declare type ProTableProps = {
|
|
75
78
|
/** sort 排序请求参数处理函数 */
|
76
79
|
formatSort?: (sort: object) => object;
|
77
80
|
/** 如需自定义调用参数格式,则可以设定此值在请求前对 params 进行自定义,如果返回false则可以阻止请求 */
|
78
|
-
formatParams?: (params: any) => typeof params;
|
81
|
+
formatParams?: ((params: any) => typeof params) | string;
|
79
82
|
/** 对返回值的 data,total 进行映射处理 */
|
80
|
-
formatResult?: TDataService | ((res: any) => TDataService);
|
83
|
+
formatResult?: TDataService | ((res: any) => TDataService) | string;
|
81
84
|
/** 请求成功后经过 formatResult 转换后的回调 */
|
82
85
|
onFormatResult?: (data: any[]) => void;
|
83
86
|
/** 是否第一次加载时就发起请求 */
|
@@ -86,6 +89,8 @@ export declare type ProTableProps = {
|
|
86
89
|
onSuccess?: (res: any) => void;
|
87
90
|
/** 内部请求失败时的回调 */
|
88
91
|
onError?: (error: Error) => void;
|
92
|
+
/** 自定义的请求配置 */
|
93
|
+
requestConfig?: AxiosRequestConfig;
|
89
94
|
/** 翻页页数的请求参数名 */
|
90
95
|
pageKey?: string;
|
91
96
|
/** 翻页器页数对应字段 */
|
@@ -126,7 +131,15 @@ export declare type ProTableProps = {
|
|
126
131
|
/** 非全屏模式下是否吸底 默认状态下取用 ProPageContainer 作为参照物。如果传入了 Dom,则取用 Dom 作为参照物 */
|
127
132
|
footerSuction?: boolean | Element;
|
128
133
|
/** 当满足条件时开启自动刷新,返回值为自动刷新间隔时间,如果返回 0 或 false 则停止自动刷新,每次触发翻页、搜索都将重置时间 */
|
129
|
-
autoRefresh?: (dataSource: any[]) => number | boolean;
|
134
|
+
autoRefresh?: ((dataSource: any[]) => number | boolean) | boolean;
|
135
|
+
/** 自动刷新配置 */
|
136
|
+
autoRefreshProps?: {
|
137
|
+
/** 可选间隔列表 **/
|
138
|
+
dataSource?: {
|
139
|
+
label?: React.ReactNode;
|
140
|
+
value?: number;
|
141
|
+
}[];
|
142
|
+
};
|
130
143
|
/** 自定义请求方法,必需返回 success,data 字段,如果需要手动分页 total 也是必需的 */
|
131
144
|
customRequest?: (params: any) => Promise<{
|
132
145
|
success: boolean;
|
@@ -145,6 +158,20 @@ export declare type ProTableProps = {
|
|
145
158
|
context?: any;
|
146
159
|
/** 是否固定表格主体(开启后横向滚动条会固定在底部) */
|
147
160
|
fixedTableBody?: boolean;
|
161
|
+
/** 用于埋点 */
|
162
|
+
'data-teamix-spm'?: string;
|
163
|
+
/** 是否切换卡片视角 **/
|
164
|
+
switchCardView?: boolean;
|
165
|
+
/** 卡片视角配置 **/
|
166
|
+
cardViewProps?: ProTableCardProps;
|
167
|
+
/** 默认展示维度 **/
|
168
|
+
defaultView?: 'table' | 'card';
|
169
|
+
/** 空状态配置 **/
|
170
|
+
emptyProps?: EmptyContentProps;
|
171
|
+
/** 是否绑定 url **/
|
172
|
+
bindUrl?: boolean;
|
173
|
+
/** 绑定 url 配置 **/
|
174
|
+
bindUrlProps?: ProTableBindUrlProps;
|
148
175
|
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
149
176
|
export declare type rowSelectionType = {
|
150
177
|
getProps?: (record: any, index: number) => any;
|
@@ -201,6 +228,7 @@ export declare type ProTableActionType = {
|
|
201
228
|
};
|
202
229
|
/** 重置翻页器为1,不发送请求 */
|
203
230
|
resetPage?: () => void;
|
231
|
+
nextPage?: () => void;
|
204
232
|
/** 获取数据过滤区表单实例 */
|
205
233
|
dataFilterForm?: ProFormType;
|
206
234
|
/** 用于在 mount 的时候获取到表单 ref */
|
@@ -210,6 +238,15 @@ export declare type ProTableActionType = {
|
|
210
238
|
filterEnableRef?: any;
|
211
239
|
/** 表格当前的数据 */
|
212
240
|
data?: any[];
|
241
|
+
/** 切换视角 **/
|
242
|
+
switchView?: (view: 'card' | 'table') => void;
|
243
|
+
/** 设置数据源 **/
|
244
|
+
setData?: (data: any[]) => void;
|
245
|
+
setCardViewScrollPosition?: (scrollTop: number) => void;
|
246
|
+
/** 刷新定时器间隔时间 */
|
247
|
+
setAutoRefreshTimers?: (timers: number) => void;
|
248
|
+
/** 清除刷新定时器 */
|
249
|
+
clearAutoRefreshTimers?: () => void;
|
213
250
|
} & ProTableActionTypeMutations;
|
214
251
|
/** action State 定义 */
|
215
252
|
export declare type ProTableActionTypeMutations = {
|
@@ -256,6 +293,8 @@ export declare type ProTableTopAreaProps = {
|
|
256
293
|
mainAction?: ProActionGroupProps | React.ReactNode;
|
257
294
|
/** 工具栏区 */
|
258
295
|
toolBar?: boolean | ProTableToolBarItem[];
|
296
|
+
/** 是否开启工具栏自适应 */
|
297
|
+
toolBarAutoWidth?: boolean;
|
259
298
|
/** 快捷操作区 */
|
260
299
|
extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
|
261
300
|
/** 数据过滤区 */
|
@@ -274,6 +313,14 @@ export declare type ProTableLayoutProps = {
|
|
274
313
|
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
275
314
|
columns?: ProTableColumnProps[];
|
276
315
|
rowSelection?: innerRowSelectionType | rowSelectionType;
|
316
|
+
fullScreenState?: boolean;
|
317
|
+
dataTeamixSpm?: string;
|
318
|
+
switchCardView?: boolean;
|
319
|
+
defaultView?: 'table' | 'card';
|
320
|
+
autoRefresh?: ProTableProps['autoRefresh'];
|
321
|
+
autoRefreshProps?: ProTableProps['autoRefreshProps'];
|
322
|
+
bindUrl?: ProTableProps['bindUrl'];
|
323
|
+
bindUrlProps?: ProTableProps['bindUrlProps'];
|
277
324
|
} & ProTableTopAreaProps;
|
278
325
|
/** columns 列过滤 */
|
279
326
|
export declare type ProTableColumnsFilterItemProps = {
|
@@ -296,4 +343,76 @@ export declare type parentPositionProps = {
|
|
296
343
|
offsetLeft: number;
|
297
344
|
offsetRight: number;
|
298
345
|
};
|
346
|
+
/** card props **/
|
347
|
+
export declare type ProTableCardProps = {
|
348
|
+
/** 标题 dataIndex **/
|
349
|
+
title?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps) | ((index: number, record: any) => ProTableColumnProps['dataIndex'] | ProTableColumnProps);
|
350
|
+
/** 副标题 dataIndex **/
|
351
|
+
subTitle?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps) | ((index: number, record: any) => ProTableColumnProps['dataIndex'] | ProTableColumnProps);
|
352
|
+
/** 内容区域 dataIndex **/
|
353
|
+
content?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[] | ((index: number, record: any) => (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[]);
|
354
|
+
/** extra 区域 **/
|
355
|
+
extra?: (ProActionGroupProps | React.ReactNode | ProTableColumnProps['dataIndex'])[] | ((index: number, record: any) => (ProActionGroupProps | React.ReactNode | ProTableColumnProps['dataIndex'])[]);
|
356
|
+
/** 标签区域 **/
|
357
|
+
tags?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[] | ((index: number, record: any) => (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[]);
|
358
|
+
/** 分页器条数 **/
|
359
|
+
pageSize?: 12 | 24 | 48 | 96 | number;
|
360
|
+
/** 卡片区域滚动高度 **/
|
361
|
+
scrollHeight?: number | string;
|
362
|
+
/** 自动加载下一页 **/
|
363
|
+
autoLoadNextPage?: boolean;
|
364
|
+
/** 滚动容器 用于监听触底事件 **/
|
365
|
+
scrollDom?: HTMLElement;
|
366
|
+
/** 触底事件 **/
|
367
|
+
onScrollBottom?: () => void;
|
368
|
+
/** 使用表格分页 **/
|
369
|
+
useTablePagination?: boolean;
|
370
|
+
/** 使用响应式 **/
|
371
|
+
cardResponsiveProps?: {
|
372
|
+
xxs?: number;
|
373
|
+
xs?: number;
|
374
|
+
s?: number;
|
375
|
+
m?: number;
|
376
|
+
l?: number;
|
377
|
+
xl?: number;
|
378
|
+
};
|
379
|
+
/** 卡片配置 **/
|
380
|
+
cardProps?: {
|
381
|
+
[key in keyof ProCardProps]?: ProCardProps[key] | ((index: number, record: any) => ProCardProps[key]);
|
382
|
+
};
|
383
|
+
/** 是否展示卡片骨架 **/
|
384
|
+
showSkeleton?: boolean;
|
385
|
+
};
|
386
|
+
/** card 视角 Props (内部组件) **/
|
387
|
+
export declare type ProTableCardViewProps = {
|
388
|
+
/** 卡片视角配置 **/
|
389
|
+
cardViewProps?: ProTableCardProps;
|
390
|
+
/** 数据源 **/
|
391
|
+
dataSource?: any[];
|
392
|
+
/** 原始 columns **/
|
393
|
+
originColumns?: any[];
|
394
|
+
/** 处理过后的 columns **/
|
395
|
+
columns?: any[];
|
396
|
+
/** 加载动画 **/
|
397
|
+
loading?: boolean;
|
398
|
+
/** 上下文 **/
|
399
|
+
context?: any;
|
400
|
+
actionRef?: React.MutableRefObject<ProTableActionType | undefined>;
|
401
|
+
/** 卡片区域滚动高度 **/
|
402
|
+
scrollHeight?: number | string;
|
403
|
+
/** 骨架屏状态 **/
|
404
|
+
showSkeleton?: boolean;
|
405
|
+
/** ProCard 卡片配置 **/
|
406
|
+
cardProps?: ProTableCardProps['cardProps'];
|
407
|
+
/** 表格分页器参数 **/
|
408
|
+
tablePaginationProps?: PaginationProps;
|
409
|
+
};
|
410
|
+
export declare type ProTableBindUrlProps = {
|
411
|
+
/** 翻页器区域 **/
|
412
|
+
pagination?: boolean;
|
413
|
+
/** 搜索区域 **/
|
414
|
+
filters?: boolean;
|
415
|
+
/** 表格标题过滤器区域 **/
|
416
|
+
headerFilters?: boolean;
|
417
|
+
};
|
299
418
|
export {};
|
@@ -2,12 +2,12 @@
|
|
2
2
|
* 渲染列的逻辑函数
|
3
3
|
*/
|
4
4
|
import React from 'react';
|
5
|
-
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
5
|
+
import { ProTableColumnProps, ProTableActionType, ProTableProps } from '../typing';
|
6
6
|
/**
|
7
7
|
* 增加了 icon 的功能 render title
|
8
8
|
*/
|
9
|
-
export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined
|
9
|
+
export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined>, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']) => JSX.Element;
|
10
10
|
/**
|
11
11
|
* 负责单元格的具体渲染
|
12
12
|
*/
|
13
|
-
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any) => JSX.Element;
|
13
|
+
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string) => JSX.Element;
|
@@ -1,29 +1,16 @@
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
-
|
3
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
-
|
5
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
-
|
7
4
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
8
|
-
|
9
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
|
-
|
11
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
12
|
-
|
13
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
14
|
-
|
15
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16
|
-
|
17
9
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
18
|
-
|
19
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
20
|
-
|
21
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
22
|
-
|
23
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
24
|
-
|
25
13
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
26
|
-
|
27
14
|
/**
|
28
15
|
* 渲染列的逻辑函数
|
29
16
|
*/
|
@@ -35,36 +22,28 @@ import Filter from '../components/Filter';
|
|
35
22
|
/**
|
36
23
|
* 增加了 icon 的功能 render title
|
37
24
|
*/
|
38
|
-
|
39
|
-
export var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
25
|
+
export var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bindUrl, bindUrlProps) {
|
40
26
|
var filterMode = item.filterMode,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
27
|
+
filters = item.filters,
|
28
|
+
dataSource = item.dataSource,
|
29
|
+
dataIndex = item.dataIndex,
|
30
|
+
valueType = item.valueType;
|
31
|
+
// 为列过滤添加状态标题
|
46
32
|
var getItemLabel = function getItemLabel() {
|
47
33
|
if (filters && filterMode !== 'multiple') {
|
48
34
|
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2;
|
49
|
-
|
50
35
|
var selectedItem = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : _actionRef$current$ge2.call(_actionRef$current).filterRules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
51
|
-
|
52
36
|
if (Object.keys(selectedItem).length > 0) {
|
53
37
|
var _selectedItem$dataInd;
|
54
|
-
|
55
38
|
if ((_selectedItem$dataInd = selectedItem[dataIndex]) === null || _selectedItem$dataInd === void 0 ? void 0 : _selectedItem$dataInd.params) {
|
56
39
|
var _targetFilters$find;
|
57
|
-
|
58
40
|
// 找到对应的 label
|
59
41
|
var targetFilters = filters !== null && filters !== void 0 ? filters : [];
|
60
|
-
|
61
42
|
if (filters === true) {
|
62
43
|
targetFilters = dataSource !== null && dataSource !== void 0 ? dataSource : [];
|
63
44
|
}
|
64
|
-
|
65
45
|
var label = (_targetFilters$find = targetFilters.find(function (item) {
|
66
46
|
var _selectedItem$dataInd2;
|
67
|
-
|
68
47
|
return item.value === ((_selectedItem$dataInd2 = selectedItem[dataIndex]) === null || _selectedItem$dataInd2 === void 0 ? void 0 : _selectedItem$dataInd2.params);
|
69
48
|
})) === null || _targetFilters$find === void 0 ? void 0 : _targetFilters$find.label;
|
70
49
|
var value = "".concat(item.title, " (").concat(label, ")");
|
@@ -82,7 +61,6 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
82
61
|
}
|
83
62
|
}
|
84
63
|
}
|
85
|
-
|
86
64
|
return /*#__PURE__*/React.createElement(ProField, {
|
87
65
|
style: {
|
88
66
|
display: 'inline-flex'
|
@@ -95,37 +73,36 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
95
73
|
}
|
96
74
|
});
|
97
75
|
};
|
98
|
-
|
99
76
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelIconTip, {
|
100
77
|
label: item.title,
|
101
78
|
tooltip: item.tooltip,
|
102
79
|
icon: item.tooltipIcon
|
103
80
|
}), item.filters && /*#__PURE__*/React.createElement(Filter, {
|
104
81
|
column: item,
|
105
|
-
actionRef: actionRef
|
82
|
+
actionRef: actionRef,
|
83
|
+
bindUrl: bindUrl,
|
84
|
+
bindUrlProps: bindUrlProps
|
106
85
|
}));
|
107
86
|
};
|
108
87
|
/**
|
109
88
|
* 负责单元格的具体渲染
|
110
89
|
*/
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
90
|
+
export var renderCell = function renderCell(value, item, index, record, actionRef, /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
91
|
+
context,
|
92
|
+
// 用于埋点
|
93
|
+
dataTeamixSpm) {
|
115
94
|
var _actionSchema$actions;
|
116
|
-
|
117
95
|
var _item$valueType = item.valueType,
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
96
|
+
valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
|
97
|
+
render = item.render,
|
98
|
+
actionSchema = item.actionSchema,
|
99
|
+
dataIndex = item.dataIndex,
|
100
|
+
format = item.format;
|
101
|
+
// 如果没传 dataIndex,返回 null
|
124
102
|
if (!dataIndex) {
|
125
103
|
value = null;
|
126
|
-
}
|
127
|
-
|
128
|
-
|
104
|
+
}
|
105
|
+
// 处理 dataIndex 为数组的情况
|
129
106
|
if (Array.isArray(dataIndex)) {
|
130
107
|
value = dataIndex.map(function (item) {
|
131
108
|
return getTargetValue("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
@@ -133,18 +110,16 @@ context) {
|
|
133
110
|
}));
|
134
111
|
});
|
135
112
|
}
|
136
|
-
|
137
113
|
var newRender = null;
|
138
114
|
var newDataSource = null;
|
139
|
-
var props = item.props;
|
140
|
-
|
115
|
+
var props = item.props;
|
116
|
+
// 如果 render 直接传函数
|
141
117
|
if (typeof render === 'function') {
|
142
118
|
newRender = function newRender() {
|
143
119
|
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
144
120
|
};
|
145
121
|
} else {
|
146
122
|
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
147
|
-
|
148
123
|
if (valueType === 'selectGroup') {
|
149
124
|
newRender = _objectSpread(_objectSpread({
|
150
125
|
maxShowNumber: 'auto',
|
@@ -161,15 +136,13 @@ context) {
|
|
161
136
|
}
|
162
137
|
}, props);
|
163
138
|
}
|
164
|
-
|
165
139
|
if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
|
166
140
|
newRender = _objectSpread(_objectSpread({}, newRender), {}, {
|
167
141
|
ellipsis: false
|
168
142
|
});
|
169
143
|
}
|
170
|
-
}
|
171
|
-
|
172
|
-
|
144
|
+
}
|
145
|
+
// 渲染操作组
|
173
146
|
if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
|
174
147
|
// 默认 context
|
175
148
|
var defaultContext = _objectSpread({
|
@@ -178,28 +151,24 @@ context) {
|
|
178
151
|
record: record,
|
179
152
|
action: actionRef.current
|
180
153
|
}, context);
|
181
|
-
|
182
154
|
return /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({
|
183
155
|
type: "text"
|
184
156
|
}, actionSchema), {}, {
|
185
|
-
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
157
|
+
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context),
|
158
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-columnAction") : undefined
|
186
159
|
}));
|
187
|
-
}
|
188
|
-
|
189
|
-
|
160
|
+
}
|
161
|
+
// dataSource可传函数
|
190
162
|
if (typeof item.dataSource === 'function') {
|
191
163
|
var _item$dataSource;
|
192
|
-
|
193
164
|
newDataSource = (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.call(item, value, index, record);
|
194
165
|
} else {
|
195
166
|
var _item$dataSource2;
|
196
|
-
|
197
167
|
newDataSource = ((_item$dataSource2 = item.dataSource) !== null && _item$dataSource2 !== void 0 ? _item$dataSource2 : []).map(function (item) {
|
198
168
|
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
199
169
|
var _ref2 = _slicedToArray(_ref, 2),
|
200
|
-
|
201
|
-
|
202
|
-
|
170
|
+
k = _ref2[0],
|
171
|
+
v = _ref2[1];
|
203
172
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
204
173
|
record: record,
|
205
174
|
value: value,
|
@@ -207,9 +176,8 @@ context) {
|
|
207
176
|
}))];
|
208
177
|
}));
|
209
178
|
});
|
210
|
-
}
|
211
|
-
|
212
|
-
|
179
|
+
}
|
180
|
+
// 渲染 ProField
|
213
181
|
return /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
214
182
|
type: valueType || 'text',
|
215
183
|
value: value,
|
@@ -226,7 +194,6 @@ context) {
|
|
226
194
|
* @param record table cell record
|
227
195
|
* @returns
|
228
196
|
*/
|
229
|
-
|
230
197
|
var processRenderFunction = function processRenderFunction() {
|
231
198
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
232
199
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -236,25 +203,20 @@ var processRenderFunction = function processRenderFunction() {
|
|
236
203
|
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
237
204
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
238
205
|
var _ref4 = _slicedToArray(_ref3, 2),
|
239
|
-
|
240
|
-
|
241
|
-
|
206
|
+
k = _ref4[0],
|
207
|
+
v = _ref4[1];
|
242
208
|
if (typeof v === 'function') {
|
243
209
|
var _v;
|
244
|
-
|
245
210
|
if (external.includes(k)) {
|
246
211
|
return [k, function () {
|
247
212
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
248
213
|
others[_key] = arguments[_key];
|
249
214
|
}
|
250
|
-
|
251
215
|
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, index, record].concat(others));
|
252
216
|
}];
|
253
217
|
}
|
254
|
-
|
255
218
|
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, index, record)) !== null && _v !== void 0 ? _v : ''];
|
256
219
|
}
|
257
|
-
|
258
220
|
return [k, v];
|
259
221
|
}));
|
260
222
|
};
|
@@ -264,20 +226,18 @@ var processRenderFunction = function processRenderFunction() {
|
|
264
226
|
* @param record table cell record
|
265
227
|
* @returns
|
266
228
|
*/
|
267
|
-
|
268
|
-
|
269
229
|
var processBuriedPoint = function processBuriedPoint() {
|
270
230
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
271
231
|
var record = arguments.length > 1 ? arguments[1] : undefined;
|
272
232
|
var value = arguments.length > 2 ? arguments[2] : undefined;
|
273
233
|
var index = arguments.length > 3 ? arguments[3] : undefined;
|
274
|
-
return Object.fromEntries([
|
234
|
+
return Object.fromEntries([
|
235
|
+
// 默认 ellipsis、descriptionEllipsis 为 true
|
275
236
|
// emptyText 默认为 '-'
|
276
237
|
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
277
238
|
var _ref6 = _slicedToArray(_ref5, 2),
|
278
|
-
|
279
|
-
|
280
|
-
|
239
|
+
k = _ref6[0],
|
240
|
+
v = _ref6[1];
|
281
241
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
282
242
|
record: record,
|
283
243
|
value: value,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
2
|
+
import { ProTableColumnProps, ProTableActionType, ProTableProps } from '../typing';
|
3
3
|
import { ColumnProps } from '@alicloudfe/components/types/table';
|
4
4
|
declare type FixedColumnProps = ColumnProps & {
|
5
5
|
wordBreak?: string;
|
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
|
|
9
9
|
*/
|
10
10
|
export default function genProColumnToColumn(columns: ProTableColumnProps[],
|
11
11
|
/** 是否渲染骨架屏 */
|
12
|
-
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any): FixedColumnProps[];
|
12
|
+
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
|
13
13
|
export {};
|
@@ -1,15 +1,9 @@
|
|
1
|
-
var _excluded = ["filters", "dataIndex"];
|
2
|
-
|
1
|
+
var _excluded = ["filters", "dataIndex", "children"];
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
|
-
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
|
-
|
7
4
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
-
|
9
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
-
|
11
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
-
|
13
7
|
import React from 'react';
|
14
8
|
import { renderColumnsTitle, renderCell } from './columnRender';
|
15
9
|
import { ProSkeletonRaw as Skeleton } from '../../skeleton';
|
@@ -17,16 +11,19 @@ import { getLanguage } from '@teamix/utils';
|
|
17
11
|
/**
|
18
12
|
* ProColumn => Column
|
19
13
|
*/
|
20
|
-
|
21
|
-
export default function genProColumnToColumn(columns,
|
22
|
-
/** 是否渲染骨架屏 */
|
14
|
+
export default function genProColumnToColumn(columns, /** 是否渲染骨架屏 */
|
23
15
|
showSkeleton, actionRef) {
|
24
16
|
var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
17
|
+
var
|
18
|
+
// 用于埋点
|
19
|
+
dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
|
20
|
+
var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
|
21
|
+
var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
|
25
22
|
return columns.map(function (columnProps) {
|
26
23
|
var filters = columnProps.filters,
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
dataIndex = columnProps.dataIndex,
|
25
|
+
children = columnProps.children,
|
26
|
+
others = _objectWithoutProperties(columnProps, _excluded);
|
30
27
|
if (showSkeleton) {
|
31
28
|
return _objectSpread(_objectSpread({}, others), {}, {
|
32
29
|
filters: undefined,
|
@@ -38,16 +35,16 @@ showSkeleton, actionRef) {
|
|
38
35
|
}
|
39
36
|
});
|
40
37
|
}
|
41
|
-
|
42
38
|
return _objectSpread(_objectSpread({
|
43
39
|
// 金钱样式默认右对齐
|
44
40
|
align: columnProps.valueType === 'money' ? 'right' : 'left',
|
45
41
|
wordBreak: getLanguage() === 'en-us' ? 'word' : 'all'
|
46
42
|
}, others), {}, {
|
43
|
+
children: children ? genProColumnToColumn(children, showSkeleton, actionRef, context) : undefined,
|
47
44
|
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
48
|
-
title: renderColumnsTitle(columnProps, actionRef),
|
45
|
+
title: renderColumnsTitle(columnProps, actionRef, bindUrl, bindUrlProps),
|
49
46
|
cell: function cell(value, index, record) {
|
50
|
-
return renderCell(value, columnProps, index, record, actionRef, context);
|
47
|
+
return renderCell(value, columnProps, index, record, actionRef, context, dataTeamixSpm);
|
51
48
|
}
|
52
49
|
});
|
53
50
|
});
|