@bit-sun/business-component 4.2.0-alpha.1 → 4.2.0-alpha.10

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.
Files changed (90) hide show
  1. package/.umirc.ts +9 -9
  2. package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
  3. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
  4. package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
  5. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
  6. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
  7. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
  8. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
  9. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
  11. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
  12. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
  13. package/dist/components/Business/BsLayouts/index.d.ts +1 -1
  14. package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
  15. package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
  16. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +6 -6
  17. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
  18. package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
  19. package/dist/components/Business/CommonAlert/index.d.ts +1 -2
  20. package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
  21. package/dist/components/Business/DetailPageWrapper/index.d.ts +12 -12
  22. package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
  23. package/dist/components/Business/ItemPropertySelector/index.d.ts +1 -2
  24. package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
  25. package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
  26. package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
  27. package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
  28. package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
  29. package/dist/components/Business/PropertyModal/index.d.ts +1 -2
  30. package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
  31. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  32. package/dist/components/Business/StateFlow/index.d.ts +1 -2
  33. package/dist/components/Business/SystemLog/index.d.ts +78 -0
  34. package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
  35. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +6 -6
  36. package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
  37. package/dist/components/Business/columnSettingTable/index.d.ts +3 -3
  38. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +3 -3
  39. package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
  40. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
  41. package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
  42. package/dist/components/Common/Section/index.d.ts +1 -1
  43. package/dist/components/Functional/AddSelect/index.d.ts +1 -2
  44. package/dist/components/Functional/AuthButton/index.d.ts +1 -2
  45. package/dist/components/Functional/DataImport/index.d.ts +3 -3
  46. package/dist/components/Functional/DataValidation/index.d.ts +5 -5
  47. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
  48. package/dist/components/Functional/QueryMutipleInput/index.d.ts +1 -2
  49. package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
  50. package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
  51. package/dist/components/Functional/SearchSelect/utils.d.ts +2 -3
  52. package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
  53. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
  54. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
  55. package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
  56. package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
  57. package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
  58. package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
  59. package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
  60. package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
  61. package/dist/index.d.ts +3 -0
  62. package/dist/index.esm.js +1909 -1186
  63. package/dist/index.js +1908 -1181
  64. package/dist/plugin/TableColumnSetting/index.d.ts +5 -5
  65. package/dist/utils/TableUtils.d.ts +18 -19
  66. package/dist/utils/utils.d.ts +41 -0
  67. package/docs/flow-control-readme.md +283 -0
  68. package/package.json +1 -1
  69. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +0 -1
  70. package/src/components/Business/BsSulaQueryTable/index.md +57 -4
  71. package/src/components/Business/BsSulaQueryTable/index.tsx +164 -7
  72. package/src/components/Business/BsSulaQueryTable/setting.tsx +6 -0
  73. package/src/components/Business/DetailPageWrapper/index.tsx +81 -1
  74. package/src/components/Business/DetailPageWrapper/readme.md +89 -0
  75. package/src/components/Business/SearchSelect/BusinessUtils.tsx +363 -41
  76. package/src/components/Business/SystemLog/index.md +37 -0
  77. package/src/components/Business/SystemLog/index.tsx +87 -0
  78. package/src/components/Business/columnSettingTable/index.tsx +7 -6
  79. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +23 -22
  80. package/src/components/Functional/AddSelect/index.tsx +92 -0
  81. package/src/components/Functional/DataValidation/index.tsx +22 -3
  82. package/src/components/Functional/QueryMutipleInput/index.tsx +1 -1
  83. package/src/components/Functional/SearchSelect/index.tsx +68 -10
  84. package/src/components/Functional/SearchSelect/utils.tsx +4 -1
  85. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +9 -1
  86. package/src/components/Solution/RuleComponent/RenderCompItem_README.md +189 -0
  87. package/src/components/Solution/RuleComponent/index.js +1 -0
  88. package/src/components/Solution/RuleComponent/ruleFiled.js +25 -1
  89. package/src/index.ts +7 -0
  90. package/src/utils/utils.ts +41 -1
