@bit-sun/business-component 3.0.0-alpha.21 → 3.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) 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/index.esm.js +1271 -1236
  9. package/dist/index.js +345 -310
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +82 -82
  18. package/src/assets/arrow_top.svg +17 -17
  19. package/src/assets/caidan.svg +11 -11
  20. package/src/assets/exportFail.svg +37 -37
  21. package/src/assets/exportProcessing.svg +28 -28
  22. package/src/assets/exportSuccess.svg +34 -34
  23. package/src/assets/fixed-left-active.svg +11 -11
  24. package/src/assets/fixed-right-active.svg +11 -11
  25. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  26. package/src/components/Business/AddSelectBusiness/index.tsx +1079 -1079
  27. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  28. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -193
  29. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -10
  30. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  31. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  32. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  33. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -163
  34. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  35. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  36. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +8 -8
  37. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -172
  38. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  39. package/src/components/Business/BsLayouts/index.tsx +1494 -1494
  40. package/src/components/Business/BsLayouts/service.ts +10 -10
  41. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -566
  42. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -5
  43. package/src/components/Business/BsSulaQueryTable/index.tsx +729 -729
  44. package/src/components/Business/BsSulaQueryTable/setting.tsx +892 -892
  45. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  46. package/src/components/Business/BsSulaQueryTable/utils.tsx +713 -713
  47. package/src/components/Business/CommodityEntry/index.tsx +3 -2
  48. package/src/components/Business/CommonAlert/index.tsx +23 -23
  49. package/src/components/Business/CommonGuideWrapper/index.less +121 -121
  50. package/src/components/Business/CommonGuideWrapper/index.tsx +94 -94
  51. package/src/components/Business/DetailPageWrapper/index.less +88 -88
  52. package/src/components/Business/DetailPageWrapper/index.tsx +326 -326
  53. package/src/components/Business/DetailPageWrapper/utils.tsx +164 -164
  54. package/src/components/Business/HomePageWrapper/index.less +33 -33
  55. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  56. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  57. package/src/components/Business/JsonQueryTable/components/Formula.tsx +206 -206
  58. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  59. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  60. package/src/components/Business/JsonQueryTable/index.tsx +535 -535
  61. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  62. package/src/components/Business/SearchSelect/{BusinessUtils.ts → BusinessUtils.tsx} +2139 -2076
  63. package/src/components/Business/SearchSelect/common.ts +134 -134
  64. package/src/components/Business/SearchSelect/index.md +1503 -1444
  65. package/src/components/Business/SearchSelect/index.tsx +55 -55
  66. package/src/components/Business/SearchSelect/utils.ts +101 -101
  67. package/src/components/Business/StateFlow/index.less +130 -130
  68. package/src/components/Business/TreeSearchSelect/index.md +185 -185
  69. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  70. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  71. package/src/components/Business/columnSettingTable/columnSetting.tsx +767 -767
  72. package/src/components/Business/columnSettingTable/index.tsx +235 -235
  73. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +243 -243
  74. package/src/components/Business/columnSettingTable/utils.tsx +70 -70
  75. package/src/components/Business/moreTreeTable/index.md +448 -448
  76. package/src/components/Functional/AddSelect/helps.ts +81 -81
  77. package/src/components/Functional/AddSelect/index.md +155 -155
  78. package/src/components/Functional/AddSelect/index.tsx +1217 -1217
  79. package/src/components/Functional/BillEntry/index.md +39 -39
  80. package/src/components/Functional/BillEntry/index.tsx +773 -773
  81. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  82. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  83. package/src/components/Functional/DataImport/index.md +44 -44
  84. package/src/components/Functional/DataImport/index.tsx +696 -696
  85. package/src/components/Functional/DataValidation/index.md +39 -39
  86. package/src/components/Functional/DataValidation/index.tsx +688 -688
  87. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  88. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  89. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -65
  90. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  91. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -129
  92. package/src/components/Functional/SearchSelect/index.less +121 -121
  93. package/src/components/Functional/SearchSelect/index.md +141 -141
  94. package/src/components/Functional/SearchSelect/index.tsx +1003 -1003
  95. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  96. package/src/components/Functional/TreeSearchSelect/index.tsx +206 -206
  97. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  98. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +637 -637
  99. package/src/components/Solution/RuleComponent/index.js +1428 -1428
  100. package/src/components/Solution/RuleComponent/ruleFiled.js +2281 -2281
  101. package/src/components/Solution/RuleComponent/services.ts +13 -13
  102. package/src/components/Solution/RuleComponent/util.js +143 -143
  103. package/src/index.ts +38 -38
  104. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  105. package/src/styles/bsDefault.less +1912 -1912
  106. package/src/utils/CustomLoginInfo.ts +55 -55
  107. package/src/utils/LocalstorageUtils.ts +95 -95
  108. package/src/utils/TableUtils.less +51 -51
  109. package/src/utils/TableUtils.tsx +691 -691
  110. package/src/utils/businessUtils.ts +441 -441
  111. package/src/utils/constant.ts +38 -38
  112. package/src/utils/index.ts +6 -6
  113. package/src/utils/request.ts +53 -53
  114. package/src/utils/requestUtils.ts +193 -193
  115. package/src/utils/utils.ts +238 -238
  116. package/tsconfig.json +29 -29
  117. package/typings.d.ts +4 -4
