@bit-sun/business-component 2.3.22 → 2.3.23-beta02
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/common/ENUM.d.ts +40 -0
- package/dist/components/Business/AddSelectBusiness/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +5 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +5 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/index.d.ts +18 -0
- package/dist/components/Business/BsLayouts/service.d.ts +1 -0
- package/dist/components/Business/BsLayouts/utils.d.ts +10 -0
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +60 -0
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +3 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +60 -0
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +99 -0
- package/dist/components/Business/CommodityEntry/index.d.ts +3 -0
- package/dist/components/Business/CommonAlert/index.d.ts +4 -0
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +6 -0
- package/dist/components/Business/DetailPageWrapper/index.d.ts +10 -0
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +8 -0
- package/dist/components/Business/HomePageWrapper/index.d.ts +4 -0
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +7 -0
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/function.d.ts +37 -0
- package/dist/components/Business/JsonQueryTable/index.d.ts +4 -0
- package/dist/components/Business/JsonQueryTable/static.d.ts +44 -0
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +5 -0
- package/dist/components/Business/SearchSelect/common.d.ts +25 -0
- package/dist/components/Business/SearchSelect/index.d.ts +3 -0
- package/dist/components/Business/SearchSelect/utils.d.ts +5 -0
- package/dist/components/Business/StateFlow/index.d.ts +4 -0
- package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +4 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +54 -0
- package/dist/components/Business/columnSettingTable/index.d.ts +16 -0
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +17 -0
- package/dist/components/Business/columnSettingTable/utils.d.ts +9 -0
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +3 -0
- package/dist/components/Business/moreTreeTable/hooks/useSticky.d.ts +8 -0
- package/dist/components/Business/moreTreeTable/index.d.ts +4 -0
- package/dist/components/Business/moreTreeTable/utils.d.ts +9 -0
- package/dist/components/Functional/AddSelect/helps.d.ts +14 -0
- package/dist/components/Functional/AddSelect/index.d.ts +4 -0
- package/dist/components/Functional/BillEntry/index.d.ts +4 -0
- package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +18 -0
- package/dist/components/Functional/BsAntdSula/index.d.ts +1 -0
- package/dist/components/Functional/DataImport/index.d.ts +144 -0
- package/dist/components/Functional/DataValidation/index.d.ts +144 -0
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +13 -0
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +6 -0
- package/dist/components/Functional/SearchSelect/index.d.ts +4 -0
- package/dist/components/Functional/SearchSelect/utils.d.ts +1 -0
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Solution/RuleComponent/Formula.d.ts +9 -0
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +12 -0
- package/dist/components/Solution/RuleComponent/services.d.ts +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.esm.js +31367 -0
- package/dist/index.js +31415 -0
- package/dist/plugin/TableColumnSetting/index.d.ts +64 -0
- package/dist/plugin/TableColumnSetting/utils.d.ts +1 -0
- package/dist/utils/CheckOneUser/index.d.ts +2 -0
- package/dist/utils/CustomLoginInfo.d.ts +11 -0
- package/dist/utils/LocalstorageUtils.d.ts +17 -0
- package/dist/utils/TableUtils.d.ts +11 -0
- package/dist/utils/checkUtils.d.ts +3 -0
- package/dist/utils/enumConfig.d.ts +12 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/requestUtils.d.ts +29 -0
- package/dist/utils/utils.d.ts +17 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +4 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +3 -0
- package/package.json +3 -2
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -2
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +9 -7
- package/src/components/Business/BsSulaQueryTable/index.tsx +11 -8
- package/src/components/Business/BsSulaQueryTable/setting.tsx +7 -5
- package/src/components/Business/JsonQueryTable/components/Formula.tsx +3 -2
- package/src/components/Business/JsonQueryTable/index.tsx +8 -6
- package/src/components/Business/JsonQueryTable/static.ts +60 -0
- package/src/components/Business/SearchSelect/BusinessUtils.ts +74 -0
- package/src/components/Business/SearchSelect/index.md +58 -0
- package/src/components/Business/SearchSelect/utils.ts +3 -2
- package/src/components/Business/TreeSearchSelect/index.md +29 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +29 -0
- package/src/components/Business/columnSettingTable/columnSetting.tsx +5 -4
- package/src/components/Business/columnSettingTable/index.tsx +3 -2
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +3 -2
- package/src/components/Functional/AddSelect/helps.ts +2 -1
- package/src/components/Functional/AddSelect/index.tsx +3 -2
- package/src/components/Functional/BillEntry/index.tsx +3 -2
- package/src/components/Functional/DataImport/index.tsx +2 -1
- package/src/components/Functional/DataValidation/index.tsx +2 -1
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +2 -1
- package/src/components/Functional/SearchSelect/index.tsx +18 -12
- package/src/components/Functional/TreeSearchSelect/index.tsx +7 -5
- package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
- package/src/components/Solution/RuleComponent/index.js +59 -18
- package/src/components/Solution/RuleComponent/ruleFiled.js +202 -28
- package/src/components/Solution/RuleComponent/util.js +4 -0
- package/src/plugin/TableColumnSetting/index.tsx +4 -3
- package/src/utils/CustomLoginInfo.ts +55 -0
- package/src/utils/requestUtils.ts +139 -7
- package/src/utils/utils.ts +0 -21
|
@@ -1758,5 +1758,79 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
1760
|
|
|
1761
|
+
// 角色选择器
|
|
1762
|
+
if(type === 'role') {
|
|
1763
|
+
requestConfig = {
|
|
1764
|
+
url: `${prefixUrl.selectPrefix}/role`,
|
|
1765
|
+
filter: 'qp-name,code-orGroup,like', // 过滤参数
|
|
1766
|
+
mappingTextField: 'name',
|
|
1767
|
+
mappingTextShowKeyField: 'code',
|
|
1768
|
+
mappingValueField: 'code',
|
|
1769
|
+
otherParams: {
|
|
1770
|
+
'qp-status-eq': 10, // 10启用 20禁用
|
|
1771
|
+
sorter: 'desc-id',
|
|
1772
|
+
}, // 默认参数
|
|
1773
|
+
sourceName: 'roleCode',
|
|
1774
|
+
...requestConfigProp
|
|
1775
|
+
}
|
|
1776
|
+
tableSearchForm = [
|
|
1777
|
+
{ name: 'qp-name-like', label: '角色名称' },
|
|
1778
|
+
{ name: 'qp-code-like', label: '角色编码' },
|
|
1779
|
+
{ name: 'qp-categoryCode-eq', type: 'select', label: '角色分类', field: {
|
|
1780
|
+
type: 'select',
|
|
1781
|
+
props: {
|
|
1782
|
+
notFoundContent: '暂无数据',
|
|
1783
|
+
allowClear: true,
|
|
1784
|
+
showSearch: true,
|
|
1785
|
+
showArrow: true,
|
|
1786
|
+
maxTagCount: 1,
|
|
1787
|
+
optionFilterProp: 'children',
|
|
1788
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
1789
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
1790
|
+
},
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
]
|
|
1794
|
+
Promise.all([
|
|
1795
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/permissionCategory`, {
|
|
1796
|
+
pageSize: 5000,
|
|
1797
|
+
currentPage: 1,
|
|
1798
|
+
}),
|
|
1799
|
+
]).then((x: any)=>{
|
|
1800
|
+
formatSource(x,0, 2, tableSearchForm);
|
|
1801
|
+
})
|
|
1802
|
+
modalTableProps = {
|
|
1803
|
+
modalTableTitle: '选择角色',
|
|
1804
|
+
tableSearchForm,
|
|
1805
|
+
tableColumns: [
|
|
1806
|
+
{
|
|
1807
|
+
title: '角色编码',
|
|
1808
|
+
dataIndex: 'code',
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
title: '角色名称',
|
|
1812
|
+
dataIndex: 'name',
|
|
1813
|
+
render: (text: any) => handleTextOverflow(text),
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
title: '角色分类',
|
|
1817
|
+
dataIndex: 'categoryName',
|
|
1818
|
+
render: (text: any) => handleTextOverflow(text),
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
dataIndex: 'remark',
|
|
1822
|
+
title: '角色描述',
|
|
1823
|
+
render: (text: any) => handleTextOverflow(text),
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
dataIndex: 'applicationName',
|
|
1827
|
+
title: '应用',
|
|
1828
|
+
render: (text: any) => handleTextOverflow(text),
|
|
1829
|
+
},
|
|
1830
|
+
],
|
|
1831
|
+
...modalTableBusProps
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1761
1835
|
return { modalTableProps, requestConfig, needModalTable };
|
|
1762
1836
|
}
|
|
@@ -1157,6 +1157,7 @@ export default () => {
|
|
|
1157
1157
|
const props2 = {
|
|
1158
1158
|
...props,
|
|
1159
1159
|
// prefixUrl: { selectPrefix: '/user/api', formSelectFix: '/user/api' },
|
|
1160
|
+
// prefixUrl: { selectPrefix: '/api/user-manage/', formSelectFix: '/api/user-manage/' },
|
|
1160
1161
|
modalTableProps: {
|
|
1161
1162
|
needTypeSearch: true
|
|
1162
1163
|
},
|
|
@@ -1326,4 +1327,61 @@ export default () => {
|
|
|
1326
1327
|
};
|
|
1327
1328
|
```
|
|
1328
1329
|
|
|
1330
|
+
# 角色选择器 Select-ROLE-001
|
|
1331
|
+
|
|
1332
|
+
```tsx
|
|
1333
|
+
import React, { useState } from 'react';
|
|
1334
|
+
import { Tabs } from 'antd';
|
|
1335
|
+
import {BusinessSearchSelect} from '../../../index.ts';
|
|
1336
|
+
|
|
1337
|
+
const { TabPane } = Tabs;
|
|
1338
|
+
|
|
1339
|
+
export default () => {
|
|
1340
|
+
const selectProps = {
|
|
1341
|
+
// mode: 'multiple',
|
|
1342
|
+
// maxTagCount: 1,
|
|
1343
|
+
// disabled: true
|
|
1344
|
+
}
|
|
1345
|
+
const selectPropsMultiple = {
|
|
1346
|
+
mode: 'multiple',
|
|
1347
|
+
maxTagCount: 1,
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
const [ tabKey, setTabKey ] = useState('single')
|
|
1351
|
+
const [value, setValue] = useState(selectProps?.mode ? [] : null);
|
|
1352
|
+
|
|
1353
|
+
const props = {
|
|
1354
|
+
value,
|
|
1355
|
+
onChange: (value: any) => {
|
|
1356
|
+
console.log(value)
|
|
1357
|
+
setValue(value)
|
|
1358
|
+
},
|
|
1359
|
+
selectProps,
|
|
1360
|
+
selectBusinessType: 'role',
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
const onTabChange = (key) => {
|
|
1364
|
+
setTabKey(key)
|
|
1365
|
+
setValue(key === 'single' ? null: [])
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
return (
|
|
1369
|
+
<div>
|
|
1370
|
+
<Tabs onChange={onTabChange} activeKey={tabKey}>
|
|
1371
|
+
<TabPane tab='单选' key='single'>
|
|
1372
|
+
{tabKey === 'single' && (
|
|
1373
|
+
<BusinessSearchSelect {...props} />
|
|
1374
|
+
)}
|
|
1375
|
+
</TabPane>
|
|
1376
|
+
<TabPane tab='多选' key='multiple'>
|
|
1377
|
+
{tabKey === 'multiple' && (
|
|
1378
|
+
<BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
|
|
1379
|
+
)}
|
|
1380
|
+
</TabPane>
|
|
1381
|
+
</Tabs>
|
|
1382
|
+
</div>
|
|
1383
|
+
);
|
|
1384
|
+
};
|
|
1385
|
+
```
|
|
1386
|
+
|
|
1329
1387
|
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -2,6 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import { message } from 'antd';
|
|
3
3
|
import { stringify } from 'querystring';
|
|
4
4
|
import ENUM from '@/utils/enumConfig';
|
|
5
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
5
6
|
|
|
6
7
|
const getDicData = (dicCode: string) => {
|
|
7
8
|
let dicData = {};
|
|
@@ -60,7 +61,7 @@ const loadSelectSource = (url: string, params?: any) => {
|
|
|
60
61
|
.get(`${url}?${stringify(params)}`)
|
|
61
62
|
.then((result: any) => {
|
|
62
63
|
result = result.data;
|
|
63
|
-
if ((result
|
|
64
|
+
if (judgeIsRequestError(result)) {
|
|
64
65
|
message.error(result.msg);
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
@@ -84,7 +85,7 @@ const handleDefaultPrefixUrl = (type: string) => {
|
|
|
84
85
|
case 'physicalWarehouse': case 'realWarehouse': case 'virtualWarehouse': case 'channelWarehouse': case 'ownerWarehouse':
|
|
85
86
|
result = '/stock';
|
|
86
87
|
break;
|
|
87
|
-
case 'inventoryOrg2': case 'purchaseOrg': case 'salesOrg': case 'employee2':
|
|
88
|
+
case 'inventoryOrg2': case 'purchaseOrg': case 'salesOrg': case 'employee2': case 'role':
|
|
88
89
|
result = '/user';
|
|
89
90
|
break;
|
|
90
91
|
case 'deliveryMode': case 'ruleTemplate':
|
|
@@ -126,6 +126,35 @@ export default () => {
|
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
|
|
129
|
+
结算组织选择器:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import React, { useState } from 'react';
|
|
133
|
+
import { BusinessTreeSearchSelect } from '../../../index';
|
|
134
|
+
|
|
135
|
+
export default () => {
|
|
136
|
+
|
|
137
|
+
const [value, setValue] = useState();
|
|
138
|
+
|
|
139
|
+
const props = {
|
|
140
|
+
mode: 'create',
|
|
141
|
+
value,
|
|
142
|
+
isChoose: false, // 控制是否父节点可选中,默认不可选中
|
|
143
|
+
onChange: (v) => {
|
|
144
|
+
setValue(v)
|
|
145
|
+
},
|
|
146
|
+
businessType: 'settle-organization'
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<div>
|
|
151
|
+
<BusinessTreeSearchSelect {...props} />
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
|
|
129
158
|
营销区域选择器:
|
|
130
159
|
|
|
131
160
|
```tsx
|
|
@@ -10,6 +10,7 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
10
10
|
headers: otherRequestConfig?.extralHeaders,
|
|
11
11
|
initialParams: { 'orgViewCode': 'administrative-organization-view' },
|
|
12
12
|
resKeyValue: ['code', 'name'],
|
|
13
|
+
...otherRequestConfig,
|
|
13
14
|
},
|
|
14
15
|
};
|
|
15
16
|
break;
|
|
@@ -21,6 +22,7 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
21
22
|
headers: otherRequestConfig?.extralHeaders,
|
|
22
23
|
initialParams: { 'orgViewCode': 'sales-organizational-view', 'qp-status-eq': 10 }, // status: 10启用 20禁用
|
|
23
24
|
resKeyValue: ['code', 'name'],
|
|
25
|
+
...otherRequestConfig,
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
break;
|
|
@@ -32,6 +34,7 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
32
34
|
headers: otherRequestConfig?.extralHeaders,
|
|
33
35
|
initialParams: { 'orgViewCode': 'purchase-organizational-view', 'qp-status-eq': 10 },
|
|
34
36
|
resKeyValue: ['code', 'name'],
|
|
37
|
+
...otherRequestConfig,
|
|
35
38
|
},
|
|
36
39
|
};
|
|
37
40
|
break;
|
|
@@ -43,6 +46,19 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
43
46
|
headers: otherRequestConfig?.extralHeaders,
|
|
44
47
|
initialParams: { 'orgViewCode': 'stock-organizational-view', 'qp-status-eq': 10 },
|
|
45
48
|
resKeyValue: ['code', 'name'],
|
|
49
|
+
...otherRequestConfig,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
break;
|
|
53
|
+
case 'settle-organization':
|
|
54
|
+
result = {
|
|
55
|
+
isChoose: true,
|
|
56
|
+
remoteSource: {
|
|
57
|
+
url: `/user/orgViewNode/common/getTreeForOrgViewAndTenant`,
|
|
58
|
+
headers: otherRequestConfig?.extralHeaders,
|
|
59
|
+
initialParams: { 'orgViewCode': 'settlement-organizational-view', 'qp-status-eq': 10 },
|
|
60
|
+
resKeyValue: ['code', 'name'],
|
|
61
|
+
...otherRequestConfig,
|
|
46
62
|
},
|
|
47
63
|
};
|
|
48
64
|
break;
|
|
@@ -53,6 +69,18 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
53
69
|
url: `/channel-manage/tagNode/getTree/10`,
|
|
54
70
|
headers: otherRequestConfig?.extralHeaders,
|
|
55
71
|
resKeyValue: ['code', 'name'],
|
|
72
|
+
...otherRequestConfig,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
break;
|
|
76
|
+
case 'market-channel':
|
|
77
|
+
result = {
|
|
78
|
+
isChoose: true,
|
|
79
|
+
remoteSource: {
|
|
80
|
+
url: `/channel-manage/channelInfo/tree`,
|
|
81
|
+
headers: otherRequestConfig?.extralHeaders,
|
|
82
|
+
resKeyValue: ['code', 'name'],
|
|
83
|
+
...otherRequestConfig,
|
|
56
84
|
},
|
|
57
85
|
};
|
|
58
86
|
break;
|
|
@@ -65,6 +93,7 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
|
|
|
65
93
|
headers: otherRequestConfig?.extralHeaders,
|
|
66
94
|
initialParams: { 'orgViewCode': 'administrative-organization-view' },
|
|
67
95
|
resKeyValue: ['code', 'name'],
|
|
96
|
+
...otherRequestConfig,
|
|
68
97
|
},
|
|
69
98
|
};
|
|
70
99
|
break
|
|
@@ -19,6 +19,7 @@ import axios from 'axios';
|
|
|
19
19
|
// import { request } from 'umi';
|
|
20
20
|
import './index.less';
|
|
21
21
|
import ENUM from '@/utils/enumConfig';
|
|
22
|
+
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
22
23
|
|
|
23
24
|
interface SortTableProps {
|
|
24
25
|
[propName: string]: any;
|
|
@@ -66,7 +67,7 @@ class SortableTable extends React.Component<SortTableProps> {
|
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
patchUserColumnConfig = (config: any) => {
|
|
69
|
-
const { tableCode }: any = this.props;
|
|
70
|
+
const { tableCode, appRequestConfig }: any = this.props;
|
|
70
71
|
if (!tableCode) return;
|
|
71
72
|
let configvalue = config.map((item:any) => ({
|
|
72
73
|
key: item.key,
|
|
@@ -77,14 +78,14 @@ class SortableTable extends React.Component<SortTableProps> {
|
|
|
77
78
|
}))
|
|
78
79
|
|
|
79
80
|
axios({
|
|
80
|
-
url: '/user/appConfig/saveUserOrder',
|
|
81
|
+
url: handleRequestUrl('/user','/appConfig/saveUserOrder',appRequestConfig),
|
|
81
82
|
method:'POST',
|
|
82
83
|
data: {
|
|
83
84
|
"code": tableCode,
|
|
84
85
|
"detail": JSON.stringify(configvalue)
|
|
85
86
|
},
|
|
86
87
|
}).then((res:any) => {
|
|
87
|
-
if (res?.data
|
|
88
|
+
if (judgeIsRequestSuccess(res?.data)) {
|
|
88
89
|
this.patchConfigToLocalstorage(configvalue, tableCode)
|
|
89
90
|
} else {
|
|
90
91
|
message.error('保存表头列自定义失败,请稍后尝试');
|
|
@@ -762,4 +763,4 @@ class SortableTable extends React.Component<SortTableProps> {
|
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
765
|
|
|
765
|
-
export default SortableTable;
|
|
766
|
+
export default SortableTable;
|
|
@@ -154,7 +154,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
render() {
|
|
157
|
-
const { columns, tableCode, summary = undefined, dynamicColumns = [], scroll={}, ...restProps }: any = this.props;
|
|
157
|
+
const { columns, tableCode, appRequestConfig, summary = undefined, dynamicColumns = [], scroll={}, ...restProps }: any = this.props;
|
|
158
158
|
let otherTableInfo = {
|
|
159
159
|
...restProps,
|
|
160
160
|
};
|
|
@@ -212,6 +212,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
212
212
|
showColumns={this.state.showColumns}
|
|
213
213
|
datasource={columns || []}
|
|
214
214
|
tableCode={tableCode}
|
|
215
|
+
appRequestConfig={appRequestConfig}
|
|
215
216
|
/>
|
|
216
217
|
</span>
|
|
217
218
|
</div>
|
|
@@ -230,4 +231,4 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
230
231
|
)
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
}
|
|
234
|
+
}
|
|
@@ -160,7 +160,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
render() {
|
|
163
|
-
const { style=null, columns, tableCode, summary = undefined, dynamicColumns = [], scroll={}, ...restProps }: any = this.props;
|
|
163
|
+
const { style=null, columns, tableCode, appRequestConfig, summary = undefined, dynamicColumns = [], scroll={}, ...restProps }: any = this.props;
|
|
164
164
|
let otherTableInfo = {
|
|
165
165
|
...restProps,
|
|
166
166
|
};
|
|
@@ -218,6 +218,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
218
218
|
showColumns={this.state.showColumns}
|
|
219
219
|
datasource={columns || []}
|
|
220
220
|
tableCode={tableCode}
|
|
221
|
+
appRequestConfig={appRequestConfig}
|
|
221
222
|
/>
|
|
222
223
|
</span>
|
|
223
224
|
</div>
|
|
@@ -238,4 +239,4 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
238
239
|
)
|
|
239
240
|
}
|
|
240
241
|
|
|
241
|
-
}
|
|
242
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { stringify } from 'querystring';
|
|
3
3
|
import { message } from 'antd';
|
|
4
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
4
5
|
|
|
5
6
|
// 下拉框数据源
|
|
6
7
|
// 情况①:每条记录下拉框数据不同----查询接口每条记录返回字段,前后端约定好,用dataSourceCode记录
|
|
@@ -23,7 +24,7 @@ export const loadSelectSource = (url: string, params?: any) => {
|
|
|
23
24
|
.get(`${url}?${stringify(params)}`)
|
|
24
25
|
.then((result: any) => {
|
|
25
26
|
result = result.data;
|
|
26
|
-
if ((result
|
|
27
|
+
if (judgeIsRequestError(result)) {
|
|
27
28
|
message.error(result.msg);
|
|
28
29
|
resolve(result);
|
|
29
30
|
return;
|
|
@@ -13,6 +13,7 @@ import { checkQuantityAccuracy, precisionQuantity } from '@/utils/checkUtils';
|
|
|
13
13
|
import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
14
14
|
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
15
15
|
import { handleAntdColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
16
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
16
17
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
17
18
|
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
18
19
|
import { getSelectDataList, loadSelectSource, formatFormSourceList } from './helps';
|
|
@@ -22,7 +23,7 @@ const checkSpuMatchCode = (data: any) => {
|
|
|
22
23
|
axios.post(`/stock/rwFrontRecordSkcDetail/checkSpuMatchCode`,data)
|
|
23
24
|
.then((result: any) => {
|
|
24
25
|
result = result.data;
|
|
25
|
-
if ((result
|
|
26
|
+
if (judgeIsRequestError(result)) {
|
|
26
27
|
message.error(result.msg);
|
|
27
28
|
reject(false);
|
|
28
29
|
return;
|
|
@@ -517,7 +518,7 @@ const AddSelect = (props: any) => {
|
|
|
517
518
|
.then((result: any) => {
|
|
518
519
|
setFetching(false)
|
|
519
520
|
result = result.data;
|
|
520
|
-
if ((result
|
|
521
|
+
if (judgeIsRequestError(result)) {
|
|
521
522
|
message.error(result.msg);
|
|
522
523
|
return;
|
|
523
524
|
}
|
|
@@ -13,6 +13,7 @@ import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
|
13
13
|
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
14
14
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
15
15
|
import { handleAntdColumnsSpecialParams } from '@/utils/utils';
|
|
16
|
+
import { judgeIsRequestSuccess, judgeIsRequestError } from '@/utils/requestUtils';
|
|
16
17
|
|
|
17
18
|
const InputElement = ({
|
|
18
19
|
record, text, currentIndex, inputLength, index, setData, data, item, callSelectItem
|
|
@@ -30,7 +31,7 @@ const InputElement = ({
|
|
|
30
31
|
.get(`/items/sku/pager/v2?${stringify({ 'skuCodeAndSkuName': name, 'pageSize': 100, 'qp-combination-eq': false, 'qp-approveStatus-eq': 1, 'qp-status-eq': 1 })}`)
|
|
31
32
|
.then(({ data, status }: any) => {
|
|
32
33
|
if (status === 200) {
|
|
33
|
-
if (data
|
|
34
|
+
if (judgeIsRequestSuccess(data)) {
|
|
34
35
|
const resultData = data.data.items.map((item: any, index: any) => ({
|
|
35
36
|
...item,
|
|
36
37
|
index
|
|
@@ -632,7 +633,7 @@ const BillEntry: React.FC = ({ onSaveCallback, validDataUrl="/items/sku/import/c
|
|
|
632
633
|
})
|
|
633
634
|
.then((result) => {
|
|
634
635
|
result = result.data;
|
|
635
|
-
if (result
|
|
636
|
+
if (judgeIsRequestError(result)) {
|
|
636
637
|
message.error(result.msg);
|
|
637
638
|
return { flag: false }
|
|
638
639
|
} else {
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
import axios from 'axios';
|
|
29
29
|
import './index.less';
|
|
30
30
|
import _ from "lodash"
|
|
31
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
31
32
|
|
|
32
33
|
// const luckysheet = window.luckysheet;
|
|
33
34
|
|
|
@@ -435,7 +436,7 @@ class DataImport extends React.Component {
|
|
|
435
436
|
})
|
|
436
437
|
.then((result) => {
|
|
437
438
|
result = result.data;
|
|
438
|
-
if (result
|
|
439
|
+
if (judgeIsRequestError(result)) {
|
|
439
440
|
message.error(result.msg);
|
|
440
441
|
return;
|
|
441
442
|
}
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
import axios from 'axios';
|
|
29
29
|
import './index.less';
|
|
30
30
|
import _ from "lodash"
|
|
31
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
31
32
|
|
|
32
33
|
// const luckysheet = window.luckysheet;
|
|
33
34
|
|
|
@@ -427,7 +428,7 @@ class DataValidation extends React.Component {
|
|
|
427
428
|
})
|
|
428
429
|
.then((result) => {
|
|
429
430
|
result = result.data;
|
|
430
|
-
if (result
|
|
431
|
+
if (judgeIsRequestError(result)) {
|
|
431
432
|
message.error(result.msg);
|
|
432
433
|
return;
|
|
433
434
|
}
|
|
@@ -4,6 +4,7 @@ import {message, Popconfirm, Tooltip} from "antd";
|
|
|
4
4
|
import axios from 'axios'
|
|
5
5
|
import exportlogo from '../../../../assets/exportlogo.png'
|
|
6
6
|
import {omit} from 'lodash'
|
|
7
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
7
8
|
interface exportIconType{
|
|
8
9
|
/** others选填,使用axios发请求,*/
|
|
9
10
|
request:{
|
|
@@ -44,7 +45,7 @@ const ExportIcon = ({request, tableRef}: exportIconType) => {
|
|
|
44
45
|
})
|
|
45
46
|
.then((result: any) => {
|
|
46
47
|
result = result.data;
|
|
47
|
-
if (result
|
|
48
|
+
if (judgeIsRequestError(result)) {
|
|
48
49
|
message.error(result?.msg);
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
@@ -9,6 +9,7 @@ import _ from "lodash"
|
|
|
9
9
|
import './index.less';
|
|
10
10
|
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
11
|
import { handleSourceName } from './utils';
|
|
12
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
12
13
|
|
|
13
14
|
const { Option } = Select;
|
|
14
15
|
|
|
@@ -41,6 +42,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
41
42
|
init = true,// 是否初始请求
|
|
42
43
|
extralHeaders = {},// 额外请求头参数
|
|
43
44
|
specialBracket = false,// 是否使用特殊括弧显示选项 【value】text
|
|
45
|
+
noNeedSplit = false,// label显示不需要任何特殊化
|
|
44
46
|
} = requestConfig || {};
|
|
45
47
|
const resultSourceKey = handleSourceName(sourceName || requestConfig?.sourceName || 'supplierCode')
|
|
46
48
|
|
|
@@ -282,7 +284,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
282
284
|
.then((result: any) => {
|
|
283
285
|
setFetching(false)
|
|
284
286
|
result = result.data;
|
|
285
|
-
if ((result
|
|
287
|
+
if (judgeIsRequestError(result)) {
|
|
286
288
|
message.error(result.msg);
|
|
287
289
|
return;
|
|
288
290
|
}
|
|
@@ -313,8 +315,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
313
315
|
}
|
|
314
316
|
return {
|
|
315
317
|
...item,
|
|
316
|
-
text: specialBracket
|
|
317
|
-
? `【${item[mappingValueField]}】${item[mappingTextField]}`
|
|
318
|
+
text: specialBracket
|
|
319
|
+
? `【${item[mappingValueField]}】${item[mappingTextField]}`
|
|
318
320
|
: item[mappingTextField],
|
|
319
321
|
textShowText,
|
|
320
322
|
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
@@ -336,8 +338,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
336
338
|
}
|
|
337
339
|
return {
|
|
338
340
|
...item,
|
|
339
|
-
text: specialBracket
|
|
340
|
-
? `【${item[mappingValueField]}】${item[mappingTextField]}`
|
|
341
|
+
text: specialBracket
|
|
342
|
+
? `【${item[mappingValueField]}】${item[mappingTextField]}`
|
|
341
343
|
: item[mappingTextField],
|
|
342
344
|
textShowText,
|
|
343
345
|
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
@@ -735,12 +737,16 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
735
737
|
)
|
|
736
738
|
}
|
|
737
739
|
|
|
738
|
-
const handleSelectOptionsShowValue = (specialBracket: boolean, item: object) => {
|
|
740
|
+
const handleSelectOptionsShowValue = (specialBracket: boolean, noNeedSplit: boolean, item: object) => {
|
|
739
741
|
let showText = Array.isArray(item.textShowText) &&
|
|
740
742
|
item.textShowText.join(' ') || item.textShowText;
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
743
|
+
if (noNeedSplit) {
|
|
744
|
+
return item.text;
|
|
745
|
+
} else {
|
|
746
|
+
return specialBracket
|
|
747
|
+
? `【${item.textShowKey}】${showText}`
|
|
748
|
+
: `${item.textShowKey} ${showText}`
|
|
749
|
+
}
|
|
744
750
|
};
|
|
745
751
|
|
|
746
752
|
return (
|
|
@@ -792,9 +798,9 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
792
798
|
>
|
|
793
799
|
{items.map(item => (
|
|
794
800
|
<Option key={item.value} label={item.text}>
|
|
795
|
-
{LightHeightOption({
|
|
796
|
-
text: handleSelectOptionsShowValue(specialBracket, item),
|
|
797
|
-
filterTxt: searchValue
|
|
801
|
+
{LightHeightOption({
|
|
802
|
+
text: handleSelectOptionsShowValue(specialBracket, noNeedSplit, item),
|
|
803
|
+
filterTxt: searchValue
|
|
798
804
|
})}
|
|
799
805
|
</Option>
|
|
800
806
|
))}
|
|
@@ -3,6 +3,7 @@ import { TreeSelect, Tooltip, Tag } from 'antd';
|
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { stringify } from 'querystring';
|
|
5
5
|
import _ from "lodash"
|
|
6
|
+
import { judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
6
7
|
|
|
7
8
|
const TreeSearchSelect = (props: any) => {
|
|
8
9
|
const [treeData, setTreeData] = useState([]);
|
|
@@ -39,10 +40,11 @@ const TreeSearchSelect = (props: any) => {
|
|
|
39
40
|
paramsKey = 'qp-name-like',
|
|
40
41
|
resKeyValue = ['id', 'name'],
|
|
41
42
|
initialParams = {},
|
|
43
|
+
treeChildrenRoom = 'children',// 树状结构的子集容器 默认为 'children'
|
|
42
44
|
} = remoteSource;
|
|
43
45
|
|
|
44
46
|
const mapSearchTree = (treeDataItem: any) => {
|
|
45
|
-
const haveChildren = Array.isArray(treeDataItem
|
|
47
|
+
const haveChildren = Array.isArray(treeDataItem[treeChildrenRoom]) && treeDataItem[treeChildrenRoom].length > 0; // 盘算是否为父节点
|
|
46
48
|
const isRoot = treeDataItem?.id == '0'; // 判断是否为根节点
|
|
47
49
|
return {
|
|
48
50
|
title: treeDataItem[resKeyValue[1]],
|
|
@@ -52,7 +54,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
52
54
|
data: { ...treeDataItem },
|
|
53
55
|
isLeaf: !haveChildren,
|
|
54
56
|
disabled: isDisabled(haveChildren,isRoot),
|
|
55
|
-
children: haveChildren ? treeDataItem.
|
|
57
|
+
children: haveChildren ? treeDataItem[treeChildrenRoom].map((i: any) => mapSearchTree(i)) : [],
|
|
56
58
|
};
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -76,7 +78,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
76
78
|
const resData = res?.data || [];
|
|
77
79
|
let coverData;
|
|
78
80
|
|
|
79
|
-
if(resData
|
|
81
|
+
if(judgeIsRequestSuccess(resData)) {
|
|
80
82
|
const { data } = resData;
|
|
81
83
|
if (remoteSource.converter) {
|
|
82
84
|
coverData = await remoteSource.converter({ data: [data] })
|
|
@@ -105,8 +107,8 @@ const TreeSearchSelect = (props: any) => {
|
|
|
105
107
|
const parallelData = (data: any,result: any) => {
|
|
106
108
|
data.forEach((i: any) => {
|
|
107
109
|
result.push(i);
|
|
108
|
-
if (i
|
|
109
|
-
parallelData(i
|
|
110
|
+
if (i[treeChildrenRoom]) {
|
|
111
|
+
parallelData(i[treeChildrenRoom], result);
|
|
110
112
|
}
|
|
111
113
|
});
|
|
112
114
|
return result;
|