@bit-sun/business-component 4.2.0-alpha.0 → 4.2.0-alpha.2
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/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 +12 -12
- package/dist/components/Business/HomePageWrapper/index.d.ts +2 -2
- package/dist/components/Business/ItemPropertySelector/index.d.ts +2 -2
- 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 +3 -3
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +3 -3
- 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 +4 -4
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +2 -2
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +4 -3
- 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 +3 -3
- 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 +167 -63
- package/dist/index.js +167 -63
- package/dist/plugin/TableColumnSetting/index.d.ts +6 -5
- package/dist/utils/TableUtils.d.ts +19 -19
- package/package.json +11 -11
- package/src/components/Business/AddSelectBusiness/index.md +8 -2
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +1 -1
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +1 -1
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +2 -2
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +2 -1
- package/src/components/Business/BsSulaQueryTable/utils.less +1 -1
- package/src/components/Functional/AddSelect/index.tsx +20 -3
- package/src/components/Functional/QueryMutipleInput/index.tsx +12 -3
- package/src/components/Solution/RuleComponent/InnerSelect.tsx +1 -0
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +2 -1
- package/src/components/Solution/RuleComponent/index.js +15 -3
- package/src/plugin/TableColumnSetting/index.tsx +75 -9
- package/src/utils/TableUtils.less +1 -1
|
@@ -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) =>
|
|
41
|
+
render: (text: any, record: any) => 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: () =>
|
|
48
|
+
render: () => JSX.Element;
|
|
49
49
|
width?: undefined;
|
|
50
50
|
})[];
|
|
51
51
|
showModal: () => void;
|
|
@@ -53,12 +53,13 @@ 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) =>
|
|
57
|
-
DraggableBodyRow: ({ className, style, ...restProps }: any) =>
|
|
56
|
+
DraggableContainer: (props: any) => JSX.Element;
|
|
57
|
+
DraggableBodyRow: ({ className, style, ...restProps }: any) => JSX.Element;
|
|
58
58
|
onChange: (e: any, title: any) => void;
|
|
59
59
|
handleReset: () => void;
|
|
60
|
+
handleResetSetting: () => Promise<unknown>;
|
|
60
61
|
onSearch: (e: any) => void;
|
|
61
62
|
onSearchSort: (e: any) => void;
|
|
62
|
-
render():
|
|
63
|
+
render(): JSX.Element;
|
|
63
64
|
}
|
|
64
65
|
export default TableColumnSetting;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="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) =>
|
|
53
|
-
declare const handleTextDoubleOrId: (textOne: string | undefined, textTwo: string | undefined) =>
|
|
54
|
-
declare const handleTextDouble: (textOne: string | undefined, textTwo: string | undefined) =>
|
|
55
|
-
declare const handleTextOverflow: (text: string | undefined, width?: number) =>
|
|
56
|
-
declare const handleTextLineFeed: (text: string | undefined, width?: number) =>
|
|
57
|
-
declare const handleTextTooltip: (text: any) =>
|
|
58
|
-
declare const handleTextBreakSpaces: (text: any) =>
|
|
59
|
-
declare const handleStatusBadge: (text: any, color: any) =>
|
|
60
|
-
declare const HandleTotalCount: (totalParams: any) =>
|
|
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;
|
|
61
61
|
declare const handleCommonTimeRender: (text: any, format?: any) => any;
|
|
62
|
-
declare const handleTooltip: (text: any, timeTrue?: boolean) =>
|
|
63
|
-
declare const handleTooltipHours: (text: any, timeTrue?: boolean) =>
|
|
62
|
+
declare const handleTooltip: (text: any, timeTrue?: boolean) => JSX.Element;
|
|
63
|
+
declare const handleTooltipHours: (text: any, timeTrue?: boolean) => 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) =>
|
|
69
|
+
declare const tableColumnsImage: (url?: string, paramsObj?: tableColumnsImageType) => 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) =>
|
|
85
|
+
declare const ColumnsEdit: (props: ColumnsEditInterfave) => 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) =>
|
|
94
|
-
declare const userInfoCard: (props: any) =>
|
|
93
|
+
declare const userColumns: (props: UserColumnsType) => JSX.Element;
|
|
94
|
+
declare const userInfoCard: (props: any) => JSX.Element;
|
|
95
95
|
declare const getItemDefaultWidth: (item: any) => number;
|
|
96
|
-
declare const sulaTableRenderTooltip: ({ text }: any) =>
|
|
96
|
+
declare const sulaTableRenderTooltip: ({ text }: any) => 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?: {}) =>
|
|
99
|
+
declare const handleTextWarpCustom: (text: any, style?: {}) => JSX.Element;
|
|
100
100
|
declare const calculateValidPeriod: (start: any, end: any) => string;
|
|
101
|
-
declare const handleTextWarp: (text: any) =>
|
|
101
|
+
declare const handleTextWarp: (text: any) => 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bit-sun/business-component",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"antd": "^4.17.2",
|
|
31
|
-
"bssula": "^4.1.16",
|
|
32
|
-
"umi-plugin-bssula": "^4.3.9-alpha.0",
|
|
33
|
-
"umi": "3.5.20",
|
|
34
30
|
"@ant-design/pro-layout": "^6.5.0",
|
|
31
|
+
"antd": "^4.17.2",
|
|
32
|
+
"bssula": "4.4.3-alpha.1",
|
|
35
33
|
"react-dnd": "^16.0.1",
|
|
36
|
-
"react-dnd-html5-backend": "^16.0.1"
|
|
34
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
35
|
+
"umi": "^3.5.20",
|
|
36
|
+
"umi-plugin-bssula": "4.4.3-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ant-design/icons": "^4.7.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"moment": "^2.25.3",
|
|
52
52
|
"qs": "^6.11.2",
|
|
53
53
|
"querystring": "^0.2.1",
|
|
54
|
-
"react": "
|
|
54
|
+
"react": "17.0.2",
|
|
55
55
|
"react-beautiful-dnd": "10.0.0",
|
|
56
56
|
"react-dom": "^16.12.0",
|
|
57
57
|
"react-resizable": "^3.0.4",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"serialize-javascript": "^6.0.0",
|
|
60
60
|
"umi-request": "^1.4.0",
|
|
61
61
|
"warning": "^4.0.3",
|
|
62
|
-
"xlsx": "
|
|
62
|
+
"xlsx": "0.18.5"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@ant-design/pro-layout": "
|
|
65
|
+
"@ant-design/pro-layout": "7.1.3",
|
|
66
66
|
"@types/js-cookie": "^3.0.6",
|
|
67
67
|
"@types/lodash": "^4.14.185",
|
|
68
|
-
"@types/react": "
|
|
69
|
-
"@types/react-dom": "
|
|
68
|
+
"@types/react": "17.0.2",
|
|
69
|
+
"@types/react-dom": "17.0.2",
|
|
70
70
|
"@umijs/test": "^3.0.5",
|
|
71
71
|
"acorn": "^7.2.0",
|
|
72
72
|
"acorn-walk": "^7.1.1",
|
|
@@ -54,7 +54,12 @@ export default () => {
|
|
|
54
54
|
console.log('save call', rows);
|
|
55
55
|
return Promise.resolve(true);
|
|
56
56
|
// return Promise.reject('FAILE')
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
// 批量个格式化,回调函数
|
|
59
|
+
batchFormatCallback: (rows) => {
|
|
60
|
+
return rows; // 返回格式化之后的数据
|
|
61
|
+
},
|
|
62
|
+
batchFormatBtnTitle: '批量格式化',
|
|
58
63
|
}
|
|
59
64
|
return (
|
|
60
65
|
<div>
|
|
@@ -272,7 +277,8 @@ export default () => {
|
|
|
272
277
|
dataIndex: 'skuQuantity',
|
|
273
278
|
isInputItem: true,
|
|
274
279
|
inputProps: {
|
|
275
|
-
|
|
280
|
+
max: (record: any) => record?.availableStock, // 支持传入函数
|
|
281
|
+
max: 5, // 直接传入数值
|
|
276
282
|
}
|
|
277
283
|
},
|
|
278
284
|
{
|
|
@@ -378,6 +378,7 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
378
378
|
{
|
|
379
379
|
name: 'qp-skuCode-like', label: 'SKU编码',type:'multipleQueryInput'
|
|
380
380
|
},
|
|
381
|
+
{ name: 'qp-itemCode-like', label: '款号(SPU)', type: 'multipleQueryInput', },
|
|
381
382
|
{ name: 'qp-skuName-like', label: 'SKU名称' },
|
|
382
383
|
{ name: 'qp-externalCode-like', label: '外部SPU编码' },
|
|
383
384
|
...(isNoUseItemBarcode ? []: [
|
|
@@ -476,6 +477,8 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
476
477
|
onSaveCallback: parProps.onSaveCallback,
|
|
477
478
|
businessType: 'sku',
|
|
478
479
|
isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
|
|
480
|
+
batchFormatCallback: parProps?.batchFormatCallback, // 批量格式-已选数据回调函数
|
|
481
|
+
batchFormatBtnTitle: parProps?.batchFormatBtnTitle, // 批量格式-按钮名称
|
|
479
482
|
};
|
|
480
483
|
const modalTableProps = {
|
|
481
484
|
modalTableTitle: parProps.modalTableTitle || '选择商品',
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
.account {
|
|
45
45
|
.avatar {
|
|
46
46
|
margin-right: 8px;
|
|
47
|
-
color: #
|
|
47
|
+
color: #005CFF;
|
|
48
48
|
vertical-align: top;
|
|
49
49
|
background: rgba(255, 255, 255, 0.85);
|
|
50
50
|
}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
left: -1px;
|
|
118
118
|
width: 92px;
|
|
119
119
|
height: 40px;
|
|
120
|
-
background: #
|
|
120
|
+
background: #005CFF;
|
|
121
121
|
border-radius: 0px 4px 4px 0px;
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -20,6 +20,7 @@ import { arrayMoveImmutable } from 'array-move';
|
|
|
20
20
|
import close from '../../../assets/close.svg';
|
|
21
21
|
import drag from '../../../assets/drag.svg';
|
|
22
22
|
import shezhi from '../../../assets/icon-shezhi.svg';
|
|
23
|
+
import shezhi from '../../../assets/icon-shezhi.svg';
|
|
23
24
|
import './index.less';
|
|
24
25
|
import ENUM from '@/utils/enumConfig';
|
|
25
26
|
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
@@ -587,7 +588,7 @@ class SearchItemTable extends React.Component {
|
|
|
587
588
|
</div>
|
|
588
589
|
</Modal>
|
|
589
590
|
)}
|
|
590
|
-
<div onClick={this.showModal} style={{fontSize:14, textAlign: 'center', border: '0.67px solid #D9D9D9', width: '24px', height: '24px', lineHeight: '20px'}}><img style={{width: '20px', height: '20px'}} src={shezhi} /></div>
|
|
591
|
+
<div onClick={this.showModal} style={{fontSize:14, cursor: 'pointer', textAlign: 'center', border: '0.67px solid #D9D9D9', width: '24px', height: '24px', lineHeight: '20px'}}><img style={{width: '20px', height: '20px'}} src={shezhi} /></div>
|
|
591
592
|
</div>
|
|
592
593
|
);
|
|
593
594
|
}
|
|
@@ -87,7 +87,9 @@ const AddSelect = (props: any) => {
|
|
|
87
87
|
tableCodeList = [], // 非必填 默认取组件定义code,如需自定义----数组第一位为供选择商品的table的code,第二位为已选择商品的table的code
|
|
88
88
|
businessType = 'sku',
|
|
89
89
|
isAllowRepeatedSelect = false,
|
|
90
|
-
clearTitle
|
|
90
|
+
clearTitle,
|
|
91
|
+
batchFormatCallback,
|
|
92
|
+
batchFormatBtnTitle,
|
|
91
93
|
} = props;
|
|
92
94
|
const { url, method = 'get', sourceKey, otherParams, isMap, mappingValueField = 'code', extralHeaders = {} } = requestConfig || {};
|
|
93
95
|
const realButtonProps = {type: "primary", ...buttonProps};
|
|
@@ -214,9 +216,16 @@ const AddSelect = (props: any) => {
|
|
|
214
216
|
// precision: unitAccuracy
|
|
215
217
|
}
|
|
216
218
|
}
|
|
219
|
+
// 如果属性为函数时,则执行该函数
|
|
220
|
+
const inputProps = Object.keys(item?.inputProps || {})?.reduce((acc, key) => {
|
|
221
|
+
const value = item?.inputProps?.[key];
|
|
222
|
+
acc[key] = typeof value === 'function' ? value?.(record) : value;
|
|
223
|
+
return acc;
|
|
224
|
+
}, {});
|
|
225
|
+
|
|
217
226
|
return (
|
|
218
227
|
<InputNumber
|
|
219
|
-
{...
|
|
228
|
+
{...inputProps}
|
|
220
229
|
value={text || ''}
|
|
221
230
|
min={0}
|
|
222
231
|
autoFocus={record.needFocus}
|
|
@@ -615,6 +624,11 @@ const AddSelect = (props: any) => {
|
|
|
615
624
|
}, 50)
|
|
616
625
|
};
|
|
617
626
|
|
|
627
|
+
// 将格式化完的数据回显到 表格中
|
|
628
|
+
const batchFormatCallbackHandler = () => {
|
|
629
|
+
setPopValue([...batchFormatCallback?.(popvalue)]);
|
|
630
|
+
}
|
|
631
|
+
|
|
618
632
|
const handleShowModal = () => {
|
|
619
633
|
if(beforeShowModal) {
|
|
620
634
|
beforeShowModal(popvalue).then(res => {
|
|
@@ -1049,7 +1063,10 @@ const AddSelect = (props: any) => {
|
|
|
1049
1063
|
settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
|
|
1050
1064
|
/>
|
|
1051
1065
|
</span>
|
|
1052
|
-
<div style={{ marginRight: 8
|
|
1066
|
+
<div style={{ marginRight: 8, display: 'flex', gap: '5px' }}>
|
|
1067
|
+
<span hidden={!batchFormatCallback} onClick={batchFormatCallbackHandler} style={{ cursor: 'pointer' }}>{batchFormatBtnTitle ?? '一键填充'}</span>
|
|
1068
|
+
<span onClick={deleteSelectRows} style={{ ...themeColor, cursor: 'pointer' }}>{clearTitle ?? '清空所选商品'}</span>
|
|
1069
|
+
</div>
|
|
1053
1070
|
</div>
|
|
1054
1071
|
</div>
|
|
1055
1072
|
<Table
|
|
@@ -11,9 +11,9 @@ import { useDebounceFn } from 'ahooks';
|
|
|
11
11
|
import { Input, Button, Modal, ConfigProvider } from 'antd';
|
|
12
12
|
import './index.less';
|
|
13
13
|
|
|
14
|
-
const QueryMutipleInput = ({ onValueChange,onPressEnter }) => {
|
|
14
|
+
const QueryMutipleInput = ({ onValueChange,onPressEnter, value: initialValue }) => {
|
|
15
15
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
16
|
-
const [value, setValue] = useState(
|
|
16
|
+
const [value, setValue] = useState(initialValue);
|
|
17
17
|
const [popvalue, setPopValue] = useState('');
|
|
18
18
|
const { run } = useDebounceFn(
|
|
19
19
|
() => {
|
|
@@ -24,6 +24,14 @@ const QueryMutipleInput = ({ onValueChange,onPressEnter }) => {
|
|
|
24
24
|
},
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* 初始化参数
|
|
29
|
+
* 处理参数不展示和清空不同步的问题
|
|
30
|
+
*/
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setValue(initialValue);
|
|
33
|
+
}, [initialValue]);
|
|
34
|
+
|
|
27
35
|
useEffect(() => {
|
|
28
36
|
setPopValue(value);
|
|
29
37
|
onValueChange(value);
|
|
@@ -32,7 +40,7 @@ const QueryMutipleInput = ({ onValueChange,onPressEnter }) => {
|
|
|
32
40
|
const showModal = () => {
|
|
33
41
|
setIsModalVisible(true);
|
|
34
42
|
//弹窗打开时 默认搜索内容换行显示
|
|
35
|
-
setPopValue(data => data
|
|
43
|
+
setPopValue(data => data?.replace?.(/,/g, '\n'));
|
|
36
44
|
};
|
|
37
45
|
|
|
38
46
|
const handleOk = () => {
|
|
@@ -67,6 +75,7 @@ const QueryMutipleInput = ({ onValueChange,onPressEnter }) => {
|
|
|
67
75
|
<Input
|
|
68
76
|
value={value}
|
|
69
77
|
onChange={outerChange}
|
|
78
|
+
allowClear
|
|
70
79
|
onBlur={(e) => {
|
|
71
80
|
formaData(e.target.value);
|
|
72
81
|
}}
|
|
@@ -155,6 +155,7 @@ export default function RenderCompItem(props:any){
|
|
|
155
155
|
onChange={(value) => {
|
|
156
156
|
handleEdit(ites.code, value);
|
|
157
157
|
}}
|
|
158
|
+
filterOption ={(input: any, option: any) => option?.text?.toLowerCase()?.indexOf(input?.toLowerCase()) >= 0}
|
|
158
159
|
>
|
|
159
160
|
{Object.keys(ites.enumeration).map((it) => (
|
|
160
161
|
<Select.Option key={it} value={it}>
|
|
@@ -170,7 +171,7 @@ export default function RenderCompItem(props:any){
|
|
|
170
171
|
<InnerSelect
|
|
171
172
|
disabled={disabled}
|
|
172
173
|
inputType={ites?.inputType}
|
|
173
|
-
defaultValue={ites
|
|
174
|
+
defaultValue={ites?.defaultValue}
|
|
174
175
|
styleCommon={styleCommon}
|
|
175
176
|
value={showValue(ites.code)}
|
|
176
177
|
onChange={(value) => {
|
|
@@ -1140,7 +1140,12 @@ class RuleObjectComponent extends Component {
|
|
|
1140
1140
|
let value = val;
|
|
1141
1141
|
if (isObj(code)) {
|
|
1142
1142
|
Object.keys(code).forEach((ite) => {
|
|
1143
|
-
this.handleEditExtraInfoResponse(
|
|
1143
|
+
this.handleEditExtraInfoResponse(
|
|
1144
|
+
ite,
|
|
1145
|
+
code[ite],
|
|
1146
|
+
parentDetail,
|
|
1147
|
+
classDataIndex,
|
|
1148
|
+
);
|
|
1144
1149
|
});
|
|
1145
1150
|
return;
|
|
1146
1151
|
}
|
|
@@ -1148,9 +1153,16 @@ class RuleObjectComponent extends Component {
|
|
|
1148
1153
|
value = val.map((m) => m.value || m).join(',');
|
|
1149
1154
|
}
|
|
1150
1155
|
if (isObj(val)) {
|
|
1151
|
-
value = val
|
|
1156
|
+
value = val?.value || val.PCDCode?.join('/') || val;
|
|
1152
1157
|
}
|
|
1153
|
-
|
|
1158
|
+
|
|
1159
|
+
this.handleEditExtraInfoResponse(
|
|
1160
|
+
'value',
|
|
1161
|
+
value,
|
|
1162
|
+
parentDetail,
|
|
1163
|
+
classDataIndex,
|
|
1164
|
+
code,
|
|
1165
|
+
);
|
|
1154
1166
|
};
|
|
1155
1167
|
|
|
1156
1168
|
return (
|
|
@@ -495,6 +495,56 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
|
|
|
495
495
|
this.setInitValue(datasource);
|
|
496
496
|
};
|
|
497
497
|
|
|
498
|
+
handleResetSetting = () => {
|
|
499
|
+
const { setShowColumns, datasource = [], setInitialTableInfo, appRequestConfig }: any = this.props;
|
|
500
|
+
let that = this;
|
|
501
|
+
let { bsTableCode } = this.state;
|
|
502
|
+
|
|
503
|
+
return new Promise((resolve: any, reject: any) => {
|
|
504
|
+
request({
|
|
505
|
+
url: handleRequestUrl('/user','/appConfig/saveUserOrder', appRequestConfig),
|
|
506
|
+
method: 'POST',
|
|
507
|
+
data: {
|
|
508
|
+
code: that.state.bsTableCode,
|
|
509
|
+
detail: '',
|
|
510
|
+
},
|
|
511
|
+
}).then((res:any) => {
|
|
512
|
+
if (judgeIsRequestSuccess(res?.data)) {
|
|
513
|
+
let config =
|
|
514
|
+
localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
|
|
515
|
+
let configArray = JSON.parse(config);
|
|
516
|
+
let currentSetting = configArray.filter(
|
|
517
|
+
(item) => item.code === bsTableCode,
|
|
518
|
+
);
|
|
519
|
+
if (currentSetting.length) {
|
|
520
|
+
currentSetting[0].detail = JSON.stringify([]);
|
|
521
|
+
} else {
|
|
522
|
+
configArray.push({
|
|
523
|
+
code: bsTableCode,
|
|
524
|
+
detail: JSON.stringify([]),
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
localStorage.setItem(
|
|
529
|
+
ENUM.BROWSER_CACHE.COLUMN_CONDITION,
|
|
530
|
+
JSON.stringify(configArray),
|
|
531
|
+
);
|
|
532
|
+
|
|
533
|
+
message.success('重置表头列成功!');
|
|
534
|
+
|
|
535
|
+
setInitialTableInfo(true);
|
|
536
|
+
this.setState({
|
|
537
|
+
visible: false,
|
|
538
|
+
});
|
|
539
|
+
} else {
|
|
540
|
+
message.error('重置表头列自定义失败,请稍后尝试');
|
|
541
|
+
reject('');
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
})
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
|
|
498
548
|
onSearch = (e: any) => {
|
|
499
549
|
this.setState({
|
|
500
550
|
searchDataSource: e.target.value,
|
|
@@ -532,15 +582,31 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
|
|
|
532
582
|
onOk={this.handleOk}
|
|
533
583
|
onCancel={this.handleCancel}
|
|
534
584
|
footer={[
|
|
535
|
-
<
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
585
|
+
<div>
|
|
586
|
+
<Button
|
|
587
|
+
key="back"
|
|
588
|
+
onClick={this.handleReset}
|
|
589
|
+
style={{ marginRight: 0 }}
|
|
590
|
+
>
|
|
591
|
+
恢复默认
|
|
592
|
+
</Button>
|
|
593
|
+
<Button key="back" onClick={this.handleResetSetting}>
|
|
594
|
+
重置设置
|
|
595
|
+
</Button>
|
|
596
|
+
<span style={{fontSize: '12px', color: '8A8F8D'}}>(列表字段变更会影响列设置功能,变更后请点击重置然后重新设置)</span>
|
|
597
|
+
</div>,
|
|
598
|
+
<div>
|
|
599
|
+
<Button
|
|
600
|
+
key="submit"
|
|
601
|
+
onClick={this.handleCancel}
|
|
602
|
+
style={{ marginRight: 0 }}
|
|
603
|
+
>
|
|
604
|
+
取消
|
|
605
|
+
</Button>
|
|
606
|
+
<Button key="submit" type="primary" onClick={this.handleOk}>
|
|
607
|
+
确认
|
|
608
|
+
</Button>
|
|
609
|
+
</div>,
|
|
544
610
|
]}
|
|
545
611
|
>
|
|
546
612
|
<div className={'sort_table'}>
|