@lingxiteam/ebe-utils 0.2.22 → 0.2.23

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.
Files changed (144) hide show
  1. package/lib/h5public/yarn.lock +7 -8
  2. package/lib/pcpublic/src/components/pcfactory/src/Button/index.tsx +11 -10
  3. package/lib/pcpublic/src/components/pcfactory/src/Card/CardTitle/index.tsx +31 -24
  4. package/lib/pcpublic/src/components/pcfactory/src/Card/index.tsx +32 -14
  5. package/lib/pcpublic/src/components/pcfactory/src/Card/useExtendBtn.tsx +85 -48
  6. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/ChartLine.tsx +24 -6
  7. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/PropsType.ts +31 -5
  8. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/index.tsx +3 -2
  9. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/loader.tsx +1 -1
  10. package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +153 -129
  11. package/lib/pcpublic/src/components/pcfactory/src/Form/index.tsx +2 -5
  12. package/lib/pcpublic/src/components/pcfactory/src/Form/useFormStatus.ts +8 -4
  13. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +15 -3
  14. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/PropsType.ts +4 -3
  15. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/index.tsx +1 -1
  16. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/loader.tsx +1 -1
  17. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +18 -4
  18. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/PropsType.ts +2 -1
  19. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/index.tsx +1 -1
  20. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/loader.tsx +1 -1
  21. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +7 -2
  22. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +60 -26
  23. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +62 -55
  24. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +2 -6
  25. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +5 -5
  26. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/index.tsx +9 -2
  27. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/loader.ts +1 -1
  28. package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +145 -66
  29. package/lib/pcpublic/src/components/pcfactory/src/Select/selectUtils.ts +13 -9
  30. package/lib/pcpublic/src/components/pcfactory/src/Table/BodyCell/index.tsx +36 -26
  31. package/lib/pcpublic/src/components/pcfactory/src/Table/EditComponent/index.tsx +69 -94
  32. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +12 -5
  33. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +9 -5
  34. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +11 -5
  35. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +11 -5
  36. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +14 -7
  37. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Thumbnail/index.tsx +30 -31
  38. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/index.tsx +89 -41
  39. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +25 -12
  40. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/index.tsx +12 -5
  41. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/PopoverWrapper.tsx +220 -0
  42. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/SingleBtn.tsx +39 -32
  43. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/index.tsx +178 -148
  44. package/lib/pcpublic/src/components/pcfactory/src/Table/Table.tsx +439 -0
  45. package/lib/pcpublic/src/components/pcfactory/src/Table/TableHead/index.tsx +159 -72
  46. package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +12 -20
  47. package/lib/pcpublic/src/components/pcfactory/src/Table/constant.ts +3 -0
  48. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/index.ts +4 -4
  49. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +32 -28
  50. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +44 -57
  51. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +306 -276
  52. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCommon.ts +9 -6
  53. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useDataSource.ts +30 -21
  54. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +33 -27
  55. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFilter.tsx +84 -77
  56. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.tsx +33 -16
  57. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/usePagination.ts +15 -5
  58. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +33 -33
  59. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +13 -5
  60. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useScroll.ts +94 -28
  61. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +108 -99
  62. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSort.ts +8 -5
  63. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +27 -43
  64. package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +73 -394
  65. package/lib/pcpublic/src/components/pcfactory/src/Table/loader.tsx +15 -0
  66. package/lib/pcpublic/src/components/pcfactory/src/Table/types/OperationCell.d.ts +2 -2
  67. package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +12 -8
  68. package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +2 -1
  69. package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +24 -11
  70. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/SequenceId.ts +2 -1
  71. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +90 -82
  72. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +9 -22
  73. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/translate.ts +59 -0
  74. package/lib/pcpublic/src/components/pcfactory/src/Transfer/Transfer.tsx +644 -0
  75. package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +49 -637
  76. package/lib/pcpublic/src/components/pcfactory/src/Transfer/loader.tsx +11 -0
  77. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeEllipsisIcon.tsx +38 -0
  78. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +34 -35
  79. package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +213 -149
  80. package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +47 -43
  81. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/TreeTable.tsx +264 -0
  82. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -1
  83. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +9 -3
  84. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +9 -3
  85. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +52 -191
  86. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/loader.tsx +16 -0
  87. package/lib/pcpublic/src/components/pcfactory/src/assets/index.tsx +34 -0
  88. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/quadrate.tsx +20 -0
  89. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/roundness.tsx +14 -0
  90. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/semicircle.tsx +15 -0
  91. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/verticalLine.tsx +12 -0
  92. package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +17 -0
  93. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Card.less +57 -11
  94. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +101 -12
  95. package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +6 -0
  96. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Select.less +70 -6
  97. package/lib/pcpublic/src/components/pcfactory/src/utils/ChannelContainer.tsx +20 -14
  98. package/lib/pcpublic/src/components/pcfactory/src/utils/ChildRender.ts +6 -8
  99. package/lib/pcpublic/src/components/pcfactory/src/utils/CustomModule.tsx +4 -6
  100. package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +9 -13
  101. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +5 -17
  102. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +3 -3
  103. package/lib/pcpublic/src/components/pcfactory/src/utils/Holidays.ts +11 -39
  104. package/lib/pcpublic/src/components/pcfactory/src/utils/HolidaysFormat.ts +83 -0
  105. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/index.tsx +47 -0
  106. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/scheduler.ts +74 -0
  107. package/lib/pcpublic/src/components/pcfactory/src/utils/LoaderHelper.tsx +4 -1
  108. package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +8 -7
  109. package/lib/pcpublic/src/components/pcfactory/src/utils/WithSyncValue.ts +25 -23
  110. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/index.ts +10 -7
  111. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMap.ts +9 -6
  112. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +4 -1
  113. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/usePersistFn.ts +17 -0
  114. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +2 -2
  115. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSetState.ts +7 -5
  116. package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +23 -50
  117. package/lib/pcpublic/src/components/pcfactory/src/utils/constant.ts +53 -57
  118. package/lib/pcpublic/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +12 -17
  119. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +22 -12
  120. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +50 -19
  121. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +58 -37
  122. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +33 -30
  123. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +2 -0
  124. package/lib/pcpublic/src/components/pcfactory/src/utils/generatorDisabledCallback.ts +121 -113
  125. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +16 -14
  126. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +1 -1
  127. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDataMask.ts +7 -2
  128. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +3 -1
  129. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +16 -14
  130. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +9 -3
  131. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +4 -5
  132. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInit.ts +11 -0
  133. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +3 -1
  134. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useListenState.ts +1 -0
  135. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +5 -3
  136. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +2 -2
  137. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useRules.ts +1 -1
  138. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +2 -0
  139. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +8 -4
  140. package/lib/pcpublic/src/components/pcfactory/src/utils/index.ts +10 -10
  141. package/lib/pcpublic/src/components/pcfactory/src/utils/polyfill.js +29 -31
  142. package/lib/pcpublic/src/components/pcfactory/src/utils/renderReadOnly.tsx +29 -26
  143. package/lib/public/public/iconfont.js +1 -0
  144. package/package.json +2 -2
