@lingxiteam/ebe-utils 0.2.21 → 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,13 +1,15 @@
1
- import { CloseOutlined, SaveOutlined } from '@ant-design/icons';
2
- import { Icon as LegacyIcon } from '@lingxiteam/icons';
3
- import { Button, Divider, Popconfirm, Popover, Tooltip } from 'antd';
4
- import React, { Fragment, useMemo, useRef, useState } from 'react';
5
- import CommIcon from '../../Icon';
1
+ import React, { Fragment, useState, useMemo, useRef } from 'react';
2
+ import { CloseOutlined, SaveOutlined, Icon as LegacyIcon } from '@lingxiteam/icons';
3
+ import { Divider, Popconfirm, Popover, Tooltip, Button } from 'antd';
6
4
  import type { OperationCellProps } from '../types/OperationCell';
5
+ import CommIcon from '../../Icon';
7
6
  import SingleBtn from './SingleBtn';
7
+ import PopoverWrapper from './PopoverWrapper';
8
8
 
9
9
  // 操作列
10
- const OperationCell = (props: OperationCellProps) => {
10
+ const OperationCell = (
11
+ props: OperationCellProps,
12
+ ) => {
11
13
  const {
12
14
  row,
13
15
  currentRowKey,
@@ -27,17 +29,23 @@ const OperationCell = (props: OperationCellProps) => {
27
29
  fixedAction,
28
30
  isSmallPopover,
29
31
  tableRef,
32
+ $$componentItem,
30
33
  } = props;
31
34
  const [morePopVisible, setMorePopVisible] = useState<boolean>(false); // 更多操作按钮气泡卡片显隐
32
35
  const timerRef = useRef<any>();
36
+ const { id: compId } = $$componentItem || {};
33
37
 
38
+
34
39
  const { showBuiltInBtns, showExtendBtns, moreBuiltInBtns, moreExtendBtns } = useMemo(() => {
35
40
  // 过滤掉隐藏的按钮,得到真正的内置的默认按钮数据(详情、编辑、删除)
36
41
  const builtInBtns = getRealRowActions(row, getRealIndexById(row[currentRowKey]));
37
42
  // 过滤掉隐藏的扩展按钮,得到真正的扩展按钮数据
38
43
  const extendBtns = getRealExtendRowActions(row, getRealIndexById(row[currentRowKey]));
39
44
 
40
- const allBtns = [...builtInBtns, ...extendBtns]?.filter(btn => btn?.checked !== false); // 只展示选中的按钮;
45
+ const allBtns = [
46
+ ...builtInBtns,
47
+ ...extendBtns,
48
+ ]?.filter(btn => btn?.checked !== false); // 只展示选中的按钮;
41
49
 
42
50
  let showBtns: any[] = [];
43
51
  let moreBtns: any[] = [];
@@ -119,14 +127,25 @@ const OperationCell = (props: OperationCellProps) => {
119
127
  moreExtendBtns?: any[]
120
128
  ) => {
121
129
  const BtnIcon = renderBtnIcon(c);
122
-
123
- const popconfirmPlacement = moreBuiltInBtns?.length || moreExtendBtns?.length || showExtendBtns?.length ? 'top' : 'topRight';
124
-
130
+
131
+ const popconfirmPlacement = (moreBuiltInBtns?.length || moreExtendBtns?.length || showExtendBtns?.length) ? 'top' : 'topRight';
132
+
133
+ // 操作按钮文字提示
134
+ const popoverOptions = c?.popoverSetting?.page || c?.popoverSetting?.options;
125
135
  const onBtnClick = (e: any) => {
126
- e.stopPropagation();
127
- if ((typeof c === 'string' ? c === 'detail' : c.type === 'detail') && typeof onRowDetailClick === 'function') {
136
+ if (popoverOptions?.trigger !== 'click') {
137
+ // trigger为点击的气泡卡片,阻止冒泡在内部实现
138
+ e.stopPropagation();
139
+ }
140
+ if (
141
+ (typeof c === 'string' ? c === 'detail' : c.type === 'detail') &&
142
+ typeof onRowDetailClick === 'function'
143
+ ) {
128
144
  onRowDetailClick(row, rowIndex);
129
- } else if ((typeof c === 'string' ? c === 'edit' : c.type === 'edit') && typeof onRowEditClick === 'function') {
145
+ } else if (
146
+ (typeof c === 'string' ? c === 'edit' : c.type === 'edit') &&
147
+ typeof onRowEditClick === 'function'
148
+ ) {
130
149
  onRowEditClick(row, rowIndex);
131
150
  }
132
151
  };
@@ -139,88 +158,113 @@ const OperationCell = (props: OperationCellProps) => {
139
158
  };
140
159
 
141
160
  return (
142
- <SingleBtn
143
- getLocale={getLocale}
144
- actionsMap={actionsMap}
145
- hideMorePopover={() => onMorePopVisible(false, rowIndex)}
146
- BtnIcon={BtnIcon}
147
- c={c}
148
- idx={idx}
149
- defaultBtnList={defaultBtnList}
150
- isPopover={isPopover}
151
- popconfirmPlacement={popconfirmPlacement}
152
- onBtnClick={onBtnClick}
153
- onDeleteClick={onDeleteClick}
154
- />
161
+ <PopoverWrapper
162
+ row={row}
163
+ index={rowIndex}
164
+ engineApis={engineApis}
165
+ rowId={row[currentRowKey]}
166
+ compId={compId}
167
+ popoverSetting={c?.popoverSetting}
168
+ >
169
+ <SingleBtn
170
+ getLocale={getLocale}
171
+ actionsMap={actionsMap}
172
+ hideMorePopover={() => onMorePopVisible(false, rowIndex)}
173
+ BtnIcon={BtnIcon}
174
+ c={c}
175
+ idx={idx}
176
+ defaultBtnList={defaultBtnList}
177
+ isPopover={isPopover}
178
+ popconfirmPlacement={popconfirmPlacement}
179
+ onBtnClick={onBtnClick}
180
+ onDeleteClick={onDeleteClick}
181
+ />
182
+ </PopoverWrapper>
155
183
  );
156
184
  };
157
-
185
+
158
186
  // 操作栏扩展按钮
159
187
  const renderExtendBtns = (btnList: any, isPopover = false, row: any, index: number, buttonStyle?: React.CSSProperties) => {
160
188
  return btnList.map((c: any, i: number) => {
161
189
  if (c.type) {
162
190
  return renderBuiltInSingleBtn(c, row, index, i, btnList, isPopover, btnList?.slice(i));
163
191
  }
164
- const { iconPos, id, isIcon, onClick, visible: buttonVisible = true } = c;
192
+ const { iconPos, id, isIcon, onClick, visible: buttonVisible = true, popoverSetting } = c;
165
193
 
166
194
  const BtnIcon = renderBtnIcon(c);
167
195
 
168
196
  if (!buttonVisible) {
169
197
  return null;
170
198
  }
199
+ const popoverOptions = popoverSetting?.page || popoverSetting?.options;
171
200
 
172
- return isPopover ? (
173
- <div>
174
- <Tooltip title={c.title} visible={!!isIcon && undefined}>
175
- <Button
176
- type="link"
177
- className="ued-table-actions-antBtn"
178
- disabled={c.disabled}
179
- key={id}
180
- onClick={e => {
181
- e.stopPropagation();
182
- if (typeof onClick === 'function') {
183
- onClick(currentRowKey ? row[currentRowKey] : row, row, index);
184
- }
185
- onMorePopVisible(false, index);
186
- }}
187
- >
188
- <div className="ued-table-actions-extendBtn" style={buttonStyle}>
189
- {iconPos && iconPos === 'left' && BtnIcon}
190
- {!isIcon && c.title}
191
- {iconPos && iconPos === 'right' && BtnIcon}
192
- </div>
193
- </Button>
194
- </Tooltip>
195
- </div>
196
- ) : (
197
- <Fragment key={id}>
198
- <Tooltip title={c.title} visible={!!isIcon && undefined}>
199
- <Button
200
- type="link"
201
- className="ued-table-actions-antBtn"
202
- disabled={c.disabled}
203
- key={id}
204
- onClick={e => {
205
- e.stopPropagation();
206
- if (typeof onClick === 'function') {
207
- onClick(currentRowKey ? row[currentRowKey] : row, row, index);
208
- }
209
- }}
210
- >
211
- <div className="ued-table-actions-extendBtn">
212
- {iconPos && iconPos === 'left' && BtnIcon}
213
- {!isIcon && c.title}
214
- {iconPos && iconPos === 'right' && BtnIcon}
215
- </div>
216
- </Button>
217
- </Tooltip>
218
- {i !== btnList.length - 1 && <Divider type="vertical" />}
219
- </Fragment>
220
- );
201
+ return (
202
+ <PopoverWrapper
203
+ row={row}
204
+ index={index}
205
+ engineApis={engineApis}
206
+ rowId={row[currentRowKey]}
207
+ compId={compId}
208
+ popoverSetting={c?.popoverSetting}
209
+ >
210
+ {isPopover ? (
211
+ <div>
212
+ <Tooltip title={c.title} visible={!!isIcon && undefined}>
213
+ <Button
214
+ type="link"
215
+ className="ued-table-actions-antBtn"
216
+ disabled={c.disabled}
217
+ key={id}
218
+ onClick={(e) => {
219
+ if (popoverOptions?.trigger !== 'click') {
220
+ // trigger为点击的气泡卡片,阻止冒泡在内部实现
221
+ e.stopPropagation();
222
+ }
223
+ if (typeof onClick === 'function') {
224
+ onClick(currentRowKey ? row[currentRowKey] : row, row, index);
225
+ }
226
+ onMorePopVisible(false, index);
227
+ }}
228
+ >
229
+ <div className="ued-table-actions-extendBtn" style={buttonStyle}>
230
+ {iconPos && iconPos === 'left' && BtnIcon}
231
+ {!isIcon && c.title}
232
+ {iconPos && iconPos === 'right' && BtnIcon}
233
+ </div>
234
+ </Button>
235
+ </Tooltip>
236
+ </div>) : (
237
+ <Fragment key={id}>
238
+ <Tooltip title={c.title} visible={!!isIcon && undefined}>
239
+ <Button
240
+ type="link"
241
+ className="ued-table-actions-antBtn"
242
+ disabled={c.disabled}
243
+ key={id}
244
+ onClick={(e) => {
245
+ if (popoverOptions?.trigger !== 'click') {
246
+ // trigger为点击的气泡卡片,阻止冒泡在内部实现
247
+ e.stopPropagation();
248
+ }
249
+ if (typeof onClick === 'function') {
250
+ onClick(currentRowKey ? row[currentRowKey] : row, row, index);
251
+ }
252
+ }}
253
+ >
254
+ <div className="ued-table-actions-extendBtn">
255
+ {iconPos && iconPos === 'left' && BtnIcon}
256
+ {!isIcon && c.title}
257
+ {iconPos && iconPos === 'right' && BtnIcon}
258
+ </div>
259
+ </Button>
260
+ </Tooltip>
261
+ {i !== btnList.length - 1 && <Divider type="vertical" />}
262
+ </Fragment>
263
+ )}
264
+ </PopoverWrapper>);
221
265
  });
222
266
  };
223
-
267
+
224
268
  // 操作栏更多按钮
225
269
  const renderExtendMoreBtns = (
226
270
  showBuiltInBtns: any[],
@@ -228,67 +272,61 @@ const OperationCell = (props: OperationCellProps) => {
228
272
  moreBuiltInBtns: any[],
229
273
  moreExtendBtns: any[],
230
274
  row: any,
231
- index: number
275
+ index: number,
232
276
  ) => {
233
277
  return (
234
278
  <>
235
279
  {
236
- // 扩展
237
- showExtendBtns?.length > 0 ? (
238
- <>
239
- {!!showBuiltInBtns?.length && <Divider type="vertical" />}
240
- {renderExtendBtns(showExtendBtns, false, row, index)}
241
- </>
242
- ) : null
243
- }
280
+ // 扩展
281
+ showExtendBtns?.length > 0 ? (
282
+ <>
283
+ {!!showBuiltInBtns?.length && <Divider type="vertical" />}
284
+ {renderExtendBtns(showExtendBtns, false, row, index)}
285
+ </>
286
+ ) : null
287
+ }
244
288
  {
245
- // 更多
246
- moreBuiltInBtns?.length + moreExtendBtns?.length > 0 && (
247
- <>
248
- {/* TODO: 是什么? showBuiltInBtns[showBuiltInBtns.length - 1]?.visible !== false */}
249
- {(!!showBuiltInBtns?.length || !!showExtendBtns?.length) && <Divider type="vertical" />}
250
- <Popover
251
- overlayClassName="ued-table-more-pop"
252
- content={
253
- <div
254
- style={{
255
- maxHeight: '300px',
256
- overflow: 'auto',
257
- padding: isSmallPopover ? '5px 5px' : '12px 16px',
258
- }}
259
- onClick={e => e.stopPropagation()}
289
+ // 更多
290
+ moreBuiltInBtns?.length + moreExtendBtns?.length > 0 && (
291
+ <>
292
+ {/* TODO: 是什么? showBuiltInBtns[showBuiltInBtns.length - 1]?.visible !== false */}
293
+ {(!!showBuiltInBtns?.length || !!showExtendBtns?.length) && <Divider type="vertical" />}
294
+ <Popover
295
+ overlayClassName="ued-table-more-pop"
296
+ content={(
297
+ <div style={{ maxHeight: '300px', overflow: 'auto', padding: isSmallPopover ? '5px 5px' : '12px 16px' }} onClick={e => e.stopPropagation()}>
298
+ {
299
+ moreBuiltInBtns?.length ? moreBuiltInBtns.map((child: any, idx: number) => {
300
+ return renderBuiltInSingleBtn(child, row, index, idx, showBuiltInBtns, true);
301
+ }) : null
302
+ }
303
+ {renderExtendBtns(moreExtendBtns, true, row, index, isSmallPopover ? { fontSize: '12px' } : {})}
304
+ </div>
305
+ )}
306
+ trigger="click"
307
+ placement="topRight"
308
+ open={morePopVisible}
309
+ // eslint-disable-next-line max-len
310
+ getPopupContainer={isSmallPopover ? () => document.getElementById('lcdpApp-root') || document.body : (triggerNode:HTMLElement) => triggerNode?.parentNode as HTMLElement}
311
+ onOpenChange={(vis: boolean) => {
312
+ onMorePopVisible(vis, index);
313
+ }}
314
+ >
315
+ <Button
316
+ type="link"
317
+ className="ued-table-actions-antBtn"
318
+ key="more"
319
+ onClick={(e) => e.stopPropagation()}
260
320
  >
261
- {moreBuiltInBtns?.length
262
- ? moreBuiltInBtns.map((child: any, idx: number) => {
263
- return renderBuiltInSingleBtn(child, row, index, idx, showBuiltInBtns, true);
264
- })
265
- : null}
266
- {renderExtendBtns(moreExtendBtns, true, row, index, isSmallPopover ? { fontSize: '12px' } : {})}
267
- </div>
268
- }
269
- trigger="click"
270
- placement="topRight"
271
- open={morePopVisible}
272
- // eslint-disable-next-line max-len
273
- getPopupContainer={
274
- isSmallPopover
275
- ? () => document.getElementById('lcdpApp-root') || document.body
276
- : (triggerNode: HTMLElement) => triggerNode?.parentNode as HTMLElement
277
- }
278
- onOpenChange={(vis: boolean) => {
279
- onMorePopVisible(vis, index);
280
- }}
281
- >
282
- <Button type="link" className="ued-table-actions-antBtn" key="more" onClick={e => e.stopPropagation()}>
283
- <div className="ued-table-actions-extendBtn">
284
- {getLocale?.('more')}
285
- <LegacyIcon className="actIcon-left" type="down" />
286
- </div>
287
- </Button>
288
- </Popover>
289
- </>
290
- )
291
- }
321
+ <div className="ued-table-actions-extendBtn">
322
+ {getLocale?.('more')}
323
+ <LegacyIcon className="actIcon-left" type="down" />
324
+ </div>
325
+ </Button>
326
+ </Popover>
327
+ </>
328
+ )
329
+ }
292
330
  </>
293
331
  );
294
332
  };
@@ -308,7 +346,7 @@ const OperationCell = (props: OperationCellProps) => {
308
346
  }
309
347
  }}
310
348
  >
311
- <SaveOutlined rev="" className="actIcon-left" />
349
+ <SaveOutlined className="actIcon-left" />
312
350
  {getLocale('save')}
313
351
  </div>
314
352
  <Divider type="vertical" />
@@ -322,7 +360,7 @@ const OperationCell = (props: OperationCellProps) => {
322
360
  onRowCancelClick(row);
323
361
  }
324
362
  }}
325
- onCancel={e => {
363
+ onCancel={(e) => {
326
364
  e?.preventDefault();
327
365
  e?.stopPropagation();
328
366
  }}
@@ -333,7 +371,7 @@ const OperationCell = (props: OperationCellProps) => {
333
371
  e.stopPropagation();
334
372
  }}
335
373
  >
336
- <CloseOutlined rev="" className="actIcon-left" />
374
+ <CloseOutlined className="actIcon-left" />
337
375
  {getLocale('cancel')}
338
376
  </div>
339
377
  </Popconfirm>
@@ -341,19 +379,11 @@ const OperationCell = (props: OperationCellProps) => {
341
379
  ) : (
342
380
  <>
343
381
  {showBuiltInBtns.map((c: any, idx: number) => {
344
- return renderBuiltInSingleBtn(
345
- c,
346
- row,
347
- getRealIndexById(row[currentRowKey]),
348
- idx,
349
- showBuiltInBtns,
350
- false,
351
- showExtendBtns,
352
- moreBuiltInBtns,
353
- moreExtendBtns
354
- );
382
+ return renderBuiltInSingleBtn(c, row,
383
+ getRealIndexById(row[currentRowKey]), idx, showBuiltInBtns, false, showExtendBtns, moreBuiltInBtns, moreExtendBtns);
355
384
  })}
356
- {renderExtendMoreBtns(showBuiltInBtns, showExtendBtns, moreBuiltInBtns, moreExtendBtns, row, getRealIndexById(row[currentRowKey]))}
385
+ {renderExtendMoreBtns(showBuiltInBtns, showExtendBtns, moreBuiltInBtns, moreExtendBtns, row,
386
+ getRealIndexById(row[currentRowKey]))}
357
387
  </>
358
388
  )
359
389
  }