@bit-sun/business-component 4.2.0-alpha.0 → 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 (99) 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 +3 -3
  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 +2072 -1246
  63. package/dist/index.js +2071 -1241
  64. package/dist/plugin/TableColumnSetting/index.d.ts +6 -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 +11 -11
  69. package/src/components/Business/AddSelectBusiness/index.md +8 -2
  70. package/src/components/Business/AddSelectBusiness/index.tsx +3 -0
  71. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +1 -1
  72. package/src/components/Business/BsLayouts/Components/RightContent/home.less +1 -1
  73. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +2 -2
  74. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +1 -1
  75. package/src/components/Business/BsSulaQueryTable/index.md +57 -4
  76. package/src/components/Business/BsSulaQueryTable/index.tsx +164 -7
  77. package/src/components/Business/BsSulaQueryTable/setting.tsx +6 -0
  78. package/src/components/Business/BsSulaQueryTable/utils.less +1 -1
  79. package/src/components/Business/DetailPageWrapper/index.tsx +81 -1
  80. package/src/components/Business/DetailPageWrapper/readme.md +89 -0
  81. package/src/components/Business/SearchSelect/BusinessUtils.tsx +363 -41
  82. package/src/components/Business/SystemLog/index.md +37 -0
  83. package/src/components/Business/SystemLog/index.tsx +87 -0
  84. package/src/components/Business/columnSettingTable/index.tsx +7 -6
  85. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +23 -22
  86. package/src/components/Functional/AddSelect/index.tsx +112 -3
  87. package/src/components/Functional/DataValidation/index.tsx +22 -3
  88. package/src/components/Functional/QueryMutipleInput/index.tsx +12 -3
  89. package/src/components/Functional/SearchSelect/index.tsx +68 -10
  90. package/src/components/Functional/SearchSelect/utils.tsx +4 -1
  91. package/src/components/Solution/RuleComponent/InnerSelect.tsx +1 -0
  92. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +11 -2
  93. package/src/components/Solution/RuleComponent/RenderCompItem_README.md +189 -0
  94. package/src/components/Solution/RuleComponent/index.js +16 -3
  95. package/src/components/Solution/RuleComponent/ruleFiled.js +25 -1
  96. package/src/index.ts +7 -0
  97. package/src/plugin/TableColumnSetting/index.tsx +75 -9
  98. package/src/utils/TableUtils.less +1 -1
  99. package/src/utils/utils.ts +41 -1
@@ -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
 
@@ -57,6 +57,7 @@ export default (props: Iprops) => {
57
57
  // handleEdit(ites.code, value);
58
58
  }}
59
59
  options={dataSource}
60
+ filterOption ={(input: any, option: any) => option?.label?.toLowerCase()?.indexOf(input?.toLowerCase()) >= 0}
60
61
  />
61
62
  );
62
63
  };
