@bit-sun/business-component 3.1.10-alpha.1 → 3.1.10-alpha.11

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 (223) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/components/Functional/AddSelect/index.d.ts +1 -1
  9. package/dist/index.esm.js +485 -205
  10. package/dist/index.js +486 -206
  11. package/docs/index.md +21 -21
  12. package/lib/assets/drag.svg +17 -17
  13. package/lib/assets/exportFail.svg +37 -37
  14. package/lib/assets/exportProcessing.svg +28 -28
  15. package/lib/assets/exportSuccess.svg +34 -34
  16. package/lib/assets/label_icon_bottom.svg +25 -25
  17. package/lib/assets/upExport.svg +22 -22
  18. package/package.json +88 -88
  19. package/src/assets/32.svg +27 -27
  20. package/src/assets/addIcon.svg +17 -17
  21. package/src/assets/allfunc.svg +27 -27
  22. package/src/assets/arrowRight.svg +24 -24
  23. package/src/assets/arrow_top.svg +17 -17
  24. package/src/assets/btn-delete.svg +29 -29
  25. package/src/assets/btn-edit.svg +19 -19
  26. package/src/assets/btn-more.svg +17 -17
  27. package/src/assets/btn-submit.svg +19 -19
  28. package/src/assets/caidan.svg +11 -11
  29. package/src/assets/close.svg +26 -26
  30. package/src/assets/drag.svg +17 -17
  31. package/src/assets/exportFail.svg +37 -37
  32. package/src/assets/exportProcessing.svg +28 -28
  33. package/src/assets/exportSuccess.svg +34 -34
  34. package/src/assets/fixed-left-active.svg +11 -11
  35. package/src/assets/fixed-left.svg +15 -15
  36. package/src/assets/fixed-right-active.svg +11 -11
  37. package/src/assets/fixed-right.svg +15 -15
  38. package/src/assets/guanbi.svg +15 -15
  39. package/src/assets/icon-quanping.svg +15 -15
  40. package/src/assets/icon-shezhi.svg +17 -17
  41. package/src/assets/label_icon_bottom.svg +25 -25
  42. package/src/assets/list-no-img.svg +21 -21
  43. package/src/assets/morentouxiang-32.svg +23 -23
  44. package/src/assets/scanning.svg +24 -24
  45. package/src/assets/upExport.svg +22 -22
  46. package/src/common/ENUM.ts +41 -41
  47. package/src/components/Business/AddSelectBusiness/index.md +398 -398
  48. package/src/components/Business/AddSelectBusiness/index.tsx +1116 -1116
  49. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -112
  50. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  51. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  52. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -193
  53. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -10
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  58. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  59. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  60. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  61. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  62. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  63. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  64. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -163
  65. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  66. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  67. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +8 -8
  68. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -172
  69. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  70. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  71. package/src/components/Business/BsLayouts/index.less +79 -79
  72. package/src/components/Business/BsLayouts/index.tsx +1606 -1606
  73. package/src/components/Business/BsLayouts/service.ts +10 -10
  74. package/src/components/Business/BsLayouts/utils.tsx +205 -205
  75. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +568 -566
  76. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -5
  77. package/src/components/Business/BsSulaQueryTable/index.less +227 -227
  78. package/src/components/Business/BsSulaQueryTable/index.tsx +767 -767
  79. package/src/components/Business/BsSulaQueryTable/setting.tsx +890 -888
  80. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  81. package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -709
  82. package/src/components/Business/CommodityEntry/index.md +84 -84
  83. package/src/components/Business/CommodityEntry/index.tsx +82 -82
  84. package/src/components/Business/CommonAlert/index.tsx +23 -23
  85. package/src/components/Business/CommonGuideWrapper/index.less +121 -121
  86. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  87. package/src/components/Business/CommonGuideWrapper/index.tsx +94 -94
  88. package/src/components/Business/DetailPageWrapper/index.less +87 -87
  89. package/src/components/Business/DetailPageWrapper/index.tsx +327 -327
  90. package/src/components/Business/DetailPageWrapper/utils.tsx +166 -166
  91. package/src/components/Business/HomePageWrapper/index.less +33 -33
  92. package/src/components/Business/HomePageWrapper/index.md +45 -45
  93. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  94. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -823
  95. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  96. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  97. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  98. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  99. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  100. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  101. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  102. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  103. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  104. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  105. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  106. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  107. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  108. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  109. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  110. package/src/components/Business/JsonQueryTable/index.less +16 -16
  111. package/src/components/Business/JsonQueryTable/index.md +328 -328
  112. package/src/components/Business/JsonQueryTable/index.tsx +534 -534
  113. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  114. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  115. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  116. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  117. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  118. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  119. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  120. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  121. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  122. package/src/components/Business/SearchSelect/BusinessUtils.tsx +2326 -2318
  123. package/src/components/Business/SearchSelect/common.ts +134 -134
  124. package/src/components/Business/SearchSelect/index.md +1570 -1570
  125. package/src/components/Business/SearchSelect/index.tsx +55 -55
  126. package/src/components/Business/SearchSelect/utils.ts +125 -125
  127. package/src/components/Business/StateFlow/index.less +130 -130
  128. package/src/components/Business/StateFlow/index.md +60 -60
  129. package/src/components/Business/StateFlow/index.tsx +29 -29
  130. package/src/components/Business/TreeSearchSelect/index.md +239 -239
  131. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  132. package/src/components/Business/TreeSearchSelect/utils.ts +115 -115
  133. package/src/components/Business/columnSettingTable/columnSetting.tsx +818 -816
  134. package/src/components/Business/columnSettingTable/index.less +253 -253
  135. package/src/components/Business/columnSettingTable/index.md +372 -372
  136. package/src/components/Business/columnSettingTable/index.tsx +225 -225
  137. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +232 -232
  138. package/src/components/Business/columnSettingTable/utils.tsx +87 -87
  139. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  140. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  141. package/src/components/Business/moreTreeTable/index.less +99 -99
  142. package/src/components/Business/moreTreeTable/index.md +448 -448
  143. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  144. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  145. package/src/components/Functional/AccessWrapper/index.tsx +33 -33
  146. package/src/components/Functional/AddSelect/helps.ts +81 -81
  147. package/src/components/Functional/AddSelect/index.less +367 -367
  148. package/src/components/Functional/AddSelect/index.md +155 -155
  149. package/src/components/Functional/AddSelect/index.tsx +1088 -1072
  150. package/src/components/Functional/AuthButton/index.tsx +15 -15
  151. package/src/components/Functional/BillEntry/index.less +371 -371
  152. package/src/components/Functional/BillEntry/index.md +39 -39
  153. package/src/components/Functional/BillEntry/index.tsx +771 -771
  154. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  155. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  156. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  157. package/src/components/Functional/DataImport/index.less +63 -63
  158. package/src/components/Functional/DataImport/index.md +44 -44
  159. package/src/components/Functional/DataImport/index.tsx +782 -782
  160. package/src/components/Functional/DataValidation/index.less +63 -63
  161. package/src/components/Functional/DataValidation/index.md +52 -52
  162. package/src/components/Functional/DataValidation/index.tsx +788 -788
  163. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  164. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  165. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  166. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  167. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -65
  168. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  169. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  170. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -129
  171. package/src/components/Functional/SearchSelect/index.less +121 -121
  172. package/src/components/Functional/SearchSelect/index.md +141 -141
  173. package/src/components/Functional/SearchSelect/index.tsx +1050 -1046
  174. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  175. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  176. package/src/components/Functional/TreeSearchSelect/index.tsx +224 -224
  177. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.tsx +358 -358
  178. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/function.js +255 -255
  179. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.tsx +57 -57
  180. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.tsx +129 -129
  181. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  182. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  183. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +774 -774
  184. package/src/components/Solution/RuleComponent/index.d.ts +34 -29
  185. package/src/components/Solution/RuleComponent/index.js +1680 -1663
  186. package/src/components/Solution/RuleComponent/index.less +247 -247
  187. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  188. package/src/components/Solution/RuleComponent/ruleFiled.js +2695 -2695
  189. package/src/components/Solution/RuleComponent/services.ts +13 -13
  190. package/src/components/Solution/RuleComponent/util.js +143 -143
  191. package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -6
  192. package/src/components/Solution/RuleSetter/baseRule.tsx +414 -414
  193. package/src/components/Solution/RuleSetter/function.ts +467 -467
  194. package/src/components/Solution/RuleSetter/index.less +221 -221
  195. package/src/components/Solution/RuleSetter/index.tsx +210 -210
  196. package/src/components/Solution/RuleSetter/service.js +276 -276
  197. package/src/index.ts +42 -42
  198. package/src/plugin/TableColumnSetting/index.less +247 -247
  199. package/src/plugin/TableColumnSetting/index.md +50 -50
  200. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  201. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  202. package/src/styles/bsDefault.less +1933 -1933
  203. package/src/utils/CheckOneUser/index.md +39 -39
  204. package/src/utils/CheckOneUser/index.ts +51 -51
  205. package/src/utils/CustomLoginInfo.ts +55 -55
  206. package/src/utils/LocalstorageUtils.ts +134 -134
  207. package/src/utils/TableUtils.less +51 -51
  208. package/src/utils/TableUtils.tsx +691 -691
  209. package/src/utils/TreeUtils.ts +12 -12
  210. package/src/utils/auth.ts +38 -38
  211. package/src/utils/businessUtils.ts +434 -434
  212. package/src/utils/checkUtils.ts +39 -39
  213. package/src/utils/constant.ts +38 -38
  214. package/src/utils/enumConfig.ts +17 -17
  215. package/src/utils/getFormMode.js +12 -12
  216. package/src/utils/index.ts +21 -21
  217. package/src/utils/request.ts +53 -53
  218. package/src/utils/requestUtils.ts +197 -197
  219. package/src/utils/serialize.js +7 -7
  220. package/src/utils/utils.ts +266 -266
  221. package/src/utils/xlsxUtil.tsx +145 -145
  222. package/tsconfig.json +29 -29
  223. package/typings.d.ts +4 -4