@@ -0,0 +1,37 @@
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 日志组件
9
+ order: 1
10
+ ---
11
+
12
+ # SystemLog
13
+
14
+
15
+ ## 日志业务组件
16
+
17
+ ```tsx
18
+ import React, { useState } from 'react';
19
+ import { SystemLog } from '../../../index.ts';
20
+
21
+ export default () => {
22
+ const [modeType, setModeType] = useState('view');
23
+ const renderLogRef = useRef<any>();
24
+
25
+ return {
26
+ fields: [
27
+ SystemLog({
28
+ modeType,
29
+ code: '123',
30
+ containerName: 'Test_Log_Info',
31
+ renderLogRef,
32
+ extraParams: {},
33
+ })
34
+ ],
35
+ };
36
+ };
37
+ ```
@@ -0,0 +1,87 @@
1
+ import { handleCommonTimeRender } from '@/utils/TableUtils';
2
+ import { formContainerAndItemLayout, handleConvertResponse } from '@/utils/utils';
3
+ import { Table as BsTable } from 'bssula';
4
+ import React from 'react';
5
+
6
+ //操作日志
7
+ const SystemLog = ({
8
+ modeType,
9
+ code,
10
+ containerName,
11
+ renderLogRef = {},
12
+ extraParams = {},
13
+ }: {
14
+ modeType: string,
15
+ code: any
16
+ containerName: string,
17
+ renderLogRef: object,
18
+ extraParams?: object,
19
+ }) => {
20
+ return {
21
+ ...formContainerAndItemLayout('table', '操作日志', containerName),
22
+ initialVisible: modeType != 'create',
23
+ fields: [
24
+ {
25
+ name: 'table',
26
+ label: false,
27
+ itemLayout: {
28
+ span: 24,
29
+ labelCol: {
30
+ span: 0,
31
+ },
32
+ wrapperCol: {
33
+ span: 24,
34
+ },
35
+ },
36
+ field: (ctx: any) => {
37
+ return code && <BsTable
38
+ remoteDataSource={{
39
+ url: `/oms-ops/logInfo?qp-businessCode-eq=${code}`,
40
+ convertParams: ({ params }: any) => {
41
+ return {
42
+ pageSize: params.pageSize,
43
+ currentPage: params.current,
44
+ ...extraParams,
45
+ };
46
+ },
47
+ converter: ({ data }: any) => {
48
+ return {
49
+ ...handleConvertResponse(data.list, data.total || data.totalCount),
50
+ };
51
+ },
52
+ }}
53
+ columns={[
54
+ {
55
+ title: '操作人',
56
+ dataIndex: 'handlerName',
57
+ },
58
+ {
59
+ title: '操作名称',
60
+ dataIndex: 'handlerType',
61
+ },
62
+ {
63
+ title: '操作时间',
64
+ dataIndex: 'handlerTime',
65
+ render: ({ text }: { text: any }) => handleCommonTimeRender(text)
66
+ },
67
+ {
68
+ title: '操作内容',
69
+ dataIndex: 'logcontent',
70
+ },
71
+ ]}
72
+ style={{ width: '100%', marginTop: '-16px', padding: '0px' }}
73
+ rowKey="id"
74
+ scroll={{ x: 'max-content' }}
75
+ pagination={{
76
+ showTotal: (total: any) => `共 ${total} 条`,
77
+ showQuickJumper: true,
78
+ hideOnSinglePage: true,
79
+ }}
80
+ ref={renderLogRef}
81
+ />
82
+ },
83
+ },
84
+ ],
85
+ }
86
+ }
87
+ export default SystemLog
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import React, { useState } from 'react';
2
3
  import { Table, Tooltip, Typography } from 'antd';
3
4
  import { Resizable } from 'react-resizable';
