@bit-sun/business-component 4.2.0-alpha.6.8 → 4.2.0-alpha.jw-1
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.
- package/dist/components/Functional/DataValidation/index.d.ts +1 -1
- package/dist/index.esm.js +1056 -1152
- package/dist/index.js +1056 -1152
- package/package.json +1 -1
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +2 -2
- package/src/components/Business/BsLayouts/index.tsx +2 -2
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +45 -12
- package/src/components/Functional/AddSelect/index.tsx +92 -0
- package/src/components/Functional/DataValidation/index.tsx +22 -3
- package/src/components/Functional/SearchSelect/index.tsx +5 -2
- package/src/components/Solution/RuleComponent/index.js +1 -0
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ const CustomerMenu = forwardRef(({isCollapse, handleClose, actionRef, originRout
|
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
91
|
<div className={'customer_menu_content'}>
|
|
92
|
-
<div
|
|
92
|
+
{/* <div
|
|
93
93
|
style={{cursor: 'pointer'}}
|
|
94
94
|
onClick={(e) => {
|
|
95
95
|
handleClose();
|
|
@@ -106,7 +106,7 @@ const CustomerMenu = forwardRef(({isCollapse, handleClose, actionRef, originRout
|
|
|
106
106
|
>
|
|
107
107
|
自定义菜单
|
|
108
108
|
</Button>
|
|
109
|
-
</div>
|
|
109
|
+
</div> */}
|
|
110
110
|
{!isCollapse && (
|
|
111
111
|
<Drawer
|
|
112
112
|
style={{ left: isDrawer ? 140 : 0 }}
|
|
@@ -87,7 +87,7 @@ const getAuthMenuPathAndDocsId = (pathToRegexp) => {
|
|
|
87
87
|
if (item.children && item.children.length > 0) {
|
|
88
88
|
getLimitedMenuKeys(item.children);
|
|
89
89
|
} else {
|
|
90
|
-
const originPath = item.path.replace(/^\/\w+\//, '/');
|
|
90
|
+
const originPath = (item.path || item.frontendPath).replace(/^\/\w+\//, '/');
|
|
91
91
|
menuKeys.push(originPath);
|
|
92
92
|
if (pathToRegexp('/operation-and-maintenance-center/configuration-management/all-general-documents-specific/:id').test(originPath)) {
|
|
93
93
|
getId(originPath) && docsId.push(getId(originPath))
|
|
@@ -647,7 +647,7 @@ class BasicLayout extends React.PureComponent {
|
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
// todo:暂时处理非wujie环境不做404管控
|
|
650
|
-
if (!window.__POWERED_BY_WUJIE__) {
|
|
650
|
+
if (!window.__POWERED_BY_WUJIE__ && !this.props.isSingleSystem) {
|
|
651
651
|
treeList.push({
|
|
652
652
|
tab: node.locale,
|
|
653
653
|
key: node.path,
|
|
@@ -523,11 +523,11 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
523
523
|
placeholder: '输入商品(SPU)编码或名称',
|
|
524
524
|
renderTableColumns: [
|
|
525
525
|
{
|
|
526
|
-
title: '
|
|
526
|
+
title: 'SPU编码',
|
|
527
527
|
dataIndex: 'itemCode',
|
|
528
528
|
},
|
|
529
529
|
{
|
|
530
|
-
title: '
|
|
530
|
+
title: 'SPU名称',
|
|
531
531
|
dataIndex: 'name',
|
|
532
532
|
},
|
|
533
533
|
],
|
|
@@ -547,8 +547,8 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
547
547
|
...requestConfigProp,
|
|
548
548
|
}
|
|
549
549
|
tableSearchForm = [
|
|
550
|
-
{ name: 'itemCode*multiInput', label: '
|
|
551
|
-
{ name: 'name*multiInput', label: '
|
|
550
|
+
{ name: 'itemCode*multiInput', label: 'SPU编码', type: 'multipleQueryInput' },
|
|
551
|
+
{ name: 'name*multiInput', label: 'SPU名称', type: 'multipleQueryInput' },
|
|
552
552
|
{ name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
|
|
553
553
|
type: 'select',
|
|
554
554
|
props: {
|
|
@@ -626,12 +626,12 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
626
626
|
defaultSort: 0,
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
|
-
title: '
|
|
629
|
+
title: 'SPU编码',
|
|
630
630
|
dataIndex: 'itemCode',
|
|
631
631
|
defaultSort: 1,
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
|
-
title: '
|
|
634
|
+
title: 'SPU名称',
|
|
635
635
|
dataIndex: 'name',
|
|
636
636
|
defaultSort: 2,
|
|
637
637
|
},
|
|
@@ -970,7 +970,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
970
970
|
['colorName', 'categoryId', 'classId', 'brandId'],
|
|
971
971
|
hiddenFields,
|
|
972
972
|
);
|
|
973
|
-
const fieldLoadSource = fieldsRequest.map((i: any) => loadSelectSource(i.url, i.params,options));
|
|
973
|
+
const fieldLoadSource = fieldsRequest.map((i: any) => loadSelectSource(i.url, i.params, i.options));
|
|
974
974
|
requestConfig = {
|
|
975
975
|
url: `${prefixUrl.selectPrefix}/skc/skcSelect`,
|
|
976
976
|
filter: 'qp-code,name-orGroup,like', // 过滤参数
|
|
@@ -1302,6 +1302,13 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
1302
1302
|
defaultSort: 3,
|
|
1303
1303
|
render: (text: number) => getDictionaryTextByValue('SC00004', text),
|
|
1304
1304
|
},
|
|
1305
|
+
{
|
|
1306
|
+
title: '运营组名称',
|
|
1307
|
+
dataIndex: 'groupCode',
|
|
1308
|
+
defaultSort: 7,
|
|
1309
|
+
render: (text: any, record) => record?.groupName ? `【${text}】${record?.groupName}` : "",
|
|
1310
|
+
width: 100,
|
|
1311
|
+
},
|
|
1305
1312
|
{
|
|
1306
1313
|
title: '所属销售渠道',
|
|
1307
1314
|
dataIndex: 'channelName',
|
|
@@ -1324,7 +1331,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
1324
1331
|
...(modalTableBusProps?.needStatusSearch?[{
|
|
1325
1332
|
title: '状态',
|
|
1326
1333
|
dataIndex: 'isEnable',
|
|
1327
|
-
defaultSort:
|
|
1334
|
+
defaultSort: 8,
|
|
1328
1335
|
render: (text: number) => getDictionaryTextByValue('SC00001', text),
|
|
1329
1336
|
}]:[]),
|
|
1330
1337
|
],
|
|
@@ -1860,8 +1867,10 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
1860
1867
|
...requestConfigProp,
|
|
1861
1868
|
}
|
|
1862
1869
|
tableSearchForm = [
|
|
1863
|
-
{ name: '
|
|
1864
|
-
{ name: '
|
|
1870
|
+
{ name: 'name*multiInput', label: '店铺名称', type: 'multipleQueryInput' },
|
|
1871
|
+
{ name: 'code*multiInput', label: '店铺编码', type: 'multipleQueryInput' },
|
|
1872
|
+
// { name: 'qp-name-like', label: '店铺名称' },
|
|
1873
|
+
// { name: 'qp-code-like', label: '店铺编码' },
|
|
1865
1874
|
{ name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
|
|
1866
1875
|
type: 'select',
|
|
1867
1876
|
props: {
|
|
@@ -2111,6 +2120,24 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
2111
2120
|
} ,
|
|
2112
2121
|
initialSource: getDictionarySource('BUSINESS_StoreType')
|
|
2113
2122
|
},
|
|
2123
|
+
{
|
|
2124
|
+
name: "qp-brandCode-in",
|
|
2125
|
+
label: "品牌",
|
|
2126
|
+
field: {
|
|
2127
|
+
type:'select',
|
|
2128
|
+
props: {
|
|
2129
|
+
mode: 'multiple',
|
|
2130
|
+
notFoundContent: '暂无数据',
|
|
2131
|
+
allowClear: true,
|
|
2132
|
+
showSearch: true,
|
|
2133
|
+
showArrow: true,
|
|
2134
|
+
maxTagCount: 1,
|
|
2135
|
+
optionFilterProp: 'children',
|
|
2136
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
2137
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
2138
|
+
},
|
|
2139
|
+
},
|
|
2140
|
+
},
|
|
2114
2141
|
]
|
|
2115
2142
|
const queryHeaderParams = getQueryHeadersList({ querySelectHeadersList, extralHeaders});
|
|
2116
2143
|
Promise.all([
|
|
@@ -2127,12 +2154,18 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
2127
2154
|
loadSelectSource(`${prefixUrl.formSelectFix}/tagNode/getTree/10`, {
|
|
2128
2155
|
'qp-status-eq': 1,
|
|
2129
2156
|
},getQueryHeadersItem(queryHeaderParams,'qp-orgCode-in')),
|
|
2157
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
|
|
2158
|
+
pageSize: 5000,
|
|
2159
|
+
currentPage: 1,
|
|
2160
|
+
'ctl-withAuth': true,
|
|
2161
|
+
},getQueryHeadersItem(queryHeaderParams,'ctl-withAuth'))
|
|
2130
2162
|
]).then((x: any)=>{
|
|
2131
2163
|
const channelDisabledJude = (data: any) => data['parentCode'] === '0'; // 所属销售渠道 树节点不能点判断
|
|
2132
2164
|
const areaDisabledJude = (data: any) => data['parent'] === '0'; // 所属营销区域 树节点不能点判断
|
|
2133
2165
|
formatSource(x,0, 3, tableSearchForm);
|
|
2134
2166
|
formatTreeDataSource(x, 1, 4, tableSearchForm, ['code','name'], 'channelInfoSon', channelDisabledJude)
|
|
2135
2167
|
formatTreeDataSource(x, 2, 5, tableSearchForm, ['code', 'name'], 'children', areaDisabledJude)
|
|
2168
|
+
formatSource(x,3, 7, tableSearchForm, ['brandCode', 'name']);
|
|
2136
2169
|
})
|
|
2137
2170
|
modalTableProps = {
|
|
2138
2171
|
modalTableTitle: '选择商店',
|
|
@@ -2488,7 +2521,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
2488
2521
|
} },
|
|
2489
2522
|
...(modalTableBusProps?.needTypeSearch?[{ name: 'qp-employmentType-eq', type: 'select', label: '员工类型', initialSource: employeeType }]:[]),
|
|
2490
2523
|
{ name: 'qp-email-like', label: '邮箱' },
|
|
2491
|
-
{ name: 'qp-
|
|
2524
|
+
{ name: 'qp-phone-like', label: '手机号' },
|
|
2492
2525
|
]
|
|
2493
2526
|
const queryHeaderParams = getQueryHeadersList({ querySelectHeadersList, extralHeaders});
|
|
2494
2527
|
Promise.all([
|
|
@@ -2541,7 +2574,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
2541
2574
|
},
|
|
2542
2575
|
{
|
|
2543
2576
|
title: '手机号',
|
|
2544
|
-
dataIndex: '
|
|
2577
|
+
dataIndex: 'phone',
|
|
2545
2578
|
defaultSort: 4,
|
|
2546
2579
|
render: (text: any, record: any) => handleTextOverflow(text||record?.phone),
|
|
2547
2580
|
},
|
|
@@ -222,6 +222,98 @@ const AddSelect = (props: any) => {
|
|
|
222
222
|
acc[key] = typeof value === 'function' ? value?.(record) : value;
|
|
223
223
|
return acc;
|
|
224
224
|
}, {});
|
|
225
|
+
|
|
226
|
+
// 可输入非数字字符
|
|
227
|
+
if(item.canInputString) {
|
|
228
|
+
return (
|
|
229
|
+
<InputNumber
|
|
230
|
+
min={0}
|
|
231
|
+
precision={0}
|
|
232
|
+
controls={false}
|
|
233
|
+
{...inputProps}
|
|
234
|
+
value={text || ''}
|
|
235
|
+
keyboard={false}
|
|
236
|
+
onPressEnter={(e: any) => {
|
|
237
|
+
e.target.blur();
|
|
238
|
+
}}
|
|
239
|
+
onBlur={async (e: any) => {
|
|
240
|
+
const {
|
|
241
|
+
target: { value },
|
|
242
|
+
} = e;
|
|
243
|
+
record[item.dataIndex] = value
|
|
244
|
+
editRecord(record)
|
|
245
|
+
}}
|
|
246
|
+
onKeyDown={(e) => {
|
|
247
|
+
if(e.keyCode === 13 && e.ctrlKey) {
|
|
248
|
+
handleOk(true)
|
|
249
|
+
document.getElementById("first-query")?.focus()
|
|
250
|
+
}
|
|
251
|
+
if(e.keyCode === 8 && e.ctrlKey) {
|
|
252
|
+
message.success('删除当前行')
|
|
253
|
+
e.stopPropagation();
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
256
|
+
if (dom) {
|
|
257
|
+
dom.select();
|
|
258
|
+
dom.focus();
|
|
259
|
+
dom.scrollIntoView(false)
|
|
260
|
+
}
|
|
261
|
+
dom = null
|
|
262
|
+
deleteRecord(record, popvalue);
|
|
263
|
+
}
|
|
264
|
+
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
268
|
+
if (dom) {
|
|
269
|
+
dom.select();
|
|
270
|
+
dom.focus();
|
|
271
|
+
dom.scrollIntoView(false)
|
|
272
|
+
}
|
|
273
|
+
dom = null
|
|
274
|
+
}
|
|
275
|
+
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
276
|
+
e.stopPropagation();
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
279
|
+
if (dom) {
|
|
280
|
+
dom.select();
|
|
281
|
+
dom.focus();
|
|
282
|
+
dom.scrollIntoView(false)
|
|
283
|
+
}
|
|
284
|
+
dom = null
|
|
285
|
+
}
|
|
286
|
+
if (e.keyCode === 40) {
|
|
287
|
+
e.stopPropagation();
|
|
288
|
+
e.preventDefault();
|
|
289
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
290
|
+
if (dom) {
|
|
291
|
+
dom.select();
|
|
292
|
+
dom.focus();
|
|
293
|
+
dom.scrollIntoView(false)
|
|
294
|
+
}
|
|
295
|
+
dom = null
|
|
296
|
+
} else if (e.keyCode === 38) {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
300
|
+
if (dom1) {
|
|
301
|
+
// dom1.value=""
|
|
302
|
+
// dom1.setSelectionRange(100, 0);
|
|
303
|
+
dom1.select();
|
|
304
|
+
dom1.focus();
|
|
305
|
+
dom1.scrollIntoViewIfNeeded(false)
|
|
306
|
+
// dom1.value=record['count']
|
|
307
|
+
}
|
|
308
|
+
dom1 = null
|
|
309
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
310
|
+
e.stopPropagation();
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
225
317
|
|
|
226
318
|
return (
|
|
227
319
|
<InputNumber
|
|
@@ -477,9 +477,10 @@ customSort = (a, b) => {
|
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
-
resetData = () => {
|
|
481
|
-
const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping } = this.props;
|
|
482
|
-
|
|
480
|
+
resetData = async () => {
|
|
481
|
+
const { validDataUrl, validDataParams, updateData, columns, isBrandAuth, isCheckStockNum = true, customerColumnsMapping, checkSharedValue, beforeCheckCallback } = this.props;
|
|
482
|
+
|
|
483
|
+
let resultData = this.getData().filter(d => {
|
|
483
484
|
return _.compact(Object.values(d)).length
|
|
484
485
|
})
|
|
485
486
|
|
|
@@ -491,6 +492,24 @@ customSort = (a, b) => {
|
|
|
491
492
|
otherParams = { brandAuth: 'ctl-withAuth' }
|
|
492
493
|
}
|
|
493
494
|
|
|
495
|
+
// 处理校验参数,隐藏校验参数(公用的部分)
|
|
496
|
+
if(checkSharedValue){
|
|
497
|
+
resultData = resultData.map(d => {
|
|
498
|
+
return {
|
|
499
|
+
...d,
|
|
500
|
+
...checkSharedValue,
|
|
501
|
+
}
|
|
502
|
+
})
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// 调用回调函数
|
|
506
|
+
if(beforeCheckCallback){
|
|
507
|
+
resultData = await beforeCheckCallback(resultData);
|
|
508
|
+
if(!resultData){
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
494
513
|
request
|
|
495
514
|
.post(validDataUrl, {
|
|
496
515
|
...otherParams,
|
|
@@ -32,6 +32,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
32
32
|
highestPopContainer = undefined,
|
|
33
33
|
fieldComponent,
|
|
34
34
|
onSaveCallback,
|
|
35
|
+
returnFormat = [],
|
|
35
36
|
selectBusinessType,
|
|
36
37
|
} = props;
|
|
37
38
|
const {
|
|
@@ -66,6 +67,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
66
67
|
const selectParamsKey = requestConfig?.filter || 'qp-codeAndName-like'
|
|
67
68
|
const selectParamsInitKey = requestConfig?.filterInit || selectParamsKey
|
|
68
69
|
const currentSelectProps = {
|
|
70
|
+
// 回显字段可自定义
|
|
71
|
+
optionLabelProp: "label",
|
|
69
72
|
...selectProps,
|
|
70
73
|
// 以下属性不可更改----设计配置项
|
|
71
74
|
showArrow: true,
|
|
@@ -73,7 +76,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
73
76
|
filterOption: false,
|
|
74
77
|
allowClear: true,
|
|
75
78
|
listHeight: 160,
|
|
76
|
-
optionLabelProp: "label",
|
|
77
79
|
autoClearSearchValue: false,
|
|
78
80
|
placement: 'bottomRight'
|
|
79
81
|
}
|
|
@@ -431,7 +433,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
431
433
|
|
|
432
434
|
const formaData = (value: any, source: any) => {
|
|
433
435
|
if (labelInValue) {
|
|
434
|
-
const
|
|
436
|
+
const getFromat = (format, val) => format.map(({key,value})=> ({[key]:val[value]}))
|
|
437
|
+
const formatResult = value.map((i: any) => (Object.assign({ key: i[mappingValueField] || i.key, label: i[mappingTextField] || i.label, value: i[mappingValueField] || i.value }, ...getFromat(returnFormat, i))))
|
|
435
438
|
onChange(selectMode ? formatResult : formatResult[0], value,source)
|
|
436
439
|
} else {
|
|
437
440
|
const formatResult = selectMode ? value.map((i: any) => i.value) : _.get(value[0], 'value')
|