@@ -1,637 +1,637 @@
1
- // @ts-nocheck
2
- import { BsCascader } from '@/components/Functional/BsAntdSula';
3
- import { BusinessSearchSelect, BusinessTreeSearchSelect } from '@/index';
4
- import { getDictionarySource, 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
- const { RangePicker } = DatePicker;
11
- export default function RenderCompItem(props:any){
12
- const { regularDataList,ites, showValue, handleEdit,disabled } = props;
13
- let fieldListGroup = regularDataList.map((item:any) => {
14
- const Item = {
15
- id: item.id,
16
- code: item.code,
17
- name: item.name,
18
- value: item.code,
19
- };
20
- if (item.propertyList) {
21
- // @ts-ignore
22
- Item.propertyList = item.propertyList.map((field:any) => ({
23
- id: field.id,
24
- code: field.code,
25
- name: field.name,
26
- value: `${item.code}.${field.code}`,
27
- valueText: `${item.name}.${field.name}`,
28
- }));
29
- }
30
- return Item;
31
- });
32
- console.log(ites?.dictionaryCode&&!getDictionarySource(ites.dictionaryCode))
33
- const [dictData, setDictData] = useState(getDictionarySource(ites.dictionaryCode) || [])
34
- const getDictData=async()=>{
35
- const data= await request({url:`/basic/bscDictItem/allItemList?qp-code-eq=${ites.dictionaryCode}`})
36
- setDictData(data?.map?.(item=>({text:item.dictItemName,value:item.dictItemCode})))
37
- }
38
-
39
- useEffect(() => {
40
- if (ites?.dictionaryCode && !getDictionarySource(ites.dictionaryCode)) {
41
- getDictData()
42
- }
43
- }, []);
44
- if (!ites) return;
45
- const styleCommon = {
46
- width: '200px',
47
- ...(ites?.rightText ? { marginLeft: 10 } : {}),
48
- };
49
- const style2 = {
50
- width: '100px',
51
- };
52
- return (
53
- <>
54
- {/* 输入/字符串 */}
55
- {(ites?.inputType === 10 && ites?.valueType === 21 && (
56
- <Input
57
- disabled={disabled}
58
- allowClear={true}
59
- onClear={() => handleEdit(ites.code, undefined)}
60
- defaultValue={showValue(ites.code, 'input')}
61
- style={styleCommon}
62
- onBlur={(e) => {
63
- handleEdit(
64
- ites.code,
65
- String(e.target.value).trim() == ''
66
- ? undefined
67
- : e.target.value,
68
- );
69
- }}
70
- />
71
- )) ||
72
- null}
73
- {/* 输入 / 长整数23/小数22 */}
74
- {(ites?.inputType === 10 &&
75
- (ites?.valueType === 23 || ites?.valueType === 22) && (
76
- <InputNumber
77
- disabled={disabled}
78
- max={Number.MAX_SAFE_INTEGER}
79
- min={ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER}
80
- precision={ites?.valueType === 23 ? 0 : 2}
81
- defaultValue={ites.defaultValue}
82
- style={style2}
83
- value={showValue(ites.code)}
84
- onChange={(value) => {
85
- handleEdit(ites.code, value);
86
- }}
87
- />
88
- )) ||
89
- null}
90
- {/* 输入/日期 */}
91
- {(ites?.inputType === 10 && ites?.valueType === 41 && (
92
- <DatePicker
93
- disabled={disabled}
94
- defaultValue={ites.defaultValue}
95
- style={style2}
96
- value={showValue(ites.code)}
97
- onChange={(value) => {
98
- handleEdit(ites.code, value);
99
- }}
100
- />
101
- )) ||
102
- null}
103
- {/* 输入/时间 */}
104
- {(ites?.inputType === 10 && ites?.valueType === 40 && (
105
- <RangePicker
106
- showTime
107
- disabled={disabled}
108
- defaultValue={ites.defaultValue}
109
- style={style2}
110
- value={showValue(ites.code)}
111
- onChange={(value) => {
112
- handleEdit(ites.code, value);
113
- }}
114
- />
115
- )) ||
116
- null}
117
- {/* 输入/布尔值 */}
118
- {(ites?.inputType === 10 && ites?.valueType === 24 && (
119
- <Switch
120
- disabled={disabled}
121
- defaultChecked={!!ites.defaultValue}
122
- style={style2}
123
- checked={showValue(ites.code)}
124
- onChange={(value) => {
125
- handleEdit(ites.code, value);
126
- }}
127
- />
128
- )) ||
129
- null}
130
- {/* 单选/多选 自定义 */}
131
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
132
- ites?.choiceType === 10 && (
133
- <Select
134
- disabled={disabled}
135
- allowClear
136
- showArrow
137
- {...(ites?.inputType === 30
138
- ? {
139
- mode: 'multiple',
140
- }
141
- : {})}
142
- defaultValue={ites.defaultValue}
143
- style={styleCommon}
144
- value={showValue(ites.code) as string}
145
- onChange={(value) => {
146
- handleEdit(ites.code, value);
147
- }}
148
- >
149
- {Object.keys(ites.enumeration).map((it) => (
150
- <Select.Option key={it} value={it}>
151
- {ites.enumeration[it]}
152
- </Select.Option>
153
- ))}
154
- </Select>
155
- )) ||
156
- null}
157
- {/* 单选/多选 数据字典 */}
158
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
159
- ites?.choiceType === 20 && (
160
- <Select
161
- disabled={disabled}
162
- {...(ites?.inputType === 30
163
- ? {
164
- mode: 'multiple',
165
- }
166
- : {})}
167
- defaultValue={ites.defaultValue}
168
- style={styleCommon}
169
- value={showValue(ites.code)?.split(',')}
170
- onChange={(value) => {
171
- handleEdit(ites.code, value);
172
- }}
173
- showSearch
174
- optionFilterProp="children"
175
- filterOption={(
176
- input: string,
177
- option: { props: { children: string } },
178
- ) =>
179
- option.props.children
180
- .toLowerCase()
181
- .indexOf(input.toLowerCase()) >= 0
182
- }
183
- >
184
- {(dictData as any[])?.map((it) => (
185
- <Select.Option key={it.value} value={it.value}>
186
- {it.text}
187
- </Select.Option>
188
- ))}
189
- </Select>
190
- )) ||
191
- null}
192
- {/* 单选/多选 仓库选择器(物理仓) */}
193
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
194
- ites?.choiceType === 110 && (
195
- <BusinessSearchSelect
196
- selectBusinessType="physicalWarehouse"
197
- selectProps={{
198
- style: styleCommon,
199
- placeholder: '请选择物理仓',
200
- ...(ites?.inputType === 30
201
- ? {
202
- mode: 'multiple',
203
- maxTagCount: 1,
204
- }
205
- : {}),
206
- }}
207
- disabled={disabled}
208
- labelInValue={true}
209
- value={showValue(ites.code)}
210
- requestConfig={{
211
- mappingValueField: 'physicalWarehouseCode',
212
- filterInit: 'qp-physicalWarehouseCode-in',
213
- }}
214
- onChange={(value: any) => {
215
- handleEdit(ites.code, value);
216
- }}
217
- getPopupContainer={() => document.body}
218
- />
219
- )) ||
220
- null}
221
- {/* 单选/多选 仓库选择器(逻辑仓) */}
222
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
223
- ites?.choiceType === 120 && (
224
- <BusinessSearchSelect
225
- selectBusinessType="realWarehouse"
226
- selectProps={{
227
- style: styleCommon,
228
- placeholder: '请选择逻辑仓',
229
- ...(ites?.inputType === 30
230
- ? {
231
- mode: 'multiple',
232
- maxTagCount: 1,
233
- }
234
- : {}),
235
- }}
236
- disabled={disabled}
237
- labelInValue={true}
238
- value={showValue(ites.code)}
239
- requestConfig={{
240
- mappingValueField: 'realWarehouseCode',
241
- filterInit: 'qp-realWarehouseCode-in',
242
- }}
243
- onChange={(value) => {
244
- handleEdit(ites.code, value);
245
- }}
246
- getPopupContainer={() => document.body}
247
- />
248
- )) ||
249
- null}
250
- {/* 单选/多选 仓库选择器(虚拟仓) */}
251
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
252
- ites?.choiceType === 130 && (
253
- <BusinessSearchSelect
254
- selectBusinessType="virtualWarehouse"
255
- selectProps={{
256
- style: styleCommon,
257
- placeholder: '请选择虚拟仓',
258
- ...(ites?.inputType === 30
259
- ? {
260
- mode: 'multiple',
261
- maxTagCount: 1,
262
- }
263
- : {}),
264
- }}
265
- disabled={disabled}
266
- labelInValue={true}
267
- value={showValue(ites.code)}
268
- requestConfig={{
269
- mappingValueField: 'virtualWarehouseCode',
270
- filterInit: 'qp-virtualWarehouseCode-in',
271
- }}
272
- onChange={(value) => {
273
- handleEdit(ites.code, value);
274
- }}
275
- getPopupContainer={() => document.body}
276
- />
277
- )) ||
278
- null}
279
- {/* 单选/多选 仓库选择器(渠道仓) */}
280
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
281
- ites?.choiceType === 140 && (
282
- <BusinessSearchSelect
283
- selectBusinessType="channelWarehouse"
284
- selectProps={{
285
- style: styleCommon,
286
- placeholder: '请选择渠道仓',
287
- ...(ites?.inputType === 30
288
- ? {
289
- mode: 'multiple',
290
- maxTagCount: 1,
291
- }
292
- : {}),
293
- }}
294
- disabled={disabled}
295
- labelInValue={true}
296
- value={showValue(ites.code)}
297
- requestConfig={{
298
- mappingValueField: 'channelWarehouseCode',
299
- filterInit: 'qp-channelWarehouseCode-in',
300
- }}
301
- onChange={(value: any) => {
302
- handleEdit(ites.code, value);
303
- }}
304
- getPopupContainer={() => document.body}
305
- />
306
- )) ||
307
- null}
308
- {/* 单选/多选 商品SPU选择器 */}
309
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
310
- ites?.choiceType === 150 && (
311
- <BusinessSearchSelect
312
- selectBusinessType="spuCommodity"
313
- selectProps={{
314
- style: styleCommon,
315
- placeholder: '请选择SPU',
316
- ...(ites?.inputType === 30
317
- ? {
318
- mode: 'multiple',
319
- maxTagCount: 1,
320
- }
321
- : {}),
322
- }}
323
- disabled={disabled}
324
- labelInValue={true}
325
- value={showValue(ites.code)}
326
- requestConfig={{
327
- filterInit: 'qp-itemCode-in',
328
- }}
329
- onChange={(value) => {
330
- handleEdit(ites.code, value);
331
- }}
332
- getPopupContainer={() => document.body}
333
- />
334
- )) ||
335
- null}
336
- {/* 单选/多选 商品SKU选择器 */}
337
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
338
- ites?.choiceType === 160 && (
339
- <BusinessSearchSelect
340
- selectBusinessType="skuCommodity"
341
- selectProps={{
342
- style: styleCommon,
343
- placeholder: '请选择商品',
344
- ...(ites?.inputType === 30
345
- ? {
346
- mode: 'multiple',
347
- maxTagCount: 1,
348
- }
349
- : {}),
350
- }}
351
- disabled={disabled}
352
- labelInValue={true}
353
- value={showValue(ites.code)}
354
- requestConfig={{
355
- filterInit: 'qp-skuCode-in',
356
- }}
357
- onChange={(value: any) => {
358
- handleEdit(ites.code, value);
359
- }}
360
- getPopupContainer={() => document.body}
361
- />
362
- )) ||
363
- null}
364
- {/* 单选/多选 省市区 */}
365
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
366
- ites?.choiceType === 190 && (
367
- <BsCascader
368
- disabled={disabled}
369
- isAll={true}
370
- needNameAndCode={true}
371
- notChangeOnSelect={true}
372
- initRequestSource={async () => {
373
- return await request({
374
- url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
375
- method: 'get',
376
- converter: ({ data }: any) => {
377
- // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
378
- const handleData =
379
- data && data[0]
380
- ? data?.map((item: any) => {
381
- return {
382
- text: item.name,
383
- value: item.id,
384
- level: item.level,
385
- id: item.id,
386
- };
387
- })
388
- : [];
389
- return handleData;
390
- },
391
- });
392
- }}
393
- value={showValue(ites.code)}
394
- onChange={(value) => {
395
- handleEdit(ites.code, value);
396
- }}
397
- getPopupContainer={() => document.body}
398
- />
399
- )) ||
400
- null}
401
- {/* 单选/多选 行政组织选择器 */}
402
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
403
- ites?.choiceType === 210 && (
404
- <BusinessTreeSearchSelect
405
- disabled={disabled}
406
- treeCheckable={ites?.inputType === 30}
407
- businessType="department"
408
- labelInValue={true}
409
- value={showValue(ites.code)}
410
- style={styleCommon}
411
- onChange={(value) => {
412
- handleEdit(ites.code, value);
413
- }}
414
- getPopupContainer={() => document.body}
415
- />
416
- )) ||
417
- null}
418
- {/* 单选/多选 采购组织选择器 */}
419
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
420
- ites?.choiceType === 220 && (
421
- <BusinessTreeSearchSelect
422
- disabled={disabled}
423
- treeCheckable={ites?.inputType === 30}
424
- businessType="purchase-organization"
425
- labelInValue={true}
426
- value={showValue(ites.code)}
427
- style={styleCommon}
428
- onChange={(value) => {
429
- handleEdit(ites.code, value);
430
- }}
431
- getPopupContainer={() => document.body}
432
- />
433
- )) ||
434
- null}
435
- {/* 单选/多选 销售组织选择器 */}
436
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
437
- ites?.choiceType === 230 && (
438
- <BusinessTreeSearchSelect
439
- disabled={disabled}
440
- treeCheckable={ites?.inputType === 30}
441
- businessType="sales-organization"
442
- labelInValue={true}
443
- value={showValue(ites.code)}
444
- style={styleCommon}
445
- onChange={(value) => {
446
- handleEdit(ites.code, value);
447
- }}
448
- getPopupContainer={() => document.body}
449
- />
450
- )) ||
451
- null}
452
- {/* 单选/多选 供应商选择器 */}
453
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
454
- ites?.choiceType === 240 && (
455
- <BusinessSearchSelect
456
- selectBusinessType="supplier2"
457
- selectProps={{
458
- style: styleCommon,
459
- placeholder: '请选择供应商',
460
- ...(ites?.inputType === 30
461
- ? {
462
- mode: 'multiple',
463
- maxTagCount: 1,
464
- }
465
- : {}),
466
- }}
467
- disabled={disabled}
468
- labelInValue={true}
469
- value={showValue(ites.code)}
470
- requestConfig={{
471
- filterInit: 'qp-code-in',
472
- }}
473
- onChange={(value) => {
474
- handleEdit(ites.code, value);
475
- }}
476
- getPopupContainer={() => document.body}
477
- />
478
- )) ||
479
- null}
480
- {/* 单选/多选 客户选择器 */}
481
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
482
- ites?.choiceType === 250 && (
483
- <BusinessSearchSelect
484
- selectBusinessType="customer2"
485
- selectProps={{
486
- style: styleCommon,
487
- placeholder: '请选择客户',
488
- ...(ites?.inputType === 30
489
- ? {
490
- mode: 'multiple',
491
- maxTagCount: 1,
492
- }
493
- : {}),
494
- }}
495
- disabled={disabled}
496
- labelInValue={true}
497
- value={showValue(ites.code)}
498
- requestConfig={{
499
- filterInit: 'qp-code-in',
500
- }}
501
- onChange={(value) => {
502
- handleEdit(ites.code, value);
503
- }}
504
- getPopupContainer={() => document.body}
505
- />
506
- )) ||
507
- null}
508
- {/* 单选/多选 店铺选择器 */}
509
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
510
- ites?.choiceType === 260 && (
511
- <BusinessSearchSelect
512
- selectBusinessType="shopFile2"
513
- selectProps={{
514
- style: styleCommon,
515
- placeholder: '请选择店铺',
516
- ...(ites?.inputType === 30
517
- ? {
518
- mode: 'multiple',
519
- maxTagCount: 1,
520
- }
521
- : {}),
522
- }}
523
- disabled={disabled}
524
- labelInValue={true}
525
- value={showValue(ites.code)}
526
- requestConfig={{
527
- filterInit: 'qp-code-in',
528
- }}
529
- onChange={(value) => {
530
- handleEdit(ites.code, value);
531
- }}
532
- getPopupContainer={() => document.body}
533
- />
534
- )) ||
535
- null}
536
- {/* 单选/多选 员工选择器 */}
537
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
538
- ites?.choiceType === 270 && (
539
- <BusinessSearchSelect
540
- selectBusinessType="employee2"
541
- selectProps={{
542
- style: styleCommon,
543
- placeholder: '请选择员工',
544
- ...(ites?.inputType === 30
545
- ? {
546
- mode: 'multiple',
547
- maxTagCount: 1,
548
- }
549
- : {}),
550
- }}
551
- disabled={disabled}
552
- labelInValue={true}
553
- value={showValue(ites.code)}
554
- requestConfig={{
555
- filterInit: 'qp-id-in',
556
- }}
557
- onChange={(value) => {
558
- handleEdit(ites.code, value);
559
- }}
560
- getPopupContainer={() => document.body}
561
- />
562
- )) ||
563
- null}
564
- {/* 单选/多选 库存组织选择器 */}
565
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
566
- ites?.choiceType === 280 && (
567
- <BusinessTreeSearchSelect
568
- disabled={disabled}
569
- treeCheckable={ites?.inputType === 30}
570
- businessType="stock-organization"
571
- labelInValue={true}
572
- value={showValue(ites.code)}
573
- style={styleCommon}
574
- onChange={(value) => {
575
- handleEdit(ites.code, value);
576
- }}
577
- getPopupContainer={() => document.body}
578
- />
579
- )) ||
580
- null}
581
- {/* 单选/多选 配送方式选择器 */}
582
- {((ites?.inputType === 20 || ites?.inputType === 30) &&
583
- ites?.choiceType === 310 && (
584
- <BusinessSearchSelect
585
- selectBusinessType="deliveryMode"
586
- selectProps={{
587
- style: styleCommon,
588
- placeholder: '请选择配送方式',
589
- ...(ites?.inputType === 30
590
- ? {
591
- mode: 'multiple',
592
- maxTagCount: 1,
593
- }
594
- : {}),
595
- }}
596
- disabled={disabled}
597
- labelInValue={true}
598
- value={showValue(ites.code)}
599
- requestConfig={{
600
- filterInit: 'qp-code-in',
601
- }}
602
- onChange={(value) => {
603
- handleEdit(ites.code, value);
604
- }}
605
- getPopupContainer={() => document.body}
606
- />
607
- )) ||
608
- null}
609
- {/* 表达式 */}
610
- {ites?.inputType === 40 && (
611
- <div style={{ display: 'flex' }}>
612
- <Formula
613
- disabled={disabled}
614
- key={showValue(ites.code)}
615
- // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
616
- setValue={(val, formulaName) => {
617
- console.log(val, 'val');
618
- const value = val.map((item) => {
619
- return item.value.replace(
620
- /[a-zA-Z_]+\.\w+/g,
621
- (i) => '{' + i + '}',
622
- );
623
- });
624
- handleEdit(ites.code, value.join(''));
625
- handleEdit({
626
- inputType: 40,
627
- formulaName,
628
- });
629
- }}
630
- record={{ expression: showValue(ites.code) }}
631
- sourceData={fieldListGroup}
632
- />
633
- </div>
634
- )}
635
- </>
636
- );
637
- };
1
+ // @ts-nocheck
2
+ import { BsCascader } from '@/components/Functional/BsAntdSula';
3
+ import { BusinessSearchSelect, BusinessTreeSearchSelect } from '@/index';
4
+ import { getDictionarySource, 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
+ const { RangePicker } = DatePicker;
11
+ export default function RenderCompItem(props:any){
12
+ const { regularDataList,ites, showValue, handleEdit,disabled } = props;
13
+ let fieldListGroup = regularDataList.map((item:any) => {
14
+ const Item = {
15
+ id: item.id,
16
+ code: item.code,
17
+ name: item.name,
18
+ value: item.code,
19
+ };
20
+ if (item.propertyList) {
21
+ // @ts-ignore
22
+ Item.propertyList = item.propertyList.map((field:any) => ({
23
+ id: field.id,
24
+ code: field.code,
25
+ name: field.name,
26
+ value: `${item.code}.${field.code}`,
27
+ valueText: `${item.name}.${field.name}`,
28
+ }));
29
+ }
30
+ return Item;
31
+ });
32
+ console.log(ites?.dictionaryCode&&!getDictionarySource(ites.dictionaryCode))
33
+ const [dictData, setDictData] = useState(getDictionarySource(ites.dictionaryCode) || [])
34
+ const getDictData=async()=>{
35
+ const data= await request({url:`/basic/bscDictItem/allItemList?qp-code-eq=${ites.dictionaryCode}`})
36
+ setDictData(data?.map?.(item=>({text:item.dictItemName,value:item.dictItemCode})))
37
+ }
38
+
39
+ useEffect(() => {
40
+ if (ites?.dictionaryCode && !getDictionarySource(ites.dictionaryCode)) {
41
+ getDictData()
42
+ }
43
+ }, []);
44
+ if (!ites) return;
45
+ const styleCommon = {
46
+ width: '200px',
47
+ ...(ites?.rightText ? { marginLeft: 10 } : {}),
48
+ };
49
+ const style2 = {
50
+ width: '100px',
51
+ };
52
+ return (
53
+ <>
54
+ {/* 输入/字符串 */}
55
+ {(ites?.inputType === 10 && ites?.valueType === 21 && (
56
+ <Input
57
+ disabled={disabled}
58
+ allowClear={true}
59
+ onClear={() => handleEdit(ites.code, undefined)}
60
+ defaultValue={showValue(ites.code, 'input')}
61
+ style={styleCommon}
62
+ onBlur={(e) => {
63
+ handleEdit(
64
+ ites.code,
65
+ String(e.target.value).trim() == ''
66
+ ? undefined
67
+ : e.target.value,
68
+ );
69
+ }}
70
+ />
71
+ )) ||
72
+ null}
73
+ {/* 输入 / 长整数23/小数22 */}
74
+ {(ites?.inputType === 10 &&
75
+ (ites?.valueType === 23 || ites?.valueType === 22) && (
76
+ <InputNumber
77
+ disabled={disabled}
78
+ max={Number.MAX_SAFE_INTEGER}
79
+ min={ites?.valueType === 23 ? 0 : Number.MIN_SAFE_INTEGER}
80
+ precision={ites?.valueType === 23 ? 0 : 2}
81
+ defaultValue={ites.defaultValue}
82
+ style={style2}
83
+ value={showValue(ites.code)}
84
+ onChange={(value) => {
85
+ handleEdit(ites.code, value);
86
+ }}
87
+ />
88
+ )) ||
89
+ null}
90
+ {/* 输入/日期 */}
91
+ {(ites?.inputType === 10 && ites?.valueType === 41 && (
92
+ <DatePicker
93
+ disabled={disabled}
94
+ defaultValue={ites.defaultValue}
95
+ style={style2}
96
+ value={showValue(ites.code)}
97
+ onChange={(value) => {
98
+ handleEdit(ites.code, value);
99
+ }}
100
+ />
101
+ )) ||
102
+ null}
103
+ {/* 输入/时间 */}
104
+ {(ites?.inputType === 10 && ites?.valueType === 40 && (
105
+ <RangePicker
106
+ showTime
107
+ disabled={disabled}
108
+ defaultValue={ites.defaultValue}
109
+ style={style2}
110
+ value={showValue(ites.code)}
111
+ onChange={(value) => {
112
+ handleEdit(ites.code, value);
113
+ }}
114
+ />
115
+ )) ||
116
+ null}
117
+ {/* 输入/布尔值 */}
118
+ {(ites?.inputType === 10 && ites?.valueType === 24 && (
119
+ <Switch
120
+ disabled={disabled}
121
+ defaultChecked={!!ites.defaultValue}
122
+ style={style2}
123
+ checked={showValue(ites.code)}
124
+ onChange={(value) => {
125
+ handleEdit(ites.code, value);
126
+ }}
127
+ />
128
+ )) ||
129
+ null}
130
+ {/* 单选/多选 自定义 */}
131
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
132
+ ites?.choiceType === 10 && (
133
+ <Select
134
+ disabled={disabled}
135
+ allowClear
136
+ showArrow
137
+ {...(ites?.inputType === 30
138
+ ? {
139
+ mode: 'multiple',
140
+ }
141
+ : {})}
142
+ defaultValue={ites.defaultValue}
143
+ style={styleCommon}
144
+ value={showValue(ites.code) as string}
145
+ onChange={(value) => {
146
+ handleEdit(ites.code, value);
147
+ }}
148
+ >
149
+ {Object.keys(ites.enumeration).map((it) => (
150
+ <Select.Option key={it} value={it}>
151
+ {ites.enumeration[it]}
152
+ </Select.Option>
153
+ ))}
154
+ </Select>
155
+ )) ||
156
+ null}
157
+ {/* 单选/多选 数据字典 */}
158
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
159
+ ites?.choiceType === 20 && (
160
+ <Select
161
+ disabled={disabled}
162
+ {...(ites?.inputType === 30
163
+ ? {
164
+ mode: 'multiple',
165
+ }
166
+ : {})}
167
+ defaultValue={ites.defaultValue}
168
+ style={styleCommon}
169
+ value={showValue(ites.code)?.split(',')}
170
+ onChange={(value) => {
171
+ handleEdit(ites.code, value);
172
+ }}
173
+ showSearch
174
+ optionFilterProp="children"
175
+ filterOption={(
176
+ input: string,
177
+ option: { props: { children: string } },
178
+ ) =>
179
+ option.props.children
180
+ .toLowerCase()
181
+ .indexOf(input.toLowerCase()) >= 0
182
+ }
183
+ >
184
+ {(dictData as any[])?.map((it) => (
185
+ <Select.Option key={it.value} value={it.value}>
186
+ {it.text}
187
+ </Select.Option>
188
+ ))}
189
+ </Select>
190
+ )) ||
191
+ null}
192
+ {/* 单选/多选 仓库选择器(物理仓) */}
193
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
194
+ ites?.choiceType === 110 && (
195
+ <BusinessSearchSelect
196
+ selectBusinessType="physicalWarehouse"
197
+ selectProps={{
198
+ style: styleCommon,
199
+ placeholder: '请选择物理仓',
200
+ ...(ites?.inputType === 30
201
+ ? {
202
+ mode: 'multiple',
203
+ maxTagCount: 1,
204
+ }
205
+ : {}),
206
+ }}
207
+ disabled={disabled}
208
+ labelInValue={true}
209
+ value={showValue(ites.code)}
210
+ requestConfig={{
211
+ mappingValueField: 'physicalWarehouseCode',
212
+ filterInit: 'qp-physicalWarehouseCode-in',
213
+ }}
214
+ onChange={(value: any) => {
215
+ handleEdit(ites.code, value);
216
+ }}
217
+ getPopupContainer={() => document.body}
218
+ />
219
+ )) ||
220
+ null}
221
+ {/* 单选/多选 仓库选择器(逻辑仓) */}
222
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
223
+ ites?.choiceType === 120 && (
224
+ <BusinessSearchSelect
225
+ selectBusinessType="realWarehouse"
226
+ selectProps={{
227
+ style: styleCommon,
228
+ placeholder: '请选择逻辑仓',
229
+ ...(ites?.inputType === 30
230
+ ? {
231
+ mode: 'multiple',
232
+ maxTagCount: 1,
233
+ }
234
+ : {}),
235
+ }}
236
+ disabled={disabled}
237
+ labelInValue={true}
238
+ value={showValue(ites.code)}
239
+ requestConfig={{
240
+ mappingValueField: 'realWarehouseCode',
241
+ filterInit: 'qp-realWarehouseCode-in',
242
+ }}
243
+ onChange={(value) => {
244
+ handleEdit(ites.code, value);
245
+ }}
246
+ getPopupContainer={() => document.body}
247
+ />
248
+ )) ||
249
+ null}
250
+ {/* 单选/多选 仓库选择器(虚拟仓) */}
251
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
252
+ ites?.choiceType === 130 && (
253
+ <BusinessSearchSelect
254
+ selectBusinessType="virtualWarehouse"
255
+ selectProps={{
256
+ style: styleCommon,
257
+ placeholder: '请选择虚拟仓',
258
+ ...(ites?.inputType === 30
259
+ ? {
260
+ mode: 'multiple',
261
+ maxTagCount: 1,
262
+ }
263
+ : {}),
264
+ }}
265
+ disabled={disabled}
266
+ labelInValue={true}
267
+ value={showValue(ites.code)}
268
+ requestConfig={{
269
+ mappingValueField: 'virtualWarehouseCode',
270
+ filterInit: 'qp-virtualWarehouseCode-in',
271
+ }}
272
+ onChange={(value) => {
273
+ handleEdit(ites.code, value);
274
+ }}
275
+ getPopupContainer={() => document.body}
276
+ />
277
+ )) ||
278
+ null}
279
+ {/* 单选/多选 仓库选择器(渠道仓) */}
280
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
281
+ ites?.choiceType === 140 && (
282
+ <BusinessSearchSelect
283
+ selectBusinessType="channelWarehouse"
284
+ selectProps={{
285
+ style: styleCommon,
286
+ placeholder: '请选择渠道仓',
287
+ ...(ites?.inputType === 30
288
+ ? {
289
+ mode: 'multiple',
290
+ maxTagCount: 1,
291
+ }
292
+ : {}),
293
+ }}
294
+ disabled={disabled}
295
+ labelInValue={true}
296
+ value={showValue(ites.code)}
297
+ requestConfig={{
298
+ mappingValueField: 'channelWarehouseCode',
299
+ filterInit: 'qp-channelWarehouseCode-in',
300
+ }}
301
+ onChange={(value: any) => {
302
+ handleEdit(ites.code, value);
303
+ }}
304
+ getPopupContainer={() => document.body}
305
+ />
306
+ )) ||
307
+ null}
308
+ {/* 单选/多选 商品SPU选择器 */}
309
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
310
+ ites?.choiceType === 150 && (
311
+ <BusinessSearchSelect
312
+ selectBusinessType="spuCommodity"
313
+ selectProps={{
314
+ style: styleCommon,
315
+ placeholder: '请选择SPU',
316
+ ...(ites?.inputType === 30
317
+ ? {
318
+ mode: 'multiple',
319
+ maxTagCount: 1,
320
+ }
321
+ : {}),
322
+ }}
323
+ disabled={disabled}
324
+ labelInValue={true}
325
+ value={showValue(ites.code)}
326
+ requestConfig={{
327
+ filterInit: 'qp-itemCode-in',
328
+ }}
329
+ onChange={(value) => {
330
+ handleEdit(ites.code, value);
331
+ }}
332
+ getPopupContainer={() => document.body}
333
+ />
334
+ )) ||
335
+ null}
336
+ {/* 单选/多选 商品SKU选择器 */}
337
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
338
+ ites?.choiceType === 160 && (
339
+ <BusinessSearchSelect
340
+ selectBusinessType="skuCommodity"
341
+ selectProps={{
342
+ style: styleCommon,
343
+ placeholder: '请选择商品',
344
+ ...(ites?.inputType === 30
345
+ ? {
346
+ mode: 'multiple',
347
+ maxTagCount: 1,
348
+ }
349
+ : {}),
350
+ }}
351
+ disabled={disabled}
352
+ labelInValue={true}
353
+ value={showValue(ites.code)}
354
+ requestConfig={{
355
+ filterInit: 'qp-skuCode-in',
356
+ }}
357
+ onChange={(value: any) => {
358
+ handleEdit(ites.code, value);
359
+ }}
360
+ getPopupContainer={() => document.body}
361
+ />
362
+ )) ||
363
+ null}
364
+ {/* 单选/多选 省市区 */}
365
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
366
+ ites?.choiceType === 190 && (
367
+ <BsCascader
368
+ disabled={disabled}
369
+ isAll={true}
370
+ needNameAndCode={true}
371
+ notChangeOnSelect={true}
372
+ initRequestSource={async () => {
373
+ return await request({
374
+ url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
375
+ method: 'get',
376
+ converter: ({ data }: any) => {
377
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
378
+ const handleData =
379
+ data && data[0]
380
+ ? data?.map((item: any) => {
381
+ return {
382
+ text: item.name,
383
+ value: item.id,
384
+ level: item.level,
385
+ id: item.id,
386
+ };
387
+ })
388
+ : [];
389
+ return handleData;
390
+ },
391
+ });
392
+ }}
393
+ value={showValue(ites.code)}
394
+ onChange={(value) => {
395
+ handleEdit(ites.code, value);
396
+ }}
397
+ getPopupContainer={() => document.body}
398
+ />
399
+ )) ||
400
+ null}
401
+ {/* 单选/多选 行政组织选择器 */}
402
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
403
+ ites?.choiceType === 210 && (
404
+ <BusinessTreeSearchSelect
405
+ disabled={disabled}
406
+ treeCheckable={ites?.inputType === 30}
407
+ businessType="department"
408
+ labelInValue={true}
409
+ value={showValue(ites.code)}
410
+ style={styleCommon}
411
+ onChange={(value) => {
412
+ handleEdit(ites.code, value);
413
+ }}
414
+ getPopupContainer={() => document.body}
415
+ />
416
+ )) ||
417
+ null}
418
+ {/* 单选/多选 采购组织选择器 */}
419
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
420
+ ites?.choiceType === 220 && (
421
+ <BusinessTreeSearchSelect
422
+ disabled={disabled}
423
+ treeCheckable={ites?.inputType === 30}
424
+ businessType="purchase-organization"
425
+ labelInValue={true}
426
+ value={showValue(ites.code)}
427
+ style={styleCommon}
428
+ onChange={(value) => {
429
+ handleEdit(ites.code, value);
430
+ }}
431
+ getPopupContainer={() => document.body}
432
+ />
433
+ )) ||
434
+ null}
435
+ {/* 单选/多选 销售组织选择器 */}
436
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
437
+ ites?.choiceType === 230 && (
438
+ <BusinessTreeSearchSelect
439
+ disabled={disabled}
440
+ treeCheckable={ites?.inputType === 30}
441
+ businessType="sales-organization"
442
+ labelInValue={true}
443
+ value={showValue(ites.code)}
444
+ style={styleCommon}
445
+ onChange={(value) => {
446
+ handleEdit(ites.code, value);
447
+ }}
448
+ getPopupContainer={() => document.body}
449
+ />
450
+ )) ||
451
+ null}
452
+ {/* 单选/多选 供应商选择器 */}
453
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
454
+ ites?.choiceType === 240 && (
455
+ <BusinessSearchSelect
456
+ selectBusinessType="supplier2"
457
+ selectProps={{
458
+ style: styleCommon,
459
+ placeholder: '请选择供应商',
460
+ ...(ites?.inputType === 30
461
+ ? {
462
+ mode: 'multiple',
463
+ maxTagCount: 1,
464
+ }
465
+ : {}),
466
+ }}
467
+ disabled={disabled}
468
+ labelInValue={true}
469
+ value={showValue(ites.code)}
470
+ requestConfig={{
471
+ filterInit: 'qp-code-in',
472
+ }}
473
+ onChange={(value) => {
474
+ handleEdit(ites.code, value);
475
+ }}
476
+ getPopupContainer={() => document.body}
477
+ />
478
+ )) ||
479
+ null}
480
+ {/* 单选/多选 客户选择器 */}
481
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
482
+ ites?.choiceType === 250 && (
483
+ <BusinessSearchSelect
484
+ selectBusinessType="customer2"
485
+ selectProps={{
486
+ style: styleCommon,
487
+ placeholder: '请选择客户',
488
+ ...(ites?.inputType === 30
489
+ ? {
490
+ mode: 'multiple',
491
+ maxTagCount: 1,
492
+ }
493
+ : {}),
494
+ }}
495
+ disabled={disabled}
496
+ labelInValue={true}
497
+ value={showValue(ites.code)}
498
+ requestConfig={{
499
+ filterInit: 'qp-code-in',
500
+ }}
501
+ onChange={(value) => {
502
+ handleEdit(ites.code, value);
503
+ }}
504
+ getPopupContainer={() => document.body}
505
+ />
506
+ )) ||
507
+ null}
508
+ {/* 单选/多选 店铺选择器 */}
509
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
510
+ ites?.choiceType === 260 && (
511
+ <BusinessSearchSelect
512
+ selectBusinessType="shopFile2"
513
+ selectProps={{
514
+ style: styleCommon,
515
+ placeholder: '请选择店铺',
516
+ ...(ites?.inputType === 30
517
+ ? {
518
+ mode: 'multiple',
519
+ maxTagCount: 1,
520
+ }
521
+ : {}),
522
+ }}
523
+ disabled={disabled}
524
+ labelInValue={true}
525
+ value={showValue(ites.code)}
526
+ requestConfig={{
527
+ filterInit: 'qp-code-in',
528
+ }}
529
+ onChange={(value) => {
530
+ handleEdit(ites.code, value);
531
+ }}
532
+ getPopupContainer={() => document.body}
533
+ />
534
+ )) ||
535
+ null}
536
+ {/* 单选/多选 员工选择器 */}
537
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
538
+ ites?.choiceType === 270 && (
539
+ <BusinessSearchSelect
540
+ selectBusinessType="employee2"
541
+ selectProps={{
542
+ style: styleCommon,
543
+ placeholder: '请选择员工',
544
+ ...(ites?.inputType === 30
545
+ ? {
546
+ mode: 'multiple',
547
+ maxTagCount: 1,
548
+ }
549
+ : {}),
550
+ }}
551
+ disabled={disabled}
552
+ labelInValue={true}
553
+ value={showValue(ites.code)}
554
+ requestConfig={{
555
+ filterInit: 'qp-id-in',
556
+ }}
557
+ onChange={(value) => {
558
+ handleEdit(ites.code, value);
559
+ }}
560
+ getPopupContainer={() => document.body}
561
+ />
562
+ )) ||
563
+ null}
564
+ {/* 单选/多选 库存组织选择器 */}
565
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
566
+ ites?.choiceType === 280 && (
567
+ <BusinessTreeSearchSelect
568
+ disabled={disabled}
569
+ treeCheckable={ites?.inputType === 30}
570
+ businessType="stock-organization"
571
+ labelInValue={true}
572
+ value={showValue(ites.code)}
573
+ style={styleCommon}
574
+ onChange={(value) => {
575
+ handleEdit(ites.code, value);
576
+ }}
577
+ getPopupContainer={() => document.body}
578
+ />
579
+ )) ||
580
+ null}
581
+ {/* 单选/多选 配送方式选择器 */}
582
+ {((ites?.inputType === 20 || ites?.inputType === 30) &&
583
+ ites?.choiceType === 310 && (
584
+ <BusinessSearchSelect
585
+ selectBusinessType="deliveryMode"
586
+ selectProps={{
587
+ style: styleCommon,
588
+ placeholder: '请选择配送方式',
589
+ ...(ites?.inputType === 30
590
+ ? {
591
+ mode: 'multiple',
592
+ maxTagCount: 1,
593
+ }
594
+ : {}),
595
+ }}
596
+ disabled={disabled}
597
+ labelInValue={true}
598
+ value={showValue(ites.code)}
599
+ requestConfig={{
600
+ filterInit: 'qp-code-in',
601
+ }}
602
+ onChange={(value) => {
603
+ handleEdit(ites.code, value);
604
+ }}
605
+ getPopupContainer={() => document.body}
606
+ />
607
+ )) ||
608
+ null}
609
+ {/* 表达式 */}
610
+ {ites?.inputType === 40 && (
611
+ <div style={{ display: 'flex' }}>
612
+ <Formula
613
+ disabled={disabled}
614
+ key={showValue(ites.code)}
615
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
616
+ setValue={(val, formulaName) => {
617
+ console.log(val, 'val');
618
+ const value = val.map((item) => {
619
+ return item.value.replace(
620
+ /[a-zA-Z_]+\.\w+/g,
621
+ (i) => '{' + i + '}',
622
+ );
623
+ });
624
+ handleEdit(ites.code, value.join(''));
625
+ handleEdit({
626
+ inputType: 40,
627
+ formulaName,
628
+ });
629
+ }}
630
+ record={{ expression: showValue(ites.code) }}
631
+ sourceData={fieldListGroup}
632
+ />
633
+ </div>
634
+ )}
635
+ </>
636
+ );
637
+ };