@bit-sun/business-component 4.2.0-alpha.3 → 4.2.0-alpha.30
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/.fatherrc.ts +1 -1
- package/.umirc.ts +13 -9
- package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
- package/dist/components/Business/BsLayouts/index.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +6 -6
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
- package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
- package/dist/components/Business/CommonAlert/index.d.ts +1 -2
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
- package/dist/components/Business/DetailPageWrapper/index.d.ts +12 -12
- package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
- package/dist/components/Business/ImportExport/ExportButton/ModalTitle.d.ts +11 -0
- package/dist/components/Business/ImportExport/ExportButton/TemplatePicker.d.ts +13 -0
- package/dist/components/Business/ImportExport/ExportButton/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/ImportWizard/Preview.d.ts +11 -0
- package/dist/components/Business/ImportExport/ImportWizard/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskDrawer/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskProgress/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/businessFunction.d.ts +15 -0
- package/dist/components/Business/ImportExport/index.d.ts +14 -0
- package/dist/components/Business/ImportExport/sceneCapability.d.ts +20 -0
- package/dist/components/Business/ImportExport/services/importExport.d.ts +22 -0
- package/dist/components/Business/ImportExport/services/routing.d.ts +8 -0
- package/dist/components/Business/ImportExport/types.d.ts +134 -0
- package/dist/components/Business/ItemPropertySelector/index.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/StateFlow/index.d.ts +1 -2
- package/dist/components/Business/SystemLog/index.d.ts +78 -0
- package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
- package/dist/components/Business/TrialCalculation/index.d.ts +15 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +6 -6
- package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
- package/dist/components/Business/columnSettingTable/index.d.ts +3 -3
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +3 -3
- package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
- package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
- package/dist/components/Common/Section/index.d.ts +1 -1
- package/dist/components/Functional/AddSelect/index.d.ts +1 -2
- package/dist/components/Functional/AuthButton/index.d.ts +1 -2
- package/dist/components/Functional/DataImport/index.d.ts +3 -3
- package/dist/components/Functional/DataValidation/index.d.ts +5 -5
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
- package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
- package/dist/components/Functional/SearchSelect/pagination.d.ts +22 -0
- package/dist/components/Functional/SearchSelect/utils.d.ts +2 -3
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
- package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +5413 -1215
- package/dist/index.js +5433 -1208
- package/dist/plugin/TableColumnSetting/index.d.ts +5 -5
- package/dist/utils/TableUtils.d.ts +18 -19
- package/dist/utils/auth.d.ts +4 -0
- package/dist/utils/utils.d.ts +41 -0
- package/docs/error-record.md +52 -0
- package/docs/flow-control-readme.md +283 -0
- package/docs/task-records/2026-07-31-import-export-extraction.md +81 -0
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -2
- package/src/components/Business/BsSulaQueryTable/index.md +57 -4
- package/src/components/Business/BsSulaQueryTable/index.tsx +174 -10
- package/src/components/Business/BsSulaQueryTable/setting.tsx +6 -0
- package/src/components/Business/DetailPageWrapper/index.tsx +81 -1
- package/src/components/Business/DetailPageWrapper/readme.md +89 -0
- package/src/components/Business/ImportExport/ExportButton/ModalTitle.tsx +27 -0
- package/src/components/Business/ImportExport/ExportButton/TemplatePicker.tsx +424 -0
- package/src/components/Business/ImportExport/ExportButton/index.module.less +382 -0
- package/src/components/Business/ImportExport/ExportButton/index.tsx +273 -0
- package/src/components/Business/ImportExport/ImportWizard/Preview.tsx +129 -0
- package/src/components/Business/ImportExport/ImportWizard/index.module.less +360 -0
- package/src/components/Business/ImportExport/ImportWizard/index.tsx +679 -0
- package/src/components/Business/ImportExport/TaskDrawer/index.tsx +285 -0
- package/src/components/Business/ImportExport/TaskProgress/index.tsx +267 -0
- package/src/components/Business/ImportExport/businessFunction.ts +29 -0
- package/src/components/Business/ImportExport/index.md +104 -0
- package/src/components/Business/ImportExport/index.tsx +208 -0
- package/src/components/Business/ImportExport/sceneCapability.ts +28 -0
- package/src/components/Business/ImportExport/services/importExport.ts +208 -0
- package/src/components/Business/ImportExport/services/routing.ts +21 -0
- package/src/components/Business/ImportExport/types.ts +180 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +713 -43
- package/src/components/Business/SearchSelect/index.md +2 -2
- package/src/components/Business/SystemLog/index.md +37 -0
- package/src/components/Business/SystemLog/index.tsx +87 -0
- package/src/components/Business/TrialCalculation/PathDisplay.less +93 -0
- package/src/components/Business/TrialCalculation/PathDisplay_README.md +77 -0
- package/src/components/Business/TrialCalculation/index.tsx +322 -0
- package/src/components/Business/columnSettingTable/index.tsx +7 -6
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +23 -22
- package/src/components/Functional/AddSelect/index.tsx +95 -1
- package/src/components/Functional/DataValidation/index.tsx +31 -9
- package/src/components/Functional/QueryMutipleSelect/index.tsx +2 -2
- package/src/components/Functional/SearchSelect/index.md +109 -0
- package/src/components/Functional/SearchSelect/index.tsx +99 -17
- package/src/components/Functional/SearchSelect/pagination.ts +57 -0
- package/src/components/Functional/SearchSelect/utils.tsx +28 -18
- package/src/components/Functional/TreeSearchSelect/index.tsx +2 -1
- package/src/components/Solution/RuleComponent/README.md +187 -0
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +9 -1
- package/src/components/Solution/RuleComponent/RenderCompItem_README.md +189 -0
- package/src/components/Solution/RuleComponent/RuleField.md +63 -0
- package/src/components/Solution/RuleComponent/index.js +237 -8
- package/src/components/Solution/RuleComponent/ruleFiled.js +46 -6
- package/src/components/Solution/RuleSetter/README.md +97 -0
- package/src/index.ts +9 -0
- package/src/typings/umi.d.ts +9 -0
- package/src/utils/LocalstorageUtils.ts +1 -1
- package/src/utils/auth.ts +39 -2
- package/src/utils/utils.ts +41 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
3
|
import { Table as SulaTable, request } from 'bssula';
|
|
3
4
|
import { Resizable } from 'react-resizable';
|
|
@@ -22,7 +23,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
22
23
|
showColumns: [],
|
|
23
24
|
selectedRowKeys: [], // 新增状态,用于跟踪选中的行的键
|
|
24
25
|
selectedRows: [],
|
|
25
|
-
showSummary: null
|
|
26
|
+
showSummary: null
|
|
26
27
|
}
|
|
27
28
|
this.sulaTableRef = React.createRef<any>();
|
|
28
29
|
}
|
|
@@ -79,9 +80,9 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
79
80
|
|
|
80
81
|
/**
|
|
81
82
|
* 新增函数,用于根据传入的小数位数进行四舍五入
|
|
82
|
-
* @param number
|
|
83
|
-
* @param decimalPlaces
|
|
84
|
-
* @returns
|
|
83
|
+
* @param number
|
|
84
|
+
* @param decimalPlaces
|
|
85
|
+
* @returns
|
|
85
86
|
*/
|
|
86
87
|
roundToDecimalPlaces = (number: any, decimalPlaces: number) => {
|
|
87
88
|
const factor = Math.pow(10, (decimalPlaces || 2));
|
|
@@ -90,7 +91,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
90
91
|
|
|
91
92
|
/**
|
|
92
93
|
* 合计行逻辑
|
|
93
|
-
* @returns
|
|
94
|
+
* @returns
|
|
94
95
|
*/
|
|
95
96
|
getTableSummaryInfo = () => {
|
|
96
97
|
const { summary = undefined, rowSelection, expandable, isSpecial = false, modeType }: any = this.props;
|
|
@@ -167,10 +168,10 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
167
168
|
</Table.Summary.Row>
|
|
168
169
|
</Table.Summary>
|
|
169
170
|
);
|
|
170
|
-
|
|
171
|
+
|
|
171
172
|
return () => summaryDom;
|
|
172
|
-
};
|
|
173
|
-
|
|
173
|
+
};
|
|
174
|
+
|
|
174
175
|
handledynamicColumns = (col: any[]) => {
|
|
175
176
|
let { dynamicColumns, modeType }: any = this.props;
|
|
176
177
|
col = col.map((item: any) => {
|
|
@@ -205,7 +206,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
205
206
|
|
|
206
207
|
ResizeableTitle = (props: any) => {
|
|
207
208
|
const { onResize, width, ...restProps } = props;
|
|
208
|
-
|
|
209
|
+
|
|
209
210
|
const [innerWidth, setInnerWidth] = useState(width);
|
|
210
211
|
const [isResizing, setIsResizing] = useState(false); // 标记是否正在拖拽
|
|
211
212
|
const [isDragging, setIsDragging] = useState(false); // 标记拖拽句柄是否被拖拽
|
|
@@ -213,9 +214,9 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
213
214
|
const markerPosition = useRef({ left: 0, top: 0 });
|
|
214
215
|
const currentStart = useRef(0);
|
|
215
216
|
const uuidref = useRef(uuid());
|
|
216
|
-
|
|
217
|
+
|
|
217
218
|
const prevWidthRef = useRef(width);
|
|
218
|
-
|
|
219
|
+
|
|
219
220
|
const handleMouseDown = (e: any) => {
|
|
220
221
|
currentStart.current = e.clientX;
|
|
221
222
|
markerPosition.current = { left: e.clientX, top: e.clientY }
|
|
@@ -223,35 +224,35 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
223
224
|
document.addEventListener('mousemove', handleMouseMove);
|
|
224
225
|
document.addEventListener('mouseup', handleMouseUp);
|
|
225
226
|
};
|
|
226
|
-
|
|
227
|
+
|
|
227
228
|
const handleMouseMove = (e: any) => {
|
|
228
229
|
e.stopPropagation();
|
|
229
230
|
e.preventDefault();
|
|
230
231
|
// 更新标记位置
|
|
231
232
|
markerPosition.current = { left: e.clientX, top: e.clientY }
|
|
232
233
|
const dom: HTMLElement | null = document.getElementById('text1');
|
|
233
|
-
|
|
234
|
+
|
|
234
235
|
if (dom && dom.style) {
|
|
235
236
|
dom.style.left = `${e.clientX}px`;
|
|
236
237
|
dom.style.top = `${e.clientY - 20}px`;
|
|
237
238
|
}
|
|
238
239
|
};
|
|
239
|
-
|
|
240
|
+
|
|
240
241
|
const handleMouseUp = (e: any) => {
|
|
241
242
|
document.removeEventListener('mousemove', handleMouseMove);
|
|
242
243
|
document.removeEventListener('mouseup', handleMouseUp);
|
|
243
244
|
setIsResizing(false);
|
|
244
245
|
};
|
|
245
|
-
|
|
246
|
+
|
|
246
247
|
const handleresize = (e: any, data: any, title: string) => {
|
|
247
248
|
const newWidth = data?.size?.width || 0;
|
|
248
249
|
setInnerWidth(newWidth); // 更新内部分宽度
|
|
249
250
|
};
|
|
250
|
-
|
|
251
|
+
|
|
251
252
|
const handleResizeStart = () => {
|
|
252
253
|
setIsResizing(true);
|
|
253
254
|
};
|
|
254
|
-
|
|
255
|
+
|
|
255
256
|
const handleResizeStop = (e: any, data: any) => {
|
|
256
257
|
setIsResizing(false);
|
|
257
258
|
if (onResize) {
|
|
@@ -265,11 +266,11 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
265
266
|
setInnerWidth(width);
|
|
266
267
|
}
|
|
267
268
|
}, [width]);
|
|
268
|
-
|
|
269
|
+
|
|
269
270
|
const thStyle = {
|
|
270
271
|
boxShadow: isResizing ? '2px 2px 10px rgba(0, 0, 0, 0.3)' : 'none',
|
|
271
272
|
};
|
|
272
|
-
|
|
273
|
+
|
|
273
274
|
return (
|
|
274
275
|
<Resizable
|
|
275
276
|
width={innerWidth}
|
|
@@ -333,7 +334,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
333
334
|
|
|
334
335
|
/**
|
|
335
336
|
* 处理行点击事件
|
|
336
|
-
* @param record
|
|
337
|
+
* @param record
|
|
337
338
|
*/
|
|
338
339
|
handleRowClick = (record: any) => {
|
|
339
340
|
const { selectedRowKeys, selectedRows, } = this.state;
|
|
@@ -420,7 +421,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
420
421
|
...propRowSelection,
|
|
421
422
|
selectedRowKeys: this.state.selectedRowKeys,
|
|
422
423
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
|
423
|
-
this.setState({
|
|
424
|
+
this.setState({
|
|
424
425
|
selectedRowKeys,
|
|
425
426
|
selectedRows
|
|
426
427
|
});
|
|
@@ -436,7 +437,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
436
437
|
};
|
|
437
438
|
},
|
|
438
439
|
}
|
|
439
|
-
|
|
440
|
+
|
|
440
441
|
return (
|
|
441
442
|
<div style={{ position: 'relative' }}>
|
|
442
443
|
<span style={{ position: 'absolute', zIndex: '10', right: '8px', top: '10px' }} className="ant-dropdown-link">
|
|
@@ -222,6 +222,98 @@ const AddSelect = (props: any) => {
|
|
|
222
222
|
acc[key] = typeof value === 'function' ? value?.(record) : value;
|
|
223
223
|
return acc;
|
|
224
224
|
}, {});
|
|
225
|
+
|
|
226
|
+
// 可输入非数字字符
|
|
227
|
+
if(item.canInputString) {
|
|
228
|
+
return (
|
|
229
|
+
<InputNumber
|
|
230
|
+
min={0}
|
|
231
|
+
precision={0}
|
|
232
|
+
controls={false}
|
|
233
|
+
{...inputProps}
|
|
234
|
+
value={text || ''}
|
|
235
|
+
keyboard={false}
|
|
236
|
+
onPressEnter={(e: any) => {
|
|
237
|
+
e.target.blur();
|
|
238
|
+
}}
|
|
239
|
+
onBlur={async (e: any) => {
|
|
240
|
+
const {
|
|
241
|
+
target: { value },
|
|
242
|
+
} = e;
|
|
243
|
+
record[item.dataIndex] = value
|
|
244
|
+
editRecord(record)
|
|
245
|
+
}}
|
|
246
|
+
onKeyDown={(e) => {
|
|
247
|
+
if(e.keyCode === 13 && e.ctrlKey) {
|
|
248
|
+
handleOk(true)
|
|
249
|
+
document.getElementById("first-query")?.focus()
|
|
250
|
+
}
|
|
251
|
+
if(e.keyCode === 8 && e.ctrlKey) {
|
|
252
|
+
message.success('删除当前行')
|
|
253
|
+
e.stopPropagation();
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
256
|
+
if (dom) {
|
|
257
|
+
dom.select();
|
|
258
|
+
dom.focus();
|
|
259
|
+
dom.scrollIntoView(false)
|
|
260
|
+
}
|
|
261
|
+
dom = null
|
|
262
|
+
deleteRecord(record, popvalue);
|
|
263
|
+
}
|
|
264
|
+
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
268
|
+
if (dom) {
|
|
269
|
+
dom.select();
|
|
270
|
+
dom.focus();
|
|
271
|
+
dom.scrollIntoView(false)
|
|
272
|
+
}
|
|
273
|
+
dom = null
|
|
274
|
+
}
|
|
275
|
+
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
276
|
+
e.stopPropagation();
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
279
|
+
if (dom) {
|
|
280
|
+
dom.select();
|
|
281
|
+
dom.focus();
|
|
282
|
+
dom.scrollIntoView(false)
|
|
283
|
+
}
|
|
284
|
+
dom = null
|
|
285
|
+
}
|
|
286
|
+
if (e.keyCode === 40) {
|
|
287
|
+
e.stopPropagation();
|
|
288
|
+
e.preventDefault();
|
|
289
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
290
|
+
if (dom) {
|
|
291
|
+
dom.select();
|
|
292
|
+
dom.focus();
|
|
293
|
+
dom.scrollIntoView(false)
|
|
294
|
+
}
|
|
295
|
+
dom = null
|
|
296
|
+
} else if (e.keyCode === 38) {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
300
|
+
if (dom1) {
|
|
301
|
+
// dom1.value=""
|
|
302
|
+
// dom1.setSelectionRange(100, 0);
|
|
303
|
+
dom1.select();
|
|
304
|
+
dom1.focus();
|
|
305
|
+
dom1.scrollIntoViewIfNeeded(false)
|
|
306
|
+
// dom1.value=record['count']
|
|
307
|
+
}
|
|
308
|
+
dom1 = null
|
|
309
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
310
|
+
e.stopPropagation();
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
225
317
|
|
|
226
318
|
return (
|
|
227
319
|
<InputNumber
|
|
@@ -577,7 +669,7 @@ const AddSelect = (props: any) => {
|
|
|
577
669
|
}
|
|
578
670
|
// 数据源 不可以有重复key
|
|
579
671
|
source = Array.isArray(source) ? _.uniqBy(source, 'value') : [];
|
|
580
|
-
|
|
672
|
+
|
|
581
673
|
setTableData(source)
|
|
582
674
|
setTablePagination({ ...tablePagination, total: Number(res?.total || res?.totalCount || source.length), pageSize: Number(res?.size || res?.pageSize || (params?.pageSize || pageSize)), current: Number(res?.page || res?.currentPage || (params?.currentPage || currentPage)) })
|
|
583
675
|
})
|
|
@@ -715,6 +807,8 @@ const AddSelect = (props: any) => {
|
|
|
715
807
|
}
|
|
716
808
|
|
|
717
809
|
const handleTableChange = (pagination) => {
|
|
810
|
+
// 设置分页tablePagination
|
|
811
|
+
setTablePagination({ ...tablePagination, ...pagination })
|
|
718
812
|
getData({ ...tableFormParams, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
|
|
719
813
|
}
|
|
720
814
|
|
|
@@ -242,11 +242,9 @@ class DataValidation extends React.Component {
|
|
|
242
242
|
cell.v = cell.m
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
// console.log(postion);
|
|
246
245
|
},
|
|
247
246
|
cellAllRenderBefore: function (data, sheetFile, ctx) {
|
|
248
247
|
sheetFile.config.borderInfo = [];
|
|
249
|
-
// console.info(data,sheetFile,ctx)
|
|
250
248
|
},
|
|
251
249
|
},
|
|
252
250
|
showtoolbarConfig: {
|
|
@@ -411,7 +409,8 @@ class DataValidation extends React.Component {
|
|
|
411
409
|
};
|
|
412
410
|
|
|
413
411
|
getData = () => {
|
|
414
|
-
|
|
412
|
+
// 是否使用字符串值 默认为false
|
|
413
|
+
const useStringValue = this.props.useStringValue || false;
|
|
415
414
|
let sheetData = luckysheet.getSheetData();
|
|
416
415
|
let data = JSON.parse(JSON.stringify(sheetData))
|
|
417
416
|
.filter((item) => item[0])
|
|
@@ -419,7 +418,13 @@ class DataValidation extends React.Component {
|
|
|
419
418
|
let obj = {};
|
|
420
419
|
|
|
421
420
|
item.slice(0, itemsTemp.length).map((innerItem, index) => {
|
|
422
|
-
|
|
421
|
+
// 如果使用字符串值,直接赋值字符串
|
|
422
|
+
if (useStringValue) {
|
|
423
|
+
obj[this.state.items[index].code] = innerItem && innerItem.m;
|
|
424
|
+
} else {
|
|
425
|
+
// 否则根据值是否相等来判断是否使用字符串值
|
|
426
|
+
obj[this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
|
|
427
|
+
}
|
|
423
428
|
});
|
|
424
429
|
|
|
425
430
|
return obj;
|
|
@@ -477,9 +482,10 @@ customSort = (a, b) => {
|
|
|
477
482
|
});
|
|
478
483
|
}
|
|
479
484
|
|
|
480
|
-
resetData = () => {
|
|
481
|
-
const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping } = this.props;
|
|
482
|
-
|
|
485
|
+
resetData = async () => {
|
|
486
|
+
const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping, checkSharedValue, beforeCheckCallback } = this.props;
|
|
487
|
+
|
|
488
|
+
let resultData = this.getData().filter(d => {
|
|
483
489
|
return _.compact(Object.values(d)).length
|
|
484
490
|
})
|
|
485
491
|
|
|
@@ -491,6 +497,24 @@ customSort = (a, b) => {
|
|
|
491
497
|
otherParams = { brandAuth: 'ctl-withAuth' }
|
|
492
498
|
}
|
|
493
499
|
|
|
500
|
+
// 处理校验参数,隐藏校验参数(公用的部分)
|
|
501
|
+
if(checkSharedValue){
|
|
502
|
+
resultData = resultData.map(d => {
|
|
503
|
+
return {
|
|
504
|
+
...d,
|
|
505
|
+
...checkSharedValue,
|
|
506
|
+
}
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// 调用回调函数
|
|
511
|
+
if(beforeCheckCallback){
|
|
512
|
+
resultData = await beforeCheckCallback(resultData);
|
|
513
|
+
if(!resultData){
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
494
518
|
request
|
|
495
519
|
.post(validDataUrl, {
|
|
496
520
|
...otherParams,
|
|
@@ -551,7 +575,6 @@ customSort = (a, b) => {
|
|
|
551
575
|
resultData: res,
|
|
552
576
|
});
|
|
553
577
|
|
|
554
|
-
console.log(setExportData);
|
|
555
578
|
setExportData([123123]);
|
|
556
579
|
})
|
|
557
580
|
.catch((err:any) => { });
|
|
@@ -801,7 +824,6 @@ customSort = (a, b) => {
|
|
|
801
824
|
top: '0px',
|
|
802
825
|
};
|
|
803
826
|
|
|
804
|
-
console.log('itemsTemp', itemsTemp)
|
|
805
827
|
return (
|
|
806
828
|
<>
|
|
807
829
|
<div className="sheet_table_top">
|
|
@@ -13,7 +13,7 @@ export const getValue = (value: any, selectMode?: any) => {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const QueryMutipleSearchSelect = ({ onValueChange, requestConfig={}, selectProps={}, ctx }: any) => {
|
|
16
|
-
const { filter, method = 'get', url, extralHeaders = {}, otherParams = {}, specialBracket = false, noNeedSplit = false, } = requestConfig;
|
|
16
|
+
const { filter, method = 'get', url, extralHeaders = {}, otherParams = {}, specialBracket = false, noNeedSplit = false, requestType = 'get' } = requestConfig;
|
|
17
17
|
const selectParamsKey = filter || 'qp-codeAndName-like';
|
|
18
18
|
const resultSourceKey = handleSourceName(requestConfig?.sourceName || ctx?.name || 'skuCode')
|
|
19
19
|
const currentSelectProps = {
|
|
@@ -106,7 +106,7 @@ const QueryMutipleSearchSelect = ({ onValueChange, requestConfig={}, selectProps
|
|
|
106
106
|
let getRequest;
|
|
107
107
|
const methodName = method?.toLocaleLowerCase();
|
|
108
108
|
if(['post','patch','put'].includes(methodName)) {
|
|
109
|
-
getRequest = request[methodName](`${url}${convertUrlQueryParams(queryParams)}`,convertBodyParams(queryParams),{headers: { ...extralHeaders }})
|
|
109
|
+
getRequest = request[methodName](`${url}${convertUrlQueryParams(queryParams)}`,convertBodyParams({...queryParams, requestType}),{headers: { ...extralHeaders }})
|
|
110
110
|
} else {
|
|
111
111
|
getRequest = request.get( `${url}${convertUrlQueryParams(queryParams)}`,{headers: { ...extralHeaders }})
|
|
112
112
|
}
|
|
@@ -138,4 +138,113 @@ export default () => {
|
|
|
138
138
|
};
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
+
## POST Body Request Demo
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import React, { useState } from 'react';
|
|
145
|
+
import { Button } from 'antd';
|
|
146
|
+
import { SearchSelect } from '../../../index';
|
|
147
|
+
|
|
148
|
+
export default () => {
|
|
149
|
+
const [tableSource, setTableSource] = useState([]);
|
|
150
|
+
const userInfo = { employeeResVo: { id: 'mock-id' } }; // Mock userInfo
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<SearchSelect
|
|
154
|
+
selectBusinessType="salesOrder" // Custom key
|
|
155
|
+
modalTableProps={{
|
|
156
|
+
modalTableTitle: '选择销售单明细',
|
|
157
|
+
tableSearchForm: [
|
|
158
|
+
{
|
|
159
|
+
name: 'orderNo',
|
|
160
|
+
label: '单据编号',
|
|
161
|
+
item: {
|
|
162
|
+
type: 'input'
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'orderDate',
|
|
167
|
+
label: '单据日期',
|
|
168
|
+
item: {
|
|
169
|
+
type: 'rangepicker'
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'saleOrgCode',
|
|
174
|
+
label: '销售组织',
|
|
175
|
+
item: {
|
|
176
|
+
type: 'select',
|
|
177
|
+
props: {
|
|
178
|
+
showSearch: true,
|
|
179
|
+
optionFilterProp: 'children'
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
remoteSource: {
|
|
183
|
+
url: `/user/orgViewNode/listNoPage?qp-orgViewCode-eq=sales-organizational-view&qp-employeeId-eq=${userInfo?.employeeResVo?.id}`,
|
|
184
|
+
method: 'GET',
|
|
185
|
+
converter: ({ data }: { data: any }) => {
|
|
186
|
+
return (
|
|
187
|
+
(data &&
|
|
188
|
+
Array.isArray(data) &&
|
|
189
|
+
data.length &&
|
|
190
|
+
data.map((v: any) => ({ text: v.name, value: v.code }))) ||
|
|
191
|
+
[]
|
|
192
|
+
);
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'customerCode',
|
|
198
|
+
label: '客户',
|
|
199
|
+
item: {
|
|
200
|
+
type: 'bs-customer2SearchSelect',
|
|
201
|
+
props: {
|
|
202
|
+
selectBusinessType: 'customer2',
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
tableColumns: [
|
|
208
|
+
{ title: '单据编号', key: 'orderNo' },
|
|
209
|
+
{ title: '单据日期', key: 'orderDate' },
|
|
210
|
+
{ title: '销售组织', key: 'saleDepartmentName' },
|
|
211
|
+
{ title: '客户', key: 'customerName' },
|
|
212
|
+
{ title: 'SKU', key: 'skuCode' },
|
|
213
|
+
{ title: '商品名称', key: 'spuName' },
|
|
214
|
+
{ title: '数量', key: 'planQuantity' },
|
|
215
|
+
{ title: '销售金额', key: 'saleTaxedAmount' },
|
|
216
|
+
],
|
|
217
|
+
}}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
fieldComponent={<Button type="primary">新增</Button>}
|
|
221
|
+
selectProps={{
|
|
222
|
+
mode: 'multiple', // Allow multiple selection
|
|
223
|
+
}}
|
|
224
|
+
onSaveCallback={(rows: any) => {
|
|
225
|
+
if (!rows || rows.length === 0) return;
|
|
226
|
+
const newDetails = rows.map((item: any) => ({
|
|
227
|
+
key: Date.now() + Math.random(),
|
|
228
|
+
saleOrderNo: item.orderNo,
|
|
229
|
+
saleOrderDetailLineNo: item.lineNo,
|
|
230
|
+
skuCode: item.skuCode,
|
|
231
|
+
quantity: item.planQuantity,
|
|
232
|
+
saleAmount: item.saleTaxedAmount,
|
|
233
|
+
subsidyAmount: 0,
|
|
234
|
+
}));
|
|
235
|
+
setTableSource([...tableSource, ...newDetails]);
|
|
236
|
+
return Promise.resolve();
|
|
237
|
+
}}
|
|
238
|
+
requestConfig={{
|
|
239
|
+
url: '/drp-ops/new/tradeSubOrder/pageListAndDetailByData',
|
|
240
|
+
method: 'post',
|
|
241
|
+
isBodyRequest: true, // Enable body params for POST
|
|
242
|
+
mappingValueField: 'detailId', // Unique ID for selection
|
|
243
|
+
mappingTextField: 'orderNo', // Just for display if needed
|
|
244
|
+
}}
|
|
245
|
+
/>
|
|
246
|
+
);
|
|
247
|
+
};
|
|
248
|
+
```
|
|
249
|
+
|
|
141
250
|
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|