@lingxiteam/ebe-utils 0.0.10 → 0.0.12
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/README.md +6 -0
- package/es/index.d.ts +11 -6
- package/es/index.js +63 -52
- package/es/node/babel/getAllImportFiles.d.ts +1 -1
- package/es/node/babel/getAllImportFiles.js +4 -4
- package/es/node/move.d.ts +1 -0
- package/es/node/move.js +21 -13
- package/lib/h5public/src/components/factory/package.json +4 -0
- package/lib/h5public/src/components/factory/src/BlockSelect/index.tsx +9 -1
- package/lib/h5public/src/components/factory/src/DynamicDataContainer/index.tsx +24 -5
- package/lib/h5public/src/components/factory/src/DynamicList/MySwipe/index.tsx +1 -1
- package/lib/h5public/src/hooks/usePageForm.ts +108 -4
- package/lib/h5public/src/utils/LcdpSpin/index.tsx +15 -3
- package/lib/h5public/src/utils/formUtils.ts +336 -0
- package/lib/node/babel/getAllImportFiles.d.ts +1 -1
- package/lib/node/babel/getAllImportFiles.js +3 -3
- package/lib/node/move.d.ts +1 -0
- package/lib/node/move.js +19 -8
- package/lib/pcpublic/src/components/common/PreviewFile/index.less +200 -0
- package/lib/pcpublic/src/components/common/PreviewFile/index.tsx +787 -0
- package/lib/pcpublic/src/components/common/PreviewFile/utils.ts +90 -0
- package/lib/pcpublic/src/components/pcfactory/package.json +4 -0
- package/lib/pcpublic/src/components/pcfactory/src/Audio/index.tsx +6 -6
- package/lib/pcpublic/src/components/pcfactory/src/Cascader/index.tsx +15 -0
- package/lib/pcpublic/src/components/pcfactory/src/Checkbox/index.tsx +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/DynamicDataContainer/index.tsx +301 -0
- package/lib/pcpublic/src/components/pcfactory/src/DynamicDataContainer/useDynamicDataContainer.ts +27 -0
- package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +1 -0
- package/lib/pcpublic/src/components/pcfactory/src/GridView/GridView.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/Img/assets/placeholder.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/Input/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/LoopList/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/PictureVerifyCode/assets/placeholder.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/PictureVerifyCode/index.tsx +6 -6
- package/lib/pcpublic/src/components/pcfactory/src/QuillEditor/index.tsx +11 -0
- package/lib/pcpublic/src/components/pcfactory/src/RemoteComponent/components/ReactRender.tsx +5 -1
- package/lib/pcpublic/src/components/pcfactory/src/RemoteComponent/constant.ts +36 -0
- package/lib/pcpublic/src/components/pcfactory/src/RemoteComponent/index.tsx +28 -16
- package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +12 -5
- package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +65 -39
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/default.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/js.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/pdf.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/ppt.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/txt.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/word.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/xls.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/zip.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/StdUpload/index.tsx +11 -1
- package/lib/pcpublic/src/components/pcfactory/src/SuperSelect/ComSelect.tsx +1 -2
- package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +8 -1
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +4 -4
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +91 -34
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +22 -11
- package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +51 -8
- package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +28 -6
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/bodyCell.d.ts +22 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/contentStyle.d.ts +41 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +129 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +37 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +301 -0
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +83 -31
- package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +119 -0
- package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +8 -3
- package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +4 -1
- package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +12 -1
- package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +28 -3
- package/lib/pcpublic/src/components/pcfactory/src/VerificationCode/assets/placeholder.png +0 -0
- package/lib/pcpublic/src/components/pcfactory/src/VerificationCode/index.tsx +6 -6
- package/lib/pcpublic/src/components/pcfactory/src/VideoPlayer/index.tsx +12 -12
- package/lib/pcpublic/src/components/pcfactory/src/View/index.tsx +18 -4
- package/lib/pcpublic/src/components/pcfactory/src/index.component.ts +3 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +6 -1
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +4 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Input.less +3 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/InputNumber.less +1 -1
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +3 -0
- package/lib/pcpublic/src/components/pcfactory/src/styles/components/Table.less +5 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +2 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +29 -28
- package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +36 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +29 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +18 -2
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +10 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +10 -5
- package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +46 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +44 -0
- package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +1 -0
- package/lib/pcpublic/src/utils/formUtils.ts +458 -0
- package/lib/public/src/components/WaterMark/index.tsx +1 -1
- package/lib/public/src/services/api/index.ts +7 -0
- package/package.json +2 -2
|
@@ -2,6 +2,42 @@ import FishRender from './components/FishRender';
|
|
|
2
2
|
import ReactRender from './components/ReactRender';
|
|
3
3
|
import VueRender from './components/VueRender';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 合并方法,支持对象中包含getter方法
|
|
7
|
+
* @param object
|
|
8
|
+
* @param otherArgs
|
|
9
|
+
*/
|
|
10
|
+
export function mergeGetter<
|
|
11
|
+
T extends Record<string, any>,
|
|
12
|
+
S1 extends Record<string, any>,
|
|
13
|
+
S2 extends Record<string, any>,
|
|
14
|
+
>(object: T, source1: S1, ...args: S2[]) {
|
|
15
|
+
const target: Record<string, any> = object || {};
|
|
16
|
+
|
|
17
|
+
// 合并ref 保持getter对象不被转义
|
|
18
|
+
const merge = (o: Record<string, any> = {}) => {
|
|
19
|
+
Object.keys(o).forEach((key) => {
|
|
20
|
+
const descriptor = Object.getOwnPropertyDescriptor(o, key);
|
|
21
|
+
if (descriptor) {
|
|
22
|
+
Object.defineProperty(target, key, descriptor!);
|
|
23
|
+
} else {
|
|
24
|
+
try {
|
|
25
|
+
target[key] = o[key];
|
|
26
|
+
// eslint-disable-next-line no-empty
|
|
27
|
+
} catch {}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const sources: (S1 | S2)[] = [source1, ...args];
|
|
33
|
+
|
|
34
|
+
sources.forEach((source) => {
|
|
35
|
+
merge(source);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return target as any;
|
|
39
|
+
}
|
|
40
|
+
|
|
5
41
|
export const RemoteComponentMap = {
|
|
6
42
|
React: ReactRender,
|
|
7
43
|
Vue: VueRender,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LingxiForwardRef } from '@lingxiteam/types';
|
|
2
2
|
import { createRequires } from '@paciolan/remote-component/dist/createRequires';
|
|
3
3
|
import { createUseRemoteComponent } from '@paciolan/remote-component/dist/hooks/useRemoteComponent';
|
|
4
|
-
import { useImperativeHandle, useState } from 'react';
|
|
4
|
+
import { useImperativeHandle, useRef, useState } from 'react';
|
|
5
5
|
import { useListenProps } from '../utils';
|
|
6
6
|
import { useDeepCompareEffect } from '../utils/ahooks';
|
|
7
|
-
import { RemoteComponentMap } from './constant';
|
|
7
|
+
import { mergeGetter, RemoteComponentMap } from './constant';
|
|
8
8
|
|
|
9
9
|
export const getUseRemoteComponent = (config: any) => {
|
|
10
10
|
const requires = createRequires(() => config.resolve);
|
|
@@ -38,20 +38,27 @@ const RemoteComponent = LingxiForwardRef<any, MyRemoteComponentProps>(
|
|
|
38
38
|
const [remoteUrl, setRemoteUrl] = useState<string>(url || '');
|
|
39
39
|
|
|
40
40
|
const [customProps, setProps] = useListenProps<any>(myProps);
|
|
41
|
+
const [myRefs, setMyRefs] = useState<any>();
|
|
42
|
+
const isDid = useRef(false);
|
|
41
43
|
|
|
42
|
-
useImperativeHandle(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
useImperativeHandle(
|
|
45
|
+
ref,
|
|
46
|
+
() =>
|
|
47
|
+
mergeGetter(myRefs || {}, {
|
|
48
|
+
setCompProps: (params: any) => {
|
|
49
|
+
setProps({ ...customProps, ...params });
|
|
50
|
+
},
|
|
51
|
+
setSrc: (src: string) => {
|
|
52
|
+
if (src.startsWith('http')) {
|
|
53
|
+
setRemoteUrl(src);
|
|
54
|
+
} else {
|
|
55
|
+
// 怀疑是文件id
|
|
56
|
+
setRemoteUrl(engineApis?.getAppFileUrlByFileCode(src));
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
[myRefs],
|
|
61
|
+
);
|
|
55
62
|
useDeepCompareEffect(() => {
|
|
56
63
|
// 如果是远程服务组件
|
|
57
64
|
if (fileCode && associatedType === 'file') {
|
|
@@ -64,7 +71,6 @@ const RemoteComponent = LingxiForwardRef<any, MyRemoteComponentProps>(
|
|
|
64
71
|
if (!visible) {
|
|
65
72
|
return <></>;
|
|
66
73
|
}
|
|
67
|
-
|
|
68
74
|
const Component = RemoteComponentMap[type];
|
|
69
75
|
|
|
70
76
|
return (
|
|
@@ -74,6 +80,12 @@ const RemoteComponent = LingxiForwardRef<any, MyRemoteComponentProps>(
|
|
|
74
80
|
customProps={customProps}
|
|
75
81
|
url={remoteUrl}
|
|
76
82
|
getEngineApis={getEngineApis}
|
|
83
|
+
forwardRef={(refs: any) => {
|
|
84
|
+
if (refs && isDid.current === false) {
|
|
85
|
+
isDid.current = true;
|
|
86
|
+
setMyRefs(refs);
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
77
89
|
/>
|
|
78
90
|
);
|
|
79
91
|
},
|
|
@@ -3,9 +3,8 @@ import { LingxiForwardRef } from '@lingxiteam/types';
|
|
|
3
3
|
import type { FormItemProps } from 'antd/lib/form';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import React, { CSSProperties, useMemo } from 'react';
|
|
6
|
-
import { FormFields, getFieldsProps } from '../utils';
|
|
6
|
+
import { filterHtmlNode, FormFields, getFieldsProps } from '../utils';
|
|
7
7
|
import { useLocale } from '../utils/hooks/useLocale';
|
|
8
|
-
import { renderRichText } from '../utils/renderReadOnly';
|
|
9
8
|
|
|
10
9
|
export interface MyRichTextEditorProps extends FormItemProps {
|
|
11
10
|
visible?: boolean;
|
|
@@ -84,7 +83,6 @@ const BaseRichTextEditor = React.forwardRef(
|
|
|
84
83
|
style,
|
|
85
84
|
richTextRef,
|
|
86
85
|
} = props;
|
|
87
|
-
engineApis;
|
|
88
86
|
|
|
89
87
|
const heightStyle = useMemo(
|
|
90
88
|
() =>
|
|
@@ -129,7 +127,7 @@ const BaseRichTextEditor = React.forwardRef(
|
|
|
129
127
|
ref={richTextRef}
|
|
130
128
|
{...richTextProps}
|
|
131
129
|
{...heightStyle}
|
|
132
|
-
autofocus={
|
|
130
|
+
autofocus={false} // 现场希望不要默认获取焦点
|
|
133
131
|
disabled={disabled}
|
|
134
132
|
value={value ?? ''}
|
|
135
133
|
language={language}
|
|
@@ -211,7 +209,16 @@ const RichTextEditor = LingxiForwardRef<any, MyRichTextEditorProps>(
|
|
|
211
209
|
disabled={disabled as any}
|
|
212
210
|
readOnly={readOnly}
|
|
213
211
|
rules={finalRules}
|
|
214
|
-
render={
|
|
212
|
+
render={(val: string) => {
|
|
213
|
+
const newVal = filterHtmlNode(val);
|
|
214
|
+
return (
|
|
215
|
+
<span
|
|
216
|
+
className="ued-input-readonly"
|
|
217
|
+
// eslint-disable-next-line react/no-danger
|
|
218
|
+
dangerouslySetInnerHTML={{ __html: newVal ?? '--' }}
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
}}
|
|
215
222
|
>
|
|
216
223
|
<BaseRichTextEditor
|
|
217
224
|
richTextRef={richTextRef}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CheckOutlined } from '@ant-design/icons';
|
|
2
2
|
import { EngineBaseProps } from '@lingxiteam/types';
|
|
3
|
-
import {
|
|
3
|
+
import { Select as AntdSelect, Tag } from 'antd';
|
|
4
4
|
import type { SelectProps } from 'antd/es/select';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { isEqual } from 'lodash';
|
|
@@ -19,9 +19,11 @@ import {
|
|
|
19
19
|
} from '../utils';
|
|
20
20
|
import { useMemoizedFn } from '../utils/ahooks';
|
|
21
21
|
import CustomModule from '../utils/CustomModule';
|
|
22
|
+
import EmptyComp from '../utils/Empty';
|
|
22
23
|
import { useFuncExpExecute } from '../utils/hooks/useFuncExpExecute';
|
|
23
24
|
import { useLocale } from '../utils/hooks/useLocale';
|
|
24
25
|
import { renderCommonList } from '../utils/renderReadOnly';
|
|
26
|
+
import SpinComp from '../utils/Spin';
|
|
25
27
|
import {
|
|
26
28
|
checkIfSelectedAll,
|
|
27
29
|
CHECK_ALL_VALUE,
|
|
@@ -166,8 +168,13 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
166
168
|
return _defaultValue;
|
|
167
169
|
}, []);
|
|
168
170
|
|
|
169
|
-
const {
|
|
170
|
-
|
|
171
|
+
const {
|
|
172
|
+
sandBoxSafeRun,
|
|
173
|
+
sandBoxLoadModule,
|
|
174
|
+
onlySyncValue,
|
|
175
|
+
compatConfig,
|
|
176
|
+
dataState,
|
|
177
|
+
} = getEngineApis() || {};
|
|
171
178
|
const { getLocale, lang } = useLocale(getEngineApis());
|
|
172
179
|
const CHECK_ALL_TEXT = getLocale?.('all', '全选');
|
|
173
180
|
const funcExpExecute = useFuncExpExecute(sandBoxSafeRun, getLocale);
|
|
@@ -275,6 +282,34 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
275
282
|
);
|
|
276
283
|
setDataSource(newData);
|
|
277
284
|
}, [JSON.stringify(propsDataSource)]);
|
|
285
|
+
|
|
286
|
+
const renderEmpty = useMemo(
|
|
287
|
+
() => (
|
|
288
|
+
<EmptyComp
|
|
289
|
+
getLocale={getLocale}
|
|
290
|
+
dataState={dataState}
|
|
291
|
+
clsName="pcfactory-empty-small"
|
|
292
|
+
/>
|
|
293
|
+
),
|
|
294
|
+
[dataState],
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// 远程过滤搜索
|
|
298
|
+
const onRemoteFilter = async (searchText: string) => {
|
|
299
|
+
try {
|
|
300
|
+
if (filterOption) {
|
|
301
|
+
setSearching(true);
|
|
302
|
+
// 所配置的动作,如发送请求需‘同步’才能正确展示loading
|
|
303
|
+
await filterOption(searchText ?? '');
|
|
304
|
+
}
|
|
305
|
+
} catch (err) {
|
|
306
|
+
searchTextRef.current = '';
|
|
307
|
+
console.log('err', err);
|
|
308
|
+
} finally {
|
|
309
|
+
setSearching(false);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
278
313
|
const filterObject: SelectProps = useMemo(() => {
|
|
279
314
|
if (filter === 'local') {
|
|
280
315
|
return {
|
|
@@ -289,24 +324,11 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
289
324
|
return {
|
|
290
325
|
defaultActiveFirstOption: false,
|
|
291
326
|
showSearch: true,
|
|
292
|
-
notFoundContent: searching ? <Spin size="small" /> : <Empty />,
|
|
293
327
|
filterOption: false,
|
|
294
328
|
onKeyDown: (e) => {
|
|
295
329
|
// 兼容旧浏览器使用keyCode
|
|
296
330
|
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
297
|
-
|
|
298
|
-
setSearching(true);
|
|
299
|
-
if (filterOption) {
|
|
300
|
-
// filterOption(searchText);
|
|
301
|
-
filterOption(searchTextRef?.current || '');
|
|
302
|
-
}
|
|
303
|
-
setSearching(false);
|
|
304
|
-
} catch (err) {
|
|
305
|
-
setSearching(false);
|
|
306
|
-
// setSearchText('');
|
|
307
|
-
searchTextRef.current = '';
|
|
308
|
-
console.log('err', err);
|
|
309
|
-
}
|
|
331
|
+
onRemoteFilter(searchTextRef?.current || '');
|
|
310
332
|
}
|
|
311
333
|
},
|
|
312
334
|
onSearch: (input) => {
|
|
@@ -320,7 +342,7 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
320
342
|
// 下拉单选,失去焦点的时候,会触发,多选不触发,导致下拉单选在失去焦点时,会多触发一次,所以input?.length > 0 判断下
|
|
321
343
|
if (filterOption && isInputSearch === true) {
|
|
322
344
|
// filterOption(searchText);
|
|
323
|
-
|
|
345
|
+
onRemoteFilter(input);
|
|
324
346
|
}
|
|
325
347
|
} catch (err) {
|
|
326
348
|
// setSearchText('');
|
|
@@ -331,7 +353,7 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
331
353
|
};
|
|
332
354
|
}
|
|
333
355
|
return {};
|
|
334
|
-
}, [filter]);
|
|
356
|
+
}, [filter, dataState]);
|
|
335
357
|
|
|
336
358
|
const renderLabel = (c: any, index: number) => {
|
|
337
359
|
if (
|
|
@@ -494,9 +516,7 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
494
516
|
const resetRemoteFilter = () => {
|
|
495
517
|
// 当选中后,需要重新调用远程过滤
|
|
496
518
|
if (filter === 'remote') {
|
|
497
|
-
|
|
498
|
-
filterOption('');
|
|
499
|
-
}
|
|
519
|
+
onRemoteFilter('');
|
|
500
520
|
}
|
|
501
521
|
};
|
|
502
522
|
|
|
@@ -560,6 +580,9 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
560
580
|
open={open}
|
|
561
581
|
mode={mode}
|
|
562
582
|
optionLabelProp="label"
|
|
583
|
+
notFoundContent={
|
|
584
|
+
searching ? <SpinComp dataState={dataState} /> : renderEmpty
|
|
585
|
+
}
|
|
563
586
|
onChange={(v) => {
|
|
564
587
|
if (filter === 'local' && searchTextRef.current) {
|
|
565
588
|
// 点击时需要重置过滤条件
|
|
@@ -602,23 +625,26 @@ const Select = React.forwardRef<any, MySelectProps>((props, ref) => {
|
|
|
602
625
|
}}
|
|
603
626
|
>
|
|
604
627
|
{renderCheckAll()}
|
|
605
|
-
{
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
628
|
+
{/* 远程过滤searching时展示notFoundContent内的loading */}
|
|
629
|
+
{searching
|
|
630
|
+
? []
|
|
631
|
+
: (dataSource || []).map((c: any, index: number) => {
|
|
632
|
+
return (
|
|
633
|
+
<AntdSelect.Option
|
|
634
|
+
label={renderLabel(c, index)}
|
|
635
|
+
title={c.label}
|
|
636
|
+
key={c.value || Math.random()}
|
|
637
|
+
value={transformValueType(c.value, value ?? [])}
|
|
638
|
+
disabled={
|
|
639
|
+
rangeLimit &&
|
|
640
|
+
rangeLimit.length > 0 &&
|
|
641
|
+
!rangeLimit.includes(+c.value)
|
|
642
|
+
}
|
|
643
|
+
>
|
|
644
|
+
{renderOption(c, index)}
|
|
645
|
+
</AntdSelect.Option>
|
|
646
|
+
);
|
|
647
|
+
})}
|
|
622
648
|
</AntdSelect>
|
|
623
649
|
</FormFields>
|
|
624
650
|
);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -266,6 +266,16 @@ const FormUpload = LingxiForwardRef<any, MyFormUploadProps>((props, ref) => {
|
|
|
266
266
|
) {
|
|
267
267
|
effectDownUrl = filePathInServer;
|
|
268
268
|
}
|
|
269
|
+
if (
|
|
270
|
+
effectDownUrl &&
|
|
271
|
+
effectDownUrl.match('X-SIGN=') &&
|
|
272
|
+
engineApis?.service?.buildXSignUrl
|
|
273
|
+
) {
|
|
274
|
+
// 如果资源地址使用签名模式,需更新地址签名
|
|
275
|
+
effectDownUrl = engineApis.service.buildXSignUrl(
|
|
276
|
+
effectDownUrl.slice(0, url.indexOf('&X-SIGN')),
|
|
277
|
+
);
|
|
278
|
+
}
|
|
269
279
|
return {
|
|
270
280
|
...file,
|
|
271
281
|
url:
|
|
@@ -458,7 +468,7 @@ const FormUpload = LingxiForwardRef<any, MyFormUploadProps>((props, ref) => {
|
|
|
458
468
|
const addWaterMark =
|
|
459
469
|
isWatermark && (!optionalFile || downloadWay === '2');
|
|
460
470
|
|
|
461
|
-
downUrl = engineApis?.service?.getAppFileUrlById({
|
|
471
|
+
downUrl = await engineApis?.service?.getAppFileUrlById({
|
|
462
472
|
addWaterMark,
|
|
463
473
|
fileId: file.fileId,
|
|
464
474
|
});
|
|
@@ -245,7 +245,7 @@ const ComSelect = forwardRef<any, ComSelectProps>((props) => {
|
|
|
245
245
|
});
|
|
246
246
|
// 针对选择的数据在对应表中已删除时,手动补齐数据做展示
|
|
247
247
|
const others: any[] = [];
|
|
248
|
-
ids.
|
|
248
|
+
ids.forEach((i: any) => {
|
|
249
249
|
// eslint-disable-next-line eqeqeq
|
|
250
250
|
if (!res.find((r) => r[valueKey?.key] == i)) {
|
|
251
251
|
others.push({
|
|
@@ -253,7 +253,6 @@ const ComSelect = forwardRef<any, ComSelectProps>((props) => {
|
|
|
253
253
|
[labelKey?.key || valueKey?.key]: i,
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
return i;
|
|
257
256
|
});
|
|
258
257
|
setSelectedRows([...res, ...others]);
|
|
259
258
|
// 如果初次未传入正确的value数据类型
|
|
@@ -16,9 +16,14 @@ export interface SummaryRowProps<T> {
|
|
|
16
16
|
* 默认总结行
|
|
17
17
|
*/
|
|
18
18
|
summary?: TableProps<T>['summary'];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 选择模式
|
|
22
|
+
*/
|
|
23
|
+
selectionType?: Required<TableProps<T>>['rowSelection']['type'];
|
|
19
24
|
}
|
|
20
25
|
const TableSummaryRow = <T,>(props: SummaryRowProps<T>) => {
|
|
21
|
-
const { dataSource, columns, summaryConfig, summary } = props;
|
|
26
|
+
const { dataSource, columns, summaryConfig, summary, selectionType } = props;
|
|
22
27
|
const { background } = summaryConfig || {};
|
|
23
28
|
const { summaryColList } = useSummaryCol({
|
|
24
29
|
dataSource,
|
|
@@ -32,6 +37,8 @@ const TableSummaryRow = <T,>(props: SummaryRowProps<T>) => {
|
|
|
32
37
|
background,
|
|
33
38
|
}}
|
|
34
39
|
>
|
|
40
|
+
{/* 开启选择模式时,预置一个占位单元格 */}
|
|
41
|
+
{selectionType !== undefined && <Cell index={0} />}
|
|
35
42
|
{summaryColList.map(({ colSpan, title, align }, i) => (
|
|
36
43
|
<Cell index={i} colSpan={colSpan || 1} align={align}>
|
|
37
44
|
{title}
|
|
@@ -139,7 +139,7 @@ const useCMDAction = (props: UseCMDActionPropsType) => {
|
|
|
139
139
|
name: dataName,
|
|
140
140
|
patch: undefined,
|
|
141
141
|
operateType: 0,
|
|
142
|
-
itemIndex:
|
|
142
|
+
itemIndex: 0,
|
|
143
143
|
newData: {},
|
|
144
144
|
payload,
|
|
145
145
|
};
|
|
@@ -154,7 +154,7 @@ const useCMDAction = (props: UseCMDActionPropsType) => {
|
|
|
154
154
|
name: dataName,
|
|
155
155
|
patch: undefined,
|
|
156
156
|
operateType: 0,
|
|
157
|
-
itemIndex:
|
|
157
|
+
itemIndex: 0,
|
|
158
158
|
newData: {},
|
|
159
159
|
payload,
|
|
160
160
|
},
|
|
@@ -166,7 +166,7 @@ const useCMDAction = (props: UseCMDActionPropsType) => {
|
|
|
166
166
|
updateData(params);
|
|
167
167
|
} else {
|
|
168
168
|
// 注意,不是直接使用 setInnerDataSource,而是通过 setOuterDataSource 间接驱动 -> setInnerDataSource
|
|
169
|
-
setOuterDataSource([...innerDataSource
|
|
169
|
+
setOuterDataSource([newRowData, ...innerDataSource]);
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// 是否开启行编辑
|
|
@@ -186,7 +186,7 @@ const useCMDAction = (props: UseCMDActionPropsType) => {
|
|
|
186
186
|
* 而是通过 setOuterDataSource 间接驱动 -> setInnerDataSource
|
|
187
187
|
* 因为需要对数据进行初始化
|
|
188
188
|
*/
|
|
189
|
-
setOuterDataSource([...innerDataSource
|
|
189
|
+
setOuterDataSource([newRowData, ...innerDataSource]);
|
|
190
190
|
},
|
|
191
191
|
|
|
192
192
|
/**
|