@bit-sun/business-component 3.1.4 → 3.1.6

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