@@ -1,44 +1,32 @@
1
- /* eslint-disable no-nested-ternary */
2
- /* eslint-disable eqeqeq */
3
- /* eslint-disable array-callback-return */
4
- /* eslint-disable no-param-reassign */
5
- /* eslint-disable no-underscore-dangle */
6
- import { Form, Table } from 'antd';
7
- import classnames from 'classnames';
8
- import React, { useMemo, useRef } from 'react';
9
- import BodyCell from '../Table/BodyCell';
10
- import HeaderCell from '../Table/HeaderCell';
11
- import { useColumns, useCommon, useDataSource, useRowEdit, useScroll, useSelection } from '../Table/hooks';
12
- import TableHead from '../Table/TableHead';
13
- import type { MyTableProps } from '../Table/types/prop';
14
- import { useCreation } from '../utils/ahooks';
15
- import EmptyComp from '../utils/Empty';
1
+ import React from 'react';
2
+ import { LingxiForwardRef } from '@lingxiteam/types';
3
+ import { useCommon, useDataSource, useSelection } from '../Table/hooks';
16
4
  import { useFuncExpExecute } from '../utils/hooks/useFuncExpExecute';
17
5
  import { useLocale } from '../utils/hooks/useLocale';
18
6
  import { useCMDAction, useExpandable } from './hooks';
