@bit-sun/business-component 4.0.13-alpha.17 → 4.0.13-alpha.19
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/.umirc.ts +9 -9
- package/dist/components/Business/AddSelectBusiness/index.d.ts +4 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +2 -2
- package/dist/components/Business/BsLayouts/index.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +2 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +6 -6
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +15 -15
- package/dist/components/Business/CommodityEntry/index.d.ts +2 -2
- package/dist/components/Business/CommonAlert/index.d.ts +2 -2
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
- package/dist/components/Business/DetailPageWrapper/index.d.ts +6 -6
- package/dist/components/Business/HomePageWrapper/index.d.ts +2 -2
- package/dist/components/Business/ItemPropertySelector/index.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +2 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +2 -2
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +2 -2
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +2 -2
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +2 -2
- package/dist/components/Business/PropertyModal/index.d.ts +2 -2
- package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/StateFlow/index.d.ts +2 -2
- package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +6 -6
- package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +2 -2
- package/dist/components/Business/columnSettingTable/index.d.ts +2 -2
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +2 -2
- package/dist/components/Business/columnSettingTable/utils.d.ts +2 -2
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
- package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
- package/dist/components/Common/Section/index.d.ts +1 -1
- package/dist/components/Functional/AddSelect/index.d.ts +2 -2
- package/dist/components/Functional/AuthButton/index.d.ts +2 -2
- package/dist/components/Functional/DataImport/index.d.ts +3 -3
- package/dist/components/Functional/DataValidation/index.d.ts +3 -3
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +2 -2
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +2 -2
- package/dist/components/Functional/QueryMutipleSelect/index.d.ts +2 -2
- package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
- package/dist/components/Functional/SearchSelect/utils.d.ts +5 -4
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -2
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +2 -2
- package/dist/components/Solution/RuleComponent/Formula.d.ts +2 -2
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +2 -2
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +2 -2
- package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +2 -2
- package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
- package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
- package/dist/index.esm.js +790 -459
- package/dist/index.js +790 -459
- package/dist/plugin/TableColumnSetting/index.d.ts +5 -5
- package/dist/utils/TableUtils.d.ts +19 -19
- package/package.json +1 -1
- package/src/components/Business/ItemPropertySelector/index.tsx +88 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +192 -0
- package/src/components/Business/SearchSelect/index.md +2 -2
- package/src/components/Business/SearchSelect/utils.ts +1 -1
- package/src/components/Functional/SearchSelect/index.tsx +37 -4
- package/src/components/Functional/SearchSelect/utils.tsx +6 -5
|
@@ -38,14 +38,14 @@ declare class TableColumnSetting extends React.Component<TableColumnSettingProps
|
|
|
38
38
|
} | {
|
|
39
39
|
title: string;
|
|
40
40
|
dataIndex: string;
|
|
41
|
-
render: (text: any, record: any) => JSX.Element;
|
|
41
|
+
render: (text: any, record: any) => React.JSX.Element;
|
|
42
42
|
className?: undefined;
|
|
43
43
|
width?: undefined;
|
|
44
44
|
} | {
|
|
45
45
|
title: string;
|
|
46
46
|
dataIndex: string;
|
|
47
47
|
className: string;
|
|
48
|
-
render: () => JSX.Element;
|
|
48
|
+
render: () => React.JSX.Element;
|
|
49
49
|
width?: undefined;
|
|
50
50
|
})[];
|
|
51
51
|
showModal: () => void;
|
|
@@ -53,12 +53,12 @@ declare class TableColumnSetting extends React.Component<TableColumnSettingProps
|
|
|
53
53
|
handleCancel: (e: React.MouseEvent<HTMLElement>) => void;
|
|
54
54
|
handleTableHeadHidden: (title: string) => void;
|
|
55
55
|
onSortEnd: ({ oldIndex, newIndex }: any) => void;
|
|
56
|
-
DraggableContainer: (props: any) => JSX.Element;
|
|
57
|
-
DraggableBodyRow: ({ className, style, ...restProps }: any) => JSX.Element;
|
|
56
|
+
DraggableContainer: (props: any) => React.JSX.Element;
|
|
57
|
+
DraggableBodyRow: ({ className, style, ...restProps }: any) => React.JSX.Element;
|
|
58
58
|
onChange: (e: any, title: any) => void;
|
|
59
59
|
handleReset: () => void;
|
|
60
60
|
onSearch: (e: any) => void;
|
|
61
61
|
onSearchSort: (e: any) => void;
|
|
62
|
-
render(): JSX.Element;
|
|
62
|
+
render(): React.JSX.Element;
|
|
63
63
|
}
|
|
64
64
|
export default TableColumnSetting;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
type mediaListType = {
|
|
4
4
|
type: number;
|
|
@@ -49,24 +49,24 @@ declare const updateGuanDate: (requestParams: any, dateKeyParams?: any) => {
|
|
|
49
49
|
};
|
|
50
50
|
submit: any;
|
|
51
51
|
};
|
|
52
|
-
declare const textIcon: (type: string | number, text?: string) => JSX.Element | undefined;
|
|
53
|
-
declare const handleTextDoubleOrId: (textOne: string | undefined, textTwo: string | undefined) => JSX.Element;
|
|
54
|
-
declare const handleTextDouble: (textOne: string | undefined, textTwo: string | undefined) => JSX.Element;
|
|
55
|
-
declare const handleTextOverflow: (text: string | undefined, width?: number) => JSX.Element;
|
|
56
|
-
declare const handleTextLineFeed: (text: string | undefined, width?: number) => JSX.Element;
|
|
57
|
-
declare const handleTextTooltip: (text: any) => JSX.Element;
|
|
58
|
-
declare const handleTextBreakSpaces: (text: any) => JSX.Element;
|
|
59
|
-
declare const handleStatusBadge: (text: any, color: any) => JSX.Element;
|
|
60
|
-
declare const HandleTotalCount: (totalParams: any) => JSX.Element;
|
|
52
|
+
declare const textIcon: (type: string | number, text?: string) => React.JSX.Element | undefined;
|
|
53
|
+
declare const handleTextDoubleOrId: (textOne: string | undefined, textTwo: string | undefined) => React.JSX.Element;
|
|
54
|
+
declare const handleTextDouble: (textOne: string | undefined, textTwo: string | undefined) => React.JSX.Element;
|
|
55
|
+
declare const handleTextOverflow: (text: string | undefined, width?: number) => React.JSX.Element;
|
|
56
|
+
declare const handleTextLineFeed: (text: string | undefined, width?: number) => React.JSX.Element;
|
|
57
|
+
declare const handleTextTooltip: (text: any) => React.JSX.Element;
|
|
58
|
+
declare const handleTextBreakSpaces: (text: any) => React.JSX.Element;
|
|
59
|
+
declare const handleStatusBadge: (text: any, color: any) => React.JSX.Element;
|
|
60
|
+
declare const HandleTotalCount: (totalParams: any) => React.JSX.Element;
|
|
61
61
|
declare const handleCommonTimeRender: (text: any, format?: any) => any;
|
|
62
|
-
declare const handleTooltip: (text: any, timeTrue?: boolean) => JSX.Element;
|
|
63
|
-
declare const handleTooltipHours: (text: any, timeTrue?: boolean) => JSX.Element;
|
|
62
|
+
declare const handleTooltip: (text: any, timeTrue?: boolean) => React.JSX.Element;
|
|
63
|
+
declare const handleTooltipHours: (text: any, timeTrue?: boolean) => React.JSX.Element;
|
|
64
64
|
type tableColumnsImageType = {
|
|
65
65
|
width?: number | string;
|
|
66
66
|
height?: number | string;
|
|
67
67
|
[key: string]: any;
|
|
68
68
|
};
|
|
69
|
-
declare const tableColumnsImage: (url?: string, paramsObj?: tableColumnsImageType) => JSX.Element;
|
|
69
|
+
declare const tableColumnsImage: (url?: string, paramsObj?: tableColumnsImageType) => React.JSX.Element;
|
|
70
70
|
interface ColumnsEditInterfave {
|
|
71
71
|
text?: string;
|
|
72
72
|
record?: any;
|
|
@@ -82,7 +82,7 @@ interface ColumnsEditInterfave {
|
|
|
82
82
|
};
|
|
83
83
|
[key: string]: any;
|
|
84
84
|
}
|
|
85
|
-
declare const ColumnsEdit: (props: ColumnsEditInterfave) => JSX.Element;
|
|
85
|
+
declare const ColumnsEdit: (props: ColumnsEditInterfave) => React.JSX.Element;
|
|
86
86
|
type UserColumnsType = {
|
|
87
87
|
name: string;
|
|
88
88
|
department?: string;
|
|
@@ -90,13 +90,13 @@ type UserColumnsType = {
|
|
|
90
90
|
company?: string;
|
|
91
91
|
avatar?: string;
|
|
92
92
|
};
|
|
93
|
-
declare const userColumns: (props: UserColumnsType) => JSX.Element;
|
|
94
|
-
declare const userInfoCard: (props: any) => JSX.Element;
|
|
93
|
+
declare const userColumns: (props: UserColumnsType) => React.JSX.Element;
|
|
94
|
+
declare const userInfoCard: (props: any) => React.JSX.Element;
|
|
95
95
|
declare const getItemDefaultWidth: (item: any) => number;
|
|
96
|
-
declare const sulaTableRenderTooltip: ({ text }: any) => JSX.Element;
|
|
96
|
+
declare const sulaTableRenderTooltip: ({ text }: any) => React.JSX.Element;
|
|
97
97
|
declare const renderNumberText: ({ text }: any) => any;
|
|
98
98
|
declare const renderFixed2: (text: any) => any;
|
|
99
|
-
declare const handleTextWarpCustom: (text: any, style?: {}) => JSX.Element;
|
|
99
|
+
declare const handleTextWarpCustom: (text: any, style?: {}) => React.JSX.Element;
|
|
100
100
|
declare const calculateValidPeriod: (start: any, end: any) => string;
|
|
101
|
-
declare const handleTextWarp: (text: any) => JSX.Element;
|
|
101
|
+
declare const handleTextWarp: (text: any) => React.JSX.Element;
|
|
102
102
|
export { getSkuImg, updateGuanDate, textIcon, handleTextDoubleOrId, handleTextDouble, handleTextOverflow, handleTextLineFeed, handleTextTooltip, handleTextBreakSpaces, handleStatusBadge, HandleTotalCount, handleTooltip, handleCommonTimeRender, handleTooltipHours, tableColumnsImage, ColumnsEdit, userColumns, userInfoCard, getItemDefaultWidth, renderNumberText, sulaTableRenderTooltip, renderFixed2, handleTextWarpCustom, handleTextWarp, calculateValidPeriod };
|
package/package.json
CHANGED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
|
+
import { Input, Select } from 'antd';
|
|
5
|
+
import { request } from 'bssula';
|
|
6
|
+
|
|
7
|
+
const ItemPropertySelector = ({
|
|
8
|
+
onChange,
|
|
9
|
+
value,
|
|
10
|
+
propertyCode,
|
|
11
|
+
name,
|
|
12
|
+
...restProps
|
|
13
|
+
}: any) => {
|
|
14
|
+
|
|
15
|
+
const [source, setSource] = useState([]);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
// FIXME: 目前只能通过固定属性编码先获取属性id,再通过属性id去查属性值 @林军
|
|
19
|
+
if (propertyCode) {
|
|
20
|
+
request({
|
|
21
|
+
url: `/items/item/propertyValue/getPropertyValueNoPagerByCode?qp-propertyCode-eq=${propertyCode}&pageSize=5000`,
|
|
22
|
+
method: 'GET',
|
|
23
|
+
converter: ({ data }: any) => {
|
|
24
|
+
const source = (data?.items || []).map(item => ({
|
|
25
|
+
text: item.value,
|
|
26
|
+
value: item.value
|
|
27
|
+
}))
|
|
28
|
+
setSource(source);
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
return;
|
|
32
|
+
request({
|
|
33
|
+
url: `/items/item/property?qp-propertyCode-eq=${propertyCode}`,
|
|
34
|
+
metod: 'GET',
|
|
35
|
+
converter: ({ data }: any) => {
|
|
36
|
+
let propInfo = data?.items?.[0] || {};
|
|
37
|
+
if (propInfo?.dictIs) {
|
|
38
|
+
request({
|
|
39
|
+
url: `/items/bscDict/detailAndFilter/${propInfo?.dictCode}`,
|
|
40
|
+
method: 'GET',
|
|
41
|
+
converter: ({ data }: any) => {
|
|
42
|
+
const source = (data?.dictItemResVoList || []).map(item => ({
|
|
43
|
+
text: item.dictItemName,
|
|
44
|
+
value: item.dictItemName
|
|
45
|
+
}))
|
|
46
|
+
setSource(source);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (propInfo?.id) {
|
|
53
|
+
request({
|
|
54
|
+
url: `/items/item/propertyValue?qp-propertyId-eq=${propInfo?.id}`,
|
|
55
|
+
method: 'GET',
|
|
56
|
+
converter: ({ data }: any) => {
|
|
57
|
+
const source = (data?.items || []).map(item => ({
|
|
58
|
+
text: item.value,
|
|
59
|
+
value: item.value
|
|
60
|
+
}))
|
|
61
|
+
setSource(source);
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
}, [propertyCode]);
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Select
|
|
73
|
+
{...restProps}
|
|
74
|
+
value={value}
|
|
75
|
+
allowClear
|
|
76
|
+
style={{width: '100%'}}
|
|
77
|
+
onChange={(v: any) => {
|
|
78
|
+
onChange(v);
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{source.map((res) => {
|
|
82
|
+
return <Select.Option value={res.value}>{res.text}</Select.Option>;
|
|
83
|
+
})}
|
|
84
|
+
</Select>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export default ItemPropertySelector;
|
|
@@ -628,6 +628,198 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
|
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
|
|
631
|
+
// 新库存商品选择器spu
|
|
632
|
+
if(type === 'spuCommodityWithProperty') {
|
|
633
|
+
selectProps = {
|
|
634
|
+
placeholder: '输入spu编码或名称',
|
|
635
|
+
renderTableColumns: [
|
|
636
|
+
{
|
|
637
|
+
title: 'spu编码',
|
|
638
|
+
dataIndex: 'itemCode',
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
title: 'spu名称',
|
|
642
|
+
dataIndex: 'name',
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
...selectConfigProps,
|
|
646
|
+
}
|
|
647
|
+
requestConfig = {
|
|
648
|
+
url: `/stock/item/doItemPageAll`,
|
|
649
|
+
method: 'POST',
|
|
650
|
+
filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
|
|
651
|
+
mappingTextField: 'name',
|
|
652
|
+
mappingValueField: 'itemCode',
|
|
653
|
+
otherParams: {
|
|
654
|
+
// 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
|
|
655
|
+
sorter: 'desc-id',
|
|
656
|
+
...(requestConfigProp?.addOtherParams || {}),
|
|
657
|
+
}, // 默认参数
|
|
658
|
+
sourceName: 'itemCode',
|
|
659
|
+
...requestConfigProp,
|
|
660
|
+
}
|
|
661
|
+
tableSearchForm = [
|
|
662
|
+
{ name: 'qp-name-like', label: 'SPU名称' },
|
|
663
|
+
{ name: 'qp-itemCode-like', label: 'SPU编码' },
|
|
664
|
+
{ name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
|
|
665
|
+
type: 'select',
|
|
666
|
+
props: {
|
|
667
|
+
mode: 'multiple',
|
|
668
|
+
notFoundContent: '暂无数据',
|
|
669
|
+
allowClear: true,
|
|
670
|
+
showSearch: true,
|
|
671
|
+
showArrow: true,
|
|
672
|
+
maxTagCount: 1,
|
|
673
|
+
optionFilterProp: 'children',
|
|
674
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
675
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
676
|
+
},
|
|
677
|
+
} },
|
|
678
|
+
{ name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
|
|
679
|
+
type: 'treeSelect',
|
|
680
|
+
props: {
|
|
681
|
+
treeData: [],
|
|
682
|
+
treeCheckable: true,
|
|
683
|
+
showSearch: true,
|
|
684
|
+
allowClear: true,
|
|
685
|
+
showArrow: true,
|
|
686
|
+
treeNodeFilterProp: 'title',
|
|
687
|
+
treeDefaultExpandAll: true,
|
|
688
|
+
maxTagCount: 1,
|
|
689
|
+
placeholder: '请选择',
|
|
690
|
+
style: {
|
|
691
|
+
width: '100%',
|
|
692
|
+
},
|
|
693
|
+
dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
|
|
694
|
+
},
|
|
695
|
+
} },
|
|
696
|
+
{ name: 'qp-classId-in', type: 'select', label: '品类', field: {
|
|
697
|
+
type: 'select',
|
|
698
|
+
props: {
|
|
699
|
+
mode: 'multiple',
|
|
700
|
+
notFoundContent: '暂无数据',
|
|
701
|
+
allowClear: true,
|
|
702
|
+
showSearch: true,
|
|
703
|
+
showArrow: true,
|
|
704
|
+
maxTagCount: 1,
|
|
705
|
+
optionFilterProp: 'children',
|
|
706
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
707
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
708
|
+
},
|
|
709
|
+
} },
|
|
710
|
+
{
|
|
711
|
+
name: 'qp-year-in',
|
|
712
|
+
label: '年份',
|
|
713
|
+
field: {
|
|
714
|
+
type: 'itemPropertySelector',
|
|
715
|
+
props: {
|
|
716
|
+
propertyCode: 'SX0000114',
|
|
717
|
+
mode: 'multiple',
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
name: 'qp-season-in',
|
|
723
|
+
label: '季节',
|
|
724
|
+
field: {
|
|
725
|
+
type: 'itemPropertySelector',
|
|
726
|
+
props: {
|
|
727
|
+
propertyCode: 'SX0000070',
|
|
728
|
+
mode: 'multiple',
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
name: 'qp-zzdlbm-in',
|
|
734
|
+
label: '大类',
|
|
735
|
+
field: {
|
|
736
|
+
type: 'itemPropertySelector',
|
|
737
|
+
props: {
|
|
738
|
+
propertyCode: 'SX0000071',
|
|
739
|
+
mode: 'multiple',
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
name: 'qp-zzzlbm-in',
|
|
745
|
+
label: '中类',
|
|
746
|
+
field: {
|
|
747
|
+
type: 'itemPropertySelector',
|
|
748
|
+
props: {
|
|
749
|
+
propertyCode: 'SX0000072',
|
|
750
|
+
mode: 'multiple',
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: 'qp-zzxlbm-in',
|
|
756
|
+
label: '小类',
|
|
757
|
+
field: {
|
|
758
|
+
type: 'itemPropertySelector',
|
|
759
|
+
props: {
|
|
760
|
+
propertyCode: 'SX0000110',
|
|
761
|
+
mode: 'multiple',
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
]
|
|
766
|
+
Promise.all([
|
|
767
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
|
|
768
|
+
pageSize: 5000,
|
|
769
|
+
currentPage: 1,
|
|
770
|
+
'ctl-withAuth': true
|
|
771
|
+
}),
|
|
772
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
|
|
773
|
+
pageSize: 5000,
|
|
774
|
+
currentPage: 1,
|
|
775
|
+
}),
|
|
776
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
|
|
777
|
+
pageSize: 5000,
|
|
778
|
+
currentPage: 1,
|
|
779
|
+
}),
|
|
780
|
+
]).then((x: any)=>{
|
|
781
|
+
formatSource(x,0, 2, tableSearchForm,['id','name']);
|
|
782
|
+
formatTreeDataSource(x,1, 3, tableSearchForm);
|
|
783
|
+
formatSource(x,2, 4, tableSearchForm,['id','name']);
|
|
784
|
+
})
|
|
785
|
+
modalTableProps = {
|
|
786
|
+
modalTableTitle: '选择SPU',
|
|
787
|
+
tableSearchForm,
|
|
788
|
+
tableColumns: [
|
|
789
|
+
{
|
|
790
|
+
title: '序号',
|
|
791
|
+
dataIndex: 'keyIndex',
|
|
792
|
+
defaultSort: 0,
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
title: 'SPU编码',
|
|
796
|
+
dataIndex: 'itemCode',
|
|
797
|
+
defaultSort: 1,
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
title: 'SPU名称',
|
|
801
|
+
dataIndex: 'name',
|
|
802
|
+
defaultSort: 2,
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
title: '品牌',
|
|
806
|
+
dataIndex: 'brandName',
|
|
807
|
+
defaultSort: 3,
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
title: '类目',
|
|
811
|
+
dataIndex: 'categoryText',
|
|
812
|
+
defaultSort: 4,
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
title: '品类',
|
|
816
|
+
dataIndex: 'className',
|
|
817
|
+
},
|
|
818
|
+
],
|
|
819
|
+
...modalTableBusProps
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
631
823
|
// 商品选择器skc
|
|
632
824
|
if(type === 'skcCommodity') {
|
|
633
825
|
selectProps = {
|
|
@@ -297,7 +297,7 @@ import {BusinessSearchSelect} from '../../../index.ts';
|
|
|
297
297
|
const { TabPane } = Tabs;
|
|
298
298
|
export default () => {
|
|
299
299
|
const selectProps = {
|
|
300
|
-
|
|
300
|
+
mode: 'multiple',
|
|
301
301
|
// maxTagCount: 1,
|
|
302
302
|
// disabled: true
|
|
303
303
|
}
|
|
@@ -317,7 +317,7 @@ export default () => {
|
|
|
317
317
|
},
|
|
318
318
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
319
319
|
selectProps,
|
|
320
|
-
selectBusinessType: '
|
|
320
|
+
selectBusinessType: 'spuCommodityWithProperty',
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
const onTabChange = (key) => {
|
|
@@ -79,7 +79,7 @@ const handleDefaultPrefixUrl = (type: string) => {
|
|
|
79
79
|
case 'supplier2': case 'customer2': case 'shopFile2': case 'platCompany': case 'market-channel':
|
|
80
80
|
result = '/channel-manage';
|
|
81
81
|
break;
|
|
82
|
-
case 'skuCommodity': case 'skuPropertyValue': case 'spuCommodity': case 'skcCommodity': case 'brand':
|
|
82
|
+
case 'skuCommodity': case 'skuPropertyValue': case 'spuCommodity': case 'skcCommodity': case 'brand': case 'spuCommodityWithProperty':
|
|
83
83
|
result = '/items';
|
|
84
84
|
break;
|
|
85
85
|
case 'physicalWarehouse': case 'realWarehouse': case 'virtualWarehouse': case 'channelWarehouse': case 'ownerWarehouse':
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import { useDebounceFn } from 'ahooks';
|
|
4
|
-
import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs, Empty } from 'antd';
|
|
4
|
+
import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag, Row, Col, Space, Tabs, Empty, DatePicker } from 'antd';
|
|
5
5
|
import { SearchOutlined, CopyOutlined, CaretLeftOutlined } from '@ant-design/icons';
|
|
6
6
|
import request from '@/utils/request';
|
|
7
7
|
import _, { escapeRegExp, isNil, values } from "lodash"
|
|
8
8
|
import './index.less';
|
|
9
9
|
import { BusinessSearchSelect, QueryMutipleInput, QueryMutipleSearchSelect } from '@/index';
|
|
10
|
-
import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr,
|
|
10
|
+
import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr, handleTableColumns } from './utils';
|
|
11
11
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
12
12
|
import zhankaitiaojian from '../../../assets/zhankaitiaojian-icon.svg';
|
|
13
13
|
import PropertySelector from '@/components/Business/PropertyModal';
|
|
14
|
+
import ItemPropertySelector from '@/components/Business/ItemPropertySelector';
|
|
14
15
|
|
|
15
16
|
const { Option } = Select;
|
|
16
17
|
|
|
@@ -573,7 +574,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
573
574
|
}
|
|
574
575
|
};
|
|
575
576
|
|
|
576
|
-
const { emptyArray } = getFormRowInfo(list);
|
|
577
|
+
const { emptyArray, ColSpan } = getFormRowInfo(list, modalTableProps?.tableSearchColSpan);
|
|
577
578
|
const addKong = emptyArray?.map((i: any) =>({ type: 'kong'}))||[];
|
|
578
579
|
return list?.concat(addKong)?.map((i: any, index: number) => {
|
|
579
580
|
if(i?.type === 'kong') return <Col span={ColSpan} key={i}></Col>;
|
|
@@ -602,6 +603,25 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
602
603
|
)
|
|
603
604
|
}
|
|
604
605
|
|
|
606
|
+
if (i?.type === 'rangepicker' || i?.field?.type === 'rangepicker') {
|
|
607
|
+
return (
|
|
608
|
+
<Col span={ColSpan} key={i.name}>
|
|
609
|
+
<Form.Item name={i.name} label={i.label} key={i.name} initialValue={i?.initialValue ?? []}>
|
|
610
|
+
<DatePicker.RangePicker style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props} disabled={setDisabled(i.name)}></DatePicker.RangePicker>
|
|
611
|
+
</Form.Item>
|
|
612
|
+
</Col>
|
|
613
|
+
)
|
|
614
|
+
}
|
|
615
|
+
if (i?.type === 'datepicker' || i?.field?.type === 'datepicker') {
|
|
616
|
+
return (
|
|
617
|
+
<Col span={ColSpan} key={i.name}>
|
|
618
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
619
|
+
<DatePicker style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props} disabled={setDisabled(i.name)}></DatePicker>
|
|
620
|
+
</Form.Item>
|
|
621
|
+
</Col>
|
|
622
|
+
)
|
|
623
|
+
}
|
|
624
|
+
|
|
605
625
|
if (i?.type === 'businessSearchSelect' || i?.field?.type === 'businessSearchSelect') {
|
|
606
626
|
return (
|
|
607
627
|
<Col span={ColSpan} key={i.name}>
|
|
@@ -635,6 +655,19 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
635
655
|
</Col>
|
|
636
656
|
);
|
|
637
657
|
}
|
|
658
|
+
if (i?.type === 'itemPropertySelector' || i?.field?.type === 'itemPropertySelector') {
|
|
659
|
+
return (
|
|
660
|
+
<Col span={ColSpan} key={i.name}>
|
|
661
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
662
|
+
<ItemPropertySelector
|
|
663
|
+
style={{ width: '100%' }}
|
|
664
|
+
placeholder="请选择"
|
|
665
|
+
{...i?.field?.props}
|
|
666
|
+
></ItemPropertySelector>
|
|
667
|
+
</Form.Item>
|
|
668
|
+
</Col>
|
|
669
|
+
);
|
|
670
|
+
}
|
|
638
671
|
if (i?.field?.type === 'multipleQuerySearchSelect') {
|
|
639
672
|
return (
|
|
640
673
|
<Col span={ColSpan} key={i.name}>
|
|
@@ -929,7 +962,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
929
962
|
重置 ctrl+U
|
|
930
963
|
</Button>
|
|
931
964
|
<div style={{position: 'absolute',top: 0,right: 0}}>
|
|
932
|
-
{hasMoreQueryFields(modalTableProps)
|
|
965
|
+
{hasMoreQueryFields(modalTableProps)
|
|
933
966
|
? <img onClick={() => {toggleCollapsed()}} style={{
|
|
934
967
|
cursor: 'pointer',
|
|
935
968
|
fontSize: '10px',
|
|
@@ -17,12 +17,13 @@ export const handleSourceName = (sName: any) => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// ------------------------------------------处理样式相关--开始----------------------------------------
|
|
20
|
-
export const getFormRowInfo = (list: any) => {
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
20
|
+
export const getFormRowInfo = (list: any, tableSearchColSpan: number) => {
|
|
21
|
+
const lastColumnsPerRow = tableSearchColSpan == 6 ? columnsPerRow : 3;
|
|
22
|
+
const totalRows = Math.ceil(list.length / lastColumnsPerRow); // 计算总行数
|
|
23
|
+
const lastRowColumns = (list.length+1) % lastColumnsPerRow; // 计算最后一行的实际列数
|
|
24
|
+
const emptySlots = lastRowColumns === 0 ? 0 : lastColumnsPerRow - lastRowColumns; // 计算最后一行的空位数
|
|
24
25
|
const emptyArray = new Array(emptySlots).fill(null); // 生成长度为 emptySlots 的数组
|
|
25
|
-
return { totalRows, emptyArray }
|
|
26
|
+
return { totalRows, emptyArray, ColSpan: tableSearchColSpan ?? ColSpan}
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export const defaultVisibleFieldsCount = 7;
|