@@ -155,6 +155,7 @@ export default function RenderCompItem(props:any){
155
155
  onChange={(value) => {
156
156
  handleEdit(ites.code, value);
157
157
  }}
158
+ filterOption ={(input: any, option: any) => option?.text?.toLowerCase()?.indexOf(input?.toLowerCase()) >= 0}
158
159
  >
159
160
  {Object.keys(ites.enumeration).map((it) => (
160
161
  <Select.Option key={it} value={it}>
@@ -170,7 +171,7 @@ export default function RenderCompItem(props:any){
170
171
  <InnerSelect
171
172
  disabled={disabled}
172
173
  inputType={ites?.inputType}
173
- defaultValue={ites.defaultValue}
174
+ defaultValue={ites?.defaultValue}
174
175
  styleCommon={styleCommon}
175
176
  value={showValue(ites.code)}
176
177
  onChange={(value) => {
@@ -588,7 +589,7 @@ export default function RenderCompItem(props:any){
588
589
  null}
589
590
  {/* 单选/多选 配送方式选择器 */}
590
591
  {((ites?.inputType === 20 || ites?.inputType === 30) &&
591
- ites?.choiceType === 310 && (
592
+ (ites?.choiceType === 310 || ites?.choiceType === 311)&& (
592
593
  <BusinessSearchSelect
593
594
  selectBusinessType="deliveryMode"
594
595
  selectProps={{
@@ -605,6 +606,14 @@ export default function RenderCompItem(props:any){
605
606
  labelInValue={true}
606
607
  value={showValue(ites.code)}
607
608
  requestConfig={{
609
+ ...(ites?.choiceType === 311
610
+ ? {
611
+ otherParams: {
612
+ // 配送方式只选择标准配送方式
613
+ 'qp-recordChannnelCode-eq': 80,
614
+ },
615
+ }
616
+ : {}),
608
617
  filterInit: 'qp-code-in',
609
618
  }}
610
619
  onChange={(value) => {
@@ -0,0 +1,189 @@
1
+ # RenderCompItem 组件说明文档
2
+
3
+ `RenderCompItem` 是一个通用的表单控件渲染组件,它根据传入的配置对象 (`ites`) 动态渲染不同类型的 Ant Design 表单组件或业务封装组件。
4
+
5
+ ## 1. 组件引入
6
+
7
+ ```typescript
8
+ import RenderCompItem from '@/components/Solution/RuleComponent/RenderCompItem';
9
+ ```
10
+
11
+ ## 2. Props 参数说明
12
+
13
+ | 参数名 | 类型 | 必填 | 说明 |
14
+ | --- | --- | --- | --- |
15
+ | `ites` | `object` | 是 | 核心配置对象,决定渲染什么组件(见下文详解) |
16
+ | `showValue` | `(code: string, type?: string) => any` | 是 | 获取组件当前值的回调函数 |
17
+ | `handleEdit` | `(code: string, value: any) => void` | 是 | 组件值发生变化时的回调函数 |
18
+ | `disabled` | `boolean` | 否 | 是否禁用组件 |
19
+ | `regularDataList` | `array` | 否 | 用于表达式 (`Formula`) 组件的数据源列表 |
20
+ | `others` | `object` | 否 | 扩展属性(目前主要用于 `CustomSelector` 的配置,**注意:源码中可能未正确解构此参数,使用自定义选择器时需检查**) |
21
+
22
+ ## 3. `ites` 配置详解
23
+
24
+ `ites` 对象通过 `inputType`、`valueType` 和 `choiceType` 的组合来决定渲染的具体组件。
25
+
26
+ ### 3.1 基础输入类 (`inputType: 10`)
27
+
28
+ 当 `inputType` 为 `10` 时,根据 `valueType` 区分:
29
+
30
+ | valueType | 组件类型 | 说明 | 对应 Antd 组件 |
31
+ | --- | --- | --- | --- |
32
+ | `21` | 文本输入 | 默认字符串输入 | `Input` |
33
+ | `22` | 小数输入 | 保留2位小数 | `InputNumber` |
34
+ | `23` | 整数输入 | 整数,无小数 | `InputNumber` |
35
+ | `24` | 布尔开关 | Switch 开关 | `Switch` |
36
+ | `32` | 日期时间 | 选择日期和时间 | `DatePicker` (showTime) |
37
+ | `40` | 时间范围 | 选择时间范围 | `RangePicker` (showTime) |
38
+ | `41` | 日期 | 仅选择日期 | `DatePicker` |
39
+
40
+ ### 3.2 选择类 (`inputType: 20 | 30`)
41
+
42
+ * `inputType: 20`: 单选
43
+ * `inputType: 30`: 多选
44
+
45
+ 根据 `choiceType` 区分具体业务组件:
46
+
47
+ | choiceType | 组件类型 | 说明 | 数据源/依赖 |
48
+ | --- | --- | --- | --- |
49
+ | `10` | 枚举选择 | 静态选项 | 需提供 `ites.enumeration` 对象 (key-value) |
50
+ | `20` | 数据字典 | 字典选择 | 需提供 `ites.dictionaryCode` |
51
+ | `110` | 物理仓 | 业务选择器 | `BusinessSearchSelect` (physicalWarehouse) |
52
+ | `120` | 逻辑仓 | 业务选择器 | `BusinessSearchSelect` (realWarehouse) |
53
+ | `130` | 虚拟仓 | 业务选择器 | `BusinessSearchSelect` (virtualWarehouse) |
54
+ | `140` | 渠道仓 | 业务选择器 | `BusinessSearchSelect` (channelWarehouse) |
55
+ | `150` | SPU | 业务选择器 | `BusinessSearchSelect` (spuCommodity) |
56
+ | `160` | SKU | 业务选择器 | `BusinessSearchSelect` (skuCommodity) |
57
+ | `190` | 省市区 | 级联选择 | `BsCascader` |
58
+ | `210` | 行政组织 | 树形选择 | `BusinessTreeSearchSelect` (department) |
59
+ | `220` | 采购组织 | 树形选择 | `BusinessTreeSearchSelect` (purchase-organization) |
60
+ | `230` | 销售组织 | 树形选择 | `BusinessTreeSearchSelect` (sales-organization) |
61
+ | `240` | 供应商 | 业务选择器 | `BusinessSearchSelect` (supplier2) |
62
+ | `250` | 客户 | 业务选择器 | `BusinessSearchSelect` (customer2) |
63
+ | `260` | 店铺 | 业务选择器 | `BusinessSearchSelect` (shopFile2) |
64
+ | `270` | 员工 | 业务选择器 | `BusinessSearchSelect` (employee2) |
65
+ | `280` | 库存组织 | 树形选择 | `BusinessTreeSearchSelect` (stock-organization) |
66
+ | `290` | 结算组织 | 树形选择 | `BusinessTreeSearchSelect` (settle-organization) |
67
+ | `310` / `311`| 配送方式 | 业务选择器 | `BusinessSearchSelect` (deliveryMode) |
68
+ | `360` | 角色 | 业务选择器 | `BusinessSearchSelect` (role) |
69
+ | `410` | 品牌 | 业务选择器 | `BusinessSearchSelect` (brand) |
70
+ | `420` | 类目 | 树形选择 | `BusinessTreeSearchSelect` (background-category) |
71
+ | `40` | 自定义 | 自定义组件 | `CustomSelector` (依赖 `others.customSelectorConfig`) |
72
+
73
+ ### 3.3 表达式 (`inputType: 40`)
74
+
75
+ 渲染 `Formula` 组件,用于配置计算公式。依赖 `regularDataList` 作为变量源。
76
+
77
+ ## 4. 使用示例
78
+
79
+ ```tsx
80
+ import React, { useState } from 'react';
81
+ import RenderCompItem from './RenderCompItem';
82
+
83
+ const Demo = () => {
84
+ const [formData, setFormData] = useState<any>({});
85
+
86
+ // 模拟数据回显
87
+ const showValue = (code: string) => {
88
+ return formData[code];
89
+ };
90
+
91
+ // 模拟数据更新
92
+ const handleEdit = (code: string, value: any) => {
93
+ console.log('Update:', code, value);
94
+ setFormData((prev: any) => ({ ...prev, [code]: value }));
95
+ };
96
+
97
+ // 配置项示例:文本输入
98
+ const inputConfig = {
99
+ code: 'userName',
100
+ inputType: 10,
101
+ valueType: 21,
102
+ defaultValue: '张三'
103
+ };
104
+
105
+ // 配置项示例:静态下拉选择
106
+ const selectConfig = {
107
+ code: 'status',
108
+ inputType: 20, // 单选
109
+ choiceType: 10, // 枚举
110
+ enumeration: {
111
+ '1': '启用',
112
+ '0': '禁用'
113
+ }
114
+ };
115
+
116
+ // 配置项示例:SKU 选择器 (多选)
117
+ const skuSelectConfig = {
118
+ code: 'skuCodes',
119
+ inputType: 30, // 多选
120
+ choiceType: 160, // SKU 选择器
121
+ };
122
+
123
+ // 配置项示例:数据字典选择 (单选)
124
+ const dictSelectConfig = {
125
+ code: 'warehouseType',
126
+ inputType: 20, // 单选
127
+ choiceType: 20, // 数据字典
128
+ dictionaryCode: 'SC0001' // 传入字典编码,组件会自动请求接口获取字典数据
129
+ };
130
+
131
+ return (
132
+ <div>
133
+ <div style={{ marginBottom: 20 }}>
134
+ <label>用户名:</label>
135
+ <RenderCompItem
136
+ ites={inputConfig}
137
+ showValue={showValue}
138
+ handleEdit={handleEdit}
139
+ regularDataList={[]}
140
+ />
141
+ </div>
142
+
143
+ <div style={{ marginBottom: 20 }}>
144
+ <label>状态:</label>
145
+ <RenderCompItem
146
+ ites={selectConfig}
147
+ showValue={showValue}
148
+ handleEdit={handleEdit}
149
+ regularDataList={[]}
150
+ />
151
+ </div>
152
+
153
+ <div style={{ marginBottom: 20 }}>
154
+ <label>商品SKU:</label>
155
+ <RenderCompItem
156
+ ites={skuSelectConfig}
157
+ showValue={showValue}
158
+ handleEdit={handleEdit}
159
+ regularDataList={[]}
160
+ />
161
+ </div>
162
+
163
+ <div>
164
+ <label>仓库类型(数据字典):</label>
165
+ <RenderCompItem
166
+ ites={dictSelectConfig}
167
+ showValue={showValue}
168
+ handleEdit={handleEdit}
169
+ regularDataList={[]}
170
+ />
171
+ </div>
172
+ </div>
173
+ );
174
+ };
175
+
176
+ export default Demo;
177
+ ```
178
+
179
+ ## 5. 依赖说明
180
+
181
+ 该组件依赖以下项目内部组件和库:
182
+ * `antd`
183
+ * `bssula` (request)
184
+ * `@/components/Functional/BsAntdSula` (BsCascader)
185
+ * `@/index` (BusinessSearchSelect, BusinessTreeSearchSelect)
186
+ * 内部组件: `./Formula`, `./InnerSelect`, `./CustomPlugin/CustomSelector`
187
+ * 工具函数: `../../../utils/utils`
188
+
189
+ 使用前请确保相关依赖已安装且路径正确。
@@ -748,6 +748,7 @@ class RuleObjectComponent extends Component {
748
748
  <div
749
749
  className={'rule_line_content'}
750
750
  style={{ display: 'flex', marginBottom: '0px', padding: '10px 0px' }}
751
+ key={itemDetail.elementId}
751
752
  >
752
753
  <div
753
754
  className={'logical_operate_content'}
@@ -1140,7 +1141,12 @@ class RuleObjectComponent extends Component {
1140
1141
  let value = val;
1141
1142
  if (isObj(code)) {
1142
1143
  Object.keys(code).forEach((ite) => {
1143
- this.handleEditExtraInfoResponse(ite, code[ite], parentDetail,classDataIndex);
1144
+ this.handleEditExtraInfoResponse(
1145
+ ite,
1146
+ code[ite],
1147
+ parentDetail,
1148
+ classDataIndex,
1149
+ );
1144
1150
  });
1145
1151
  return;
1146
1152
  }
@@ -1148,9 +1154,16 @@ class RuleObjectComponent extends Component {
1148
1154
  value = val.map((m) => m.value || m).join(',');
1149
1155
  }
1150
1156
  if (isObj(val)) {
1151
- value = val.value || val.PCDCode?.join('/');
1157
+ value = val?.value || val.PCDCode?.join('/') || val;
1152
1158
  }
1153
- this.handleEditExtraInfoResponse('value', value, parentDetail,classDataIndex,code);
1159
+
1160
+ this.handleEditExtraInfoResponse(
1161
+ 'value',
1162
+ value,
1163
+ parentDetail,
1164
+ classDataIndex,
1165
+ code,
1166
+ );
1154
1167
  };
1155
1168
 
1156
1169
  return (
@@ -1932,7 +1932,7 @@ export default class RuleField extends Component {
1932
1932
  }
1933
1933
  }
1934
1934
  // 配送方式选择器
1935
- if (dataChoiceBusinessType == 310) {
1935
+ if (dataChoiceBusinessType == 310 || dataChoiceBusinessType == 311) {
1936
1936
  if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1937
1937
  return (
1938
1938
  <>
@@ -1952,6 +1952,14 @@ export default class RuleField extends Component {
1952
1952
  labelInValue={true}
1953
1953
  value={values[0]}
1954
1954
  requestConfig={{
1955
+ ...(dataChoiceBusinessType === 311
1956
+ ? {
1957
+ otherParams: {
1958
+ // 配送方式只选择标准配送方式
1959
+ 'qp-recordChannnelCode-eq': 80,
1960
+ },
1961
+ }
1962
+ : {}),
1955
1963
  filterInit: 'qp-code-in',
1956
1964
  }}
1957
1965
  onChange={(value) => {
@@ -1983,6 +1991,14 @@ export default class RuleField extends Component {
1983
1991
  labelInValue={true}
1984
1992
  value={values[1]}
1985
1993
  requestConfig={{
1994
+ ...(dataChoiceBusinessType === 311
1995
+ ? {
1996
+ otherParams: {
1997
+ // 配送方式只选择标准配送方式
1998
+ 'qp-recordChannnelCode-eq': 80,
1999
+ },
2000
+ }
2001
+ : {}),
1986
2002
  filterInit: 'qp-code-in',
1987
2003
  }}
1988
2004
  onChange={(value) => {
@@ -2020,6 +2036,14 @@ export default class RuleField extends Component {
2020
2036
  labelInValue={true}
2021
2037
  value={currentValue}
2022
2038
  requestConfig={{
2039
+ ...(dataChoiceBusinessType === 311
2040
+ ? {
2041
+ otherParams: {
2042
+ // 配送方式只选择标准配送方式
2043
+ 'qp-recordChannnelCode-eq': 80,
2044
+ },
2045
+ }
2046
+ : {}),
2023
2047
  filterInit: 'qp-code-in',
2024
2048
  }}
2025
2049
  onChange={(value) => {
package/src/index.ts CHANGED
@@ -43,8 +43,15 @@ export { default as EllipsisTooltip} from './components/Functional/EllipsisToolt
43
43
  export * from './components/Functional/BsAntdSula/index';
44
44
  export { default as RuleComponent} from './components/Solution/RuleComponent';
45
45
  export { default as RuleSetter} from './components/Solution/RuleSetter';
46
+ export { default as RenderCompItem} from './components/Solution/RuleComponent/RenderCompItem';
47
+
48
+ export { processDetailButtonsVisible as processDetailButtonsVisible } from './components/Business/DetailPageWrapper';
49
+
50
+
46
51
 
47
52
  // 通用组件
48
53
  export { default as ExtendedCollapse } from './components/Common/ExtendedCollapse';
49
54
  export { default as Section } from './components/Common/Section';
50
55
  export { default as ParagraphCopier } from './components/Common/ParagraphCopier';
56
+
57
+ export { default as SystemLog } from './components/Business/SystemLog';
@@ -495,6 +495,56 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
495
495
  this.setInitValue(datasource);
496
496
  };
497
497
 
498
+ handleResetSetting = () => {
499
+ const { setShowColumns, datasource = [], setInitialTableInfo, appRequestConfig }: any = this.props;
500
+ let that = this;
501
+ let { bsTableCode } = this.state;
502
+
503
+ return new Promise((resolve: any, reject: any) => {
504
+ request({
505
+ url: handleRequestUrl('/user','/appConfig/saveUserOrder', appRequestConfig),
506
+ method: 'POST',
507
+ data: {
508
+ code: that.state.bsTableCode,
509
+ detail: '',
510
+ },
511
+ }).then((res:any) => {
512
+ if (judgeIsRequestSuccess(res?.data)) {
513
+ let config =
514
+ localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
515
+ let configArray = JSON.parse(config);
516
+ let currentSetting = configArray.filter(
517
+ (item) => item.code === bsTableCode,
518
+ );
519
+ if (currentSetting.length) {
520
+ currentSetting[0].detail = JSON.stringify([]);
521
+ } else {
522
+ configArray.push({
523
+ code: bsTableCode,
524
+ detail: JSON.stringify([]),
525
+ });
526
+ }
527
+
528
+ localStorage.setItem(
529
+ ENUM.BROWSER_CACHE.COLUMN_CONDITION,
530
+ JSON.stringify(configArray),
531
+ );
532
+
533
+ message.success('重置表头列成功!');
534
+
535
+ setInitialTableInfo(true);
536
+ this.setState({
537
+ visible: false,
538
+ });
539
+ } else {
540
+ message.error('重置表头列自定义失败,请稍后尝试');
541
+ reject('');
542
+ }
543
+ });
544
+ })
545
+ };
546
+
547
+
498
548
  onSearch = (e: any) => {
499
549
  this.setState({
500
550
  searchDataSource: e.target.value,
@@ -532,15 +582,31 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
532
582
  onOk={this.handleOk}
533
583
  onCancel={this.handleCancel}
534
584
  footer={[
535
- <Button key="back" onClick={this.handleReset}>
536
- 恢复默认
537
- </Button>,
538
- <Button key="submit" onClick={this.handleOk}>
539
- 取消
540
- </Button>,
541
- <Button key="submit" type="primary" onClick={this.handleOk}>
542
- 确认
543
- </Button>,
585
+ <div>
586
+ <Button
587
+ key="back"
588
+ onClick={this.handleReset}
589
+ style={{ marginRight: 0 }}
590
+ >
591
+ 恢复默认
592
+ </Button>
593
+ <Button key="back" onClick={this.handleResetSetting}>
594
+ 重置设置
595
+ </Button>
596
+ <span style={{fontSize: '12px', color: '8A8F8D'}}>(列表字段变更会影响列设置功能,变更后请点击重置然后重新设置)</span>
597
+ </div>,
598
+ <div>
599
+ <Button
600
+ key="submit"
601
+ onClick={this.handleCancel}
602
+ style={{ marginRight: 0 }}
603
+ >
604
+ 取消
605
+ </Button>
606
+ <Button key="submit" type="primary" onClick={this.handleOk}>
607
+ 确认
608
+ </Button>
609
+ </div>,
544
610
  ]}
545
611
  >
546
612
  <div className={'sort_table'}>
@@ -48,5 +48,5 @@
48
48
  }
49
49
 
50
50
  .card_department {
51
- color: #005cff !important;
51
+ color: #005CFF !important;
52
52
  }
@@ -267,4 +267,44 @@ export const handleConvertResponse = (items: any, total: number): object => {
267
267
 
268
268
  export const noEmptyArray = (targetObj: any) => {
269
269
  return Array.isArray(targetObj) && targetObj.length !== 0;
270
- };
270
+ };
271
+
272
+ export const formContainerAndItemLayout = (type: string, title: any, name: string) => {
273
+ return type === 'form' ? {
274
+ container: {
275
+ type: 'card',
276
+ props: {
277
+ title,
278
+ id: Math.random(),
279
+ level: 1,
280
+ name
281
+ },
282
+ },
283
+ itemLayout: {
284
+ span: 8, // span表示每项所占的栅格数
285
+ labelCol: {
286
+ span: 8,
287
+ },
288
+ wrapperCol: {
289
+ span: 18,
290
+ },
291
+ },
292
+ } : {
293
+ container: {
294
+ type: 'card',
295
+ props: {
296
+ title,
297
+ id: Math.random(),
298
+ level: 1,
299
+ bordered: null,
300
+ isWhiteCard: true,
301
+ name
302
+ },
303
+ },
304
+ itemLayout: {
305
+ wrapperCol: {
306
+ span: 0,
307
+ },
308
+ },
309
+ }
310
+ }