@bit-sun/business-component 4.0.0-alpha.3 → 4.0.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/.editorconfig +16 -0
- package/.fatherrc.ts +5 -0
- package/.gitlab-ci.yml +179 -0
- package/.prettierignore +7 -0
- package/.prettierrc +11 -0
- package/.umirc.ts +74 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -1
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -1
- package/dist/components/Business/columnSettingTable/index.d.ts +1 -0
- package/dist/components/Common/ParagraphCopier/index.d.ts +8 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +3 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.d.ts +2 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1901 -639
- package/dist/index.js +1903 -636
- package/dist/utils/requestUtils.d.ts +1 -0
- package/dist/utils/utils.d.ts +3 -0
- package/docs/index.md +21 -0
- package/package.json +9 -14
- package/src/assets/32.svg +28 -0
- package/src/assets/addIcon.svg +18 -0
- package/src/assets/allfunc.svg +28 -0
- package/src/assets/arrowRight.svg +25 -0
- package/src/assets/arrow_top.png +0 -0
- package/src/assets/arrow_top.svg +18 -0
- package/src/assets/btn-delete.svg +30 -0
- package/src/assets/btn-edit.svg +20 -0
- package/src/assets/btn-more.svg +18 -0
- package/src/assets/btn-submit.svg +20 -0
- package/src/assets/caidan.svg +12 -0
- package/src/assets/close.svg +26 -0
- package/src/assets/closeicon.png +0 -0
- package/src/assets/drag.svg +17 -0
- package/src/assets/exportFail.svg +38 -0
- package/src/assets/exportProcessing.svg +29 -0
- package/src/assets/exportSuccess.svg +35 -0
- package/src/assets/exportlogo.png +0 -0
- package/src/assets/fixed-left-active.svg +12 -0
- package/src/assets/fixed-left.svg +16 -0
- package/src/assets/fixed-right-active.svg +12 -0
- package/src/assets/fixed-right.svg +16 -0
- package/src/assets/guanbi.svg +16 -0
- package/src/assets/icon-quanping.svg +16 -0
- package/src/assets/icon-shezhi.svg +18 -0
- package/src/assets/label_icon_bottom.svg +26 -0
- package/src/assets/list-no-img.svg +22 -0
- package/src/assets/morentouxiang-32.svg +24 -0
- package/src/assets/right.png +0 -0
- package/src/assets/scanning.svg +25 -0
- package/src/assets/upExport.svg +23 -0
- package/src/assets/xinglan-icon-out.png +0 -0
- package/src/common/ENUM.ts +41 -0
- package/src/components/Business/AddSelectBusiness/index.md +398 -0
- package/src/components/Business/AddSelectBusiness/index.tsx +1116 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -0
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
- package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
- package/src/components/Business/BsLayouts/index.less +80 -0
- package/src/components/Business/BsLayouts/index.tsx +1602 -0
- package/src/components/Business/BsLayouts/service.ts +11 -0
- package/src/components/Business/BsLayouts/utils.tsx +205 -0
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -0
- package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
- package/src/components/Business/BsSulaQueryTable/index.less +228 -0
- package/src/components/Business/BsSulaQueryTable/index.tsx +817 -0
- package/src/components/Business/BsSulaQueryTable/setting.tsx +937 -0
- package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
- package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -0
- package/src/components/Business/CommodityEntry/index.md +84 -0
- package/src/components/Business/CommodityEntry/index.tsx +82 -0
- package/src/components/Business/CommonAlert/index.less +0 -0
- package/src/components/Business/CommonAlert/index.tsx +23 -0
- package/src/components/Business/CommonGuideWrapper/index.less +156 -0
- package/src/components/Business/CommonGuideWrapper/index.md +61 -0
- package/src/components/Business/CommonGuideWrapper/index.tsx +108 -0
- package/src/components/Business/DetailPageWrapper/index.less +89 -0
- package/src/components/Business/DetailPageWrapper/index.tsx +306 -0
- package/src/components/Business/DetailPageWrapper/utils.tsx +166 -0
- package/src/components/Business/HomePageWrapper/index.less +36 -0
- package/src/components/Business/HomePageWrapper/index.md +45 -0
- package/src/components/Business/HomePageWrapper/index.tsx +130 -0
- package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -0
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +206 -0
- package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -0
- package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -0
- package/src/components/Business/JsonQueryTable/configButton/index.js +20 -0
- package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -0
- package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -0
- package/src/components/Business/JsonQueryTable/configTree/index.js +82 -0
- package/src/components/Business/JsonQueryTable/configTree/index.less +44 -0
- package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -0
- package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -0
- package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -0
- package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -0
- package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -0
- package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -0
- package/src/components/Business/JsonQueryTable/function.ts +62 -0
- package/src/components/Business/JsonQueryTable/index.less +17 -0
- package/src/components/Business/JsonQueryTable/index.md +328 -0
- package/src/components/Business/JsonQueryTable/index.tsx +534 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -0
- package/src/components/Business/JsonQueryTable/static.ts +450 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +2207 -0
- package/src/components/Business/SearchSelect/common.ts +134 -0
- package/src/components/Business/SearchSelect/index.md +1570 -0
- package/src/components/Business/SearchSelect/index.tsx +55 -0
- package/src/components/Business/SearchSelect/utils.ts +125 -0
- package/src/components/Business/StateFlow/index.less +131 -0
- package/src/components/Business/StateFlow/index.md +60 -0
- package/src/components/Business/StateFlow/index.tsx +30 -0
- package/src/components/Business/TreeSearchSelect/index.md +239 -0
- package/src/components/Business/TreeSearchSelect/index.tsx +33 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +115 -0
- package/src/components/Business/columnSettingTable/columnSetting.tsx +869 -0
- package/src/components/Business/columnSettingTable/index.less +253 -0
- package/src/components/Business/columnSettingTable/index.md +373 -0
- package/src/components/Business/columnSettingTable/index.tsx +235 -0
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +232 -0
- package/src/components/Business/columnSettingTable/utils.tsx +88 -0
- package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -0
- package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -0
- package/src/components/Business/moreTreeTable/index.less +100 -0
- package/src/components/Business/moreTreeTable/index.md +448 -0
- package/src/components/Business/moreTreeTable/index.tsx +387 -0
- package/src/components/Business/moreTreeTable/utils.ts +127 -0
- package/src/components/Common/ExtendedCollapse/ExtendedPanel.tsx +51 -0
- package/src/components/Common/ExtendedCollapse/index.less +33 -0
- package/src/components/Common/ExtendedCollapse/index.md +136 -0
- package/src/components/Common/ExtendedCollapse/index.tsx +25 -0
- package/src/components/Common/ParagraphCopier/index.md +81 -0
- package/src/components/Common/ParagraphCopier/index.tsx +56 -0
- package/src/components/Common/Section/index.md +120 -0
- package/src/components/Common/Section/index.module.less +16 -0
- package/src/components/Common/Section/index.tsx +70 -0
- package/src/components/Functional/AccessWrapper/index.tsx +34 -0
- package/src/components/Functional/AddSelect/helps.ts +81 -0
- package/src/components/Functional/AddSelect/index.less +367 -0
- package/src/components/Functional/AddSelect/index.md +155 -0
- package/src/components/Functional/AddSelect/index.tsx +1072 -0
- package/src/components/Functional/AuthButton/index.tsx +15 -0
- package/src/components/Functional/BillEntry/index.less +371 -0
- package/src/components/Functional/BillEntry/index.md +39 -0
- package/src/components/Functional/BillEntry/index.tsx +771 -0
- package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -0
- package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -0
- package/src/components/Functional/BsAntdSula/index.ts +2 -0
- package/src/components/Functional/DataImport/index.less +63 -0
- package/src/components/Functional/DataImport/index.md +44 -0
- package/src/components/Functional/DataImport/index.tsx +782 -0
- package/src/components/Functional/DataValidation/index.less +63 -0
- package/src/components/Functional/DataValidation/index.md +52 -0
- package/src/components/Functional/DataValidation/index.tsx +788 -0
- package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -0
- package/src/components/Functional/EllipsisTooltip/index.js +36 -0
- package/src/components/Functional/EllipsisTooltip/index.md +30 -0
- package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -0
- package/src/components/Functional/QueryMutipleInput/index.less +37 -0
- package/src/components/Functional/QueryMutipleInput/index.md +33 -0
- package/src/components/Functional/QueryMutipleInput/index.tsx +129 -0
- package/src/components/Functional/SearchSelect/index.less +121 -0
- package/src/components/Functional/SearchSelect/index.md +141 -0
- package/src/components/Functional/SearchSelect/index.tsx +1041 -0
- package/src/components/Functional/SearchSelect/utils.ts +3 -0
- package/src/components/Functional/TreeSearchSelect/index.md +47 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +224 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.tsx +358 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/function.js +255 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.tsx +58 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.tsx +129 -0
- package/src/components/Solution/RuleComponent/Formula.tsx +335 -0
- package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +743 -0
- package/src/components/Solution/RuleComponent/index.d.ts +29 -0
- package/src/components/Solution/RuleComponent/index.js +1614 -0
- package/src/components/Solution/RuleComponent/index.less +247 -0
- package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -0
- package/src/components/Solution/RuleComponent/ruleFiled.js +2587 -0
- package/src/components/Solution/RuleComponent/services.ts +13 -0
- package/src/components/Solution/RuleComponent/util.js +143 -0
- package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -0
- package/src/components/Solution/RuleSetter/baseRule.tsx +394 -0
- package/src/components/Solution/RuleSetter/function.ts +437 -0
- package/src/components/Solution/RuleSetter/index.less +221 -0
- package/src/components/Solution/RuleSetter/index.tsx +208 -0
- package/src/components/Solution/RuleSetter/service.js +276 -0
- package/src/index.ts +46 -0
- package/src/plugin/TableColumnSetting/index.less +247 -0
- package/src/plugin/TableColumnSetting/index.md +50 -0
- package/src/plugin/TableColumnSetting/index.tsx +725 -0
- package/src/plugin/TableColumnSetting/utils.ts +19 -0
- package/src/styles/bsDefault.less +32 -12
- package/src/utils/CheckOneUser/index.md +39 -0
- package/src/utils/CheckOneUser/index.ts +52 -0
- package/src/utils/CustomLoginInfo.ts +55 -0
- package/src/utils/LocalstorageUtils.ts +134 -0
- package/src/utils/TableUtils.less +52 -0
- package/src/utils/TableUtils.tsx +691 -0
- package/src/utils/auth.ts +39 -0
- package/src/utils/businessUtils.ts +434 -0
- package/src/utils/checkUtils.ts +39 -0
- package/src/utils/constant.ts +38 -0
- package/src/utils/enumConfig.ts +17 -0
- package/src/utils/getFormMode.js +12 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/request.ts +53 -0
- package/src/utils/requestUtils.ts +197 -0
- package/src/utils/serialize.js +7 -0
- package/src/utils/utils.ts +267 -0
- package/src/utils/xlsxUtil.tsx +146 -0
- package/tsconfig.json +29 -0
- package/typings.d.ts +5 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { List, Tooltip } from 'antd';
|
|
3
|
+
import React, { useEffect, useState, } from 'react';
|
|
4
|
+
import { Link, formatMessage } from 'umi';
|
|
5
|
+
import './index.less';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import right from '../../../../../assets/right.png';
|
|
8
|
+
import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils';
|
|
9
|
+
export type SiderTheme = 'light' | 'dark';
|
|
10
|
+
|
|
11
|
+
const DrawContent = ({onClose, itemPath}: any) => {
|
|
12
|
+
const routes = JSON.parse(localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]');
|
|
13
|
+
const btnAuth = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]');
|
|
14
|
+
const [homepageData, sethomepageData]: any = useState([]);
|
|
15
|
+
const [routesData, setroutesData]: any = useState([]);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const homepageDataList: any[] = []; //不含子集的菜单
|
|
19
|
+
const routesDataList: any[] = []; //含子集的菜单
|
|
20
|
+
routes.forEach(item => {
|
|
21
|
+
if (btnAuth.find((d: any) => d === item.code)) {
|
|
22
|
+
}
|
|
23
|
+
if (item.children) {
|
|
24
|
+
routesDataList.push(item);
|
|
25
|
+
} else {
|
|
26
|
+
homepageDataList.push(item);
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
sethomepageData(homepageDataList)
|
|
30
|
+
setroutesData(routesDataList)
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
const renderChildItem = (child) => {
|
|
34
|
+
if (!child.hideInMenu && child.children) {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<List.Item style={{color: '#000', fontWeight: 'bold' }}>
|
|
38
|
+
{formatMessage({ id: `${child.locale}` })}
|
|
39
|
+
</List.Item>
|
|
40
|
+
{child.children.map((menuItem: any) => {
|
|
41
|
+
return renderChildItem(menuItem)
|
|
42
|
+
})}
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
} else if (!child.hideInMenu && child.path) {
|
|
46
|
+
return (
|
|
47
|
+
<List.Item style={{ fontSize: '12px' }} className="allFuncOnMouserover">
|
|
48
|
+
<Link to={child.path} onClick={onClose}>
|
|
49
|
+
<Tooltip
|
|
50
|
+
title={formatMessage({ id: `${child.locale}` })}
|
|
51
|
+
>
|
|
52
|
+
{formatMessage({ id: `${child.locale}` }).length > 10
|
|
53
|
+
? `${formatMessage({
|
|
54
|
+
id: `${child.name}`,
|
|
55
|
+
}).slice(0, 10)}...`
|
|
56
|
+
: formatMessage({ id: `${child.locale}` })}
|
|
57
|
+
</Tooltip>
|
|
58
|
+
<img className="allFuncOnMouseroverImg" src={right}></img>
|
|
59
|
+
</Link>
|
|
60
|
+
</List.Item>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className='allfunc_drawcontent'>
|
|
68
|
+
<p className={'drawerWarp_p'}>您的当前权限可以使用以下功能:</p>
|
|
69
|
+
<div className={'drawerWarp'}>
|
|
70
|
+
{homepageData && homepageData.filter((d) => !d.hideInMenu).length > 0 && (
|
|
71
|
+
<List
|
|
72
|
+
className={classNames('allFunsList', 'allFunsListWarp')}
|
|
73
|
+
dataSource={homepageData}
|
|
74
|
+
renderItem={(child: any) => {
|
|
75
|
+
if (!child.hideInMenu && child.path) {
|
|
76
|
+
return (
|
|
77
|
+
<div className={classNames('allFunsListWarp')}>
|
|
78
|
+
<List.Item
|
|
79
|
+
className={classNames('allFuncOnMouserover')}
|
|
80
|
+
style={{ padding: '12px 24px' }}
|
|
81
|
+
>
|
|
82
|
+
<Link to={child.path} onClick={onClose}>
|
|
83
|
+
{formatMessage({ id: `${child.name}` })}
|
|
84
|
+
<img className="allFuncOnMouseroverImg" src={right}></img>
|
|
85
|
+
</Link>
|
|
86
|
+
</List.Item>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
{routesData.map((item, index) => {
|
|
94
|
+
return (
|
|
95
|
+
<List
|
|
96
|
+
className={classNames('allFunsList', 'allFunsListWarp')}
|
|
97
|
+
style={{color: '#005CFF'}}
|
|
98
|
+
header={<b>{formatMessage({ id: `${item.name}` })}</b>}
|
|
99
|
+
bordered
|
|
100
|
+
dataSource={item.children}
|
|
101
|
+
renderItem={(child: any) => {
|
|
102
|
+
return renderChildItem(child)
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
})}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default DrawContent;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.menu {
|
|
4
|
+
.anticon {
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
}
|
|
7
|
+
.ant-dropdown-menu-item {
|
|
8
|
+
min-width: 160px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.right {
|
|
13
|
+
display: flex;
|
|
14
|
+
float: right;
|
|
15
|
+
height: 48px;
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
.action {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
height: 48px;
|
|
22
|
+
padding: 0 12px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: all 0.3s;
|
|
25
|
+
> span {
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
}
|
|
28
|
+
&:hover {
|
|
29
|
+
background: rgba(0, 0, 0, 0.025);
|
|
30
|
+
}
|
|
31
|
+
.opened {
|
|
32
|
+
background: rgba(0, 0, 0, 0.025);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.search {
|
|
36
|
+
padding: 0 12px;
|
|
37
|
+
&:hover {
|
|
38
|
+
background: transparent;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.account {
|
|
42
|
+
.avatar {
|
|
43
|
+
margin-right: 8px;
|
|
44
|
+
color: #005cff;
|
|
45
|
+
vertical-align: top;
|
|
46
|
+
background: rgba(255, 255, 255, 0.85);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dark {
|
|
52
|
+
.action {
|
|
53
|
+
&:hover {
|
|
54
|
+
background: #252a3d;
|
|
55
|
+
}
|
|
56
|
+
.opened {
|
|
57
|
+
background: #252a3d;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.warp_allfunc {
|
|
63
|
+
z-index: 100;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.drawerWarp {
|
|
67
|
+
column-count: 4;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.drawer_header_warp {
|
|
71
|
+
.ant-list-header {
|
|
72
|
+
padding: 0 0 0 10px !important;
|
|
73
|
+
line-height: 40px;
|
|
74
|
+
border: 0px !important;
|
|
75
|
+
b {
|
|
76
|
+
width: 100%;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
border-bottom: 1px solid #f0f0f0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
.ant-list-item {
|
|
82
|
+
padding: 0 0 0 10px !important;
|
|
83
|
+
line-height: 30px !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ant-drawer-close {
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
.p {
|
|
95
|
+
color: #b1bad4;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
margin-bottom: 10px;
|
|
99
|
+
font-family: PingFangSC, PingFangSC-Regular;
|
|
100
|
+
line-height: 16px;
|
|
101
|
+
text-align: left;
|
|
102
|
+
opacity: 0.8;
|
|
103
|
+
user-select: none;
|
|
104
|
+
text-align: center;
|
|
105
|
+
margin-left: 8px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.btn {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
height: 44px;
|
|
112
|
+
color: #b1bad4;
|
|
113
|
+
background: #10234c;
|
|
114
|
+
border-radius: 8px;
|
|
115
|
+
width: 130px;
|
|
116
|
+
user-select: none;
|
|
117
|
+
}
|
|
118
|
+
.btn:hover,
|
|
119
|
+
.btnSpan1:hover,
|
|
120
|
+
.btnSpan2:hover {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
color: #b1bad4;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.btnSpan1 {
|
|
126
|
+
margin: 0 7px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.allfunc_drawcontent {
|
|
131
|
+
.allFunsList {
|
|
132
|
+
margin-bottom: 10px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.allFunsListWarp {
|
|
136
|
+
width: 200px;
|
|
137
|
+
margin-right: 10px;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
|
|
140
|
+
break-inside: avoid;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.drawerWarp_p {
|
|
144
|
+
color: #8c8c8c;
|
|
145
|
+
font-weight: 400;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
font-family: PingFangSC, PingFangSC-Regular;
|
|
148
|
+
line-height: 20px;
|
|
149
|
+
text-align: left;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { Drawer } from 'antd';
|
|
4
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import './index.less';
|
|
6
|
+
import allfunc from '../../../../../assets/allfunc.svg';
|
|
7
|
+
import DrawContent from './drawContent';
|
|
8
|
+
export type SiderTheme = 'light' | 'dark';
|
|
9
|
+
|
|
10
|
+
const AllFunc: any = forwardRef(({ isCollapse, handleClose, itemPath }: any, ref) => {
|
|
11
|
+
const [isDrawer, setIsDrawer]: any = useState(false);
|
|
12
|
+
useImperativeHandle(ref, () => ({
|
|
13
|
+
close: () => {
|
|
14
|
+
setIsDrawer(false)
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (isCollapse) {
|
|
20
|
+
setIsDrawer(false);
|
|
21
|
+
}
|
|
22
|
+
}, [isCollapse]);
|
|
23
|
+
const showDrawer = (e) => {
|
|
24
|
+
if (isCollapse) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
handleClose()
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
setIsDrawer(!isDrawer);
|
|
30
|
+
};
|
|
31
|
+
const onClose = () => {
|
|
32
|
+
setIsDrawer(!isDrawer);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
className={'warp_allfunc'}
|
|
39
|
+
onClick={(e: any) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
}}
|
|
42
|
+
style={{ opacity: isCollapse ? '0' : '1' }}
|
|
43
|
+
>
|
|
44
|
+
<p className={'p'}>没有找到想要的功能?</p>
|
|
45
|
+
|
|
46
|
+
<p className={'btn'} onClick={showDrawer}>
|
|
47
|
+
<span className={'btnSpan1'}>
|
|
48
|
+
<img style={{marginTop: '-2px'}} width={18} src={allfunc} />
|
|
49
|
+
</span>
|
|
50
|
+
<span className={'btnSpan2'}>查看全部功能</span>
|
|
51
|
+
</p>
|
|
52
|
+
{!isCollapse && (
|
|
53
|
+
<Drawer
|
|
54
|
+
style={{ left: isDrawer ? 140 : 0, top:50 }}
|
|
55
|
+
destroyOnClose
|
|
56
|
+
title={<span style={{ fontWeight: 'bold', fontSize: 18 }}>全部功能</span>}
|
|
57
|
+
zIndex={19}
|
|
58
|
+
width={850}
|
|
59
|
+
className={'drawer_header_warp'}
|
|
60
|
+
placement="left"
|
|
61
|
+
onClose={onClose}
|
|
62
|
+
visible={isDrawer}
|
|
63
|
+
>
|
|
64
|
+
<DrawContent itemPath={itemPath} onClose={onClose} />
|
|
65
|
+
</Drawer>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
export default AllFunc;
|
|
File without changes
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
|
2
|
+
import { Select, Form, Modal, Input, Radio, List } from 'antd';
|
|
3
|
+
import { getStoreByName } from './services';
|
|
4
|
+
import debounce from 'lodash/debounce';
|
|
5
|
+
|
|
6
|
+
const debounceTimeout = 800;
|
|
7
|
+
|
|
8
|
+
const ChooseStore = (props: any) => {
|
|
9
|
+
const { employeeCode } = props;
|
|
10
|
+
const plainOptions = ['UR', '本来'];
|
|
11
|
+
const name: any = localStorage.getItem('WARE_HOUSE_NAME');
|
|
12
|
+
const code: any = localStorage.getItem('WARE_HOUSE_CODE');
|
|
13
|
+
|
|
14
|
+
const fetchRef = useRef(0);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const [index, setIndex] = useState(-1);
|
|
18
|
+
const [value, setValue] = useState([{ label: name, value: code }]);
|
|
19
|
+
// const [ key, setKey ] = useState(undefined);
|
|
20
|
+
const [key, setKey] = useState<'UR' | 'BL' | undefined>(undefined);
|
|
21
|
+
const [openSelect, setOpenSelect] = useState(false);
|
|
22
|
+
const [options, setOptions] = useState<any[]>([]);
|
|
23
|
+
const [rescouse, setRescouse] = useState([]);
|
|
24
|
+
const [searchValue, setSearchValue] = useState('');
|
|
25
|
+
const [store, setStore] = useState([{ label: name, value: code }]);
|
|
26
|
+
|
|
27
|
+
async function fetchUserList(storeName: any, init?: boolean) {
|
|
28
|
+
return getStoreByName({
|
|
29
|
+
orgName: storeName ? storeName : undefined,
|
|
30
|
+
platCompanyCode: init ? undefined : key,
|
|
31
|
+
'qp-employeeCode-eq': employeeCode || 'EMP231011000002',
|
|
32
|
+
'qp-orgViewCode-eq': 'business-organizational-view',
|
|
33
|
+
}).then((res) => {
|
|
34
|
+
const { data } = res;
|
|
35
|
+
if (data.code != '000000') {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
return data.data.map((item: any) => {
|
|
39
|
+
return {
|
|
40
|
+
label: item.orgName,
|
|
41
|
+
value: item.orgCode,
|
|
42
|
+
defaultOrg: item.defaultOrg,
|
|
43
|
+
platCompanyCode: item.platCompanyCode,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const debounceFetcher = useMemo(() => {
|
|
50
|
+
const loadOptions = (str: string) => {
|
|
51
|
+
fetchRef.current += 1;
|
|
52
|
+
const fetchId = fetchRef.current;
|
|
53
|
+
setOptions([]);
|
|
54
|
+
setRescouse([]);
|
|
55
|
+
fetchUserList(str).then((newOptions) => {
|
|
56
|
+
if (fetchId !== fetchRef.current) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setOptions(newOptions);
|
|
60
|
+
setRescouse(newOptions);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return debounce(loadOptions, debounceTimeout);
|
|
65
|
+
}, [debounceTimeout, key]);
|
|
66
|
+
|
|
67
|
+
const changeInput = async (str: string) => {
|
|
68
|
+
const res: any = await debounceFetcher(str);
|
|
69
|
+
setOptions(res);
|
|
70
|
+
setRescouse(res);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
(async () => {
|
|
75
|
+
const res: any = await fetchUserList(undefined, true);
|
|
76
|
+
res.map((item: any, indexNumber: number) => {
|
|
77
|
+
if (item.label === name) {
|
|
78
|
+
setIndex(indexNumber);
|
|
79
|
+
}
|
|
80
|
+
if (item.defaultOrg) {
|
|
81
|
+
if (name) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
localStorage.setItem('WARE_HOUSE_NAME', item?.label);
|
|
85
|
+
localStorage.setItem('WARE_HOUSE_CODE', item?.value);
|
|
86
|
+
setValue([item]);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
setOptions(res);
|
|
90
|
+
setRescouse(res);
|
|
91
|
+
})();
|
|
92
|
+
}, []);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div>
|
|
96
|
+
<Select
|
|
97
|
+
value={value}
|
|
98
|
+
style={{ width: 280, marginRight: 20 }}
|
|
99
|
+
open={false}
|
|
100
|
+
onClick={() => {
|
|
101
|
+
setOpenSelect(true);
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<Modal
|
|
106
|
+
open={openSelect}
|
|
107
|
+
onCancel={() => {
|
|
108
|
+
setOpenSelect(false);
|
|
109
|
+
}}
|
|
110
|
+
onOk={() => {
|
|
111
|
+
localStorage.setItem('WARE_HOUSE_NAME', store[0]?.label);
|
|
112
|
+
localStorage.setItem('WARE_HOUSE_CODE', store[0]?.value);
|
|
113
|
+
window.location.reload();
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<Form
|
|
117
|
+
style={{ height: 300, marginTop: 20 }}
|
|
118
|
+
labelCol={{ span: 3 }}
|
|
119
|
+
wrapperCol={{ span: 16 }}
|
|
120
|
+
>
|
|
121
|
+
<Form.Item label="品牌" name="brand">
|
|
122
|
+
<Radio.Group
|
|
123
|
+
options={plainOptions}
|
|
124
|
+
onChange={(item: any) => {
|
|
125
|
+
const str = item?.target?.value;
|
|
126
|
+
setKey(str === 'UR' ? 'UR' : 'BL');
|
|
127
|
+
if (str === 'UR') {
|
|
128
|
+
const res: any = rescouse?.filter((current: any) => {
|
|
129
|
+
return current.platCompanyCode === 'UR';
|
|
130
|
+
});
|
|
131
|
+
setOptions(res);
|
|
132
|
+
setSearchValue('');
|
|
133
|
+
} else {
|
|
134
|
+
const res: any = rescouse?.filter((current: any) => {
|
|
135
|
+
return current.platCompanyCode === 'BL';
|
|
136
|
+
});
|
|
137
|
+
setOptions(res);
|
|
138
|
+
setSearchValue('');
|
|
139
|
+
}
|
|
140
|
+
}}
|
|
141
|
+
optionType="button"
|
|
142
|
+
buttonStyle="solid"
|
|
143
|
+
/>
|
|
144
|
+
</Form.Item>
|
|
145
|
+
<Form.Item
|
|
146
|
+
label="门店"
|
|
147
|
+
name="store"
|
|
148
|
+
rules={[{ required: true, message: '请选择门店' }]}
|
|
149
|
+
>
|
|
150
|
+
<Input
|
|
151
|
+
placeholder="输入门店名称"
|
|
152
|
+
value={searchValue}
|
|
153
|
+
onChange={(e) => {
|
|
154
|
+
changeInput(e.target.value);
|
|
155
|
+
setSearchValue(e.target.value);
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
<div
|
|
159
|
+
style={{
|
|
160
|
+
height: 220,
|
|
161
|
+
overflowY: 'scroll',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<List
|
|
165
|
+
dataSource={options}
|
|
166
|
+
bordered
|
|
167
|
+
renderItem={(item, indexNumber) => (
|
|
168
|
+
<List.Item
|
|
169
|
+
style={
|
|
170
|
+
indexNumber === index ? {
|
|
171
|
+
// opacity
|
|
172
|
+
color: '#0047bb',
|
|
173
|
+
} : {}
|
|
174
|
+
}
|
|
175
|
+
onClick={(current: any) => {
|
|
176
|
+
// setValue([item]);
|
|
177
|
+
setStore([item]);
|
|
178
|
+
setIndex(indexNumber);
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
{item.label}
|
|
182
|
+
</List.Item>
|
|
183
|
+
)}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
</Form.Item>
|
|
187
|
+
</Form>
|
|
188
|
+
</Modal>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export default ChooseStore;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.setting_content>div {
|
|
2
|
+
width: 50%;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
// float: left;
|
|
5
|
+
margin: 0 10px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.setting_content {
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
.tree_title {
|
|
14
|
+
height: 50px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tree_content {
|
|
18
|
+
height: 400px;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
border: 1px solid #d9d9d9;
|
|
21
|
+
padding: 5px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.setting_content::after {
|
|
25
|
+
clear: both;
|
|
26
|
+
display: block;
|
|
27
|
+
content: '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.choosed_label_color {
|
|
31
|
+
color: #f50;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.left_tree_content {
|
|
35
|
+
.ant-tree .ant-tree-node-content-wrapper {
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
.ant-tree-title {
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.ant-tree .ant-tree-treenode {
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.right_tree_content, .left_tree_content {
|
|
47
|
+
.ant-tree .ant-tree-node-content-wrapper {
|
|
48
|
+
display: flex;
|
|
49
|
+
margin-left: -3px;
|
|
50
|
+
}
|
|
51
|
+
.ant-tree-checkbox {
|
|
52
|
+
top: auto;
|
|
53
|
+
top: initial;
|
|
54
|
+
// margin: 4px 3px 0 0 !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.node_title_content:hover {
|
|
59
|
+
.right_arrow {
|
|
60
|
+
display: block !important;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.right_arrow {
|
|
65
|
+
float: right;
|
|
66
|
+
display: none;
|
|
67
|
+
color: #999999;
|
|
68
|
+
margin-right: 10px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
.right_tree_content {
|
|
74
|
+
.ant-tree-title {
|
|
75
|
+
width: 100%;
|
|
76
|
+
display: inline-block;
|
|
77
|
+
padding-right: 10px;
|
|
78
|
+
}
|
|
79
|
+
.ant-dropdown-trigger {
|
|
80
|
+
color: gray !important;
|
|
81
|
+
}
|
|
82
|
+
.tree_node_title {
|
|
83
|
+
font-size: 20px;
|
|
84
|
+
color: #d9d9d9;
|
|
85
|
+
float: right;
|
|
86
|
+
span {
|
|
87
|
+
margin-right: 5px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useState,
|
|
3
|
+
forwardRef,
|
|
4
|
+
useImperativeHandle
|
|
5
|
+
} from "react";
|
|
6
|
+
import './index.less';
|
|
7
|
+
import LeftTree from "./leftTree";
|
|
8
|
+
import RightTree from "./rightTree";
|
|
9
|
+
|
|
10
|
+
const MenuSetting = forwardRef(({actionRef, originRoutes, itemPath}: any, ref) => {
|
|
11
|
+
|
|
12
|
+
const [customerMenuData, setCustomerMenuData] = useState(
|
|
13
|
+
JSON.parse( localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]')
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
useImperativeHandle(ref, () => ({
|
|
17
|
+
saveMenuData: () => {
|
|
18
|
+
localStorage.setItem(`customerMenu_${itemPath}_front`, JSON.stringify(customerMenuData));
|
|
19
|
+
actionRef.current?.reload();
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={'setting_content'}>
|
|
25
|
+
<LeftTree
|
|
26
|
+
originRoutes={originRoutes}
|
|
27
|
+
customerMenuData={customerMenuData}
|
|
28
|
+
setCustomerMenuData={setCustomerMenuData}
|
|
29
|
+
/>
|
|
30
|
+
<RightTree
|
|
31
|
+
customerMenuData={customerMenuData}
|
|
32
|
+
setCustomerMenuData={setCustomerMenuData}
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export default MenuSetting;
|