@lingxiteam/ebe-utils 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -18,11 +18,7 @@ const evalMyFunction = (str: any, params: any = {}) => {
|
|
|
18
18
|
if (!str) return '';
|
|
19
19
|
|
|
20
20
|
// 去除前后$, 去除注释,去除换行
|
|
21
|
-
let codeStr = str
|
|
22
|
-
.replace(/^\$/, '')
|
|
23
|
-
.replace(/\$$/, '')
|
|
24
|
-
.replace(/\/\*.+[\s\S]*\*\//, '')
|
|
25
|
-
.replace(/\n/, '');
|
|
21
|
+
let codeStr = str.replace(/^\$/, '').replace(/\$$/, '').replace(/\/\*.+[\s\S]*\*\//, '').replace(/\n/, '');
|
|
26
22
|
|
|
27
23
|
try {
|
|
28
24
|
if (params && Array.isArray(params)) {
|
|
@@ -227,7 +223,7 @@ const getRegExp = (pattern = '') => {
|
|
|
227
223
|
pattern
|
|
228
224
|
.split('')
|
|
229
225
|
.reverse()
|
|
230
|
-
.findIndex(w => w === '/') -
|
|
226
|
+
.findIndex((w) => w === '/') -
|
|
231
227
|
1; // 找到 '/'
|
|
232
228
|
if (location === pattern.length - 1) {
|
|
233
229
|
return new RegExp(pattern.substr(1, pattern.length - 2));
|
|
@@ -235,7 +231,7 @@ const getRegExp = (pattern = '') => {
|
|
|
235
231
|
return new RegExp(pattern.substr(1, location - 1), pattern.substring(location + 1));
|
|
236
232
|
}
|
|
237
233
|
// 如果是/开头和结尾 或者/开头/; 结尾
|
|
238
|
-
if (typeof pattern === 'string' &&
|
|
234
|
+
if (typeof pattern === 'string' && !(/^\/.*\/$|^\/.*\/;$/.test(pattern))) {
|
|
239
235
|
return new RegExp(pattern);
|
|
240
236
|
}
|
|
241
237
|
// 还原原逻辑,原来的正则是通过eval执行到的结果,通过new RegExp可能部分无法正确还原
|
|
@@ -258,21 +254,25 @@ const setRgbTo16 = (str: string) => {
|
|
|
258
254
|
const r = Math.floor(a * parseInt(values[0], 10) + (1 - a) * 255);
|
|
259
255
|
const g = Math.floor(a * parseInt(values[1], 10) + (1 - a) * 255);
|
|
260
256
|
const b = Math.floor(a * parseInt(values[2], 10) + (1 - a) * 255);
|
|
261
|
-
return
|
|
257
|
+
return (
|
|
258
|
+
`#${
|
|
259
|
+
(`0${r.toString(16)}`).slice(-2)
|
|
260
|
+
}${(`0${g.toString(16)}`).slice(-2)
|
|
261
|
+
}${(`0${b.toString(16)}`).slice(-2)}`
|
|
262
|
+
);
|
|
262
263
|
};
|
|
263
264
|
|
|
264
265
|
// 判断图片是否存在
|
|
265
|
-
const isImgUrl = (imgurl: any) =>
|
|
266
|
-
new
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
});
|
|
266
|
+
const isImgUrl = (imgurl: any) => new Promise((resolve, reject) => {
|
|
267
|
+
const ImgObj = new Image();
|
|
268
|
+
ImgObj.onload = res => {
|
|
269
|
+
resolve(res);
|
|
270
|
+
};
|
|
271
|
+
ImgObj.onerror = err => {
|
|
272
|
+
reject(err);
|
|
273
|
+
};
|
|
274
|
+
ImgObj.src = imgurl;
|
|
275
|
+
});
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
278
|
* @description: 根据文本计算大概宽度
|
|
@@ -309,42 +309,16 @@ const convertToBytes = (size: string) => {
|
|
|
309
309
|
if (typeof size !== 'string') return 0;
|
|
310
310
|
const unit = size.match(/[a-zA-Z]+/)?.[0]?.toUpperCase() || 'B';
|
|
311
311
|
const value = parseFloat(size);
|
|
312
|
-
const units: any = {
|
|
313
|
-
B: 1,
|
|
314
|
-
KB: 1024,
|
|
315
|
-
MB: 1024 * 1024,
|
|
316
|
-
GB: 1024 * 1024 * 1024,
|
|
317
|
-
TB: 1024 * 1024 * 1024 * 1024,
|
|
318
|
-
};
|
|
312
|
+
const units: any = { B: 1, KB: 1024, MB: 1024 * 1024, GB: 1024 * 1024 * 1024, TB: 1024 * 1024 * 1024 * 1024 };
|
|
319
313
|
return value * (units[unit] || 0);
|
|
320
314
|
};
|
|
321
315
|
const getSvgImageBase64 = (text: string) => {
|
|
322
316
|
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(text)}`;
|
|
323
317
|
};
|
|
324
318
|
|
|
325
|
-
const IconWebViewErrorSvg = getSvgImageBase64(
|
|
326
|
-
|
|
327
|
-
);
|
|
328
|
-
const IconNormalCheckSvg = getSvgImageBase64(
|
|
329
|
-
'<?xml version="1.0" encoding="UTF-8"?><svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>全局样式:20/原子级控件/复选/状态:未选中</title><g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="元素/选择/未选中"><path d="M11,22 C4.93492502,22 0,17.0653546 0,10.999496 C0,4.9337633 4.93492502,0 11,0 C17.065075,0 22,4.93464539 22,10.999496 C22,17.0644725 17.0660846,22 11,22" id="Fill" fill="#FFFFFF"></path><path d="M11,0.5 C13.8998633,0.5 16.5248731,1.67505184 18.4249106,3.57508938 C20.3249482,5.47512693 21.5,8.10013672 21.5,11 C21.5,13.8995696 20.3245821,16.5243277 18.4245965,18.4243132 C16.5242275,20.3246822 13.8989967,21.5 11,21.5 C8.10129687,21.5 5.47631792,20.324316 3.57600094,18.4239991 C1.67568396,16.5236821 0.5,13.8987031 0.5,11 C0.5,8.10100334 1.67531776,5.47577251 3.57568679,3.57540349 C5.47567234,1.67541793 8.10043037,0.5 11,0.5 Z" id="Shape" stroke="#CCCCCC"></path></g></g></svg>'
|
|
330
|
-
);
|
|
331
|
-
const IconCheckSvg = getSvgImageBase64(
|
|
332
|
-
'<?xml version="1.0" encoding="UTF-8"?><svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>全局样式:20/原子级控件/复选/状态:#选中</title><g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="system-complete"><path d="M11,0 C17.075904,0 22,4.92409598 22,11 C22,17.075904 17.0734732,22 11,22 C4.92652679,22 0,17.0734732 0,11 C0,4.92652679 4.92409598,0 11,0 Z" id="Shape" fill="#1890FF"></path><path d="M9.42871875,12.9681652 L7.2069029,10.7463493 C6.90006126,10.4395077 6.40257267,10.4395077 6.09573103,10.7463493 C5.78889035,11.05319 5.78889035,11.550677 6.09573103,11.8575177 C6.09573161,11.8575183 6.0957322,11.8575189 6.09573278,11.8575195 L8.72212536,14.4838955 C9.11265701,14.8744045 9.74581424,14.874407 10.136349,14.483901 L10.5404063,14.0798527 L10.5404063,14.0798527 L16.2813591,8.33795955 C16.588183,8.03108543 16.5881626,7.53359119 16.2813136,7.22674219 C15.974472,6.91990055 15.4769834,6.91990055 15.1701417,7.22674219 L9.42871875,12.9681652 L9.42871875,12.9681652 Z" id="Path" fill="#FFFFFF"></path></g></g></svg>'
|
|
333
|
-
);
|
|
334
|
-
|
|
335
|
-
const getDynamicProperty = (str: string) => {
|
|
336
|
-
const patterns = ['data.', 'globalData.', 'state.'];
|
|
337
|
-
|
|
338
|
-
// eslint-disable-next-line no-plusplus
|
|
339
|
-
for (let index = 0; index < patterns.length; index++) {
|
|
340
|
-
const pattern = patterns[index];
|
|
341
|
-
if (str.includes(pattern)) {
|
|
342
|
-
return pattern.slice(0, -1);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
// 如果都不包含,返回 null
|
|
346
|
-
return undefined;
|
|
347
|
-
};
|
|
319
|
+
const IconWebViewErrorSvg = getSvgImageBase64('<svg width="181" height="170" viewBox="0 0 181 170" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="Frame"><g id="页面-1"><g id="1920X1000"><g id="此页面未找到~"><g id="Group 2"><path id="Stroke-1" fill-rule="evenodd" clip-rule="evenodd" d="M47.5789 45.7989C47.5789 42.6064 48.8474 39.5438 51.1051 37.2858C53.3629 35.0284 56.4252 33.7597 59.6182 33.7597H59.6193C59.9774 33.7597 60.3209 33.9019 60.5741 34.1552C60.8272 34.4085 60.9695 34.7522 60.9695 35.1099C60.9695 39.9093 60.9695 55.8563 60.9695 55.8563L47.5789 56.0773V45.7989Z" fill="white" stroke="#9DB9F5"/><path id="Stroke-2" fill-rule="evenodd" clip-rule="evenodd" d="M132.386 45.8145C132.386 39.1572 126.989 33.7597 120.331 33.7597H120.33C119.976 33.7597 119.636 33.9003 119.386 34.1508C119.136 34.4013 118.995 34.7405 118.995 35.0943C118.995 39.8741 118.995 55.8563 118.995 55.8563L132.386 56.0773V45.8145Z" fill="white" stroke="#9DB9F5"/><path id="Fill-4" fill-rule="evenodd" clip-rule="evenodd" d="M145.776 80.8136C145.776 57.3996 126.767 38.3906 103.353 38.3906H76.6114C53.1975 38.3906 34.1884 57.3996 34.1884 80.8136V85.238C34.1884 108.652 46.4826 125.429 69.8965 125.429H110.068C133.482 125.429 145.776 108.652 145.776 85.238V80.8136Z" fill="white"/><path id="形状结合" fill-rule="evenodd" clip-rule="evenodd" d="M116.64 40.0003C133.598 45.5561 145.861 61.52 145.861 80.3254V84.7498C145.861 108.164 133.566 124.941 110.153 124.941H69.9808C63.4458 124.941 57.7771 123.634 53.0001 121.241C56.5982 122.352 60.5944 122.941 64.9808 122.941H105.153C128.566 122.941 140.861 106.164 140.861 82.7498V78.3254C140.861 61.4673 131.006 46.8928 116.749 40.0527L116.64 40.0003Z" fill="#DCE7FA"/><path id="Stroke-5" fill-rule="evenodd" clip-rule="evenodd" d="M145.776 80.8136C145.776 57.3996 126.767 38.3906 103.353 38.3906H76.6114C53.1975 38.3906 34.1884 57.3996 34.1884 80.8136V85.238C34.1884 108.652 46.4826 125.429 69.8965 125.429H110.068C133.482 125.429 145.776 108.652 145.776 85.238V80.8136Z" stroke="#9DB9F5" stroke-linecap="round" stroke-linejoin="round"/><path id="Fill-10" fill-rule="evenodd" clip-rule="evenodd" d="M96.9342 38.863C96.9342 42.1561 93.3046 43 90.2136 43C87.1227 43 83.4931 42.1561 83.4931 38.863C83.4931 34.9214 86.767 29.1802 88.9891 25.6778C89.2536 25.2563 89.7158 25.0005 90.2136 25C90.7114 25 91.1742 25.2563 91.4387 25.6778C93.6603 29.1802 96.9342 34.9214 96.9342 38.863Z" fill="#E0E8FA" stroke="#9DB9F5"/><path id="Fill-6" fill-rule="evenodd" clip-rule="evenodd" d="M132.386 81.9099C132.386 66.513 119.886 54.0129 104.489 54.0129H75.476C60.0792 54.0129 47.5789 66.513 47.5789 81.9099C47.5789 97.3067 52.268 107.575 67.6648 107.575H112.3C127.697 107.575 132.386 97.3067 132.386 81.9099Z" fill="white"/><path id="Stroke-7" d="M104.489 50.6653H75.476C58.2303 50.6653 44.2313 64.6642 44.2313 81.9099C44.2313 90.7375 45.7017 97.4992 49.092 102.417C52.9783 108.053 59.1903 110.923 67.6648 110.923H112.3C120.775 110.923 126.987 108.053 130.873 102.417C134.263 97.4992 135.734 90.7375 135.734 81.9099C135.734 64.6641 121.735 50.6653 104.489 50.6653Z" fill="#9DB9F5"/><g id="路径-2"><path id="路径" d="M75.476 57.3605H104.489C118.037 57.3605 129.038 68.3618 129.038 81.9099C129.038 97.3996 124.331 104.228 112.3 104.228H67.6648C55.6342 104.228 50.9266 97.3996 50.9266 81.9099C50.9266 68.3619 61.928 57.3605 75.476 57.3605Z" fill="#E0E8FA"/></g><path id="Fill-8" fill-rule="evenodd" clip-rule="evenodd" d="M84.1137 95.9463C85.4031 95.6201 86.6775 95.4603 87.9468 95.3546C88.7982 95.2837 89.6435 95.2645 90.4899 95.2639C91.1254 95.2634 91.7597 95.2636 92.3969 95.297C93.876 95.3745 95.3613 95.5534 96.8638 95.9458C97.3955 96.1229 97.9702 95.8352 98.1476 95.3038C98.3245 94.7723 98.0366 94.1972 97.5054 94.0202C95.903 93.3659 94.2973 92.8946 92.6647 92.6492C91.9422 92.5406 91.2158 92.4767 90.4888 92.4767C89.5219 92.4766 88.5549 92.5743 87.5953 92.7544C86.2043 93.0155 84.8402 93.454 83.4746 94.0198C82.9429 94.1961 82.6544 94.7709 82.8308 95.3025C83.0071 95.8341 83.5819 96.1226 84.1137 95.9463Z" fill="#9DB9F5"/><path id="Fill-9" fill-rule="evenodd" clip-rule="evenodd" d="M117.27 77.4622C117.27 74.9977 115.272 73 112.808 73H112.806C110.341 73 108.343 74.9977 108.343 77.4622C108.343 80.1433 108.343 83.5432 108.343 86.2243C108.343 88.6888 110.341 90.6867 112.806 90.6867H112.808C115.272 90.6867 117.27 88.6888 117.27 86.2243C117.27 83.5432 117.27 80.1433 117.27 77.4622Z" fill="#9DB9F5"/><path id="Fill-9_2" fill-rule="evenodd" clip-rule="evenodd" d="M72.927 77.6596C72.927 75.1951 70.9291 73.1974 68.4646 73.1974H68.4624C65.998 73.1974 64 75.1951 64 77.6596C64 80.3407 64 83.7406 64 86.4217C64 88.8862 65.998 90.8841 68.4624 90.8841H68.4646C70.9291 90.8841 72.927 88.8862 72.927 86.4217C72.927 83.7406 72.927 80.3407 72.927 77.6596Z" fill="#9DB9F5"/><path id="形状结合_2" fill-rule="evenodd" clip-rule="evenodd" d="M68.5 76.1974C69.88 76.1974 71 77.3176 71 78.6974C71 80.0772 69.88 81.1974 68.5 81.1974C67.12 81.1974 66 80.0772 66 78.6974C66 77.3176 67.12 76.1974 68.5 76.1974ZM112.843 76C114.223 76 115.343 77.1202 115.343 78.5C115.343 79.8798 114.223 81 112.843 81C111.463 81 110.343 79.8798 110.343 78.5C110.343 77.1202 111.463 76 112.843 76Z" fill="white"/><path id="形状结合_3" d="M68.4934 61.2901L68.4933 64.8168C63.005 66.1839 58.9321 71.1569 58.9321 77.0741C58.9321 77.3899 58.9359 77.6987 58.9436 78.0005L55.504 78.0002C55.4967 77.6966 55.4931 77.3879 55.4931 77.0741C55.4931 69.2458 61.0911 62.7179 68.4934 61.2901Z" fill="white"/><path id="矩形" fill-rule="evenodd" clip-rule="evenodd" d="M70.4931 61H76.4931V64.806H70.4931V61Z" fill="white"/><g id="编组"><path id="Fill-11" fill-rule="evenodd" clip-rule="evenodd" d="M36.927 70.1091C36.927 69.4966 36.4306 69 35.8182 69C35.493 69 35.1116 69 34.6953 69C32.9196 69 31.2166 69.7056 29.961 70.9612C28.7054 72.2168 28 73.9198 28 75.6955C28 79.785 28 84.9965 28 89.086C28 90.8617 28.7054 92.5647 29.961 93.8203C31.2166 95.076 32.9196 95.7813 34.6953 95.7813C35.1116 95.7813 35.493 95.7813 35.8182 95.7813C36.4306 95.7813 36.927 95.2849 36.927 94.6725C36.927 90.3236 36.927 74.4579 36.927 70.1091Z" fill="white" stroke="#9DB9F5"/><path id="形状结合_4" fill-rule="evenodd" clip-rule="evenodd" d="M29.5069 73.4835V86.874C29.5069 88.6497 30.2123 90.3527 31.4679 91.6083C32.7236 92.864 34.4265 93.5693 36.2022 93.5693L36.4339 93.5692L36.434 94.4605C36.434 95.032 36.0015 95.5026 35.4459 95.5628L35.3251 95.5693H34.2022C32.4265 95.5693 31.7236 94.864 30.4679 93.6083C29.2123 92.3527 28.5069 90.6497 28.5069 88.874V75.8337C28.5069 74.4889 28.9115 73.1858 29.6533 72.0872C29.5569 72.543 29.5069 73.0106 29.5069 73.4835Z" fill="#DFE9FB"/></g><g id="编组备份"><path id="Fill-11_2" fill-rule="evenodd" clip-rule="evenodd" d="M144 70.1091C144 69.4966 144.496 69 145.109 69C145.434 69 145.815 69 146.232 69C148.007 69 149.71 69.7056 150.966 70.9612C152.222 72.2168 152.927 73.9198 152.927 75.6955C152.927 79.785 152.927 84.9965 152.927 89.086C152.927 90.8617 152.222 92.5647 150.966 93.8203C149.71 95.076 148.007 95.7813 146.232 95.7813C145.815 95.7813 145.434 95.7813 145.109 95.7813C144.496 95.7813 144 95.2849 144 94.6725C144 90.3236 144 74.4579 144 70.1091Z" fill="white" stroke="#9DB9F5"/><path id="形状结合_5" fill-rule="evenodd" clip-rule="evenodd" d="M151.42 73.4835V86.874C151.42 88.6497 150.715 90.3527 149.459 91.6083C148.204 92.864 146.501 93.5693 144.725 93.5693L144.493 93.5692L144.493 94.4605C144.493 95.032 144.926 95.5026 145.481 95.5628L145.602 95.5693H146.725C148.501 95.5693 149.204 94.864 150.459 93.6083C151.715 92.3527 152.42 90.6497 152.42 88.874V75.8337C152.42 74.4889 152.016 73.1858 151.274 72.0872C151.37 72.543 151.42 73.0106 151.42 73.4835Z" fill="#DFE9FB"/></g><path id="椭圆形" d="M90 145C110.987 145 128 142.09 128 138.5C128 134.91 110.987 132 90 132C69.0132 132 52 134.91 52 138.5C52 142.09 69.0132 145 90 145Z" fill="#E0E8FA"/><path id="路径_2" d="M171.537 94.931C167.868 99.3728 161.059 99.807 161.059 99.807C161.059 99.807 160.2 93.0389 163.871 88.597C167.541 84.1555 174.349 83.7213 174.349 83.7213C174.349 83.7213 175.207 90.4891 171.537 94.931Z" fill="#E0E8FA"/><path id="路径备份-2" d="M23.1487 112.332C20.7639 115.219 16.3383 115.501 16.3383 115.501C16.3383 115.501 15.7803 111.102 18.1661 108.215C20.5514 105.328 24.977 105.045 24.977 105.045C24.977 105.045 25.5346 109.444 23.1487 112.332Z" fill="#E0E8FA"/></g></g></g></g></g></svg>');
|
|
320
|
+
const IconNormalCheckSvg = getSvgImageBase64('<?xml version="1.0" encoding="UTF-8"?><svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>全局样式:20/原子级控件/复选/状态:未选中</title><g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="元素/选择/未选中"><path d="M11,22 C4.93492502,22 0,17.0653546 0,10.999496 C0,4.9337633 4.93492502,0 11,0 C17.065075,0 22,4.93464539 22,10.999496 C22,17.0644725 17.0660846,22 11,22" id="Fill" fill="#FFFFFF"></path><path d="M11,0.5 C13.8998633,0.5 16.5248731,1.67505184 18.4249106,3.57508938 C20.3249482,5.47512693 21.5,8.10013672 21.5,11 C21.5,13.8995696 20.3245821,16.5243277 18.4245965,18.4243132 C16.5242275,20.3246822 13.8989967,21.5 11,21.5 C8.10129687,21.5 5.47631792,20.324316 3.57600094,18.4239991 C1.67568396,16.5236821 0.5,13.8987031 0.5,11 C0.5,8.10100334 1.67531776,5.47577251 3.57568679,3.57540349 C5.47567234,1.67541793 8.10043037,0.5 11,0.5 Z" id="Shape" stroke="#CCCCCC"></path></g></g></svg>');
|
|
321
|
+
const IconCheckSvg = getSvgImageBase64('<?xml version="1.0" encoding="UTF-8"?><svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>全局样式:20/原子级控件/复选/状态:#选中</title><g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="system-complete"><path d="M11,0 C17.075904,0 22,4.92409598 22,11 C22,17.075904 17.0734732,22 11,22 C4.92652679,22 0,17.0734732 0,11 C0,4.92652679 4.92409598,0 11,0 Z" id="Shape" fill="#1890FF"></path><path d="M9.42871875,12.9681652 L7.2069029,10.7463493 C6.90006126,10.4395077 6.40257267,10.4395077 6.09573103,10.7463493 C5.78889035,11.05319 5.78889035,11.550677 6.09573103,11.8575177 C6.09573161,11.8575183 6.0957322,11.8575189 6.09573278,11.8575195 L8.72212536,14.4838955 C9.11265701,14.8744045 9.74581424,14.874407 10.136349,14.483901 L10.5404063,14.0798527 L10.5404063,14.0798527 L16.2813591,8.33795955 C16.588183,8.03108543 16.5881626,7.53359119 16.2813136,7.22674219 C15.974472,6.91990055 15.4769834,6.91990055 15.1701417,7.22674219 L9.42871875,12.9681652 L9.42871875,12.9681652 Z" id="Path" fill="#FFFFFF"></path></g></g></svg>');
|
|
348
322
|
|
|
349
323
|
export {
|
|
350
324
|
flatTree,
|
|
@@ -365,5 +339,4 @@ export {
|
|
|
365
339
|
IconCheckSvg,
|
|
366
340
|
IconNormalCheckSvg,
|
|
367
341
|
IconWebViewErrorSvg,
|
|
368
|
-
getDynamicProperty,
|
|
369
342
|
};
|
|
@@ -47,41 +47,11 @@ const LABEL_SPAN_DATA = [
|
|
|
47
47
|
];
|
|
48
48
|
|
|
49
49
|
const getDefaultTableColumns = () => [
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
titleLineNum: 1,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: '第二列',
|
|
59
|
-
dataIndex: 'column2',
|
|
60
|
-
key: 'column2',
|
|
61
|
-
lineNum: 1,
|
|
62
|
-
titleLineNum: 1,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: '第三列',
|
|
66
|
-
dataIndex: 'column3',
|
|
67
|
-
key: 'column3',
|
|
68
|
-
lineNum: 1,
|
|
69
|
-
titleLineNum: 1,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
title: '第四列',
|
|
73
|
-
dataIndex: 'column4',
|
|
74
|
-
key: 'column4',
|
|
75
|
-
lineNum: 1,
|
|
76
|
-
titleLineNum: 1,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
title: '第五列',
|
|
80
|
-
dataIndex: 'column5',
|
|
81
|
-
key: 'column5',
|
|
82
|
-
lineNum: 1,
|
|
83
|
-
titleLineNum: 1,
|
|
84
|
-
},
|
|
50
|
+
{ title: '第一列', dataIndex: 'column1', key: 'column1', lineNum: 1, titleLineNum: 1 },
|
|
51
|
+
{ title: '第二列', dataIndex: 'column2', key: 'column2', lineNum: 1, titleLineNum: 1 },
|
|
52
|
+
{ title: '第三列', dataIndex: 'column3', key: 'column3', lineNum: 1, titleLineNum: 1 },
|
|
53
|
+
{ title: '第四列', dataIndex: 'column4', key: 'column4', lineNum: 1, titleLineNum: 1 },
|
|
54
|
+
{ title: '第五列', dataIndex: 'column5', key: 'column5', lineNum: 1, titleLineNum: 1 },
|
|
85
55
|
];
|
|
86
56
|
|
|
87
57
|
const getDefaultDescriptionColumns = () => [
|
|
@@ -171,17 +141,16 @@ const getDefaultIconSetting = () => [
|
|
|
171
141
|
},
|
|
172
142
|
];
|
|
173
143
|
|
|
174
|
-
const getDefaultTransferData = () =>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}));
|
|
144
|
+
const getDefaultTransferData = () => [...new Array(4).keys()].map(key => ({
|
|
145
|
+
id: key + 1,
|
|
146
|
+
key: key + 1,
|
|
147
|
+
title: `第${key + 1}项`,
|
|
148
|
+
children: [...new Array(4).keys()].map(childKey => ({
|
|
149
|
+
id: `${key + 1}-${childKey + 1}`,
|
|
150
|
+
key: `${key + 1}-${childKey + 1}`,
|
|
151
|
+
title: `子 ${key + 1}-${childKey + 1}`,
|
|
152
|
+
})),
|
|
153
|
+
}));
|
|
185
154
|
|
|
186
155
|
const ganttItemEventParams = [
|
|
187
156
|
{ title: '项目对象', name: 'plan', value: '$plan$' },
|
|
@@ -189,11 +158,7 @@ const ganttItemEventParams = [
|
|
|
189
158
|
{ title: '项目计划名称', name: 'planName', value: '$planName$' },
|
|
190
159
|
{ title: '项目计划索引', name: 'index', value: '$index$' },
|
|
191
160
|
{ title: '项目计划开始时间', name: 'planStart', value: '$planStart$' },
|
|
192
|
-
{
|
|
193
|
-
title: '项目计划子任务列表',
|
|
194
|
-
name: 'planChildren',
|
|
195
|
-
value: '$planChildren$',
|
|
196
|
-
},
|
|
161
|
+
{ title: '项目计划子任务列表', name: 'planChildren', value: '$planChildren$' },
|
|
197
162
|
];
|
|
198
163
|
|
|
199
164
|
const getCompListID2 = () => [
|
|
@@ -361,9 +326,17 @@ const lxRadarChartDefaultData = [
|
|
|
361
326
|
},
|
|
362
327
|
];
|
|
363
328
|
|
|
364
|
-
const lxRadarChartDefaultIndicator = [
|
|
329
|
+
const lxRadarChartDefaultIndicator = [
|
|
330
|
+
{ name: '销售' },
|
|
331
|
+
{ name: '管理' },
|
|
332
|
+
{ name: '信息技术' },
|
|
333
|
+
{ name: '客服' },
|
|
334
|
+
{ name: '研发' },
|
|
335
|
+
{ name: '市场' },
|
|
336
|
+
];
|
|
365
337
|
|
|
366
|
-
const FILE_ENCODE_TIP =
|
|
338
|
+
const FILE_ENCODE_TIP =
|
|
339
|
+
'下载时系统自动对文件名进行编码,编码规则为:大写英文字母+数字随机组合,长度20。';
|
|
367
340
|
const IS_WATERMARK_TIP =
|
|
368
341
|
'点击下载时系统将自动为WORD、EXCEL、PPT和PDF等文档添加水印信息(可在应用设置-水印设置页面对水印信息进行配置),其中WORD、EXCEL、PPT等文档将自动转成PDF文档,且PDF文档为锁定不可编辑状态';
|
|
369
342
|
const OPTIONAL_FILE_TIP = '点击下载时可选"源文件下载" 或 "加水印下载(PDF)"';
|
|
@@ -395,10 +368,8 @@ const treeArrReloadDataTip = {
|
|
|
395
368
|
data: `接收数据类型需要为数组类型: 如:${JSON.stringify(getDefaultTreeOptions())}`,
|
|
396
369
|
labelKey: '名称的映射字段名:如内容返回时[{title: "第一列", value: "column1"}], 那么需要输入title',
|
|
397
370
|
nodeValueKey: 'key的映射字段名:如内容返回时[{title: "第一列", value: "column1"}], 那么需要输入value',
|
|
398
|
-
selectable:
|
|
399
|
-
"
|
|
400
|
-
childrenKey:
|
|
401
|
-
'使用场景:一次性查询所有数据时,需要设置下一级列表数据的取值字段;\n 示例说明:如下参数,当查询所有数据,需要标记出从children字段获取下级列表的数据;\n {\n "resultObject": [{\n "children": [{\n "children": [],\n "parent_id": "10700",\n "name": "2-1",\n "id": "10900",\n }],\n "parent_id": "-1",\n "name": "第二棵",\n "id": "10700",\n }]\n }\n ',
|
|
371
|
+
selectable: "适用场景:需要控制当前节点是否能够选择,且需后端服务有字段标识出是否可选;\n 处理逻辑:当节点的字段编码值为布尔类型的false,或者字符串类型为'false'、\n 空字符串时,都认为不可选,否则认为可选。",
|
|
372
|
+
childrenKey: '使用场景:一次性查询所有数据时,需要设置下一级列表数据的取值字段;\n 示例说明:如下参数,当查询所有数据,需要标记出从children字段获取下级列表的数据;\n {\n "resultObject": [{\n "children": [{\n "children": [],\n "parent_id": "10700",\n "name": "2-1",\n "id": "10900",\n }],\n "parent_id": "-1",\n "name": "第二棵",\n "id": "10700",\n }]\n }\n ',
|
|
402
373
|
};
|
|
403
374
|
|
|
404
375
|
/**
|
|
@@ -578,6 +549,29 @@ const DatePickerOptions = {
|
|
|
578
549
|
],
|
|
579
550
|
} as const;
|
|
580
551
|
|
|
552
|
+
/**
|
|
553
|
+
* 标准时间格式
|
|
554
|
+
*/
|
|
555
|
+
export const StandardFormat = {
|
|
556
|
+
date: 'YYYY-MM-DD',
|
|
557
|
+
time: 'YYYY-MM-DD HH:mm:ss',
|
|
558
|
+
year: 'YYYY',
|
|
559
|
+
month: 'YYYY-MM',
|
|
560
|
+
} as const;
|
|
561
|
+
|
|
562
|
+
export type StandardFormatType = keyof typeof StandardFormat;
|
|
563
|
+
|
|
564
|
+
const SizePaddingMap = {
|
|
565
|
+
small: '8px',
|
|
566
|
+
default: '12px',
|
|
567
|
+
large: '16px',
|
|
568
|
+
} as any;
|
|
569
|
+
|
|
570
|
+
const CardIconTypePaddingMap = {
|
|
571
|
+
middle: '2px',
|
|
572
|
+
left: '0px',
|
|
573
|
+
} as any;
|
|
574
|
+
|
|
581
575
|
export {
|
|
582
576
|
COL_SPAN_DATA,
|
|
583
577
|
WRAPPER_SPAN_DATA,
|
|
@@ -607,4 +601,6 @@ export {
|
|
|
607
601
|
commonArrReloadDataTip,
|
|
608
602
|
treeArrReloadDataTip,
|
|
609
603
|
DatePickerOptions,
|
|
604
|
+
SizePaddingMap,
|
|
605
|
+
CardIconTypePaddingMap,
|
|
610
606
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, createContext } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface DynamicDataContext {
|
|
4
4
|
|
|
@@ -60,7 +60,7 @@ export interface DynamicDataContext {
|
|
|
60
60
|
* @returns
|
|
61
61
|
*/
|
|
62
62
|
useWatch: (formCode: string, fieldCode: string) => unknown;
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export interface NoopInDynamicContainerProps {
|
|
@@ -70,34 +70,29 @@ export interface NoopInDynamicContainerProps {
|
|
|
70
70
|
*/
|
|
71
71
|
_innerDynamicDataContainer: false;
|
|
72
72
|
|
|
73
|
-
form: DynamicDataContext['form']
|
|
73
|
+
form: DynamicDataContext['form']
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export const dynamicDataContext = createContext<DynamicDataContext | NoopInDynamicContainerProps>({
|
|
77
77
|
_innerDynamicDataContainer: false,
|
|
78
78
|
form: {
|
|
79
|
-
getFieldsValue: () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
resetFields: () => {
|
|
84
|
-
console.warn('请在动态容器下使用resetFields方法');
|
|
85
|
-
},
|
|
86
|
-
setFieldsValue: () => {
|
|
87
|
-
console.warn('请在动态容器下使用resetFields方法');
|
|
88
|
-
},
|
|
89
|
-
useWatch: (formCode: string, fieldCode: string) => {
|
|
90
|
-
console.warn('请在动态容器下使用useWatch方法');
|
|
91
|
-
},
|
|
79
|
+
getFieldsValue: () => { console.warn('请在动态容器下使用getFieldsValue方法'); return {}; },
|
|
80
|
+
resetFields: () => { console.warn('请在动态容器下使用resetFields方法'); },
|
|
81
|
+
setFieldsValue: () => { console.warn('请在动态容器下使用resetFields方法'); },
|
|
82
|
+
useWatch: (formCode: string, fieldCode: string) => { console.warn('请在动态容器下使用useWatch方法'); },
|
|
92
83
|
},
|
|
93
84
|
});
|
|
94
85
|
|
|
95
86
|
dynamicDataContext.displayName = 'PCFactoryDynamicDataContext';
|
|
96
87
|
|
|
88
|
+
|
|
97
89
|
const useDynamicData = () => {
|
|
98
90
|
return useContext(dynamicDataContext);
|
|
99
91
|
};
|
|
100
92
|
|
|
101
93
|
const DynamicDataProvider = dynamicDataContext.Provider;
|
|
102
94
|
|
|
103
|
-
export {
|
|
95
|
+
export {
|
|
96
|
+
DynamicDataProvider,
|
|
97
|
+
useDynamicData,
|
|
98
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ColProps } from 'antd/es/col';
|
|
2
1
|
import type { FormInstance } from 'antd/es/form';
|
|
2
|
+
import { useContext, createContext } from 'react';
|
|
3
3
|
import type { FormLayout } from 'antd/es/form/Form';
|
|
4
|
-
import {
|
|
4
|
+
import type { ColProps } from 'antd/es/col';
|
|
5
5
|
|
|
6
6
|
export type StatusType = 'disabled' | 'readonly';
|
|
7
7
|
|
|
@@ -23,19 +23,19 @@ export interface FormContextProps {
|
|
|
23
23
|
* 状态下发
|
|
24
24
|
*/
|
|
25
25
|
statusMonitor: {
|
|
26
|
-
addListener: (fn: MonitorFn) => void
|
|
27
|
-
removeListener: (fn: MonitorFn) => void
|
|
26
|
+
addListener: (fn: MonitorFn) => void,
|
|
27
|
+
removeListener: (fn: MonitorFn) => void,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* 表单编码
|
|
32
32
|
*/
|
|
33
|
-
formCode: string
|
|
33
|
+
formCode: string,
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* 布局
|
|
37
37
|
*/
|
|
38
|
-
layout: FormLayout
|
|
38
|
+
layout: FormLayout,
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* 每行列数
|
|
@@ -86,17 +86,22 @@ export interface FormContextProps {
|
|
|
86
86
|
/**
|
|
87
87
|
* 行间距
|
|
88
88
|
*/
|
|
89
|
-
rowSpace: string | number
|
|
89
|
+
rowSpace: string | number
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* 列间距
|
|
93
93
|
*/
|
|
94
|
-
colSpace: string | number
|
|
94
|
+
colSpace: string | number
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* 是否一直展示标题(零代码使用,表单内包裹view然后再包裹表单控件,需要展示标题)
|
|
98
98
|
*/
|
|
99
99
|
isShowTitle?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* label是否换行
|
|
103
|
+
*/
|
|
104
|
+
labelWrap?: boolean;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
export interface NoopInFormProps {
|
|
@@ -109,8 +114,8 @@ export interface NoopInFormProps {
|
|
|
109
114
|
/**
|
|
110
115
|
* 表单编码
|
|
111
116
|
*/
|
|
112
|
-
formCode?: string
|
|
113
|
-
|
|
117
|
+
formCode?: string,
|
|
118
|
+
|
|
114
119
|
/**
|
|
115
120
|
* 是否一直展示标题(零代码使用,表单内包裹view然后再包裹表单控件,需要展示标题)
|
|
116
121
|
*/
|
|
@@ -120,7 +125,7 @@ export interface NoopInFormProps {
|
|
|
120
125
|
export const formContext = createContext<FormContextProps | NoopInFormProps>({
|
|
121
126
|
inForm: false,
|
|
122
127
|
});
|
|
123
|
-
type FormEDContextProps = Pick<FormContextProps, 'colSpace' | 'colon' | 'labelAlign' | 'labelCol' | 'rowSpace' | 'colSpan' | 'layout' | 'wrapperCol'
|
|
128
|
+
type FormEDContextProps = Pick<FormContextProps, 'colSpace' | 'colon' | 'labelAlign' | 'labelCol' | 'rowSpace' | 'colSpan' | 'layout' | 'wrapperCol' | 'labelWrap'>
|
|
124
129
|
export const formEDContext = createContext<Partial<FormEDContextProps>>({});
|
|
125
130
|
|
|
126
131
|
formContext.displayName = 'PCFactoryFormContext';
|
|
@@ -137,4 +142,9 @@ const useEDForm = () => {
|
|
|
137
142
|
return useContext(formEDContext);
|
|
138
143
|
};
|
|
139
144
|
|
|
140
|
-
export {
|
|
145
|
+
export {
|
|
146
|
+
FormProvider,
|
|
147
|
+
useForm,
|
|
148
|
+
useEDForm,
|
|
149
|
+
FormEDProvider,
|
|
150
|
+
};
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, {
|
|
2
|
+
CSSProperties,
|
|
3
|
+
useCallback,
|
|
4
|
+
useEffect,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from 'react';
|
|
2
10
|
import { Form } from 'antd';
|
|
11
|
+
import { useForm } from './FormContext';
|
|
12
|
+
import { getFormItemClassName, getMode, mode } from './common';
|
|
13
|
+
import renderReadOnly from '../renderReadOnly';
|
|
14
|
+
import TooltipView from '../../TooltipView';
|
|
3
15
|
import { FormItemProps, Rule } from 'antd/es/form';
|
|
16
|
+
import WrapperContainer from './WrapperContainer';
|
|
17
|
+
import { useUpdateEffect } from '../ahooks';
|
|
4
18
|
import classNames from 'classnames';
|
|
5
|
-
import
|
|
6
|
-
import TooltipView from '../../TooltipView';
|
|
19
|
+
import { EngineBaseProps } from '@lingxiteam/types';
|
|
7
20
|
import { antPrefix } from '../../variables';
|
|
8
|
-
import
|
|
9
|
-
import renderReadOnly from '../renderReadOnly';
|
|
10
|
-
import { getFormItemClassName, getMode, mode } from './common';
|
|
11
|
-
import { useForm } from './FormContext';
|
|
12
|
-
import WrapperContainer from './WrapperContainer';
|
|
21
|
+
import useInit from '../hooks/useInit';
|
|
13
22
|
|
|
14
23
|
const FULL_COL = 24;
|
|
15
24
|
|
|
@@ -177,7 +186,10 @@ export interface FormFieldsProps extends BaseFormFieldsProps {
|
|
|
177
186
|
maskValue: any;
|
|
178
187
|
getMaskData(value: any): any;
|
|
179
188
|
init: boolean;
|
|
180
|
-
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// 组件尺寸
|
|
192
|
+
size?: string;
|
|
181
193
|
}
|
|
182
194
|
|
|
183
195
|
export const getFieldsProps = (props: any): FormFieldsProps => {
|
|
@@ -210,6 +222,7 @@ export const getFieldsProps = (props: any): FormFieldsProps => {
|
|
|
210
222
|
uid: props.$$componentItem?.uid,
|
|
211
223
|
className: props.className,
|
|
212
224
|
visibility: props.visibility,
|
|
225
|
+
size: props.size,
|
|
213
226
|
};
|
|
214
227
|
};
|
|
215
228
|
|
|
@@ -270,8 +283,7 @@ const WrapperInput = React.forwardRef<any, WrapperInputProps>((props, ref) => {
|
|
|
270
283
|
// 控件只读模式改造
|
|
271
284
|
if (props.readOnly && !props.render) {
|
|
272
285
|
return renderReadOnly(value || '--');
|
|
273
|
-
}
|
|
274
|
-
if (props.readOnly && typeof props.render === 'function') {
|
|
286
|
+
} if (props.readOnly && typeof props.render === 'function') {
|
|
275
287
|
return props.render(value);
|
|
276
288
|
}
|
|
277
289
|
}
|
|
@@ -308,6 +320,11 @@ export interface FormFieldsHooks {
|
|
|
308
320
|
onChange(...args: any): void;
|
|
309
321
|
}
|
|
310
322
|
|
|
323
|
+
const HorizontalLineHeightObj: any = {
|
|
324
|
+
small: '28px',
|
|
325
|
+
large: '36px',
|
|
326
|
+
};
|
|
327
|
+
|
|
311
328
|
export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((props, ref) => {
|
|
312
329
|
const {
|
|
313
330
|
isFormRootChild: temIsFormRootChild,
|
|
@@ -323,6 +340,7 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
323
340
|
uid,
|
|
324
341
|
className,
|
|
325
342
|
visibility = false,
|
|
343
|
+
size = 'default',
|
|
326
344
|
} = props;
|
|
327
345
|
const { useTopContainerHidden } = getEngineApis?.() || {};
|
|
328
346
|
// 获取上层容器是否被隐藏
|
|
@@ -377,6 +395,7 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
377
395
|
showWrapperContainer: boolean;
|
|
378
396
|
colon: boolean;
|
|
379
397
|
labelCol: any;
|
|
398
|
+
lineHeight: any;
|
|
380
399
|
wrapperCol: any;
|
|
381
400
|
colSpan: number;
|
|
382
401
|
wrapperStyle: CSSProperties;
|
|
@@ -386,10 +405,16 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
386
405
|
return {
|
|
387
406
|
// 表单项排版模式
|
|
388
407
|
mode,
|
|
389
|
-
showWrapperContainer:
|
|
408
|
+
showWrapperContainer:
|
|
409
|
+
isFormRootChild && mode !== 'grid' && formContext.layout === 'horizontal',
|
|
390
410
|
colon: !!name && formContext.colon,
|
|
391
|
-
labelCol:
|
|
392
|
-
|
|
411
|
+
labelCol:
|
|
412
|
+
formContext.layout === 'horizontal' ? labelCol || formContext.labelCol.span : FULL_COL,
|
|
413
|
+
lineHeight: HorizontalLineHeightObj[size] || '32px',
|
|
414
|
+
wrapperCol:
|
|
415
|
+
formContext.layout === 'horizontal'
|
|
416
|
+
? wrapperCol || formContext.wrapperCol.span
|
|
417
|
+
: FULL_COL,
|
|
393
418
|
colSpan: selfSpan || formContext.colSpan,
|
|
394
419
|
// flex子元素默认 flex: 0 1 auto, 需要手动 将 flex-shrink设置为0,避免宽度不生效;
|
|
395
420
|
// flex子元素默认 min-width为auto (width 和 min-width均为auto)导致shrink-to-fit计算容器宽度内容溢出,设置overflow 或者 width: 0 或 min-width: 0;
|
|
@@ -421,6 +446,7 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
421
446
|
return [colStyle, hiddenClassName];
|
|
422
447
|
}, [props.visible, customDisplay, customVisibility, visibility]);
|
|
423
448
|
|
|
449
|
+
|
|
424
450
|
const initialValue = useMemo(() => {
|
|
425
451
|
if (props.defaultValue !== undefined && props.value === undefined) {
|
|
426
452
|
return props.defaultValue;
|
|
@@ -440,6 +466,8 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
440
466
|
tipSize={props.tipSize}
|
|
441
467
|
tipWidth={props.tipWidth}
|
|
442
468
|
tipHeight={props.tipHeight}
|
|
469
|
+
// @ts-ignore
|
|
470
|
+
labelWrap={formContext?.layout === 'horizontal' ? formContext?.labelWrap : true}
|
|
443
471
|
/>
|
|
444
472
|
) : undefined;
|
|
445
473
|
}, [isFormRootChild]);
|
|
@@ -467,7 +495,8 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
467
495
|
},
|
|
468
496
|
}));
|
|
469
497
|
|
|
470
|
-
|
|
498
|
+
// 初始化默认值提前上报,避免事件执行时机过晚
|
|
499
|
+
useInit(() => {
|
|
471
500
|
const { onlySyncValue } = getEngineApis?.() || {};
|
|
472
501
|
// 组件加载完成 默认值主动上报 只执行一次
|
|
473
502
|
// 当默认值是false的时候
|
|
@@ -478,9 +507,10 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
478
507
|
// 同步值到hoc层value hoc层value变化后会触发以下逻辑上报给form表单
|
|
479
508
|
onlySyncValue?.(props.defaultValue);
|
|
480
509
|
}
|
|
481
|
-
}
|
|
510
|
+
});
|
|
482
511
|
|
|
483
|
-
const finalValue = useMemo(() =>
|
|
512
|
+
const finalValue = useMemo(() => props.handleFormValue ? props.handleFormValue(props.value) : props.value,
|
|
513
|
+
[props.value]);
|
|
484
514
|
|
|
485
515
|
useUpdateEffect(() => {
|
|
486
516
|
const { compatConfig } = getEngineApis?.() || {};
|
|
@@ -525,8 +555,7 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
525
555
|
clearValue={props.clearValue}
|
|
526
556
|
maskData={props.maskData}
|
|
527
557
|
{...valueObj}
|
|
528
|
-
>
|
|
529
|
-
{props.children}
|
|
558
|
+
>{props.children}
|
|
530
559
|
</WrapperInput>
|
|
531
560
|
) : null;
|
|
532
561
|
}
|
|
@@ -567,6 +596,8 @@ export const FormFields = React.forwardRef<FormFieldsHooks, FormFieldsProps>((pr
|
|
|
567
596
|
}}
|
|
568
597
|
fieldName={fieldName}
|
|
569
598
|
disabled={props.disabled}
|
|
599
|
+
labelWrap={formContext.labelWrap}
|
|
600
|
+
lineHeight={childProps.lineHeight}
|
|
570
601
|
>
|
|
571
602
|
<Form.Item
|
|
572
603
|
name={fieldName}
|