@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,12 +1,12 @@
|
|
|
1
|
-
import { DatePicker,
|
|
2
|
-
import _, { cloneDeep } from 'lodash';
|
|
1
|
+
import { DatePicker, Input, InputNumber, Select, Radio, Switch, Form } from 'antd';
|
|
3
2
|
import moment, { Moment } from 'moment';
|
|
4
3
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
5
|
-
import ModalSelect from '../../ModalSelect';
|
|
6
4
|
import ComSelect from '../../SuperSelect/ComSelect';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
5
|
+
import ModalSelect from '../../ModalSelect';
|
|
6
|
+
import { initMomentLocale, getRegExp } from '../../utils/common';
|
|
9
7
|
import { ExpressionRenderingParams } from '../../utils/PropsType';
|
|
8
|
+
import _, { cloneDeep } from 'lodash';
|
|
9
|
+
import { useLocale } from '../../utils/hooks/useLocale';
|
|
10
10
|
import { EDIT_COMPONENT_STOP_PROPAGATION_CLS } from '../constant';
|
|
11
11
|
import { getFormItemFieldName } from '../utils';
|
|
12
12
|
|
|
@@ -37,20 +37,9 @@ export interface MyEditComponent {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
type LimitRangeType = '' | 'no' | 'afterToday' | 'beforeToday' | 'period' | 'custom';
|
|
40
|
-
const supportEditComponents = [
|
|
41
|
-
'Select',
|
|
42
|
-
'Radio',
|
|
43
|
-
'TimePicker',
|
|
44
|
-
'DatePicker',
|
|
45
|
-
'Switch',
|
|
46
|
-
'InputNumber',
|
|
47
|
-
'TextArea',
|
|
48
|
-
'Input',
|
|
49
|
-
'SuperSelect',
|
|
50
|
-
'ModalSelect',
|
|
51
|
-
];
|
|
40
|
+
const supportEditComponents = ['Select', 'Radio', 'TimePicker', 'DatePicker', 'Switch', 'InputNumber', 'TextArea', 'Input', 'SuperSelect', 'ModalSelect'];
|
|
52
41
|
|
|
53
|
-
const EditComponent: React.FC<MyEditComponent> = props => {
|
|
42
|
+
const EditComponent: React.FC<MyEditComponent> = (props) => {
|
|
54
43
|
const {
|
|
55
44
|
disabled,
|
|
56
45
|
inlineVChange,
|
|
@@ -91,7 +80,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
91
80
|
startTime: Moment;
|
|
92
81
|
endTime: Moment;
|
|
93
82
|
} = useMemo(() => {
|
|
94
|
-
const res: { startTime: Moment; endTime: Moment } = {
|
|
83
|
+
const res: { startTime: Moment; endTime: Moment; } = {
|
|
95
84
|
startTime: moment(),
|
|
96
85
|
endTime: moment(),
|
|
97
86
|
};
|
|
@@ -136,7 +125,10 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
136
125
|
return value;
|
|
137
126
|
}
|
|
138
127
|
case 'Switch': {
|
|
139
|
-
const checked =
|
|
128
|
+
const checked =
|
|
129
|
+
typeof initValue === 'string' && ['null', 'undefined', 'false', '0'].includes(initValue)
|
|
130
|
+
? false
|
|
131
|
+
: !!initValue;
|
|
140
132
|
return checked;
|
|
141
133
|
}
|
|
142
134
|
default:
|
|
@@ -164,8 +156,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
164
156
|
message: errorMsg,
|
|
165
157
|
transform,
|
|
166
158
|
};
|
|
167
|
-
}
|
|
168
|
-
if (typeof res === 'string') {
|
|
159
|
+
} if (typeof res === 'string') {
|
|
169
160
|
return {
|
|
170
161
|
pattern: getRegExp(res),
|
|
171
162
|
message: errorMsg,
|
|
@@ -221,51 +212,43 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
221
212
|
return res?.length > 0 ? res : null;
|
|
222
213
|
}, [initialValueType, isNaNValue, rules, validateDateCustomExpress]);
|
|
223
214
|
|
|
224
|
-
const getDisabledDate = useCallback(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
if (
|
|
240
|
-
if (current >= limitRangeTime.startTime && current <= limitRangeTime.endTime) {
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
if (startTime && current > limitRangeTime.startTime) {
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
if (endTime && current < limitRangeTime.endTime) {
|
|
215
|
+
const getDisabledDate = useCallback((current: Moment) => {
|
|
216
|
+
// custom 自定义规则通过form表单进行校验
|
|
217
|
+
if (!limitRange || limitRange === 'no' || limitRange === 'custom') {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
switch (limitRange) {
|
|
221
|
+
case 'beforeToday':
|
|
222
|
+
return current > moment(new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1);
|
|
223
|
+
case 'afterToday':
|
|
224
|
+
return current < moment(new Date().setHours(0, 0, 0, 0));
|
|
225
|
+
case 'period':
|
|
226
|
+
if (!startTime && !endTime) {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
if (startTime && endTime && limitRangeTime.startTime <= limitRangeTime.endTime) {
|
|
230
|
+
if (current >= limitRangeTime.startTime && current <= limitRangeTime.endTime) {
|
|
249
231
|
return false;
|
|
250
232
|
}
|
|
251
|
-
break;
|
|
252
|
-
default:
|
|
253
233
|
return true;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
234
|
+
}
|
|
235
|
+
if (startTime && current > limitRangeTime.startTime) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
if (endTime && current < limitRangeTime.endTime) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
break;
|
|
242
|
+
default:
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
return undefined;
|
|
246
|
+
}, [limitRange, format, limitRangeTime]);
|
|
259
247
|
|
|
260
248
|
initMomentLocale();
|
|
261
249
|
|
|
262
250
|
const renderComponent = (isFormItem = false) => {
|
|
263
|
-
const commonProps: any = isFormItem
|
|
264
|
-
? {}
|
|
265
|
-
: {
|
|
266
|
-
value: tempInputValue ?? initialValue,
|
|
267
|
-
className: EDIT_COMPONENT_STOP_PROPAGATION_CLS,
|
|
268
|
-
};
|
|
251
|
+
const commonProps: any = isFormItem ? {} : { value: tempInputValue ?? initialValue, className: EDIT_COMPONENT_STOP_PROPAGATION_CLS };
|
|
269
252
|
switch (edittype) {
|
|
270
253
|
case 'Select':
|
|
271
254
|
// eslint-disable-next-line no-case-declarations
|
|
@@ -286,7 +269,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
286
269
|
inlineVChange(v, {});
|
|
287
270
|
onChange(v);
|
|
288
271
|
}}
|
|
289
|
-
onClick={e => {
|
|
272
|
+
onClick={(e) => {
|
|
290
273
|
e.stopPropagation();
|
|
291
274
|
}}
|
|
292
275
|
>
|
|
@@ -340,7 +323,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
340
323
|
inlineVChange(dateVal, {});
|
|
341
324
|
onChange(dateVal);
|
|
342
325
|
}}
|
|
343
|
-
onClick={e => {
|
|
326
|
+
onClick={(e) => {
|
|
344
327
|
e.stopPropagation();
|
|
345
328
|
}}
|
|
346
329
|
/>
|
|
@@ -361,7 +344,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
361
344
|
inlineVChange(dateVal, {});
|
|
362
345
|
onChange(dateVal);
|
|
363
346
|
}}
|
|
364
|
-
onClick={e => {
|
|
347
|
+
onClick={(e) => {
|
|
365
348
|
e.stopPropagation();
|
|
366
349
|
}}
|
|
367
350
|
/>
|
|
@@ -369,32 +352,30 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
369
352
|
);
|
|
370
353
|
}
|
|
371
354
|
case 'Switch': {
|
|
372
|
-
return
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
/>
|
|
381
|
-
);
|
|
355
|
+
return <Switch
|
|
356
|
+
disabled={disabled}
|
|
357
|
+
checked={initialValue}
|
|
358
|
+
onChange={(v) => {
|
|
359
|
+
inlineVChange(v, {});
|
|
360
|
+
onChange(v);
|
|
361
|
+
}}
|
|
362
|
+
/>;
|
|
382
363
|
}
|
|
383
364
|
case 'InputNumber':
|
|
384
365
|
return (
|
|
385
366
|
<InputNumber
|
|
386
367
|
{...commonProps}
|
|
387
368
|
disabled={disabled}
|
|
388
|
-
onChange={v => {
|
|
369
|
+
onChange={(v) => {
|
|
389
370
|
inlineVChange(v, {});
|
|
390
371
|
onChange(v);
|
|
391
372
|
}}
|
|
392
|
-
onBlur={e => {
|
|
373
|
+
onBlur={(e) => {
|
|
393
374
|
// 行主键字段编辑时tr被卸载,光标会被重置
|
|
394
375
|
inlineVChange(e.target.value, {});
|
|
395
376
|
onBlur(e.target.value);
|
|
396
377
|
}}
|
|
397
|
-
onClick={e => {
|
|
378
|
+
onClick={(e) => {
|
|
398
379
|
e.stopPropagation();
|
|
399
380
|
}}
|
|
400
381
|
/>
|
|
@@ -406,17 +387,17 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
406
387
|
{...commonProps}
|
|
407
388
|
disabled={disabled}
|
|
408
389
|
rows={4}
|
|
409
|
-
onBlur={e => {
|
|
390
|
+
onBlur={(e) => {
|
|
410
391
|
// 行主键字段编辑时tr被卸载,光标会被重置
|
|
411
392
|
inlineVChange(e.target.value, {});
|
|
412
393
|
updateTempInputValue(undefined);
|
|
413
394
|
onBlur(e.target.value);
|
|
414
395
|
}}
|
|
415
|
-
onChange={e => {
|
|
396
|
+
onChange={(e) => {
|
|
416
397
|
updateTempInputValue(e.target.value);
|
|
417
398
|
onChange(e.target.value);
|
|
418
399
|
}}
|
|
419
|
-
onClick={e => {
|
|
400
|
+
onClick={(e) => {
|
|
420
401
|
e.stopPropagation();
|
|
421
402
|
}}
|
|
422
403
|
/>
|
|
@@ -428,23 +409,24 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
428
409
|
<Input
|
|
429
410
|
{...commonProps}
|
|
430
411
|
disabled={disabled}
|
|
431
|
-
onBlur={e => {
|
|
412
|
+
onBlur={(e) => {
|
|
432
413
|
// 行主键字段编辑时tr被卸载,光标会被重置
|
|
433
414
|
inlineVChange(e.target.value, {});
|
|
434
415
|
updateTempInputValue(undefined);
|
|
435
416
|
onBlur(e.target.value);
|
|
436
417
|
}}
|
|
437
|
-
onChange={e => {
|
|
418
|
+
onChange={(e) => {
|
|
438
419
|
updateTempInputValue(e.target.value);
|
|
439
420
|
onChange(e.target.value);
|
|
440
421
|
}}
|
|
441
|
-
onClick={e => {
|
|
422
|
+
onClick={(e) => {
|
|
442
423
|
e.stopPropagation();
|
|
443
424
|
}}
|
|
444
425
|
/>
|
|
445
426
|
// </WrapperInput>
|
|
446
427
|
);
|
|
447
|
-
case 'SuperSelect':
|
|
428
|
+
case 'SuperSelect':
|
|
429
|
+
{
|
|
448
430
|
let showLabel = rowData[`${c.dataIndex}_introduce`];
|
|
449
431
|
if (Array.isArray(c.dataIndex)) {
|
|
450
432
|
// 兼容层级字段情况
|
|
@@ -468,7 +450,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
468
450
|
label={c.title}
|
|
469
451
|
value={initialValue}
|
|
470
452
|
engineApis={engineApis}
|
|
471
|
-
getEngineApis={() => {}}
|
|
453
|
+
getEngineApis={() => { }}
|
|
472
454
|
onChange={(e: any, _label: any) => {
|
|
473
455
|
inlineVChange(e, {
|
|
474
456
|
[`${c.dataIndex}_introduce`]: _label,
|
|
@@ -479,8 +461,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
479
461
|
e.stopPropagation();
|
|
480
462
|
}}
|
|
481
463
|
/>
|
|
482
|
-
);
|
|
483
|
-
}
|
|
464
|
+
); }
|
|
484
465
|
case 'ModalSelect':
|
|
485
466
|
return (
|
|
486
467
|
<ModalSelect
|
|
@@ -502,7 +483,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
502
483
|
postfixStyle={c?.editoption?.postfixStyle}
|
|
503
484
|
size="sm"
|
|
504
485
|
engineApis={engineApis}
|
|
505
|
-
getEngineApis={() => {}}
|
|
486
|
+
getEngineApis={() => { }}
|
|
506
487
|
onChange={(val: any, options: any) => {
|
|
507
488
|
const labels = (options || [])?.map((v: any) => v.label);
|
|
508
489
|
inlineVChange(val, {
|
|
@@ -518,13 +499,7 @@ const EditComponent: React.FC<MyEditComponent> = props => {
|
|
|
518
499
|
};
|
|
519
500
|
|
|
520
501
|
if (supportEditComponents.includes(edittype) && validateRules) {
|
|
521
|
-
const fieldName = getFormItemFieldName({
|
|
522
|
-
compId,
|
|
523
|
-
currentRowKey,
|
|
524
|
-
rowData,
|
|
525
|
-
rowId,
|
|
526
|
-
dataIndex,
|
|
527
|
-
});
|
|
502
|
+
const fieldName = getFormItemFieldName({ compId, currentRowKey, rowData, rowId, dataIndex });
|
|
528
503
|
return (
|
|
529
504
|
<Form.Item
|
|
530
505
|
style={{ height: 'auto' }}
|
|
@@ -11,14 +11,21 @@ export interface GhostTagProps {
|
|
|
11
11
|
|
|
12
12
|
const ghostTagClassName = 'ued-table-cell-ghostTag';
|
|
13
13
|
|
|
14
|
-
const GhostTag: React.FC<GhostTagProps> = props => {
|
|
15
|
-
const {
|
|
14
|
+
const GhostTag: React.FC<GhostTagProps> = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
fontColor,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
borderColor,
|
|
19
|
+
content,
|
|
20
|
+
onClick,
|
|
21
|
+
} = props;
|
|
16
22
|
|
|
17
23
|
return (
|
|
18
24
|
<span
|
|
19
|
-
className={classNames(
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
className={classNames(
|
|
26
|
+
ghostTagClassName,
|
|
27
|
+
{ [`${ghostTagClassName}-click`]: !!onClick }
|
|
28
|
+
)}
|
|
22
29
|
style={{
|
|
23
30
|
color: fontColor,
|
|
24
31
|
backgroundColor,
|
|
@@ -8,14 +8,18 @@ export interface HyperlinkProps {
|
|
|
8
8
|
|
|
9
9
|
const hyperlinkClassName = 'ued-table-cell-hyperlink';
|
|
10
10
|
|
|
11
|
-
const Hyperlink: React.FC<HyperlinkProps> = props => {
|
|
12
|
-
const {
|
|
11
|
+
const Hyperlink: React.FC<HyperlinkProps> = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
content,
|
|
14
|
+
onClick,
|
|
15
|
+
} = props;
|
|
13
16
|
|
|
14
17
|
return (
|
|
15
18
|
<span
|
|
16
|
-
className={classNames(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
className={classNames(
|
|
20
|
+
hyperlinkClassName,
|
|
21
|
+
{ [`${hyperlinkClassName}-click`]: !!onClick }
|
|
22
|
+
)}
|
|
19
23
|
onClick={onClick}
|
|
20
24
|
>
|
|
21
25
|
{content}
|
|
@@ -10,14 +10,20 @@ export interface PointTagProps {
|
|
|
10
10
|
|
|
11
11
|
const pointTagClassName = 'ued-table-cell-pointTag';
|
|
12
12
|
|
|
13
|
-
const PointTag: React.FC<PointTagProps> = props => {
|
|
14
|
-
const {
|
|
13
|
+
const PointTag: React.FC<PointTagProps> = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
fontColor,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
content,
|
|
18
|
+
onClick,
|
|
19
|
+
} = props;
|
|
15
20
|
|
|
16
21
|
return (
|
|
17
22
|
<div
|
|
18
|
-
className={classNames(
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
className={classNames(
|
|
24
|
+
pointTagClassName,
|
|
25
|
+
{ [`${pointTagClassName}-click`]: !!onClick }
|
|
26
|
+
)}
|
|
21
27
|
onClick={onClick}
|
|
22
28
|
>
|
|
23
29
|
<span
|
|
@@ -10,14 +10,20 @@ export interface PureColourFillProps {
|
|
|
10
10
|
|
|
11
11
|
const pureColourFillClassName = 'ued-table-cell-pureColourFill';
|
|
12
12
|
|
|
13
|
-
const PureColourFill: React.FC<PureColourFillProps> = props => {
|
|
14
|
-
const {
|
|
13
|
+
const PureColourFill: React.FC<PureColourFillProps> = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
fontColor,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
content,
|
|
18
|
+
onClick,
|
|
19
|
+
} = props;
|
|
15
20
|
|
|
16
21
|
return (
|
|
17
22
|
<div
|
|
18
|
-
className={classNames(
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
className={classNames(
|
|
24
|
+
pureColourFillClassName,
|
|
25
|
+
{ [`${pureColourFillClassName}-click`]: !!onClick }
|
|
26
|
+
)}
|
|
21
27
|
style={{
|
|
22
28
|
backgroundColor,
|
|
23
29
|
color: fontColor,
|
package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
3
|
|
|
4
4
|
export interface PureFadeColorTagProps {
|
|
5
|
-
fontColor?: string
|
|
5
|
+
fontColor?: string
|
|
6
6
|
backgroundColor?: string;
|
|
7
7
|
content?: any;
|
|
8
8
|
onClick: any;
|
|
@@ -11,14 +11,21 @@ export interface PureFadeColorTagProps {
|
|
|
11
11
|
const pureColourTagClassName = 'ued-table-cell-pureColourTag';
|
|
12
12
|
const fadeColourTagClassName = 'ued-table-cell-fadeColourTag';
|
|
13
13
|
|
|
14
|
-
const PureFadeColorTag: React.FC<PureFadeColorTagProps> = props => {
|
|
15
|
-
const {
|
|
14
|
+
const PureFadeColorTag: React.FC<PureFadeColorTagProps> = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
fontColor,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
content,
|
|
19
|
+
onClick,
|
|
20
|
+
} = props;
|
|
16
21
|
|
|
17
22
|
return (
|
|
18
23
|
<span
|
|
19
|
-
className={classNames(
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
className={classNames(
|
|
25
|
+
pureColourTagClassName,
|
|
26
|
+
fadeColourTagClassName,
|
|
27
|
+
{ [`${pureColourTagClassName}-click ${fadeColourTagClassName}-click`]: !!onClick }
|
|
28
|
+
)}
|
|
22
29
|
style={{
|
|
23
30
|
color: fontColor,
|
|
24
31
|
backgroundColor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import React, { useMemo, useEffect, useState } from 'react';
|
|
1
2
|
import { Popover } from 'antd';
|
|
2
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import CommIcon from '../../../Icon';
|
|
4
3
|
import IconPlaceholder from '../../assets/placeholder.png';
|
|
4
|
+
import CommIcon from '../../../Icon';
|
|
5
5
|
import { BODY_CELL_MODE_ED } from '../../constant';
|
|
6
6
|
|
|
7
7
|
export interface PureFadeColorTagProps {
|
|
@@ -18,7 +18,7 @@ export interface PureFadeColorTagProps {
|
|
|
18
18
|
|
|
19
19
|
const thumbnailClassName = 'ued-table-cell-thumbnail';
|
|
20
20
|
|
|
21
|
-
const Thumbnail: React.FC<PureFadeColorTagProps> = props => {
|
|
21
|
+
const Thumbnail: React.FC<PureFadeColorTagProps> = (props) => {
|
|
22
22
|
const {
|
|
23
23
|
row,
|
|
24
24
|
field,
|
|
@@ -48,22 +48,20 @@ const Thumbnail: React.FC<PureFadeColorTagProps> = props => {
|
|
|
48
48
|
if (!Array.isArray(imgsData) && imgsData) {
|
|
49
49
|
imgsData = [imgsData];
|
|
50
50
|
}
|
|
51
|
-
imgsData = await Promise.all(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
);
|
|
51
|
+
imgsData = await Promise.all(imgsData?.map?.(async (img: any) => {
|
|
52
|
+
let src = img.url || img.data;
|
|
53
|
+
if (img.fileId) {
|
|
54
|
+
src = engineApis?.getAppFileUrlById(img.fileId);
|
|
55
|
+
} else if (img.url) {
|
|
56
|
+
// 对回填url地址重新进行加密加签处理
|
|
57
|
+
src = engineApis?.securityWithUrl(src);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...img,
|
|
61
|
+
downloadUrl: src,
|
|
62
|
+
src: src || IconPlaceholder,
|
|
63
|
+
};
|
|
64
|
+
}));
|
|
67
65
|
|
|
68
66
|
setImgs(imgsData);
|
|
69
67
|
};
|
|
@@ -179,17 +177,15 @@ const Thumbnail: React.FC<PureFadeColorTagProps> = props => {
|
|
|
179
177
|
|
|
180
178
|
// 加载错误时展示默认图片
|
|
181
179
|
const handleImgError = (index: number) => {
|
|
182
|
-
setImgs(pre =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
})
|
|
192
|
-
);
|
|
180
|
+
setImgs((pre) => pre.map((v, i) => {
|
|
181
|
+
if (i === index) {
|
|
182
|
+
return {
|
|
183
|
+
...v,
|
|
184
|
+
src: IconPlaceholder,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return v;
|
|
188
|
+
}));
|
|
193
189
|
};
|
|
194
190
|
|
|
195
191
|
const renderPopoverContent = () => {
|
|
@@ -251,7 +247,10 @@ const Thumbnail: React.FC<PureFadeColorTagProps> = props => {
|
|
|
251
247
|
};
|
|
252
248
|
|
|
253
249
|
return (
|
|
254
|
-
<span
|
|
250
|
+
<span
|
|
251
|
+
className={thumbnailClassName}
|
|
252
|
+
title=""
|
|
253
|
+
>
|
|
255
254
|
{renderImg()}
|
|
256
255
|
</span>
|
|
257
256
|
);
|