7
+ import TableLoader from './loader';
8
+ import IdleContainer from '../utils/IdleContainer';
19
9
 
20
- const TreeTable = React.forwardRef<any, MyTableProps>((props, ref) => {
21
- const { dataSource: boundDataSource, visible = true, style: styles, className, onChange, $$componentItem, getEngineApis, ...restProps } = props;
10
+ const Table = LingxiForwardRef<unknown, any>((props, ref) => {
11
+ const { dataSource: boundDataSource, $$componentItem, getEngineApis } = props;
22
12
 
23
13
  const { uid: compId } = $$componentItem;
24
- const [form] = Form.useForm();
25
-
26
14
  const engineApis = getEngineApis?.();
27
- const { sandBoxSafeRun, dataState } = engineApis || {};
15
+ const { sandBoxSafeRun } = engineApis || {};
28
16
 
29
17
  const { getLocale } = useLocale(engineApis);
30
18
 
31
19
  const funcExpExecute = useFuncExpExecute(sandBoxSafeRun as any, getLocale);
32
20
 
33
- const appId = props?.appId || $$componentItem?.appId;
34
- const pageId = props?.pageId || $$componentItem?.pageId;
35
-
36
- const { currentRowKey, isBordered, innerClassName, setReplaceBoundDataSource, outerDataSource, outerDataSourceRef } = useCommon({
37
- ...props,
38
- boundDataSource,
39
- });
21
+ const commonProps = useCommon({ ...props, boundDataSource });
22
+ const {
23
+ currentRowKey,
24
+ setReplaceBoundDataSource,
25
+ outerDataSource,
26
+ outerDataSourceRef,
27
+ } = commonProps;
40
28
 
41
- const { innerDataSource, setInnerDataSource, setOuterDataSource, currentPageDataSource } = useDataSource({
29
+ const dataSourceProps = useDataSource({
42
30
  ...props,
43
31
  compId,
44
32
  currentRowKey,
@@ -47,52 +35,30 @@ const TreeTable = React.forwardRef<any, MyTableProps>((props, ref) => {
47
35
  outerDataSource,
48
36
  outerDataSourceRef,
49
37
  });
38
+ const {
39
+ innerDataSource,
40
+ setInnerDataSource,
41
+ setOuterDataSource,
42
+ currentPageDataSource,
43
+ } = dataSourceProps;
50
44
 
51
- // 根据id获取真实的下标,避免过滤和排序后影响下标
52
- const { getRealIndexById } = useCreation(() => {
53
- const indexMap = new Map<string | number, number>();
54
- return {
55
- getRealIndexById: (id: string | number) => {
56
- if (indexMap.has(id)) {
57
- return indexMap.get(id);
58
- }
59
- const index = (innerDataSource || []).findIndex((c: any) => c[currentRowKey] === id);
60
- if (index !== -1) {
61
- indexMap.set(id, index);
62
- }
63
- return index;
64
- },
65
- };
66
- }, [innerDataSource, currentRowKey]);
67
-
68
- const { rowSelection, selectedRows, selectedRowKeys, setSelectedRows, setSelectedRowKeys, setSelectedRowsRule, onRowSelected, onRowSelectClick } =
69
- useSelection({
70
- ...props,
71
- innerDataSource,
72
- currentRowKey,
73
- currentPageDataSource,
74
- funcExpExecute,
75
- });
76
-
77
- const { onRowDeleteClick, onRowEditClick, onRowDetailClick, onRowClick, onRowDoubleClick } = useRowEdit({
45
+ const selectionProps = useSelection({
78
46
  ...props,
79
- funcExpExecute,
80
47
  innerDataSource,
81
- outerDataSource,
82
- setInnerDataSource,
83
48
  currentRowKey,
49
+ currentPageDataSource,
50
+ funcExpExecute,
51
+ });
52
+ const {
84
53
  selectedRows,
54
+ selectedRowKeys,
55
+ setSelectedRows,
56
+ setSelectedRowKeys,
57
+ setSelectedRowsRule,
85
58
  onRowSelected,
86
- engineApis,
87
- });
59
+ } = selectionProps;
88
60
 
89
- const {
90
- expandable: realExpandable,
91
- childrenColumnName,
92
- setChildrenColumnName,
93
- setMode,
94
- expandTableData,
95
- } = useExpandable({
61
+ const expandProps = useExpandable({
96
62
  ...props,
97
63
  dataSource: innerDataSource,
98
64
  innerDataSource,
@@ -103,8 +69,14 @@ const TreeTable = React.forwardRef<any, MyTableProps>((props, ref) => {
103
69
  engineApis,
104
70
  isTree: true,
105
71
  });
72
+ const {
73
+ childrenColumnName,
74
+ setChildrenColumnName,
75
+ setMode,
76
+ expandTableData,
77
+ } = expandProps;
106
78
 
107
- const { loading, colServiceData } = useCMDAction({
79
+ const cmdProps = useCMDAction({
108
80
  ref,
109
81
  currentRowKey,
110
82
  childrenColumnName,
@@ -123,129 +95,18 @@ const TreeTable = React.forwardRef<any, MyTableProps>((props, ref) => {
123
95
  expandTableData,
124
96
  });
125
97
 
126
- const { tableRef, finalcolumns, columnWidth, setColumnWidth, initLoadColWidth, fixedAction } = useColumns({
127
- ...props,
128
- sandBoxSafeRun,
129
- funcExpExecute,
130
- engineApis,
131
- form,
132
- appId,
133
- pageId,
134
- compId,
135
- innerDataSource,
136
- currentRowKey,
137
- colServiceData,
138
- onRowDetailClick,
139
- onRowDeleteClick,
140
- onRowEditClick,
141
- loading,
142
- rowSelection,
143
- getLocale,
144
- getRealIndexById,
145
- });
146
-
147
- const { scroll, tableWrapRef, initTableWrapWidthRef, getTableWrapWidth } = useScroll({
148
- ...props,
149
- initLoadColWidth,
150
- finalcolumns,
151
- columnWidth,
152
- setColumnWidth,
153
- });
154
-
155
- const superSelectTranslationMapRef: any = useRef(); // 防止state更新不及时,导致翻译无法获取翻译数据
156
- if (!superSelectTranslationMapRef.current) {
157
- superSelectTranslationMapRef.current = {};
158
- }
159
-
160
- const innerTableStyle: any = {};
161
- if (styles?.overflowY) {
162
- // 通过自定义样式给表格设置y轴滚动时, 认为希望只有表格滚动,但分页栏固定在底部
163
- innerTableStyle.overflowY = styles.overflowY;
164
- }
165
-
166
- const handleTableChange = (newPagination: any, newFilters: any, newSorter: any, newExtra: any) => {
167
- if (typeof onChange === 'function') {
168
- onChange(newPagination, newFilters, newSorter, newExtra);
169
- }
98
+ const innerProps = {
99
+ ...commonProps,
100
+ ...dataSourceProps,
101
+ ...selectionProps,
102
+ ...expandProps,
103
+ ...cmdProps,
170
104
  };
171
-
172
- // 表格宽度需要根据列宽度赋值
173
- const finalStyles = useMemo(() => {
174
- const tmpStyle = { ...styles };
175
- const tableWidth = getTableWrapWidth();
176
- if (tableWrapRef.current && tableWidth) {
177
- const realTableWidth = tableWidth >= initTableWrapWidthRef.current - 10 ? initTableWrapWidthRef.current - 9 : tableWidth;
178
- tmpStyle.width = `${realTableWidth}px`;
179
- }
180
- return tmpStyle;
181
- }, [columnWidth]);
182
-
183
- return visible ? (
184
- <div
185
- // appId={appId} // TODO:先注释,不知道什么场景用到
186
- // pageId={pageId} // TODO:先注释,不知道什么场景用到
187
- data-compid={(props as any)?.['data-compid']}
188
- style={finalStyles}
189
- className={classnames('ued-table-wrap', className)}
190
- ref={tableWrapRef}
191
- >
192
- <TableHead
193
- {...restProps} // 涉及到不确定的事件,所以要这么传
194
- source="engine"
195
- columns={[]}
196
- sandBoxSafeRun={sandBoxSafeRun}
197
- engineApis={engineApis}
198
- />
199
- <Form form={form}>
200
- <Table
201
- locale={{
202
- emptyText: <EmptyComp dataState={dataState} getLocale={getLocale} />,
203
- }}
204
- ref={tableRef}
205
- bordered={isBordered}
206
- className={innerClassName}
207
- style={innerTableStyle}
208
- components={{
209
- body: {
210
- cell: BodyCell,
211
- },
212
- header: {
213
- cell: (info: any) => <HeaderCell {...info} tableData={innerDataSource} childrenColumnName={realExpandable.childrenColumnName} />,
214
- },
215
- }}
216
- columns={finalcolumns.map((item, index) => {
217
- // 固定列最后一项宽度根据本身计算返回
218
- if (fixedAction && finalcolumns.length - 1 === index) {
219
- return item;
220
- }
221
- item.width = columnWidth[index] || item.width;
222
- return item;
223
- })}
224
- rowKey={currentRowKey}
225
- scroll={scroll}
226
- onChange={handleTableChange}
227
- onRow={(record, index?: number) => {
228
- return {
229
- onClick: event => {
230
- const hasOnRowClick = onRowClick(event, record, index);
231
- !hasOnRowClick && onRowSelectClick(record, index);
232
- }, // 点击行
233
- onDoubleClick: event => {
234
- onRowDoubleClick(event, record, index);
235
- },
236
- onContextMenu: event => {},
237
- onMouseEnter: event => {}, // 鼠标移入行
238
- onMouseLeave: event => {},
239
- };
240
- }}
241
- rowSelection={rowSelection}
242
- dataSource={innerDataSource}
243
- expandable={realExpandable}
244
- pagination={false}
245
- />
246
- </Form>
247
- </div>
248
- ) : null;
105
+ return (
106
+ <IdleContainer>
107
+ <TableLoader {...props} {...innerProps} />
108
+ </IdleContainer>
109
+ );
249
110
  });
250
111
 
251
- export default TreeTable;
112
+ export default Table;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import Loadable from 'react-loadable';
3
+ import { LoadingComponennt } from '../utils/LoaderHelper';
4
+
5
+
6
+ const TableLoader = Loadable<any, React.ComponentType<any>>({
7
+ loader: () => import(/* webpackChunkName: "pcfactory-TreeTable" */ './TreeTable'),
8
+ loading: LoadingComponennt,
9
+ });
10
+
11
+ export default TableLoader;
12
+
13
+
14
+ // import TreeTable from './TreeTable';
15
+
16
+ // export default TreeTable;
@@ -0,0 +1,34 @@
1
+ import Loadable from 'react-loadable';
2
+
3
+ const IconQuadrate = Loadable({
4
+ loader: () => import(/* webpackChunkName: 'IconQuadrate' */ './svg/quadrate'),
5
+ // eslint-disable-next-line react/react-in-jsx-scope
6
+ loading: () => <></>,
7
+ });
8
+ const IconRoundness = Loadable({
9
+ loader: () =>
10
+ import(/* webpackChunkName: 'IconRoundness' */ './svg/roundness'),
11
+ // eslint-disable-next-line react/react-in-jsx-scope
12
+ loading: () => <></>,
13
+ });
14
+ const IconSemicircle = Loadable({
15
+ loader: () =>
16
+ import(/* webpackChunkName: 'IconSemicircle' */ './svg/semicircle'),
17
+ // eslint-disable-next-line react/react-in-jsx-scope
18
+ loading: () => <></>,
19
+ });
20
+ const IconVerticalLine = Loadable({
21
+ loader: () =>
22
+ import(/* webpackChunkName: 'IconVerticalLine' */ './svg/verticalLine'),
23
+ // eslint-disable-next-line react/react-in-jsx-scope
24
+ loading: () => <></>,
25
+ });
26
+
27
+ const SystemIcon = {
28
+ IconQuadrate,
29
+ IconRoundness,
30
+ IconSemicircle,
31
+ IconVerticalLine,
32
+ };
33
+
34
+ export default SystemIcon;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ const IconQuadrate = (props: any) => {
4
+ const { className, style, width = '24px', height = '24px' } = props;
5
+ return (
6
+ <svg width={width} height={height} style={style} className={className} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
7
+ <rect x="7.5" y="7.5" width="14" height="14" rx="4" fillOpacity={1} />
8
+ <rect
9
+ x="2.5"
10
+ y="2.5"
11
+ width="14"
12
+ height="14"
13
+ rx="4"
14
+ fillOpacity="0.2"
15
+ />
16
+ </svg>
17
+ );
18
+ };
19
+
20
+ export default IconQuadrate;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ const IconRoundness = (props: any) => {
4
+ const { className, style, width = '24px', height = '24px' } = props;
5
+
6
+ return (
7
+ <svg xmlns="http://www.w3.org/2000/svg" width={width} height={height} style={style} className={className} viewBox="0 0 24 24">
8
+ <rect x="6.5" y="6.5" width="16" height="16" rx="8" fillOpacity={1} />
9
+ <rect x="1.5" y="1.5" width="16" height="16" rx="8" fillOpacity="0.2" />
10
+ </svg>
11
+ );
12
+ };
13
+
14
+ export default IconRoundness;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+
3
+ const IconSemicircle = (props: any) => {
4
+ const { className, style, width = '24px', height = '24px' } = props;
5
+ return (
6
+ <svg className={className} width={width} height={height} style={style} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
7
+ <path
8
+ d="M0 3H9C13.9706 3 18 7.02944 18 12V12C18 16.9706 13.9706 21 9 21H0V3Z"
9
+ fillOpacity={1}
10
+ />
11
+ </svg>
12
+ );
13
+ };
14
+
15
+ export default IconSemicircle;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ const IconVerticalLine = (props: any) => {
4
+ const { className, style, width = '24px', height = '24px' } = props;
5
+ return (
6
+ <svg className={className} width={width} height={height} style={style} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
7
+ <rect x="9" y="3" width="6" height="18" rx="3" fillOpacity={1} />
8
+ </svg>
9
+ );
10
+ };
11
+
12
+ export default IconVerticalLine;
@@ -48,6 +48,23 @@
48
48
 
49
49
  .@{ant-prefix}-message {
50
50
  z-index: 1050;
51
+ &-btns {
52
+ display: flex;
53
+ align-self: flex-end;
54
+ margin-left: 48px;
55
+ span {
56
+ cursor: pointer;
57
+ &:not(:last-child) {
58
+ margin-right: 8px;
59
+ }
60
+ }
61
+ &-okBtn {
62
+ color: @primary-color;
63
+ }
64
+ &-cancelBtn {
65
+ color: @text-color-secondary;
66
+ }
67
+ }
51
68
  }
52
69
 
53
70
  // 图标使用主题色统一样式
@@ -9,7 +9,7 @@
9
9
  &.@{ant-prefix}-card-large {
10
10
  .@{ant-prefix}-card-head {
11
11
  & > .@{ant-prefix}-card-head-wrapper > .@{ant-prefix}-card-head-title {
12
- padding: @padding-md 0;
12
+ padding: 0;
13
13
  }
14
14
  }
15
15
  }
@@ -17,6 +17,7 @@
17
17
  .ued-card-title {
18
18
  display: flex;
19
19
  align-items: center;
20
+ padding: 0;
20
21
 
21
22
  .main {
22
23
  white-space: nowrap;
@@ -25,18 +26,30 @@
25
26
  min-width: 10px;
26
27
  }
27
28
  &::before {
28
- position: absolute;
29
- top: 50%;
30
- left: @padding-xs;
31
29
  width: @padding-xxs;
32
30
  height: @font-size-sm;
33
31
  margin-right: @margin-xs;
34
32
  background: @primary-color;
35
- border-radius: @padding-xxs / 2;
36
- transform: translateY(-50%);
33
+ border-radius: 2px;
37
34
  content: '';
38
35
  }
39
36
 
37
+ &.ued-card-title-middle,
38
+ &.ued-card-title-icon-left,
39
+ &.ued-card-title-icon-auto {
40
+ &::after {
41
+ left: -6px;
42
+ }
43
+ }
44
+
45
+ // 标题内置样式边距不受主题影响
46
+ &.ued-card-title-middle {
47
+ &::before {
48
+ position: static;
49
+ transform: none;
50
+ margin-right: 8px;
51
+ }
52
+ }
40
53
  &-icon-left {
41
54
  &::before {
42
55
  left: 0;
@@ -45,18 +58,39 @@
45
58
  border-radius: 0 (@padding-sm / 2) (@padding-sm / 2) 0;
46
59
  }
47
60
  }
61
+ &.ued-card-title-icon-left {
62
+ &::before {
63
+ position: static;
64
+ transform: none;
65
+ margin: 0 8px 0 0;
66
+ }
67
+ }
48
68
 
49
- &-icon-auto {
69
+ &.ued-card-title-icon-auto {
70
+ &::after,
50
71
  &::before {
51
72
  content: none;
52
73
  }
74
+ }
53
75
 
76
+ &-icon-auto {
54
77
  > i,
55
78
  span {
56
79
  margin-right: @padding-xs;
57
80
  color: @primary-color;
58
81
  }
59
82
  }
83
+
84
+ &-icon-custom {
85
+ margin-left: 0;
86
+ padding-left: 0;
87
+ &::before {
88
+ width: 0 !important;
89
+ }
90
+ &::after {
91
+ width: 0 !important;
92
+ }
93
+ }
60
94
  }
61
95
 
62
96
  .ued-card-style-less-title {
@@ -115,6 +149,10 @@
115
149
  }
116
150
  }
117
151
 
152
+ &.@{ant-prefix}-card > .@{ant-prefix}-card-body {
153
+ background: transparent;
154
+ }
155
+
118
156
  .@{ant-prefix}-card-body {
119
157
  display: flex;
120
158
  flex: 1 1 auto;
@@ -124,12 +162,14 @@
124
162
 
125
163
  .@{ant-prefix}-card-head {
126
164
  position: relative;
127
- padding: 0 @padding-20;
165
+ // padding: 0 @padding-20;
128
166
  border-color: #f0f0f0;
167
+ margin-bottom: 0px;
129
168
 
130
169
  & > .@{ant-prefix}-card-head-wrapper {
170
+ width: 100%;
131
171
  & > .@{ant-prefix}-card-head-title {
132
- padding: @padding-sm 0;
172
+ padding: 0;
133
173
  font-weight: @font-weight-bold;
134
174
  font-size: @font-size-lg;
135
175
  line-height: 1.5;
@@ -143,11 +183,11 @@
143
183
 
144
184
  &.@{ant-prefix}-card-small {
145
185
  .@{ant-prefix}-card-head {
146
- padding: 0 @padding-20;
186
+ // padding: 0 @padding-20;
147
187
 
148
188
  & > .@{ant-prefix}-card-head-wrapper {
149
189
  & > .@{ant-prefix}-card-head-title {
150
- padding: @padding-xs 0;
190
+ padding: 0;
151
191
  }
152
192
 
153
193
  & > .@{ant-prefix}-card-extra {
@@ -159,6 +199,12 @@
159
199
 
160
200
  &.@{ant-prefix}-card-bordered {
161
201
  border-color: @border-color-base;
202
+ &.@{ant-prefix}-card {
203
+ padding: 0;
204
+ .@{ant-prefix}-card-head > .@{ant-prefix}-card-head-wrapper > .@{ant-prefix}-card-head-title {
205
+ padding: 0;
206
+ }
207
+ }
162
208
 
163
209
  .@{ant-prefix}-card-head {
164
210
  border-color: @border-color-base;