@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.
- package/lib/h5public/yarn.lock +7 -8
- package/lib/pcpublic/src/components/pcfactory/src/Button/index.tsx +11 -10
- package/lib/pcpublic/src/components/pcfactory/src/Card/CardTitle/index.tsx +31 -24
- package/lib/pcpublic/src/components/pcfactory/src/Card/index.tsx +32 -14
- package/lib/pcpublic/src/components/pcfactory/src/Card/useExtendBtn.tsx +85 -48
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/ChartLine.tsx +24 -6
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/PropsType.ts +31 -5
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/index.tsx +3 -2
- package/lib/pcpublic/src/components/pcfactory/src/ChartLine/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +153 -129
- package/lib/pcpublic/src/components/pcfactory/src/Form/index.tsx +2 -5
- package/lib/pcpublic/src/components/pcfactory/src/Form/useFormStatus.ts +8 -4
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +15 -3
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/PropsType.ts +4 -3
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +18 -4
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/PropsType.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/loader.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +7 -2
- package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +60 -26
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +62 -55
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +2 -6
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +5 -5
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/index.tsx +9 -2
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/loader.ts +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +145 -66
- package/lib/pcpublic/src/components/pcfactory/src/Select/selectUtils.ts +13 -9
- package/lib/pcpublic/src/components/pcfactory/src/Table/BodyCell/index.tsx +36 -26
- package/lib/pcpublic/src/components/pcfactory/src/Table/EditComponent/index.tsx +69 -94
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +12 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +9 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +11 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +11 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +14 -7
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Thumbnail/index.tsx +30 -31
- package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/index.tsx +89 -41
- package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +25 -12
- package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/index.tsx +12 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/PopoverWrapper.tsx +220 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/SingleBtn.tsx +39 -32
- package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/index.tsx +178 -148
- package/lib/pcpublic/src/components/pcfactory/src/Table/Table.tsx +439 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/TableHead/index.tsx +159 -72
- package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +12 -20
- package/lib/pcpublic/src/components/pcfactory/src/Table/constant.ts +3 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/index.ts +4 -4
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +32 -28
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +44 -57
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +306 -276
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCommon.ts +9 -6
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useDataSource.ts +30 -21
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +33 -27
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFilter.tsx +84 -77
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.tsx +33 -16
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/usePagination.ts +15 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +33 -33
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +13 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useScroll.ts +94 -28
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +108 -99
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSort.ts +8 -5
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +27 -43
- package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +73 -394
- package/lib/pcpublic/src/components/pcfactory/src/Table/loader.tsx +15 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/OperationCell.d.ts +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +12 -8
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +24 -11
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/SequenceId.ts +2 -1
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +90 -82
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +9 -22
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/translate.ts +59 -0
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/Transfer.tsx +644 -0
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +49 -637
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/loader.tsx +11 -0
- package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeEllipsisIcon.tsx +38 -0
- package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +34 -35
- package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +213 -149
- package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +47 -43
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/TreeTable.tsx +264 -0
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +52 -191
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/loader.tsx +16 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/index.tsx +34 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/quadrate.tsx +20 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/roundness.tsx +14 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/semicircle.tsx +15 -0
- package/lib/pcpublic/src/components/pcfactory/src/assets/svg/verticalLine.tsx +12 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +17 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Card.less +57 -11
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +101 -12
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +6 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Select.less +70 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/ChannelContainer.tsx +20 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/ChildRender.ts +6 -8
- package/lib/pcpublic/src/components/pcfactory/src/utils/CustomModule.tsx +4 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +9 -13
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +5 -17
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +3 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/Holidays.ts +11 -39
- package/lib/pcpublic/src/components/pcfactory/src/utils/HolidaysFormat.ts +83 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/index.tsx +47 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/scheduler.ts +74 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/LoaderHelper.tsx +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +8 -7
- package/lib/pcpublic/src/components/pcfactory/src/utils/WithSyncValue.ts +25 -23
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/index.ts +10 -7
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMap.ts +9 -6
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/usePersistFn.ts +17 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSetState.ts +7 -5
- package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +23 -50
- package/lib/pcpublic/src/components/pcfactory/src/utils/constant.ts +53 -57
- package/lib/pcpublic/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +12 -17
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +22 -12
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +50 -19
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +58 -37
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +33 -30
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +2 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/generatorDisabledCallback.ts +121 -113
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +16 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDataMask.ts +7 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +3 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +16 -14
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +9 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +4 -5
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInit.ts +11 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +3 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useListenState.ts +1 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +5 -3
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useRules.ts +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +2 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +8 -4
- package/lib/pcpublic/src/components/pcfactory/src/utils/index.ts +10 -10
- package/lib/pcpublic/src/components/pcfactory/src/utils/polyfill.js +29 -31
- package/lib/pcpublic/src/components/pcfactory/src/utils/renderReadOnly.tsx +29 -26
- package/lib/public/public/iconfont.js +1 -0
- package/package.json +2 -2
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Icon as LegacyIcon } from '@lingxiteam/icons';
|
|
3
|
-
import {
|
|
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 = (
|
|
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 = [
|
|
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
|
-
|
|
127
|
-
|
|
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 (
|
|
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
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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,
|
|
385
|
+
{renderExtendMoreBtns(showBuiltInBtns, showExtendBtns, moreBuiltInBtns, moreExtendBtns, row,
|
|
386
|
+
getRealIndexById(row[currentRowKey]))}
|
|
357
387
|
</>
|
|
358
388
|
)
|
|
359
389
|
}
|