@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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface TableColumnSettingProps {
|
|
4
|
+
/** tableCode必填,做用户存储关键key,*/
|
|
5
|
+
tableCode: string;
|
|
6
|
+
/** datasource必填,为要操作的表头(即原始表头),*/
|
|
7
|
+
datasource: any;
|
|
8
|
+
/** showColumns必填,为当前用户设置的表头,*/
|
|
9
|
+
showColumns: any;
|
|
10
|
+
/** setShowColumns必填,设置当前表头的方法,*/
|
|
11
|
+
setShowColumns: void;
|
|
12
|
+
/** settingImgAttribute非必填,设置当前设置img样式,*/
|
|
13
|
+
settingImgAttribute: {
|
|
14
|
+
[propName: string]: any;
|
|
15
|
+
};
|
|
16
|
+
[propName: string]: any;
|
|
17
|
+
}
|
|
18
|
+
declare class TableColumnSetting extends React.Component<TableColumnSettingProps> {
|
|
19
|
+
state: {
|
|
20
|
+
dataSource: never[];
|
|
21
|
+
columns: never[];
|
|
22
|
+
selectedRowKeys: never[];
|
|
23
|
+
sortDataSource: never[];
|
|
24
|
+
setVisible: boolean;
|
|
25
|
+
searchDataSource: boolean;
|
|
26
|
+
onSearchSort: boolean;
|
|
27
|
+
};
|
|
28
|
+
patchUserColumnConfig: (config: any) => void;
|
|
29
|
+
setInitValue: (datasource: any[]) => void;
|
|
30
|
+
componentWillReceiveProps(nextProps: any): void;
|
|
31
|
+
componentDidMount(): void;
|
|
32
|
+
columns: ({
|
|
33
|
+
title: string;
|
|
34
|
+
dataIndex: string;
|
|
35
|
+
className: string;
|
|
36
|
+
width: number;
|
|
37
|
+
render?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
title: string;
|
|
40
|
+
dataIndex: string;
|
|
41
|
+
render: (text: any, record: any) => React.JSX.Element;
|
|
42
|
+
className?: undefined;
|
|
43
|
+
width?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
title: string;
|
|
46
|
+
dataIndex: string;
|
|
47
|
+
className: string;
|
|
48
|
+
render: () => React.JSX.Element;
|
|
49
|
+
width?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
showModal: () => void;
|
|
52
|
+
handleOk: (e?: React.MouseEvent<HTMLElement>) => void;
|
|
53
|
+
handleCancel: (e: React.MouseEvent<HTMLElement>) => void;
|
|
54
|
+
handleTableHeadHidden: (title: string) => void;
|
|
55
|
+
onSortEnd: ({ oldIndex, newIndex }: any) => void;
|
|
56
|
+
DraggableContainer: (props: any) => React.JSX.Element;
|
|
57
|
+
DraggableBodyRow: ({ className, style, ...restProps }: any) => React.JSX.Element;
|
|
58
|
+
onChange: (e: any, title: any) => void;
|
|
59
|
+
handleReset: () => void;
|
|
60
|
+
onSearch: (e: any) => void;
|
|
61
|
+
onSearchSort: (e: any) => void;
|
|
62
|
+
render(): React.JSX.Element;
|
|
63
|
+
}
|
|
64
|
+
export default TableColumnSetting;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setInitialShowColumn: (tableCode: string, columns: any[], callback: any) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function getEekaSessionId(): any;
|
|
2
|
+
export declare function getEekaAccountId(): any;
|
|
3
|
+
export declare function getEekaEmployeeId(): any;
|
|
4
|
+
export declare function getEekaTenantId(): any;
|
|
5
|
+
export declare function getEekaToken(): any;
|
|
6
|
+
export declare function getLoginHeaderInfo(headerkey: string, storage?: string): string | null | undefined;
|
|
7
|
+
export declare function getGuoyaoshukeCompanyId(): string | null | undefined;
|
|
8
|
+
export declare function getGuoyaoshukeTenantCode(): string | null | undefined;
|
|
9
|
+
export declare function getGuoyaoshukeTenantId(): string | 1;
|
|
10
|
+
export declare function getGuoyaoshukeToken(): string | null | undefined;
|
|
11
|
+
export declare function getGuoyaoshukeUscCode(): string | null | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const setConfigTableColumns: (configvalue: any, tableCode: string) => void;
|
|
2
|
+
export declare const getConfigTableColumns: (tableCode: string) => any;
|
|
3
|
+
export declare const saveTenantList: (data: any) => void;
|
|
4
|
+
export declare const getTenantList: () => any;
|
|
5
|
+
export declare const removeTenantList: () => void;
|
|
6
|
+
export declare const saveCurrentTenantId: (item: string) => void;
|
|
7
|
+
export declare const getCurrentTenantId: () => string | 1;
|
|
8
|
+
export declare const removeCurrentTenantId: () => void;
|
|
9
|
+
export declare function getEmployeeId(): any;
|
|
10
|
+
export declare function getEmployeeCode(): any;
|
|
11
|
+
export declare function getSessionId(): any;
|
|
12
|
+
export declare function getAccountId(): any;
|
|
13
|
+
export declare function getUserId(): any;
|
|
14
|
+
export declare function getAccountID(): any;
|
|
15
|
+
export declare function getUserName(): any;
|
|
16
|
+
export declare function handleUserPhone(): any;
|
|
17
|
+
export declare function getCurrentTargetBgId(): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
BROWSER_CACHE: {
|
|
3
|
+
COLUMN_CONDITION: string;
|
|
4
|
+
MAIN_AUTH_CODES: string;
|
|
5
|
+
LIMIT_MENU_DATA: string;
|
|
6
|
+
USER_INFO: string;
|
|
7
|
+
DICT_CODES: string;
|
|
8
|
+
CHILD_APP_BACK: string;
|
|
9
|
+
SEARCH_FIELDS_CONDITION: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare function handleRequestAuthHeader(config?: any): void;
|
|
2
|
+
/**
|
|
3
|
+
* 处理请求路径前缀/请求路径等使用不一的问题
|
|
4
|
+
* @param {*} defaultUrl 默认请求路径
|
|
5
|
+
* @param {*} defaultPreFix 默认请求路径的前缀
|
|
6
|
+
* @param {*} config 更改请求前缀/路径集合
|
|
7
|
+
* 示例:
|
|
8
|
+
* appRequestConfig: {
|
|
9
|
+
* '/appConfig/saveUserOrder': ['/api/user-manage'],
|
|
10
|
+
* '/appConfig/saveQueryCriteria': ['/api/user-manage']
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export declare const handleRequestUrl: (defaultPreFix: string, defaultUrl: string, config: any) => string;
|
|
14
|
+
/**
|
|
15
|
+
* 处理错误请求
|
|
16
|
+
* @param {*} response 返回结果
|
|
17
|
+
* @param {*} needBackError 是否需要将错误回传到页面单独处理
|
|
18
|
+
*/
|
|
19
|
+
export declare function handleError(response: object, needBackError?: boolean): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 判断为请求错误
|
|
22
|
+
* @param {*} res 响应体
|
|
23
|
+
* */
|
|
24
|
+
export declare const judgeIsRequestError: (res: any) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 判断为请求成功
|
|
27
|
+
* @param {*} res 响应体
|
|
28
|
+
* */
|
|
29
|
+
export declare const judgeIsRequestSuccess: (res: any) => boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function downloadExcel(data: any, fileName?: any, isResUrl?: boolean): void;
|
|
2
|
+
export declare const formatter: (data: any, parentAuthority: any, parentName: any) => any;
|
|
3
|
+
export declare const memoizeOneFormatter: any;
|
|
4
|
+
export declare const go2BackAndClose: () => void;
|
|
5
|
+
/**
|
|
6
|
+
* 处理bssulaTable的公共回显样式
|
|
7
|
+
* @param col 每一具体行
|
|
8
|
+
*/
|
|
9
|
+
export declare const handleBssulaColumnsSpecialParams: (col: any) => void;
|
|
10
|
+
/**
|
|
11
|
+
* 处理antdTable的公共回显样式
|
|
12
|
+
* @param col 每一具体行
|
|
13
|
+
*/
|
|
14
|
+
export declare const handleAntdColumnsSpecialParams: (col: any) => void;
|
|
15
|
+
export declare const getDictionarySource: (dicCode: string, needConvertInterger?: boolean) => any;
|
|
16
|
+
export declare function uuid(): string;
|
|
17
|
+
export declare const judgeIsEmpty: (value: any) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bit-sun/business-component",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.23-beta02",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"react-resizable": "^3.0.4",
|
|
54
54
|
"react-sortable-hoc": "^2.0.0",
|
|
55
55
|
"warning": "^4.0.3",
|
|
56
|
-
"ast-types": "^0.13.3"
|
|
56
|
+
"ast-types": "^0.13.3",
|
|
57
|
+
"js-cookie": "^3.0.1"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@ant-design/pro-layout": "^7.1.3",
|
|
@@ -11,6 +11,7 @@ import axios from 'axios';
|
|
|
11
11
|
import { AddSelect } from '../../../index';
|
|
12
12
|
import { tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
|
|
13
13
|
import { getSkuImg } from '@/utils/TableUtils';
|
|
14
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
14
15
|
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
15
16
|
// import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
|
|
16
17
|
|
|
@@ -460,7 +461,7 @@ export const AddSkcSelect = (parProps: any) => {
|
|
|
460
461
|
// type: 1 尺码组; 2 配码组
|
|
461
462
|
axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
|
|
462
463
|
result = result.data;
|
|
463
|
-
if ((result
|
|
464
|
+
if (judgeIsRequestError(result)) {
|
|
464
465
|
message.error(result.msg);
|
|
465
466
|
return;
|
|
466
467
|
}
|
|
@@ -765,7 +766,7 @@ export const AddSpuSelect = (parProps: any) => {
|
|
|
765
766
|
// type: 1 尺码组; 2 配码组
|
|
766
767
|
axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
|
|
767
768
|
result = result.data;
|
|
768
|
-
if ((result
|
|
769
|
+
if (judgeIsRequestError(result)) {
|
|
769
770
|
message.error(result.msg);
|
|
770
771
|
return;
|
|
771
772
|
}
|
|
@@ -21,6 +21,7 @@ import close from '../../../assets/close.svg';
|
|
|
21
21
|
import drag from '../../../assets/drag.svg';
|
|
22
22
|
import './index.less';
|
|
23
23
|
import ENUM from '@/utils/enumConfig';
|
|
24
|
+
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
24
25
|
|
|
25
26
|
const DragHandle = SortableHandle(() => <img width={25} src={drag} />);
|
|
26
27
|
const SortableItem = SortableElement((props) => <tr {...props} />);
|
|
@@ -41,6 +42,7 @@ class SearchItemTable extends React.Component {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
patchUserSearchFieldsConfig = (config) => {
|
|
45
|
+
const { appRequestConfig } = this.props;
|
|
44
46
|
let that = this;
|
|
45
47
|
let configvalue = config
|
|
46
48
|
? config.map((item) => ({
|
|
@@ -50,14 +52,14 @@ class SearchItemTable extends React.Component {
|
|
|
50
52
|
: '';
|
|
51
53
|
|
|
52
54
|
axios({
|
|
53
|
-
url: '/user/appConfig/saveQueryCriteria',
|
|
55
|
+
url: handleRequestUrl('/user','/appConfig/saveQueryCriteria', appRequestConfig),
|
|
54
56
|
method: 'POST',
|
|
55
57
|
data: {
|
|
56
58
|
code: that.state.bsTableCode,
|
|
57
59
|
detail: configvalue ? JSON.stringify(configvalue) : '',
|
|
58
60
|
},
|
|
59
61
|
}).then((res:any) => {
|
|
60
|
-
if (res?.data
|
|
62
|
+
if (judgeIsRequestSuccess(res?.data)) {
|
|
61
63
|
this.patchConfigToLocalstorage(configvalue)
|
|
62
64
|
} else {
|
|
63
65
|
message.error('保存搜索项自定义失败,请稍后尝试');
|
|
@@ -92,7 +94,7 @@ class SearchItemTable extends React.Component {
|
|
|
92
94
|
"detail": JSON.stringify(configvalue)
|
|
93
95
|
})
|
|
94
96
|
}
|
|
95
|
-
|
|
97
|
+
|
|
96
98
|
localStorage.setItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION, JSON.stringify(configArray));
|
|
97
99
|
this.setState({
|
|
98
100
|
visible: false,
|
|
@@ -152,10 +154,10 @@ class SearchItemTable extends React.Component {
|
|
|
152
154
|
};
|
|
153
155
|
|
|
154
156
|
componentDidMount() {
|
|
155
|
-
const {
|
|
156
|
-
datasource,
|
|
157
|
-
showSearchFields,
|
|
158
|
-
bsTableCode
|
|
157
|
+
const {
|
|
158
|
+
datasource,
|
|
159
|
+
showSearchFields,
|
|
160
|
+
bsTableCode
|
|
159
161
|
}: any = this.props;
|
|
160
162
|
|
|
161
163
|
let config = this.getConfigFromlocalstorage();
|
|
@@ -56,7 +56,7 @@ export default (props: any) => {
|
|
|
56
56
|
const [value, setValue]: any = useState(props);
|
|
57
57
|
const [showColumn, setShowColumns] = useState([]); // 列字段
|
|
58
58
|
const [showSearchFields, setShowSearchFields] = useState(props.fields || []); //搜索项字段
|
|
59
|
-
const { isPage = true, pagination, tableCode } = props;
|
|
59
|
+
const { isPage = true, pagination, tableCode, appRequestConfig } = props;
|
|
60
60
|
|
|
61
61
|
const [height, setHeight]: any = useState('100vh');
|
|
62
62
|
const sortTableRef = useRef(null);
|
|
@@ -71,12 +71,12 @@ export default (props: any) => {
|
|
|
71
71
|
window.top.document.fullScreen ||
|
|
72
72
|
window.top.document.webkitIsFullScreen ||
|
|
73
73
|
window.top.document.mozFullScreen;
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
// wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
|
|
76
76
|
let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
|
|
77
|
-
let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
|
|
78
|
-
(document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
|
|
79
|
-
let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
|
|
77
|
+
let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
|
|
78
|
+
(document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
|
|
79
|
+
let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
|
|
80
80
|
(document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
|
|
81
81
|
|
|
82
82
|
|
|
@@ -371,8 +371,8 @@ export default (props: any) => {
|
|
|
371
371
|
<Dropdown overlay={
|
|
372
372
|
<Menu>
|
|
373
373
|
<Menu.Item>
|
|
374
|
-
<div
|
|
375
|
-
onClick={sortTableRef?.current?.showModal}
|
|
374
|
+
<div
|
|
375
|
+
onClick={sortTableRef?.current?.showModal}
|
|
376
376
|
style={{fontSize:14, textAlign: 'center'}}
|
|
377
377
|
>列设置</div>
|
|
378
378
|
</Menu.Item>
|
|
@@ -383,9 +383,10 @@ export default (props: any) => {
|
|
|
383
383
|
showSearchFields={showSearchFields}
|
|
384
384
|
datasource={value?.fields || []}
|
|
385
385
|
bsTableCode={bsTableCode}
|
|
386
|
+
appRequestConfig={appRequestConfig}
|
|
386
387
|
/>
|
|
387
388
|
</Menu.Item>
|
|
388
|
-
</Menu>
|
|
389
|
+
</Menu>
|
|
389
390
|
} placement="bottomRight" >
|
|
390
391
|
<span className="ant-dropdown-link">
|
|
391
392
|
<img width={32} src={shezhi} />
|
|
@@ -518,6 +519,7 @@ export default (props: any) => {
|
|
|
518
519
|
...config,
|
|
519
520
|
summary: props.summary,
|
|
520
521
|
statusMapping: props.statusMapping,
|
|
522
|
+
appRequestConfig: props.appRequestConfig
|
|
521
523
|
}),
|
|
522
524
|
[value, checkedList, showColumn, props.statusMapping, showSearchFields],
|
|
523
525
|
);
|
|
@@ -529,6 +531,7 @@ export default (props: any) => {
|
|
|
529
531
|
showColumn={showColumn}
|
|
530
532
|
datasource={value?.columns || []}
|
|
531
533
|
bsTableCode={bsTableCode}
|
|
534
|
+
appRequestConfig={appRequestConfig}
|
|
532
535
|
onlyModal
|
|
533
536
|
/>
|
|
534
537
|
</>;
|
|
@@ -27,6 +27,7 @@ import fixedRight from '../../../assets/fixed-right.svg';
|
|
|
27
27
|
import fixedRightActive from '../../../assets/fixed-right-active.svg';
|
|
28
28
|
import './index.less';
|
|
29
29
|
import ENUM from '@/utils/enumConfig';
|
|
30
|
+
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
30
31
|
|
|
31
32
|
const DragHandle = SortableHandle(() => <img width={25} src={drag} />);
|
|
32
33
|
|
|
@@ -47,6 +48,7 @@ class SortableTable extends React.Component {
|
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
patchUserColumnConfig = (config) => {
|
|
51
|
+
const { appRequestConfig } = this.props;
|
|
50
52
|
let that = this;
|
|
51
53
|
let configvalue = config
|
|
52
54
|
? config.map((item) => ({
|
|
@@ -59,14 +61,14 @@ class SortableTable extends React.Component {
|
|
|
59
61
|
: '';
|
|
60
62
|
return new Promise((resolve: any, reject: any) => {
|
|
61
63
|
axios({
|
|
62
|
-
url: '/user/appConfig/saveUserOrder',
|
|
64
|
+
url: handleRequestUrl('/user','/appConfig/saveUserOrder', appRequestConfig),
|
|
63
65
|
method: 'POST',
|
|
64
66
|
data: {
|
|
65
67
|
code: that.state.bsTableCode,
|
|
66
68
|
detail: configvalue ? JSON.stringify(configvalue) : '',
|
|
67
69
|
},
|
|
68
70
|
}).then((res:any) => {
|
|
69
|
-
if (res?.data
|
|
71
|
+
if (judgeIsRequestSuccess(res?.data)) {
|
|
70
72
|
this.patchConfigToLocalstorage(configvalue);
|
|
71
73
|
resolve({ status: '0' });
|
|
72
74
|
} else {
|
|
@@ -104,7 +106,7 @@ class SortableTable extends React.Component {
|
|
|
104
106
|
"detail": JSON.stringify(configvalue)
|
|
105
107
|
})
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
|
|
108
110
|
localStorage.setItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION, JSON.stringify(configArray));
|
|
109
111
|
this.setState({
|
|
110
112
|
visible: false,
|
|
@@ -485,7 +487,7 @@ class SortableTable extends React.Component {
|
|
|
485
487
|
() => {
|
|
486
488
|
this.handleOk()
|
|
487
489
|
.then((res: any) => {
|
|
488
|
-
if (res
|
|
490
|
+
if (judgeIsRequestSuccess(res)) {
|
|
489
491
|
message.success(<span>
|
|
490
492
|
字段已隐藏,如需重新显示请前往<Typography.Link
|
|
491
493
|
underline
|
|
@@ -840,7 +842,7 @@ class SortableTable extends React.Component {
|
|
|
840
842
|
</Modal>
|
|
841
843
|
)}
|
|
842
844
|
{
|
|
843
|
-
!onlyModal
|
|
845
|
+
!onlyModal
|
|
844
846
|
? <div onClick={this.showModal} style={{fontSize:14}}>列设置</div>
|
|
845
847
|
: ''
|
|
846
848
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from 'react-sortable-hoc';
|
|
9
9
|
import { arrayMoveImmutable } from 'array-move';
|
|
10
10
|
import { ModalForm, request } from 'bssula';
|
|
11
|
+
import { judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
const App = ({
|
|
@@ -31,7 +32,7 @@ const App = ({
|
|
|
31
32
|
'qp-fieldGroup-eq': record.fieldGroup,
|
|
32
33
|
},
|
|
33
34
|
converter: ({ response, data }:any) => {
|
|
34
|
-
if (response
|
|
35
|
+
if (judgeIsRequestSuccess(response)) {
|
|
35
36
|
// UpdateFiedList(data.filter(item => item.valueType == 20 || item.valueType == 21 || item.valueType == 22))
|
|
36
37
|
const resData = data.filter((item:any) => item.inputType != 40 && (item.valueType == 20 || item.valueType == 21 || item.valueType == 22)).map((item:any) => ({value: item.code, name: item.name}))
|
|
37
38
|
UpdateFiedList(resData)
|
|
@@ -97,7 +98,7 @@ const App = ({
|
|
|
97
98
|
deleteItem(value, sortIndex)
|
|
98
99
|
}} /></span>
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
+
|
|
101
102
|
const SortableList = SortableContainer(({ items }:any) => {
|
|
102
103
|
return (
|
|
103
104
|
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
|
|
@@ -9,6 +9,7 @@ import FieldsSettingsTable from './components/FieldsSettingsTable';
|
|
|
9
9
|
import { isEmpty } from "lodash"
|
|
10
10
|
import './index.less';
|
|
11
11
|
import { getUserId } from '@/utils/LocalstorageUtils';
|
|
12
|
+
import { judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
12
13
|
|
|
13
14
|
function iterFileds (fields) {
|
|
14
15
|
let filedsValue = [];
|
|
@@ -90,14 +91,14 @@ function convertFileds (fields, falltValue, faltFieldRange, containerName) {
|
|
|
90
91
|
} else {
|
|
91
92
|
const returnField = field.isStaticCode ? falltValue[containerName ? (containerName + field.name) : field.name] : faltFieldRange[field.name];
|
|
92
93
|
if (returnField) {
|
|
93
|
-
returnField.label = field?.label;
|
|
94
|
+
returnField.label = field?.label;
|
|
94
95
|
if(field?.disabled){ // 字段设置只读属性
|
|
95
96
|
returnField.field.props.disabled = true;
|
|
96
97
|
}
|
|
97
98
|
if(field?.invisible){ // 字段设置不可见属性
|
|
98
99
|
returnField.initialVisible = false;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
|
|
101
102
|
if(Array.isArray(returnField.name)&&returnField.name?.includes("extensionFields")){
|
|
102
103
|
returnField.notShowLabel = true;
|
|
103
104
|
}
|
|
@@ -300,8 +301,9 @@ const JsonQueryTable = React.memo(props => {
|
|
|
300
301
|
Promise.all([
|
|
301
302
|
axios.get(`/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=${pageType}`),
|
|
302
303
|
]).then(([res] )=> {
|
|
303
|
-
const
|
|
304
|
-
|
|
304
|
+
const resD = res?.data || {}
|
|
305
|
+
const { data } = resD;
|
|
306
|
+
if (judgeIsRequestSuccess(resD)) {
|
|
305
307
|
if(data){
|
|
306
308
|
const { businessType, code:fieldGroup, moduleType, moduleRelationId } = data;
|
|
307
309
|
setModuleParams({
|
|
@@ -377,7 +379,7 @@ const JsonQueryTable = React.memo(props => {
|
|
|
377
379
|
saveTableCallBack(lastRes, false);
|
|
378
380
|
}
|
|
379
381
|
},[detailTablesSetting.length]);
|
|
380
|
-
|
|
382
|
+
|
|
381
383
|
const onClickRun = (value, isSave) => {
|
|
382
384
|
setJsonEditorVal(value);
|
|
383
385
|
|
|
@@ -420,7 +422,7 @@ const JsonQueryTable = React.memo(props => {
|
|
|
420
422
|
message.error(e);
|
|
421
423
|
}
|
|
422
424
|
}
|
|
423
|
-
|
|
425
|
+
|
|
424
426
|
React.useEffect(() => {
|
|
425
427
|
localStorage.setItem('jsonEditorVal',JSON.stringify(jsonEditorVal||{}))
|
|
426
428
|
}, [jsonEditorVal]);
|
|
@@ -139,6 +139,14 @@ export const inputTypes:any = {
|
|
|
139
139
|
...normalSingleSelectProps,
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
|
+
290: {
|
|
143
|
+
// 库存组织
|
|
144
|
+
type: 'bs-settleOrgSelect',
|
|
145
|
+
props: {
|
|
146
|
+
treeCheckable: false,
|
|
147
|
+
...normalSingleSelectProps,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
142
150
|
310: {
|
|
143
151
|
type: 'bs-deliveryModeSearchSelect',
|
|
144
152
|
props: {
|
|
@@ -161,6 +169,26 @@ export const inputTypes:any = {
|
|
|
161
169
|
...normalSingleSelectProps,
|
|
162
170
|
},
|
|
163
171
|
},
|
|
172
|
+
360: {
|
|
173
|
+
type: 'bs-roleSelect',
|
|
174
|
+
props: {
|
|
175
|
+
...normalSingleSelectProps,
|
|
176
|
+
requestConfig: {
|
|
177
|
+
filter: 'qp-name,code-orGroup-in',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
370: {
|
|
182
|
+
type: 'bs-marketChannelSelect',
|
|
183
|
+
props: {
|
|
184
|
+
treeCheckable: false,
|
|
185
|
+
requestConfig: {
|
|
186
|
+
treeChildrenRoom: 'channelInfoSon',
|
|
187
|
+
initialParams: { 'qp-isMain-eq': 1, 'qp-type-eq': 1 },
|
|
188
|
+
},
|
|
189
|
+
...normalSingleSelectProps,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
164
192
|
},
|
|
165
193
|
30: {
|
|
166
194
|
10: {
|
|
@@ -302,6 +330,14 @@ export const inputTypes:any = {
|
|
|
302
330
|
...normalMultipleSelectProps,
|
|
303
331
|
},
|
|
304
332
|
},
|
|
333
|
+
290: {
|
|
334
|
+
// 结算组织
|
|
335
|
+
type: 'bs-settleOrgSelect',
|
|
336
|
+
props: {
|
|
337
|
+
treeCheckable: true,
|
|
338
|
+
...normalMultipleSelectProps,
|
|
339
|
+
},
|
|
340
|
+
},
|
|
305
341
|
310: {
|
|
306
342
|
type: 'bs-deliveryModeSearchSelect',
|
|
307
343
|
props: {
|
|
@@ -327,6 +363,27 @@ export const inputTypes:any = {
|
|
|
327
363
|
...normalSingleSelectProps,
|
|
328
364
|
},
|
|
329
365
|
},
|
|
366
|
+
360: {
|
|
367
|
+
type: 'bs-roleSelect',
|
|
368
|
+
props: {
|
|
369
|
+
...normalMultipleSelectProps,
|
|
370
|
+
requestConfig: {
|
|
371
|
+
filter: 'qp-name,code-orGroup-in',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
370: {
|
|
376
|
+
type: 'bs-marketChannelSelect',
|
|
377
|
+
props: {
|
|
378
|
+
treeCheckable: true,
|
|
379
|
+
treeCheckStrictly: true,
|
|
380
|
+
requestConfig: {
|
|
381
|
+
treeChildrenRoom: 'channelInfoSon',
|
|
382
|
+
initialParams: { 'qp-isMain-eq': 1, 'qp-type-eq': 1 }
|
|
383
|
+
},
|
|
384
|
+
...normalSingleSelectProps,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
330
387
|
},
|
|
331
388
|
};
|
|
332
389
|
|
|
@@ -362,11 +419,14 @@ export const choiceType = Object.freeze({
|
|
|
362
419
|
260: '店铺选择器',
|
|
363
420
|
270: '员工选择器',
|
|
364
421
|
280: '库存组织选择器',
|
|
422
|
+
290: '结算组织选择器',
|
|
365
423
|
|
|
366
424
|
310: '配送方式选择器',
|
|
367
425
|
330: '变量',
|
|
368
426
|
340: '规则模板选择器',
|
|
369
427
|
350: '营销区域选择器',
|
|
428
|
+
360: '角色选择器',
|
|
429
|
+
370: '销售渠道选择器',
|
|
370
430
|
});
|
|
371
431
|
export const inputType:any ={
|
|
372
432
|
10: '输入',
|