@@ -1,774 +1,774 @@
1
- // @ts-nocheck
2
- import { BsCascader } from '@/components/Functional/BsAntdSula';
3
- import { BusinessSearchSelect, BusinessTreeSearchSelect } from '@/index';
4
- import { getDictionarySource, judgeIsEmpty, uuid } from '../../../utils/utils';
5
- import { useRequest } from 'ahooks';
6
- import { Input, InputNumber, DatePicker, Switch, Select } from 'antd';
7
- import React, { useEffect, useState } from 'react'
8
- import { request } from 'bssula';
9
- import Formula from './Formula';
10
- import {
11
- dateFormat,
12
- fullDateFormat
13
- } from './util';
14
- import InnerSelect from './InnerSelect';
15
- import CustomSelector from './CustomPlugin/CustomSelector';
16
- const { RangePicker } = DatePicker;
17
- export default function RenderCompItem(props:any){
18
- const { regularDataList,ites, showValue, handleEdit,disabled } = props;
19
- let fieldListGroup = regularDataList.map((item:any) => {
20
- const Item = {
21
- id: item.id,
22
- code: item.code,
23
- name: item.name,
24
- value: item.code,
25
- };
26
- if (item.propertyList) {
27
- // @ts-ignore
28
- Item.propertyList = item.propertyList.map((field:any) => ({
29
- id: field.id,
30
- code: field.code,
31
- name: field.name,
32
- value: `${item.code}.${field.code}`,
33
- valueText: `${item.name}.${field.name}`,
34
- }));
35
- }
36
- return Item;
37
- });
38
- console.log(ites?.dictionaryCode&&!getDictionarySource(ites.dictionaryCode))
39
- const [dictData, setDictData] = useState(getDictionarySource(ites.dictionaryCode) || [])
40
- const getDictData=async()=>{
41
- const data= await request({url:`/basic/bscDictItem/allItemList?qp-code-eq=${ites.dictionaryCode}`})
42
- setDictData(data?.map?.(item=>({text:item.dictItemName,value:item.dictItemCode})))
43
- }
44
-
45
- useEffect(() => {
46
- if (ites?.dictionaryCode && !getDictionarySource(ites.dictionaryCode)) {
47
- getDictData()
48
- }
49
- }, []);
50
- if (!ites) return;
51
- const styleCommon = {
52
- width: '200px',
53
- ...(ites?.rightText ? { marginLeft: 10 } : {}),
54
- };
55
- const style2 = {
56
- width: '100px',
57
- };
58
- return (
59
- <>
60
- {/* 输入/字符串 */}
61
- {(ites?.inputType === 10 && ites?.valueType === 21 && (
62
- <Input
63
- disabled={disabled}
64
- allowClear={true}
65
- onClear={() => handleEdit(ites.code, undefined)}
66
- defaultValue={showValue(ites.code, 'input')}
67
- style={styleCommon}
68
- onBlur={(e) => {
69
- handleEdit(
70
- ites.code,
71
- String(e.target.value).trim() == ''
72
- ? undefined
73
- : e.target.value,
74
- );
75
- }}
76
- />
77
- )) ||
78
- null}
79
- {/* 输入 / 长整数23/小数22 */}
80
- {(ites?.inputType === 10 &&
81
- (ites?.valueType === 23 || ites?.valueType === 22) && (
82
- <InputNumber
83
- disabled={disabled}
84
- // max={Number.MAX_SAFE_INTEGER}
85
- max={judgeIsEmpty(ites?.maxValue) ? Number.MAX_SAFE_INTEGER : ites.maxValue}
86
- // min={ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER}
87
- min={judgeIsEmpty(ites?.minValue) ? (ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER) : ites.minValue}
88
- precision={ites?.valueType === 23 ? 0 : 2}
89
- defaultValue={ites.defaultValue}
90
- style={style2}
91
- value={showValue(ites.code)}
92
- onChange={(value) => {
93
- handleEdit(ites.code, value);
94
- }}
95
- />
96
- )) ||
97
- null}
98
- {/* 输入/日期 */}
99
- {(ites?.inputType === 10 && (ites?.valueType === 41 || ites?.valueType === 32) && (
100
- <DatePicker
101
- showTime={ites?.valueType == 32}
102
- format={ites?.valueType == 41 ? dateFormat : fullDateFormat}
103
- disabled={disabled}
104
- defaultValue={ites.defaultValue}
105
- style={styleCommon}
106
- value={showValue(ites.code,ites?.valueType == 41?'date':'dateTime')}
107
- onChange={(value,dateString) => {
108
- handleEdit(ites.code, dateString);
109
- }}
110
- />
111
- )) ||
112
- null}
113
- {/* 输入/时间 */}
114
- {(ites?.inputType === 10 && ites?.valueType === 40 && (
115
- <RangePicker
116
- showTime
117
- disabled={disabled}
118
- defaultValue={ites.defaultValue}
119
- style={styleCommon}
120
- value={showValue(ites.code,'rangeTime')}
121
- onChange={(value,timeString) => {
122
- handleEdit(ites.code, timeString);
123
- }}
124
- />
125
- )) ||
126
- null}
127
- {/* 输入/布尔值 */}
128
- {(ites?.inputType === 10 && ites?.valueType === 24 && (
129
- <Switch
130
- disabled={disabled}
131
- defaultChecked={!!ites.defaultValue}
132
- style={style2}
133
- checked={showValue(ites.code)}
134
- onChange={(value) => {
135
- handleEdit(ites.code, value);
136
- }}
137
- />
138
- )) ||
139
- null}
140
- {/* 单选/多选 自定义 */}
141
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
142
- ites?.choiceType === 10 && (
143
- <Select
144
- disabled={disabled}
145
- allowClear
146
- showArrow
147
- {...(ites?.inputType === 30
148
- ? {
149
- mode: 'multiple',
150
- }
151
- : {})}
152
- defaultValue={ites.defaultValue}
153
- style={styleCommon}
154
- value={showValue(ites.code) as string}
155
- onChange={(value) => {
156
- handleEdit(ites.code, value);
157
- }}
158
- >
159
- {Object.keys(ites.enumeration).map((it) => (
160
- <Select.Option key={it} value={it}>
161
- {ites.enumeration[it]}
162
- </Select.Option>
163
- ))}
164
- </Select>
165
- )) ||
166
- null}
167
- {/* 单选/多选 数据字典 */}
168
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
169
- ites?.choiceType === 20 && (
170
- <InnerSelect
171
- disabled={disabled}
172
- inputType={ites?.inputType}
173
- defaultValue={ites.defaultValue}
174
- styleCommon={styleCommon}
175
- value={showValue(ites.code)}
176
- onChange={(value) => {
177
- handleEdit(ites.code, value);
178
- }}
179
- dictionaryCode={ites.dictionaryCode}
180
- />
181
- )) ||
182
- null}
183
- {/* 单选/多选 仓库选择器(物理仓) */}
184
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
185
- ites?.choiceType === 110 && (
186
- <BusinessSearchSelect
187
- selectBusinessType="physicalWarehouse"
188
- selectProps={{
189
- style: styleCommon,
190
- placeholder: '请选择物理仓',
191
- ...(ites?.inputType === 30
192
- ? {
193
- mode: 'multiple',
194
- maxTagCount: 1,
195
- }
196
- : {}),
197
- }}
198
- disabled={disabled}
199
- labelInValue={true}
200
- value={showValue(ites.code)}
201
- requestConfig={{
202
- mappingValueField: 'physicalWarehouseCode',
203
- filterInit: 'qp-physicalWarehouseCode-in',
204
- }}
205
- onChange={(value: any) => {
206
- handleEdit(ites.code, value);
207
- }}
208
- getPopupContainer={() => document.body}
209
- />
210
- )) ||
211
- null}
212
- {/* 单选/多选 仓库选择器(逻辑仓) */}
213
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
214
- ites?.choiceType === 120 && (
215
- <BusinessSearchSelect
216
- selectBusinessType="realWarehouse"
217
- selectProps={{
218
- style: styleCommon,
219
- placeholder: '请选择逻辑仓',
220
- ...(ites?.inputType === 30
221
- ? {
222
- mode: 'multiple',
223
- maxTagCount: 1,
224
- }
225
- : {}),
226
- }}
227
- disabled={disabled}
228
- labelInValue={true}
229
- value={showValue(ites.code)}
230
- requestConfig={{
231
- mappingValueField: 'realWarehouseCode',
232
- filterInit: 'qp-realWarehouseCode-in',
233
- }}
234
- onChange={(value) => {
235
- handleEdit(ites.code, value);
236
- }}
237
- getPopupContainer={() => document.body}
238
- />
239
- )) ||
240
- null}
241
- {/* 单选/多选 仓库选择器(虚拟仓) */}
242
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
243
- ites?.choiceType === 130 && (
244
- <BusinessSearchSelect
245
- selectBusinessType="virtualWarehouse"
246
- selectProps={{
247
- style: styleCommon,
248
- placeholder: '请选择虚拟仓',
249
- ...(ites?.inputType === 30
250
- ? {
251
- mode: 'multiple',
252
- maxTagCount: 1,
253
- }
254
- : {}),
255
- }}
256
- disabled={disabled}
257
- labelInValue={true}
258
- value={showValue(ites.code)}
259
- requestConfig={{
260
- mappingValueField: 'virtualWarehouseCode',
261
- filterInit: 'qp-virtualWarehouseCode-in',
262
- }}
263
- onChange={(value) => {
264
- handleEdit(ites.code, value);
265
- }}
266
- getPopupContainer={() => document.body}
267
- />
268
- )) ||
269
- null}
270
- {/* 单选/多选 仓库选择器(渠道仓) */}
271
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
272
- ites?.choiceType === 140 && (
273
- <BusinessSearchSelect
274
- selectBusinessType="channelWarehouse"
275
- selectProps={{
276
- style: styleCommon,
277
- placeholder: '请选择渠道仓',
278
- ...(ites?.inputType === 30
279
- ? {
280
- mode: 'multiple',
281
- maxTagCount: 1,
282
- }
283
- : {}),
284
- }}
285
- disabled={disabled}
286
- labelInValue={true}
287
- value={showValue(ites.code)}
288
- requestConfig={{
289
- mappingValueField: 'channelWarehouseCode',
290
- filterInit: 'qp-channelWarehouseCode-in',
291
- }}
292
- onChange={(value: any) => {
293
- handleEdit(ites.code, value);
294
- }}
295
- getPopupContainer={() => document.body}
296
- />
297
- )) ||
298
- null}
299
- {/* 单选/多选 商品SPU选择器 */}
300
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
301
- ites?.choiceType === 150 && (
302
- <BusinessSearchSelect
303
- selectBusinessType="spuCommodity"
304
- selectProps={{
305
- style: styleCommon,
306
- placeholder: '请选择SPU',
307
- ...(ites?.inputType === 30
308
- ? {
309
- mode: 'multiple',
310
- maxTagCount: 1,
311
- }
312
- : {}),
313
- }}
314
- disabled={disabled}
315
- labelInValue={true}
316
- value={showValue(ites.code)}
317
- requestConfig={{
318
- filterInit: 'qp-itemCode-in',
319
- }}
320
- onChange={(value) => {
321
- handleEdit(ites.code, value);
322
- }}
323
- getPopupContainer={() => document.body}
324
- />
325
- )) ||
326
- null}
327
- {/* 单选/多选 商品SKU选择器 */}
328
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
329
- ites?.choiceType === 160 && (
330
- <BusinessSearchSelect
331
- selectBusinessType="skuCommodity"
332
- selectProps={{
333
- style: styleCommon,
334
- placeholder: '请选择商品',
335
- ...(ites?.inputType === 30
336
- ? {
337
- mode: 'multiple',
338
- maxTagCount: 1,
339
- }
340
- : {}),
341
- }}
342
- disabled={disabled}
343
- labelInValue={true}
344
- value={showValue(ites.code)}
345
- requestConfig={{
346
- filterInit: 'qp-skuCode-in',
347
- }}
348
- onChange={(value: any) => {
349
- handleEdit(ites.code, value);
350
- }}
351
- getPopupContainer={() => document.body}
352
- />
353
- )) ||
354
- null}
355
- {/* 单选/多选 省市区 */}
356
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
357
- ites?.choiceType === 190 && (
358
- <BsCascader
359
- disabled={disabled}
360
- isAll={true}
361
- needNameAndCode={true}
362
- notChangeOnSelect={true}
363
- initRequestSource={async () => {
364
- return await request({
365
- url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
366
- method: 'get',
367
- converter: ({ data }: any) => {
368
- // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
369
- const handleData =
370
- data && data[0]
371
- ? data?.map((item: any) => {
372
- return {
373
- text: item.name,
374
- value: item.id,
375
- level: item.level,
376
- id: item.id,
377
- };
378
- })
379
- : [];
380
- return handleData;
381
- },
382
- });
383
- }}
384
- value={showValue(ites.code)}
385
- onChange={(value) => {
386
- handleEdit(ites.code, value);
387
- }}
388
- getPopupContainer={() => document.body}
389
- />
390
- )) ||
391
- null}
392
- {/* 单选/多选 行政组织选择器 */}
393
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
394
- ites?.choiceType === 210 && (
395
- <BusinessTreeSearchSelect
396
- disabled={disabled}
397
- treeCheckable={ites?.inputType === 30}
398
- businessType="department"
399
- labelInValue={true}
400
- value={showValue(ites.code)}
401
- style={styleCommon}
402
- onChange={(value) => {
403
- handleEdit(ites.code, value);
404
- }}
405
- getPopupContainer={() => document.body}
406
- />
407
- )) ||
408
- null}
409
- {/* 单选/多选 采购组织选择器 */}
410
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
411
- ites?.choiceType === 220 && (
412
- <BusinessTreeSearchSelect
413
- disabled={disabled}
414
- treeCheckable={ites?.inputType === 30}
415
- businessType="purchase-organization"
416
- labelInValue={true}
417
- value={showValue(ites.code)}
418
- style={styleCommon}
419
- onChange={(value) => {
420
- handleEdit(ites.code, value);
421
- }}
422
- getPopupContainer={() => document.body}
423
- />
424
- )) ||
425
- null}
426
- {/* 单选/多选 销售组织选择器 */}
427
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
428
- ites?.choiceType === 230 && (
429
- <BusinessTreeSearchSelect
430
- disabled={disabled}
431
- treeCheckable={ites?.inputType === 30}
432
- businessType="sales-organization"
433
- labelInValue={true}
434
- value={showValue(ites.code)}
435
- style={styleCommon}
436
- onChange={(value) => {
437
- handleEdit(ites.code, value);
438
- }}
439
- getPopupContainer={() => document.body}
440
- />
441
- )) ||
442
- null}
443
- {/* 单选/多选 供应商选择器 */}
444
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
445
- ites?.choiceType === 240 && (
446
- <BusinessSearchSelect
447
- selectBusinessType="supplier2"
448
- selectProps={{
449
- style: styleCommon,
450
- placeholder: '请选择供应商',
451
- ...(ites?.inputType === 30
452
- ? {
453
- mode: 'multiple',
454
- maxTagCount: 1,
455
- }
456
- : {}),
457
- }}
458
- disabled={disabled}
459
- labelInValue={true}
460
- value={showValue(ites.code)}
461
- requestConfig={{
462
- filterInit: 'qp-code-in',
463
- }}
464
- onChange={(value) => {
465
- handleEdit(ites.code, value);
466
- }}
467
- getPopupContainer={() => document.body}
468
- />
469
- )) ||
470
- null}
471
- {/* 单选/多选 客户选择器 */}
472
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
473
- ites?.choiceType === 250 && (
474
- <BusinessSearchSelect
475
- selectBusinessType="customer2"
476
- selectProps={{
477
- style: styleCommon,
478
- placeholder: '请选择客户',
479
- ...(ites?.inputType === 30
480
- ? {
481
- mode: 'multiple',
482
- maxTagCount: 1,
483
- }
484
- : {}),
485
- }}
486
- disabled={disabled}
487
- labelInValue={true}
488
- value={showValue(ites.code)}
489
- requestConfig={{
490
- filterInit: 'qp-code-in',
491
- }}
492
- onChange={(value) => {
493
- handleEdit(ites.code, value);
494
- }}
495
- getPopupContainer={() => document.body}
496
- />
497
- )) ||
498
- null}
499
- {/* 单选/多选 店铺选择器 */}
500
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
501
- ites?.choiceType === 260 && (
502
- <BusinessSearchSelect
503
- selectBusinessType="shopFile2"
504
- selectProps={{
505
- style: styleCommon,
506
- placeholder: '请选择店铺',
507
- ...(ites?.inputType === 30
508
- ? {
509
- mode: 'multiple',
510
- maxTagCount: 1,
511
- }
512
- : {}),
513
- }}
514
- disabled={disabled}
515
- labelInValue={true}
516
- value={showValue(ites.code)}
517
- requestConfig={{
518
- filterInit: 'qp-code-in',
519
- }}
520
- onChange={(value) => {
521
- handleEdit(ites.code, value);
522
- }}
523
- getPopupContainer={() => document.body}
524
- />
525
- )) ||
526
- null}
527
- {/* 单选/多选 员工选择器 */}
528
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
529
- ites?.choiceType === 270 && (
530
- <BusinessSearchSelect
531
- selectBusinessType="employee2"
532
- selectProps={{
533
- style: styleCommon,
534
- placeholder: '请选择员工',
535
- ...(ites?.inputType === 30
536
- ? {
537
- mode: 'multiple',
538
- maxTagCount: 1,
539
- }
540
- : {}),
541
- }}
542
- disabled={disabled}
543
- labelInValue={true}
544
- value={showValue(ites.code)}
545
- requestConfig={{
546
- filterInit: 'qp-id-in',
547
- }}
548
- onChange={(value) => {
549
- handleEdit(ites.code, value);
550
- }}
551
- getPopupContainer={() => document.body}
552
- />
553
- )) ||
554
- null}
555
- {/* 单选/多选 库存组织选择器 */}
556
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
557
- ites?.choiceType === 280 && (
558
- <BusinessTreeSearchSelect
559
- disabled={disabled}
560
- treeCheckable={ites?.inputType === 30}
561
- businessType="stock-organization"
562
- labelInValue={true}
563
- value={showValue(ites.code)}
564
- style={styleCommon}
565
- onChange={(value) => {
566
- handleEdit(ites.code, value);
567
- }}
568
- getPopupContainer={() => document.body}
569
- />
570
- )) ||
571
- null}
572
- {/* 单选/多选 结算组织选择器 */}
573
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
574
- ites?.choiceType === 290 && (
575
- <BusinessTreeSearchSelect
576
- disabled={disabled}
577
- treeCheckable={ites?.inputType === 30}
578
- businessType="settle-organization"
579
- labelInValue={true}
580
- value={showValue(ites.code)}
581
- style={styleCommon}
582
- onChange={(value) => {
583
- handleEdit(ites.code, value);
584
- }}
585
- getPopupContainer={() => document.body}
586
- />
587
- )) ||
588
- null}
589
- {/* 单选/多选 配送方式选择器 */}
590
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
591
- ites?.choiceType === 310 && (
592
- <BusinessSearchSelect
593
- selectBusinessType="deliveryMode"
594
- selectProps={{
595
- style: styleCommon,
596
- placeholder: '请选择配送方式',
597
- ...(ites?.inputType === 30
598
- ? {
599
- mode: 'multiple',
600
- maxTagCount: 1,
601
- }
602
- : {}),
603
- }}
604
- disabled={disabled}
605
- labelInValue={true}
606
- value={showValue(ites.code)}
607
- requestConfig={{
608
- filterInit: 'qp-code-in',
609
- }}
610
- onChange={(value) => {
611
- handleEdit(ites.code, value);
612
- }}
613
- getPopupContainer={() => document.body}
614
- />
615
- )) ||
616
- null}
617
- {/* 单选/多选 角色选择器 */}
618
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
619
- ites?.choiceType === 360 && (
620
- <BusinessSearchSelect
621
- selectBusinessType="role"
622
- selectProps={{
623
- style: styleCommon,
624
- placeholder: '请选择角色',
625
- ...(ites?.inputType === 30
626
- ? {
627
- mode: 'multiple',
628
- maxTagCount: 1,
629
- }
630
- : {}),
631
- }}
632
- disabled={disabled}
633
- labelInValue={true}
634
- value={showValue(ites.code)}
635
- requestConfig={{
636
- filterInit: 'qp-code-in',
637
- }}
638
- onChange={(value) => {
639
- handleEdit(ites.code, value);
640
- }}
641
- getPopupContainer={() => document.body}
642
- />
643
- )) ||
644
- null}
645
- {/* 单选/多选 品牌选择器 */}
646
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
647
- ites?.choiceType === 410 && (
648
- <BusinessSearchSelect
649
- selectBusinessType="brand"
650
- selectProps={{
651
- style: styleCommon,
652
- placeholder: '请选择品牌',
653
- ...(ites?.inputType === 30
654
- ? {
655
- mode: 'multiple',
656
- maxTagCount: 1,
657
- }
658
- : {}),
659
- }}
660
- disabled={disabled}
661
- labelInValue={true}
662
- value={showValue(ites.code)}
663
- requestConfig={{
664
- filterInit: 'qp-brandCode-in',
665
- }}
666
- onChange={(value) => {
667
- handleEdit(ites.code, value);
668
- }}
669
- getPopupContainer={() => document.body}
670
- />
671
- )) ||
672
- null}
673
- {/* 单选/多选 类目选择器 */}
674
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
675
- ites?.choiceType === 420 && (
676
- <BusinessTreeSearchSelect
677
- disabled={disabled}
678
- treeCheckable={ites?.inputType === 30}
679
- businessType="background-category"
680
- labelInValue={true}
681
- value={showValue(ites.code)}
682
- style={styleCommon}
683
- onChange={(value) => {
684
- handleEdit(ites.code, value);
685
- }}
686
- getPopupContainer={() => document.body}
687
- />
688
- )) ||
689
- null}
690
- {/* 单选/多选 订单标签选择器 */}
691
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
692
- ites?.choiceType === 450 && (
693
- <BusinessSearchSelect
694
- selectBusinessType="orderTag"
695
- prefixUrl={{ selectPrefix: '/oms-ops' }}
696
- selectProps={{
697
- style: styleCommon,
698
- placeholder: '请选择订单标签',
699
- ...(ites?.inputType === 30
700
- ? {
701
- mode: 'multiple',
702
- maxTagCount: 1,
703
- }
704
- : {}),
705
- }}
706
- disabled={disabled}
707
- labelInValue={true}
708
- value={showValue(ites.code)}
709
- requestConfig={{
710
- filterInit: 'qp-code-in',
711
- }}
712
- onChange={(value) => {
713
- handleEdit(ites.code, value);
714
- }}
715
- getPopupContainer={() => document.body}
716
- />
717
- )) ||
718
- null}
719
- {/* 单选/多选 自定义选择器 */}
720
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
721
- ites?.choiceType === 40 && (
722
- <CustomSelector
723
- selectProps={{
724
- style: styleCommon,
725
- placeholder: '请选择',
726
- ...(ites?.inputType === 30
727
- ? {
728
- mode: 'multiple',
729
- maxTagCount: 1,
730
- multipleForQuery: true
731
- }
732
- : {}),
733
- getPopupContainer: () => document.body,
734
- }}
735
- ctx={ { name: ites.code }}
736
- isSearchForm={true}
737
- customSelectorConfig={others?.customSelectorConfig || {}}
738
- disabled={disabled}
739
- value={showValue(ites.code)}
740
- onChange={(value) => {
741
- handleEdit(ites.code, value);
742
- }}
743
- />
744
- )) ||
745
- null}
746
- {/* 表达式 */}
747
- {ites?.inputType === 40 && (
748
- <div style={{ display: 'flex' }}>
749
- <Formula
750
- disabled={disabled}
751
- key={showValue(ites.code)}
752
- // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
753
- setValue={(val, formulaName) => {
754
- console.log(val, 'val');
755
- const value = val.map((item) => {
756
- return item.value.replace(
757
- /[a-zA-Z_]+\.\w+/g,
758
- (i) => '{' + i + '}',
759
- );
760
- });
761
- handleEdit(ites.code, value.join(''));
762
- handleEdit({
763
- inputType: 40,
764
- formulaName,
765
- });
766
- }}
767
- record={{ expression: showValue(ites.code) }}
768
- sourceData={fieldListGroup}
769
- />
770
- </div>
771
- )}
772
- </>
773
- );
774
- };
1
+ // @ts-nocheck
2
+ import { BsCascader } from '@/components/Functional/BsAntdSula';
3
+ import { BusinessSearchSelect, BusinessTreeSearchSelect } from '@/index';
4
+ import { getDictionarySource, judgeIsEmpty, uuid } from '../../../utils/utils';
5
+ import { useRequest } from 'ahooks';
6
+ import { Input, InputNumber, DatePicker, Switch, Select } from 'antd';
7
+ import React, { useEffect, useState } from 'react'
8
+ import { request } from 'bssula';
9
+ import Formula from './Formula';
10
+ import {
11
+ dateFormat,
12
+ fullDateFormat
13
+ } from './util';
14
+ import InnerSelect from './InnerSelect';
15
+ import CustomSelector from './CustomPlugin/CustomSelector';
16
+ const { RangePicker } = DatePicker;
17
+ export default function RenderCompItem(props:any){
18
+ const { regularDataList,ites, showValue, handleEdit,disabled } = props;
19
+ let fieldListGroup = regularDataList.map((item:any) => {
20
+ const Item = {
21
+ id: item.id,
22
+ code: item.code,
23
+ name: item.name,
24
+ value: item.code,
25
+ };
26
+ if (item.propertyList) {
27
+ // @ts-ignore
28
+ Item.propertyList = item.propertyList.map((field:any) => ({
29
+ id: field.id,
30
+ code: field.code,
31
+ name: field.name,
32
+ value: `${item.code}.${field.code}`,
33
+ valueText: `${item.name}.${field.name}`,
34
+ }));
35
+ }
36
+ return Item;
37
+ });
38
+ console.log(ites?.dictionaryCode&&!getDictionarySource(ites.dictionaryCode))
39
+ const [dictData, setDictData] = useState(getDictionarySource(ites.dictionaryCode) || [])
40
+ const getDictData=async()=>{
41
+ const data= await request({url:`/basic/bscDictItem/allItemList?qp-code-eq=${ites.dictionaryCode}`})
42
+ setDictData(data?.map?.(item=>({text:item.dictItemName,value:item.dictItemCode})))
43
+ }
44
+
45
+ useEffect(() => {
46
+ if (ites?.dictionaryCode && !getDictionarySource(ites.dictionaryCode)) {
47
+ getDictData()
48
+ }
49
+ }, []);
50
+ if (!ites) return;
51
+ const styleCommon = {
52
+ width: '200px',
53
+ ...(ites?.rightText ? { marginLeft: 10 } : {}),
54
+ };
55
+ const style2 = {
56
+ width: '100px',
57
+ };
58
+ return (
59
+ <>
60
+ {/* 输入/字符串 */}
61
+ {(ites?.inputType === 10 && ites?.valueType === 21 && (
62
+ <Input
63
+ disabled={disabled}
64
+ allowClear={true}
65
+ onClear={() => handleEdit(ites.code, undefined)}
66
+ defaultValue={showValue(ites.code, 'input')}
67
+ style={styleCommon}
68
+ onBlur={(e) => {
69
+ handleEdit(
70
+ ites.code,
71
+ String(e.target.value).trim() == ''
72
+ ? undefined
73
+ : e.target.value,
74
+ );
75
+ }}
76
+ />
77
+ )) ||
78
+ null}
79
+ {/* 输入 / 长整数23/小数22 */}
80
+ {(ites?.inputType === 10 &&
81
+ (ites?.valueType === 23 || ites?.valueType === 22) && (
82
+ <InputNumber
83
+ disabled={disabled}
84
+ // max={Number.MAX_SAFE_INTEGER}
85
+ max={judgeIsEmpty(ites?.maxValue) ? Number.MAX_SAFE_INTEGER : ites.maxValue}
86
+ // min={ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER}
87
+ min={judgeIsEmpty(ites?.minValue) ? (ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER) : ites.minValue}
88
+ precision={ites?.valueType === 23 ? 0 : 2}
89
+ defaultValue={ites.defaultValue}
90
+ style={style2}
91
+ value={showValue(ites.code)}
92
+ onChange={(value) => {
93
+ handleEdit(ites.code, value);
94
+ }}
95
+ />
96
+ )) ||
97
+ null}
98
+ {/* 输入/日期 */}
99
+ {(ites?.inputType === 10 && (ites?.valueType === 41 || ites?.valueType === 32) && (
100
+ <DatePicker
101
+ showTime={ites?.valueType == 32}
102
+ format={ites?.valueType == 41 ? dateFormat : fullDateFormat}
103
+ disabled={disabled}
104
+ defaultValue={ites.defaultValue}
105
+ style={styleCommon}
106
+ value={showValue(ites.code,ites?.valueType == 41?'date':'dateTime')}
107
+ onChange={(value,dateString) => {
108
+ handleEdit(ites.code, dateString);
109
+ }}
110
+ />
111
+ )) ||
112
+ null}
113
+ {/* 输入/时间 */}
114
+ {(ites?.inputType === 10 && ites?.valueType === 40 && (
115
+ <RangePicker
116
+ showTime
117
+ disabled={disabled}
118
+ defaultValue={ites.defaultValue}
119
+ style={styleCommon}
120
+ value={showValue(ites.code,'rangeTime')}
121
+ onChange={(value,timeString) => {
122
+ handleEdit(ites.code, timeString);
123
+ }}
124
+ />
125
+ )) ||
126
+ null}
127
+ {/* 输入/布尔值 */}
128
+ {(ites?.inputType === 10 && ites?.valueType === 24 && (
129
+ <Switch
130
+ disabled={disabled}
131
+ defaultChecked={!!ites.defaultValue}
132
+ style={style2}
133
+ checked={showValue(ites.code)}
134
+ onChange={(value) => {
135
+ handleEdit(ites.code, value);
136
+ }}
137
+ />
138
+ )) ||
139
+ null}
140
+ {/* 单选/多选 自定义 */}
141
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
142
+ ites?.choiceType === 10 && (
143
+ <Select
144
+ disabled={disabled}
145
+ allowClear
146
+ showArrow
147
+ {...(ites?.inputType === 30
148
+ ? {
149
+ mode: 'multiple',
150
+ }
151
+ : {})}
152
+ defaultValue={ites.defaultValue}
153
+ style={styleCommon}
154
+ value={showValue(ites.code) as string}
155
+ onChange={(value) => {
156
+ handleEdit(ites.code, value);
157
+ }}
158
+ >
159
+ {Object.keys(ites.enumeration).map((it) => (
160
+ <Select.Option key={it} value={it}>
161
+ {ites.enumeration[it]}
162
+ </Select.Option>
163
+ ))}
164
+ </Select>
165
+ )) ||
166
+ null}
167
+ {/* 单选/多选 数据字典 */}
168
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
169
+ ites?.choiceType === 20 && (
170
+ <InnerSelect
171
+ disabled={disabled}
172
+ inputType={ites?.inputType}
173
+ defaultValue={ites.defaultValue}
174
+ styleCommon={styleCommon}
175
+ value={showValue(ites.code)}
176
+ onChange={(value) => {
177
+ handleEdit(ites.code, value);
178
+ }}
179
+ dictionaryCode={ites.dictionaryCode}
180
+ />
181
+ )) ||
182
+ null}
183
+ {/* 单选/多选 仓库选择器(物理仓) */}
184
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
185
+ ites?.choiceType === 110 && (
186
+ <BusinessSearchSelect
187
+ selectBusinessType="physicalWarehouse"
188
+ selectProps={{
189
+ style: styleCommon,
190
+ placeholder: '请选择物理仓',
191
+ ...(ites?.inputType === 30
192
+ ? {
193
+ mode: 'multiple',
194
+ maxTagCount: 1,
195
+ }
196
+ : {}),
197
+ }}
198
+ disabled={disabled}
199
+ labelInValue={true}
200
+ value={showValue(ites.code)}
201
+ requestConfig={{
202
+ mappingValueField: 'physicalWarehouseCode',
203
+ filterInit: 'qp-physicalWarehouseCode-in',
204
+ }}
205
+ onChange={(value: any) => {
206
+ handleEdit(ites.code, value);
207
+ }}
208
+ getPopupContainer={() => document.body}
209
+ />
210
+ )) ||
211
+ null}
212
+ {/* 单选/多选 仓库选择器(逻辑仓) */}
213
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
214
+ ites?.choiceType === 120 && (
215
+ <BusinessSearchSelect
216
+ selectBusinessType="realWarehouse"
217
+ selectProps={{
218
+ style: styleCommon,
219
+ placeholder: '请选择逻辑仓',
220
+ ...(ites?.inputType === 30
221
+ ? {
222
+ mode: 'multiple',
223
+ maxTagCount: 1,
224
+ }
225
+ : {}),
226
+ }}
227
+ disabled={disabled}
228
+ labelInValue={true}
229
+ value={showValue(ites.code)}
230
+ requestConfig={{
231
+ mappingValueField: 'realWarehouseCode',
232
+ filterInit: 'qp-realWarehouseCode-in',
233
+ }}
234
+ onChange={(value) => {
235
+ handleEdit(ites.code, value);
236
+ }}
237
+ getPopupContainer={() => document.body}
238
+ />
239
+ )) ||
240
+ null}
241
+ {/* 单选/多选 仓库选择器(虚拟仓) */}
242
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
243
+ ites?.choiceType === 130 && (
244
+ <BusinessSearchSelect
245
+ selectBusinessType="virtualWarehouse"
246
+ selectProps={{
247
+ style: styleCommon,
248
+ placeholder: '请选择虚拟仓',
249
+ ...(ites?.inputType === 30
250
+ ? {
251
+ mode: 'multiple',
252
+ maxTagCount: 1,
253
+ }
254
+ : {}),
255
+ }}
256
+ disabled={disabled}
257
+ labelInValue={true}
258
+ value={showValue(ites.code)}
259
+ requestConfig={{
260
+ mappingValueField: 'virtualWarehouseCode',
261
+ filterInit: 'qp-virtualWarehouseCode-in',
262
+ }}
263
+ onChange={(value) => {
264
+ handleEdit(ites.code, value);
265
+ }}
266
+ getPopupContainer={() => document.body}
267
+ />
268
+ )) ||
269
+ null}
270
+ {/* 单选/多选 仓库选择器(渠道仓) */}
271
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
272
+ ites?.choiceType === 140 && (
273
+ <BusinessSearchSelect
274
+ selectBusinessType="channelWarehouse"
275
+ selectProps={{
276
+ style: styleCommon,
277
+ placeholder: '请选择渠道仓',
278
+ ...(ites?.inputType === 30
279
+ ? {
280
+ mode: 'multiple',
281
+ maxTagCount: 1,
282
+ }
283
+ : {}),
284
+ }}
285
+ disabled={disabled}
286
+ labelInValue={true}
287
+ value={showValue(ites.code)}
288
+ requestConfig={{
289
+ mappingValueField: 'channelWarehouseCode',
290
+ filterInit: 'qp-channelWarehouseCode-in',
291
+ }}
292
+ onChange={(value: any) => {
293
+ handleEdit(ites.code, value);
294
+ }}
295
+ getPopupContainer={() => document.body}
296
+ />
297
+ )) ||
298
+ null}
299
+ {/* 单选/多选 商品SPU选择器 */}
300
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
301
+ ites?.choiceType === 150 && (
302
+ <BusinessSearchSelect
303
+ selectBusinessType="spuCommodity"
304
+ selectProps={{
305
+ style: styleCommon,
306
+ placeholder: '请选择SPU',
307
+ ...(ites?.inputType === 30
308
+ ? {
309
+ mode: 'multiple',
310
+ maxTagCount: 1,
311
+ }
312
+ : {}),
313
+ }}
314
+ disabled={disabled}
315
+ labelInValue={true}
316
+ value={showValue(ites.code)}
317
+ requestConfig={{
318
+ filterInit: 'qp-itemCode-in',
319
+ }}
320
+ onChange={(value) => {
321
+ handleEdit(ites.code, value);
322
+ }}
323
+ getPopupContainer={() => document.body}
324
+ />
325
+ )) ||
326
+ null}
327
+ {/* 单选/多选 商品SKU选择器 */}
328
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
329
+ ites?.choiceType === 160 && (
330
+ <BusinessSearchSelect
331
+ selectBusinessType="skuCommodity"
332
+ selectProps={{
333
+ style: styleCommon,
334
+ placeholder: '请选择商品',
335
+ ...(ites?.inputType === 30
336
+ ? {
337
+ mode: 'multiple',
338
+ maxTagCount: 1,
339
+ }
340
+ : {}),
341
+ }}
342
+ disabled={disabled}
343
+ labelInValue={true}
344
+ value={showValue(ites.code)}
345
+ requestConfig={{
346
+ filterInit: 'qp-skuCode-in',
347
+ }}
348
+ onChange={(value: any) => {
349
+ handleEdit(ites.code, value);
350
+ }}
351
+ getPopupContainer={() => document.body}
352
+ />
353
+ )) ||
354
+ null}
355
+ {/* 单选/多选 省市区 */}
356
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
357
+ ites?.choiceType === 190 && (
358
+ <BsCascader
359
+ disabled={disabled}
360
+ isAll={true}
361
+ needNameAndCode={true}
362
+ notChangeOnSelect={true}
363
+ initRequestSource={async () => {
364
+ return await request({
365
+ url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
366
+ method: 'get',
367
+ converter: ({ data }: any) => {
368
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
369
+ const handleData =
370
+ data && data[0]
371
+ ? data?.map((item: any) => {
372
+ return {
373
+ text: item.name,
374
+ value: item.id,
375
+ level: item.level,
376
+ id: item.id,
377
+ };
378
+ })
379
+ : [];
380
+ return handleData;
381
+ },
382
+ });
383
+ }}
384
+ value={showValue(ites.code)}
385
+ onChange={(value) => {
386
+ handleEdit(ites.code, value);
387
+ }}
388
+ getPopupContainer={() => document.body}
389
+ />
390
+ )) ||
391
+ null}
392
+ {/* 单选/多选 行政组织选择器 */}
393
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
394
+ ites?.choiceType === 210 && (
395
+ <BusinessTreeSearchSelect
396
+ disabled={disabled}
397
+ treeCheckable={ites?.inputType === 30}
398
+ businessType="department"
399
+ labelInValue={true}
400
+ value={showValue(ites.code)}
401
+ style={styleCommon}
402
+ onChange={(value) => {
403
+ handleEdit(ites.code, value);
404
+ }}
405
+ getPopupContainer={() => document.body}
406
+ />
407
+ )) ||
408
+ null}
409
+ {/* 单选/多选 采购组织选择器 */}
410
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
411
+ ites?.choiceType === 220 && (
412
+ <BusinessTreeSearchSelect
413
+ disabled={disabled}
414
+ treeCheckable={ites?.inputType === 30}
415
+ businessType="purchase-organization"
416
+ labelInValue={true}
417
+ value={showValue(ites.code)}
418
+ style={styleCommon}
419
+ onChange={(value) => {
420
+ handleEdit(ites.code, value);
421
+ }}
422
+ getPopupContainer={() => document.body}
423
+ />
424
+ )) ||
425
+ null}
426
+ {/* 单选/多选 销售组织选择器 */}
427
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
428
+ ites?.choiceType === 230 && (
429
+ <BusinessTreeSearchSelect
430
+ disabled={disabled}
431
+ treeCheckable={ites?.inputType === 30}
432
+ businessType="sales-organization"
433
+ labelInValue={true}
434
+ value={showValue(ites.code)}
435
+ style={styleCommon}
436
+ onChange={(value) => {
437
+ handleEdit(ites.code, value);
438
+ }}
439
+ getPopupContainer={() => document.body}
440
+ />
441
+ )) ||
442
+ null}
443
+ {/* 单选/多选 供应商选择器 */}
444
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
445
+ ites?.choiceType === 240 && (
446
+ <BusinessSearchSelect
447
+ selectBusinessType="supplier2"
448
+ selectProps={{
449
+ style: styleCommon,
450
+ placeholder: '请选择供应商',
451
+ ...(ites?.inputType === 30
452
+ ? {
453
+ mode: 'multiple',
454
+ maxTagCount: 1,
455
+ }
456
+ : {}),
457
+ }}
458
+ disabled={disabled}
459
+ labelInValue={true}
460
+ value={showValue(ites.code)}
461
+ requestConfig={{
462
+ filterInit: 'qp-code-in',
463
+ }}
464
+ onChange={(value) => {
465
+ handleEdit(ites.code, value);
466
+ }}
467
+ getPopupContainer={() => document.body}
468
+ />
469
+ )) ||
470
+ null}
471
+ {/* 单选/多选 客户选择器 */}
472
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
473
+ ites?.choiceType === 250 && (
474
+ <BusinessSearchSelect
475
+ selectBusinessType="customer2"
476
+ selectProps={{
477
+ style: styleCommon,
478
+ placeholder: '请选择客户',
479
+ ...(ites?.inputType === 30
480
+ ? {
481
+ mode: 'multiple',
482
+ maxTagCount: 1,
483
+ }
484
+ : {}),
485
+ }}
486
+ disabled={disabled}
487
+ labelInValue={true}
488
+ value={showValue(ites.code)}
489
+ requestConfig={{
490
+ filterInit: 'qp-code-in',
491
+ }}
492
+ onChange={(value) => {
493
+ handleEdit(ites.code, value);
494
+ }}
495
+ getPopupContainer={() => document.body}
496
+ />
497
+ )) ||
498
+ null}
499
+ {/* 单选/多选 店铺选择器 */}
500
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
501
+ ites?.choiceType === 260 && (
502
+ <BusinessSearchSelect
503
+ selectBusinessType="shopFile2"
504
+ selectProps={{
505
+ style: styleCommon,
506
+ placeholder: '请选择店铺',
507
+ ...(ites?.inputType === 30
508
+ ? {
509
+ mode: 'multiple',
510
+ maxTagCount: 1,
511
+ }
512
+ : {}),
513
+ }}
514
+ disabled={disabled}
515
+ labelInValue={true}
516
+ value={showValue(ites.code)}
517
+ requestConfig={{
518
+ filterInit: 'qp-code-in',
519
+ }}
520
+ onChange={(value) => {
521
+ handleEdit(ites.code, value);
522
+ }}
523
+ getPopupContainer={() => document.body}
524
+ />
525
+ )) ||
526
+ null}
527
+ {/* 单选/多选 员工选择器 */}
528
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
529
+ ites?.choiceType === 270 && (
530
+ <BusinessSearchSelect
531
+ selectBusinessType="employee2"
532
+ selectProps={{
533
+ style: styleCommon,
534
+ placeholder: '请选择员工',
535
+ ...(ites?.inputType === 30
536
+ ? {
537
+ mode: 'multiple',
538
+ maxTagCount: 1,
539
+ }
540
+ : {}),
541
+ }}
542
+ disabled={disabled}
543
+ labelInValue={true}
544
+ value={showValue(ites.code)}
545
+ requestConfig={{
546
+ filterInit: 'qp-id-in',
547
+ }}
548
+ onChange={(value) => {
549
+ handleEdit(ites.code, value);
550
+ }}
551
+ getPopupContainer={() => document.body}
552
+ />
553
+ )) ||
554
+ null}
555
+ {/* 单选/多选 库存组织选择器 */}
556
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
557
+ ites?.choiceType === 280 && (
558
+ <BusinessTreeSearchSelect
559
+ disabled={disabled}
560
+ treeCheckable={ites?.inputType === 30}
561
+ businessType="stock-organization"
562
+ labelInValue={true}
563
+ value={showValue(ites.code)}
564
+ style={styleCommon}
565
+ onChange={(value) => {
566
+ handleEdit(ites.code, value);
567
+ }}
568
+ getPopupContainer={() => document.body}
569
+ />
570
+ )) ||
571
+ null}
572
+ {/* 单选/多选 结算组织选择器 */}
573
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
574
+ ites?.choiceType === 290 && (
575
+ <BusinessTreeSearchSelect
576
+ disabled={disabled}
577
+ treeCheckable={ites?.inputType === 30}
578
+ businessType="settle-organization"
579
+ labelInValue={true}
580
+ value={showValue(ites.code)}
581
+ style={styleCommon}
582
+ onChange={(value) => {
583
+ handleEdit(ites.code, value);
584
+ }}
585
+ getPopupContainer={() => document.body}
586
+ />
587
+ )) ||
588
+ null}
589
+ {/* 单选/多选 配送方式选择器 */}
590
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
591
+ ites?.choiceType === 310 && (
592
+ <BusinessSearchSelect
593
+ selectBusinessType="deliveryMode"
594
+ selectProps={{
595
+ style: styleCommon,
596
+ placeholder: '请选择配送方式',
597
+ ...(ites?.inputType === 30
598
+ ? {
599
+ mode: 'multiple',
600
+ maxTagCount: 1,
601
+ }
602
+ : {}),
603
+ }}
604
+ disabled={disabled}
605
+ labelInValue={true}
606
+ value={showValue(ites.code)}
607
+ requestConfig={{
608
+ filterInit: 'qp-code-in',
609
+ }}
610
+ onChange={(value) => {
611
+ handleEdit(ites.code, value);
612
+ }}
613
+ getPopupContainer={() => document.body}
614
+ />
615
+ )) ||
616
+ null}
617
+ {/* 单选/多选 角色选择器 */}
618
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
619
+ ites?.choiceType === 360 && (
620
+ <BusinessSearchSelect
621
+ selectBusinessType="role"
622
+ selectProps={{
623
+ style: styleCommon,
624
+ placeholder: '请选择角色',
625
+ ...(ites?.inputType === 30
626
+ ? {
627
+ mode: 'multiple',
628
+ maxTagCount: 1,
629
+ }
630
+ : {}),
631
+ }}
632
+ disabled={disabled}
633
+ labelInValue={true}
634
+ value={showValue(ites.code)}
635
+ requestConfig={{
636
+ filterInit: 'qp-code-in',
637
+ }}
638
+ onChange={(value) => {
639
+ handleEdit(ites.code, value);
640
+ }}
641
+ getPopupContainer={() => document.body}
642
+ />
643
+ )) ||
644
+ null}
645
+ {/* 单选/多选 品牌选择器 */}
646
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
647
+ ites?.choiceType === 410 && (
648
+ <BusinessSearchSelect
649
+ selectBusinessType="brand"
650
+ selectProps={{
651
+ style: styleCommon,
652
+ placeholder: '请选择品牌',
653
+ ...(ites?.inputType === 30
654
+ ? {
655
+ mode: 'multiple',
656
+ maxTagCount: 1,
657
+ }
658
+ : {}),
659
+ }}
660
+ disabled={disabled}
661
+ labelInValue={true}
662
+ value={showValue(ites.code)}
663
+ requestConfig={{
664
+ filterInit: 'qp-brandCode-in',
665
+ }}
666
+ onChange={(value) => {
667
+ handleEdit(ites.code, value);
668
+ }}
669
+ getPopupContainer={() => document.body}
670
+ />
671
+ )) ||
672
+ null}
673
+ {/* 单选/多选 类目选择器 */}
674
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
675
+ ites?.choiceType === 420 && (
676
+ <BusinessTreeSearchSelect
677
+ disabled={disabled}
678
+ treeCheckable={ites?.inputType === 30}
679
+ businessType="background-category"
680
+ labelInValue={true}
681
+ value={showValue(ites.code)}
682
+ style={styleCommon}
683
+ onChange={(value) => {
684
+ handleEdit(ites.code, value);
685
+ }}
686
+ getPopupContainer={() => document.body}
687
+ />
688
+ )) ||
689
+ null}
690
+ {/* 单选/多选 订单标签选择器 */}
691
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
692
+ ites?.choiceType === 450 && (
693
+ <BusinessSearchSelect
694
+ selectBusinessType="orderTag"
695
+ prefixUrl={{ selectPrefix: '/oms-ops' }}
696
+ selectProps={{
697
+ style: styleCommon,
698
+ placeholder: '请选择订单标签',
699
+ ...(ites?.inputType === 30
700
+ ? {
701
+ mode: 'multiple',
702
+ maxTagCount: 1,
703
+ }
704
+ : {}),
705
+ }}
706
+ disabled={disabled}
707
+ labelInValue={true}
708
+ value={showValue(ites.code)}
709
+ requestConfig={{
710
+ filterInit: 'qp-code-in',
711
+ }}
712
+ onChange={(value) => {
713
+ handleEdit(ites.code, value);
714
+ }}
715
+ getPopupContainer={() => document.body}
716
+ />
717
+ )) ||
718
+ null}
719
+ {/* 单选/多选 自定义选择器 */}
720
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
721
+ ites?.choiceType === 40 && (
722
+ <CustomSelector
723
+ selectProps={{
724
+ style: styleCommon,
725
+ placeholder: '请选择',
726
+ ...(ites?.inputType === 30
727
+ ? {
728
+ mode: 'multiple',
729
+ maxTagCount: 1,
730
+ multipleForQuery: true
731
+ }
732
+ : {}),
733
+ getPopupContainer: () => document.body,
734
+ }}
735
+ ctx={ { name: ites.code }}
736
+ isSearchForm={true}
737
+ customSelectorConfig={others?.customSelectorConfig || {}}
738
+ disabled={disabled}
739
+ value={showValue(ites.code)}
740
+ onChange={(value) => {
741
+ handleEdit(ites.code, value);
742
+ }}
743
+ />
744
+ )) ||
745
+ null}
746
+ {/* 表达式 */}
747
+ {ites?.inputType === 40 && (
748
+ <div style={{ display: 'flex' }}>
749
+ <Formula
750
+ disabled={disabled}
751
+ key={showValue(ites.code)}
752
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
753
+ setValue={(val, formulaName) => {
754
+ console.log(val, 'val');
755
+ const value = val.map((item) => {
756
+ return item.value.replace(
757
+ /[a-zA-Z_]+\.\w+/g,
758
+ (i) => '{' + i + '}',
759
+ );
760
+ });
761
+ handleEdit(ites.code, value.join(''));
762
+ handleEdit({
763
+ inputType: 40,
764
+ formulaName,
765
+ });
766
+ }}
767
+ record={{ expression: showValue(ites.code) }}
768
+ sourceData={fieldListGroup}
769
+ />
770
+ </div>
771
+ )}
772
+ </>
773
+ );
774
+ };