@@ -81,9 +82,9 @@ export default class ColumnSettingTable extends React.Component {
81
82
 
82
83
  /**
83
84
  * 新增函数,用于根据传入的小数位数进行四舍五入
84
- * @param number
85
- * @param decimalPlaces
86
- * @returns
85
+ * @param number
86
+ * @param decimalPlaces
87
+ * @returns
87
88
  */
88
89
  roundToDecimalPlaces = (number: any, decimalPlaces: number) => {
89
90
  const factor = Math.pow(10, (decimalPlaces || 2));
@@ -92,7 +93,7 @@ export default class ColumnSettingTable extends React.Component {
92
93
 
93
94
  /**
94
95
  * 合计行逻辑
95
- * @returns
96
+ * @returns
96
97
  */
97
98
  getTableSummaryInfo = () => {
98
99
  const { summary = undefined, rowSelection, expandable, modeType, dataSource, isSpecial = false, }: any = this.props;
@@ -232,7 +233,7 @@ export default class ColumnSettingTable extends React.Component {
232
233
 
233
234
  /**
234
235
  * 处理行点击事件
235
- * @param record
236
+ * @param record
236
237
  */
237
238
  handleRowClick = (record: any) => {
238
239
  const { selectedRowKeys, selectedRows, } = this.state;
@@ -316,7 +317,7 @@ export default class ColumnSettingTable extends React.Component {
316
317
  ...propRowSelection,
317
318
  selectedRowKeys: this.state.selectedRowKeys,
318
319
  onChange: (selectedRowKeys: any, selectedRows: any) => {
319
- this.setState({
320
+ this.setState({
320
321
  selectedRowKeys,
321
322
  selectedRows
322
323
  });
@@ -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
@@ -477,9 +477,10 @@ customSort = (a, b) => {
477
477
  });
478
478
  }
479
479
 
480
- resetData = () => {
481
- const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping } = this.props;
482
- const resultData = this.getData().filter(d => {
480
+ resetData = async () => {
481
+ const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping, checkSharedValue, beforeCheckCallback } = this.props;
482
+
483
+ let resultData = this.getData().filter(d => {
483
484
  return _.compact(Object.values(d)).length
484
485
  })
485
486
 
@@ -491,6 +492,24 @@ customSort = (a, b) => {
491
492
  otherParams = { brandAuth: 'ctl-withAuth' }
492
493
  }
493
494
 
495
+ // 处理校验参数,隐藏校验参数(公用的部分)
496
+ if(checkSharedValue){
497
+ resultData = resultData.map(d => {
498
+ return {
499
+ ...d,
500
+ ...checkSharedValue,
501
+ }
502
+ })
503
+ }
504
+
505
+ // 调用回调函数
506
+ if(beforeCheckCallback){
507
+ resultData = await beforeCheckCallback(resultData);
508
+ if(!resultData){
509
+ return;
510
+ }
511
+ }
512
+
494
513
  request
495
514
  .post(validDataUrl, {
496
515
  ...otherParams,
@@ -40,7 +40,7 @@ const QueryMutipleInput = ({ onValueChange,onPressEnter, value: initialValue })
40
40
  const showModal = () => {
41
41
  setIsModalVisible(true);
42
42
  //弹窗打开时 默认搜索内容换行显示
43
- setPopValue(data => data.replace(/,/g, '\n'));
43
+ setPopValue(data => data?.replace?.(/,/g, '\n'));
44
44
  };
45
45
 
46
46
  const handleOk = () => {
@@ -4,7 +4,7 @@ import { useDebounceFn } from 'ahooks';
4
4
  import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs, Empty, DatePicker } from 'antd';
5
5
  import { SearchOutlined, CopyOutlined, CaretLeftOutlined } from '@ant-design/icons';
6
6
  import request from '@/utils/request';
7
- import _, { escapeRegExp, isNil, values } from "lodash"
7
+ import _, { escapeRegExp, isNil, values, cloneDeep, isEmpty } from "lodash"
8
8
  import './index.less';
9
9
  import { BusinessSearchSelect, QueryMutipleInput, QueryMutipleSearchSelect } from '@/index';
10
10
  import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr, handleTableColumns } from './utils';
@@ -32,6 +32,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
32
32
  highestPopContainer = undefined,
33
33
  fieldComponent,
34
34
  onSaveCallback,
35
+ returnFormat = [],
35
36
  selectBusinessType,
36
37
  } = props;
37
38
  const {
@@ -66,6 +67,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
66
67
  const selectParamsKey = requestConfig?.filter || 'qp-codeAndName-like'
67
68
  const selectParamsInitKey = requestConfig?.filterInit || selectParamsKey
68
69
  const currentSelectProps = {
70
+ // 回显字段可自定义
71
+ optionLabelProp: "label",
69
72
  ...selectProps,
70
73
  // 以下属性不可更改----设计配置项
71
74
  showArrow: true,
@@ -73,7 +76,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
73
76
  filterOption: false,
74
77
  allowClear: true,
75
78
  listHeight: 160,
76
- optionLabelProp: "label",
77
79
  autoClearSearchValue: false,
78
80
  placement: 'bottomRight'
79
81
  }
@@ -83,7 +85,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
83
85
  const isFormPage = pathname.match(pattern)?.length > 0;
84
86
 
85
87
  const initPagination = { showQuickJumper: true, showSizeChanger: true, showTotal: (total: any) => `共 ${total} 条`, pageSize: tableInitPageSize }
86
- const tableInitPagination = { ...initPagination, total: 0, current: 1 }
88
+ const tableInitPagination = { ...initPagination, total: 0, current: 1, pageSizeOptions: [10, 20, 50, 100, 500, 1000] }
87
89
  const disabled = !!noOperate || selectProps?.disabled || props?.disabled;
88
90
  const isHaveDependency = fixedparameter && fieldValToParam && ctx;
89
91
  const isHaveDValue = () => {
@@ -360,6 +362,30 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
360
362
  };
361
363
  },[isModalVisible])
362
364
 
365
+ const safeJSONParse = (str: string) => {
366
+ try {
367
+ return JSON.parse(str);
368
+ } catch (error) {
369
+ console.warn('JSON解析失败:', error);
370
+ return null;
371
+ }
372
+ };
373
+
374
+ // 获取回显的value值 如果开启了搜索条件 则需要过滤掉搜索条件
375
+ const getShowValue = (value: any) => {
376
+ let newValue = cloneDeep(value);
377
+ if(selectProps.useSearchCondition && newValue) {
378
+ // 回显的时候 把搜索项的内容去掉
379
+ if(selectMode) {
380
+ newValue = newValue.filter((item: any) => {
381
+ const parsedItem = safeJSONParse(decodeURIComponent(item));
382
+ // 过滤掉JSON对象(搜索条件),保留非JSON数据(实际选择项)
383
+ return !parsedItem || !(parsedItem && typeof parsedItem === 'object' && !Array.isArray(parsedItem));
384
+ });
385
+ }
386
+ }
387
+ return newValue;
388
+ }
363
389
  const showModal = () => {
364
390
  if(sDisabled) return;
365
391
 
@@ -371,8 +397,9 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
371
397
  // 回显
372
398
  if (value) {
373
399
  if (selectMode) {
374
- setSelectedRowKeys(labelInValue ? value.map(i => i.key) : value)
375
- setSelectedRows(labelInValue ? value.map(i => ({ [mappingValueField]: i.key, value: i.key, text: i.label })) : value.map(i => ({ [mappingValueField]: i, value: i })))
400
+ const newValue = getShowValue(value);
401
+ setSelectedRowKeys(labelInValue ? newValue.map(i => i.key) : newValue)
402
+ setSelectedRows(labelInValue ? newValue.map(i => ({ [mappingValueField]: i.key, value: i.key, text: i.label })) : newValue.map(i => ({ [mappingValueField]: i, value: i })))
376
403
  setPopValue(labelInValue ? value.map(i => ({ value: i.key, text: i.label })) : value.map(i => ({ value: i })));
377
404
  setIndeterminate(!!value.length && value.length < itemsTotal);
378
405
  setCheckedAll(itemsTotal && value.length === itemsTotal);
@@ -393,8 +420,25 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
393
420
  setSelectDataSource(source,source?.length)
394
421
  formaData(selectedValue, source);
395
422
  } else {
396
- const formatResult = selectMode ? [] : null
397
- onChange(formatResult, selectedValue)
423
+ var formatResult = selectMode ? [] : null;
424
+ // 支持使用查询条件 筛选
425
+ if (selectProps.useSearchCondition) {
426
+ var formValue = form.getFieldsValue();
427
+ // 一次性处理数据转换和过滤
428
+ var processedFormValue = Object.keys(formValue).reduce(function (acc, key) {
429
+ var value = formValue[key];
430
+ // 过滤空值(确保trim函数存在)
431
+ var trimmedValue = typeof value === 'string' ? value.trim() : value;
432
+ if (trimmedValue && trimmedValue !== '') {
433
+ acc[key] = trimmedValue;
434
+ }
435
+ return acc;
436
+ }, {});
437
+ const result = JSON.stringify(processedFormValue)
438
+ onChange(isEmpty(processedFormValue) ? formatResult : selectMode ? [result] : result, selectedValue);
439
+ } else {
440
+ onChange(formatResult, selectedValue);
441
+ }
398
442
  }
399
443
  }
400
444
  const handleOk = () => {
@@ -424,14 +468,15 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
424
468
  setConfirmLoading(false)
425
469
  })
426
470
  } else {
427
- handleSelectOver(popvalue)
471
+ handleSelectOver(selectedRows.length ? popvalue : [])
428
472
  handleCancel();
429
473
  }
430
474
  };
431
475
 
432
476
  const formaData = (value: any, source: any) => {
433
477
  if (labelInValue) {
434
- const formatResult = value.map((i: any) => ({ key: i[mappingValueField] || i.key, label: i[mappingTextField] || i.label, value: i[mappingValueField] || i.value }))
478
+ const getFromat = (format, val) => format.map(({key,value})=> ({[key]:val[value]}))
479
+ const formatResult = value.map((i: any) => (Object.assign({ key: i[mappingValueField] || i.key, label: i[mappingTextField] || i.label, value: i[mappingValueField] || i.value }, ...getFromat(returnFormat, i))))
435
480
  onChange(selectMode ? formatResult : formatResult[0], value,source)
436
481
  } else {
437
482
  const formatResult = selectMode ? value.map((i: any) => i.value) : _.get(value[0], 'value')
@@ -931,7 +976,20 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
931
976
  footer={
932
977
  selectMode || modalTableProps?.modalRadioNeedFooter
933
978
  ? [
934
- <Button key="back" onClick={handleCancel}>
979
+ selectProps.useSearchCondition ? (
980
+ <div
981
+ key="instructions"
982
+ style={{
983
+ position: 'absolute',
984
+ width: 'calc(100% - 500px)',
985
+ textAlign: 'left'
986
+ }}
987
+ >
988
+ <div>操作说明:结果集过多时,可无需选择具体数据,系统将直接按已设筛选条件查询</div>
989
+ <Input style={{marginTop: '3px', height: '22px'}} value={value} />
990
+ </div>
991
+ ) : <></>,
992
+ <Button key="back" onClick={handleCancel} style={{margin: selectProps.useSearchCondition ? '10px 0' : 0}}>
935
993
  取消
936
994
  </Button>,
937
995
  <Button
@@ -403,7 +403,10 @@ export const maxTagPlaceholder = (selectedValues: any, { selectProps, onChange,
403
403
  // 弹窗数据表头处理
404
404
  export const handleTableColumns = (tableColumns: any) => {
405
405
  // 按照默认设置排序 > 没有排序字段的展示所有列表头 > 没有表头列不展示
406
- const showTableColumns = tableColumns?.filter((s: any) => typeof s.defaultSort == 'number')||tableColumns||[];
406
+ let showTableColumns = tableColumns?.filter((s: any) => typeof s.defaultSort == 'number') || tableColumns || [];
407
+
408
+ showTableColumns = showTableColumns?.length ? showTableColumns : tableColumns;
409
+
407
410
  return showTableColumns?.sort((a: any,b: any)=> a.defaultSort-b.defaultSort)||[]
408
411
  };
409
412
 
@@ -589,7 +589,7 @@ export default function RenderCompItem(props:any){
589
589
  null}
590
590
  {/* 单选/多选 配送方式选择器 */}
591
591
  {((ites?.inputType === 20 || ites?.inputType === 30) &&
592
- ites?.choiceType === 310 && (
592
+ (ites?.choiceType === 310 || ites?.choiceType === 311)&& (
593
593
  <BusinessSearchSelect
594
594
  selectBusinessType="deliveryMode"
595
595
  selectProps={{
@@ -606,6 +606,14 @@ export default function RenderCompItem(props:any){
606
606
  labelInValue={true}
607
607
  value={showValue(ites.code)}
608
608
  requestConfig={{
609
+ ...(ites?.choiceType === 311
610
+ ? {
611
+ otherParams: {
612
+ // 配送方式只选择标准配送方式
613
+ 'qp-recordChannnelCode-eq': 80,
614
+ },
615
+ }
616
+ : {}),
609
617
  filterInit: 'qp-code-in',
610
618
  }}
611
619
  onChange={(value) => {