@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,154 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React, {
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
forwardRef,
|
|
6
|
+
useRef,
|
|
7
|
+
useImperativeHandle
|
|
8
|
+
} from "react";
|
|
9
|
+
import { Button, Drawer, Modal, Menu } from 'antd';
|
|
10
|
+
import addIcon from '../../../../../assets/addIcon.svg';
|
|
11
|
+
import MenuSetting from "./MenuSetting";
|
|
12
|
+
import { history } from "umi";
|
|
13
|
+
import './index.less'
|
|
14
|
+
|
|
15
|
+
const CustomerMenu = forwardRef(({isCollapse, handleClose, actionRef, originRoutes, itemPath}: any, ref) => {
|
|
16
|
+
const menuSettingRef = useRef(null);
|
|
17
|
+
const menuData = JSON.parse(localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]');
|
|
18
|
+
|
|
19
|
+
const [isDrawer, setIsDrawer]: any = useState(false);
|
|
20
|
+
useImperativeHandle(ref, () => ({
|
|
21
|
+
close: () => {
|
|
22
|
+
setIsDrawer(false);
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (isCollapse) {
|
|
28
|
+
setIsDrawer(false);
|
|
29
|
+
}
|
|
30
|
+
}, [isCollapse]);
|
|
31
|
+
|
|
32
|
+
const onClose = () => {
|
|
33
|
+
setIsDrawer(!isDrawer);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const showDrawer = (e) => {
|
|
37
|
+
if (isCollapse) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
handleClose();
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
setIsDrawer(!isDrawer);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const handleOk = () => {
|
|
47
|
+
menuSettingRef?.current?.saveMenuData();
|
|
48
|
+
settingModalFn({
|
|
49
|
+
...settingModal,
|
|
50
|
+
visible: false,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const handleCancel = () => {
|
|
55
|
+
settingModalFn({
|
|
56
|
+
...settingModal,
|
|
57
|
+
visible: false,
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const [settingModal, settingModalFn] = useState({
|
|
62
|
+
visible: false,
|
|
63
|
+
onOk: handleOk,
|
|
64
|
+
onCancel: handleCancel,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const handleMenuClick = (item: any) => {
|
|
69
|
+
if (item.children || !item.component) return;
|
|
70
|
+
setIsDrawer(!isDrawer);
|
|
71
|
+
history.push({
|
|
72
|
+
pathname: item.path
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const getMenuDom = (menuData) => {
|
|
77
|
+
return menuData.map(item => (
|
|
78
|
+
<div style={{paddingLeft: '10px'}}>
|
|
79
|
+
<div onClick={()=> {handleMenuClick(item)}} className={`${'menu_item'} ${item.children || !item.component ? '' : 'link_style'}`}
|
|
80
|
+
style={{fontWeight: item.children || !item.component ? 'bolder' : '400', paddingLeft: '4px'}}>
|
|
81
|
+
{item.name}
|
|
82
|
+
</div>
|
|
83
|
+
{
|
|
84
|
+
!!item.children && !!item.children.length && getMenuDom(item.children)
|
|
85
|
+
}
|
|
86
|
+
</div>
|
|
87
|
+
))
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div className={'customer_menu_content'}>
|
|
92
|
+
<div
|
|
93
|
+
style={{cursor: 'pointer'}}
|
|
94
|
+
onClick={(e) => {
|
|
95
|
+
handleClose();
|
|
96
|
+
settingModalFn({
|
|
97
|
+
...settingModal,
|
|
98
|
+
visible: true,
|
|
99
|
+
});
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<img style={{marginTop: '-3px'}} width={24} src={addIcon} />
|
|
103
|
+
<Button
|
|
104
|
+
type='link'
|
|
105
|
+
style={{paddingLeft: '5px'}}
|
|
106
|
+
>
|
|
107
|
+
自定义菜单
|
|
108
|
+
</Button>
|
|
109
|
+
</div>
|
|
110
|
+
{!isCollapse && (
|
|
111
|
+
<Drawer
|
|
112
|
+
style={{ left: isDrawer ? 140 : 0 }}
|
|
113
|
+
title={
|
|
114
|
+
<span style={{ fontWeight: 'bold', fontSize: 18 }}>自定义菜单</span>
|
|
115
|
+
}
|
|
116
|
+
zIndex={19}
|
|
117
|
+
headerStyle={{display: 'none'}}
|
|
118
|
+
width={200}
|
|
119
|
+
className={'menu_drawer_header_warp'}
|
|
120
|
+
placement="left"
|
|
121
|
+
onClose={onClose}
|
|
122
|
+
visible={isDrawer}
|
|
123
|
+
>
|
|
124
|
+
<div>
|
|
125
|
+
<p className={'menu_title_line'}>自定义菜单</p>
|
|
126
|
+
{
|
|
127
|
+
getMenuDom(menuData)
|
|
128
|
+
}
|
|
129
|
+
</div>
|
|
130
|
+
</Drawer>
|
|
131
|
+
)}
|
|
132
|
+
<Modal
|
|
133
|
+
title={
|
|
134
|
+
<span style={{ fontWeight: '600', fontSize: 18}}>自定义菜单设置</span>
|
|
135
|
+
}
|
|
136
|
+
zIndex={999}
|
|
137
|
+
width={800}
|
|
138
|
+
destroyOnClose
|
|
139
|
+
{
|
|
140
|
+
...settingModal
|
|
141
|
+
}
|
|
142
|
+
>
|
|
143
|
+
<MenuSetting
|
|
144
|
+
originRoutes={originRoutes}
|
|
145
|
+
actionRef={actionRef}
|
|
146
|
+
ref={menuSettingRef}
|
|
147
|
+
itemPath={itemPath}
|
|
148
|
+
/>
|
|
149
|
+
</Modal>
|
|
150
|
+
</div>
|
|
151
|
+
)
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
export default CustomerMenu;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.headerContent {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
height: 100%;
|
|
6
|
+
background: #F3F3F3;
|
|
7
|
+
box-shadow: 0 1px 4px #EBECEC;
|
|
8
|
+
padding-left: 47px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.navigationBtn {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
height: 32px;
|
|
14
|
+
line-height: 32px;
|
|
15
|
+
border-radius: 5px;
|
|
16
|
+
margin-right: 15px;
|
|
17
|
+
padding: 0 10px;
|
|
18
|
+
background-color: #F4F6F7;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
color: rgba(0, 0, 0, 0.5);
|
|
21
|
+
}
|
|
22
|
+
.navigationBtn:hover {
|
|
23
|
+
border-color: #297eff;
|
|
24
|
+
border-right-width: 1px;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.headerContent {
|
|
29
|
+
background-color: #ffffff;
|
|
30
|
+
.ant-input-affix-wrapper,.ant-input {
|
|
31
|
+
// background-color: #F4F5F7 !important;
|
|
32
|
+
color: rgba(0, 0, 0, 0.5);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.searchPanel {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 36;
|
|
39
|
+
left: 0;
|
|
40
|
+
min-width: 268px;
|
|
41
|
+
height: 220px;
|
|
42
|
+
box-shadow: 0 1px 4px #EBECEC;
|
|
43
|
+
background-color: #FFFFFF;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
box-shadow: 0px 2px 4px 0px rgba(185,185,185, 0.5);
|
|
46
|
+
padding: 0 10px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.searchTitle {
|
|
50
|
+
margin-top: 20px;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
text-align: left;
|
|
54
|
+
color: #8c8c8c;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.themeColor {
|
|
58
|
+
color: #005cff;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.itemPath {
|
|
62
|
+
height: 30px;
|
|
63
|
+
line-height: 30px;
|
|
64
|
+
width: 100%;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.itemPath:hover {
|
|
72
|
+
background-color: #E6EEFF;
|
|
73
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import RightContent from '../RightContent';
|
|
4
|
+
import ChooseStore from '../ChooseStore';
|
|
5
|
+
import { Input } from 'antd';
|
|
6
|
+
import { SearchOutlined } from '@ant-design/icons';
|
|
7
|
+
import { debounce, cloneDeep } from 'lodash';
|
|
8
|
+
import { formatMessage, history } from 'umi';
|
|
9
|
+
import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils';
|
|
10
|
+
import './index.less';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const judgeIsEmpty = (value: any) => {
|
|
14
|
+
if (value == null || value == undefined || String(value).trim() == '') {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const GlobalHeaderCom = (props: any) => {
|
|
21
|
+
const { route: {routes=[]}, showSelectStore = false, employeeCode = "EMP231011000002", } = props;
|
|
22
|
+
const [keyWord, setKeyWord] = useState('');
|
|
23
|
+
const [routeList, setroutesData] = useState<any[]>([]);
|
|
24
|
+
|
|
25
|
+
const getFullPathName = (nameId:string) => {
|
|
26
|
+
const nameIdArr = nameId.split('.');
|
|
27
|
+
let nameStr = '';
|
|
28
|
+
for (let i = 0; i < nameIdArr.length; i++) {
|
|
29
|
+
let itemId = nameIdArr.slice(0, i+1).join('.');
|
|
30
|
+
nameStr += `${i === 0 ? '': '-'}${formatMessage({ id: `menu.${itemId}` })}`;
|
|
31
|
+
}
|
|
32
|
+
return nameStr;
|
|
33
|
+
}
|
|
34
|
+
const initRoute = (router: any, name?: any) => {
|
|
35
|
+
const resultList: any = [];
|
|
36
|
+
const newRouter = cloneDeep(router);
|
|
37
|
+
const btnAuth = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]');
|
|
38
|
+
const deep = (router: any) => {
|
|
39
|
+
if (router && Array.isArray(router)) {
|
|
40
|
+
router.forEach((item) => {
|
|
41
|
+
if (item.routes && Array.isArray(item.routes)) {
|
|
42
|
+
item.routes.forEach((d: any) => {
|
|
43
|
+
if (!d.nameEdit) {
|
|
44
|
+
d.name = item.name + '.' + d.name;
|
|
45
|
+
d.nameEdit = true;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
deep(item.routes);
|
|
49
|
+
} else if (
|
|
50
|
+
!item.hideInMenu &&
|
|
51
|
+
(name
|
|
52
|
+
? formatMessage({ id: `menu.${item.name}` }).indexOf(name) !== -1
|
|
53
|
+
: true)
|
|
54
|
+
) {
|
|
55
|
+
resultList.push({
|
|
56
|
+
...item,
|
|
57
|
+
fullPathName: getFullPathName(item.name),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
} else if (
|
|
62
|
+
(name ? router.name.indexOf(name) !== -1 : true)
|
|
63
|
+
// && btnAuth.find((d: any) => d.code === router.code)
|
|
64
|
+
) {
|
|
65
|
+
resultList.push({
|
|
66
|
+
...router,
|
|
67
|
+
name: formatMessage({ id: `menu.${router.name}` }),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
deep(newRouter);
|
|
72
|
+
setroutesData([...resultList]);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const renderLineStyl = (name: string) => {
|
|
76
|
+
let newName = name.split('-').join(' > ');
|
|
77
|
+
const index = newName.lastIndexOf(keyWord);
|
|
78
|
+
if (index > -1) {
|
|
79
|
+
const beforeStr = newName.substr(0, index);
|
|
80
|
+
const afterStr = newName.substr(index + keyWord.length);
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<span>{beforeStr}</span>
|
|
84
|
+
<span style={{color: '#005cff'}}>{keyWord}</span>
|
|
85
|
+
<span>{afterStr}</span>
|
|
86
|
+
</>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
return newName
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div style={{paddingLeft: props.collapsed ? '135px': '45px'}} className={'headerContent'}>
|
|
94
|
+
<div style={{flex: '1 1 0%', padding: '0 15px 0', marginLeft: '15px', display: 'flex', borderLeft: '1px solid #f0f0f0'}}>
|
|
95
|
+
{/* <div
|
|
96
|
+
className={'navigationBtn'}
|
|
97
|
+
onClick={() => {
|
|
98
|
+
message.warning('当前功能暂不支持。');
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<ApartmentOutlined />
|
|
102
|
+
|
|
103
|
+
流程导航
|
|
104
|
+
</div> */}
|
|
105
|
+
<div style={{position: 'relative'}}>
|
|
106
|
+
<Input
|
|
107
|
+
style={{width: '268px', height: '32px', borderRadius:'4px'}}
|
|
108
|
+
placeholder="搜索菜单"
|
|
109
|
+
allowClear
|
|
110
|
+
onFocus= {(e) => {
|
|
111
|
+
setKeyWord(e?.target?.value)
|
|
112
|
+
initRoute(routes, e?.target?.value)
|
|
113
|
+
}}
|
|
114
|
+
onBlur={() => {
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
setKeyWord('')
|
|
117
|
+
}, 600)
|
|
118
|
+
}}
|
|
119
|
+
|
|
120
|
+
prefix={<SearchOutlined />}
|
|
121
|
+
onChange={debounce((e: any) => {
|
|
122
|
+
setKeyWord(e?.target?.value)
|
|
123
|
+
initRoute(routes, e?.target?.value)
|
|
124
|
+
}, 600)}
|
|
125
|
+
/>
|
|
126
|
+
<div style={{display: judgeIsEmpty(keyWord) ? 'none' : 'block'}} className={'searchPanel'}>
|
|
127
|
+
<p className={'searchTitle'}>
|
|
128
|
+
共搜到{' '}
|
|
129
|
+
<span className={'themeColor'}>
|
|
130
|
+
{routeList.length || 0}
|
|
131
|
+
</span>{' '}
|
|
132
|
+
条结果{' '}
|
|
133
|
+
</p>
|
|
134
|
+
<div style={{marginTop: '10px'}}>
|
|
135
|
+
{
|
|
136
|
+
routeList.map(item => (
|
|
137
|
+
<div
|
|
138
|
+
className={'itemPath'}
|
|
139
|
+
onClick={() => {
|
|
140
|
+
history.push({
|
|
141
|
+
pathname: item.path
|
|
142
|
+
})
|
|
143
|
+
// setKeyWord('')
|
|
144
|
+
}}
|
|
145
|
+
title={item.fullPathName}
|
|
146
|
+
>{renderLineStyl(item.fullPathName)}</div>
|
|
147
|
+
))
|
|
148
|
+
}
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
{
|
|
154
|
+
showSelectStore && (
|
|
155
|
+
<ChooseStore employeeCode={employeeCode} />
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
<RightContent />
|
|
159
|
+
</div>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export default GlobalHeaderCom;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Form, Input, Button, Modal } from 'antd';
|
|
4
|
+
import { getAccountID, getUserId } from '@/utils/LocalstorageUtils';
|
|
5
|
+
import request from '@/utils/request';
|
|
6
|
+
|
|
7
|
+
export default (props: any) => {
|
|
8
|
+
const { loginOut } = props;
|
|
9
|
+
const [form] = Form.useForm();
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<Modal
|
|
13
|
+
{...props}
|
|
14
|
+
visible={props.visible}
|
|
15
|
+
onCancel={() => {
|
|
16
|
+
props.onCancel();
|
|
17
|
+
}}
|
|
18
|
+
footer={[
|
|
19
|
+
<Button onClick={() => props.onCancel()}>取消</Button>,
|
|
20
|
+
<Button
|
|
21
|
+
onClick={() => {
|
|
22
|
+
form.validateFields().then((res) => {
|
|
23
|
+
request({
|
|
24
|
+
url: `/bop/api/account/changePassWord/${getAccountID()}`,
|
|
25
|
+
method: 'patch',
|
|
26
|
+
params: res,
|
|
27
|
+
}).then(() => {
|
|
28
|
+
loginOut();
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}}
|
|
32
|
+
type="primary"
|
|
33
|
+
>
|
|
34
|
+
确认
|
|
35
|
+
</Button>,
|
|
36
|
+
]}
|
|
37
|
+
>
|
|
38
|
+
<Form
|
|
39
|
+
form={form}
|
|
40
|
+
name="login"
|
|
41
|
+
labelCol={{ span: 4 }}
|
|
42
|
+
wrapperCol={{ span: 20 }}
|
|
43
|
+
initialValues={{
|
|
44
|
+
username: getUserId(),
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<Form.Item label="账号" name="username">
|
|
48
|
+
<Input disabled />
|
|
49
|
+
</Form.Item>
|
|
50
|
+
<Form.Item
|
|
51
|
+
label="旧密码"
|
|
52
|
+
name="oldPassword"
|
|
53
|
+
rules={[{ required: true, message: '请输入您的旧密码' }]}
|
|
54
|
+
>
|
|
55
|
+
<Input.Password />
|
|
56
|
+
</Form.Item>
|
|
57
|
+
<Form.Item
|
|
58
|
+
label="新密码"
|
|
59
|
+
name="newPassword"
|
|
60
|
+
help="密码最少要包含一个大写字母+一个小写字母+一个数字+一个特殊符号最少6位"
|
|
61
|
+
rules={[
|
|
62
|
+
{ required: true, message: '请输入您的新密码' },
|
|
63
|
+
{
|
|
64
|
+
pattern:
|
|
65
|
+
/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/,
|
|
66
|
+
message: '密码强度不够请重新输入',
|
|
67
|
+
},
|
|
68
|
+
]}
|
|
69
|
+
>
|
|
70
|
+
<Input.Password />
|
|
71
|
+
</Form.Item>
|
|
72
|
+
|
|
73
|
+
<Form.Item
|
|
74
|
+
label="请确认密码"
|
|
75
|
+
name="confirmPassword"
|
|
76
|
+
help="请确认密码和第一次输入一致"
|
|
77
|
+
rules={[{ required: true, message: '请确认您的密码' }]}
|
|
78
|
+
>
|
|
79
|
+
<Input.Password />
|
|
80
|
+
</Form.Item>
|
|
81
|
+
</Form>
|
|
82
|
+
</Modal>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// @import '~antd/es/style/themes/default.less';
|
|
2
|
+
// @import '~antd/dist/antd.less';
|
|
3
|
+
|
|
4
|
+
@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
|
|
5
|
+
|
|
6
|
+
.menu {
|
|
7
|
+
.anticon {
|
|
8
|
+
margin-right: 8px;
|
|
9
|
+
}
|
|
10
|
+
.ant-dropdown-menu-item {
|
|
11
|
+
min-width: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rcom_right {
|
|
16
|
+
display: flex;
|
|
17
|
+
float: right;
|
|
18
|
+
height: 48px;
|
|
19
|
+
margin-left: auto;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
.action {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
height: 48px;
|
|
25
|
+
padding: 0 12px;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: all 0.3s;
|
|
28
|
+
> span {
|
|
29
|
+
vertical-align: middle;
|
|
30
|
+
}
|
|
31
|
+
&:hover {
|
|
32
|
+
background: @pro-header-hover-bg;
|
|
33
|
+
}
|
|
34
|
+
.opened {
|
|
35
|
+
background: @pro-header-hover-bg;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.search {
|
|
39
|
+
padding: 0 12px;
|
|
40
|
+
&:hover {
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.account {
|
|
45
|
+
.avatar {
|
|
46
|
+
margin-right: 8px;
|
|
47
|
+
color: #005cff;
|
|
48
|
+
vertical-align: top;
|
|
49
|
+
background: rgba(255, 255, 255, 0.85);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.ant-space-item {
|
|
53
|
+
margin: 0 10px 0 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rcom_dark {
|
|
58
|
+
.action {
|
|
59
|
+
&:hover {
|
|
60
|
+
background: #252a3d;
|
|
61
|
+
}
|
|
62
|
+
.opened {
|
|
63
|
+
background: #252a3d;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.ant-space-item {
|
|
67
|
+
margin: 0 10px 0 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.rcom_imgWap {
|
|
72
|
+
position: relative;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
|
|
76
|
+
.rcom_headLine {
|
|
77
|
+
width: 1px;
|
|
78
|
+
height: 16px;
|
|
79
|
+
margin-right: 20px;
|
|
80
|
+
background: #cacaca;
|
|
81
|
+
}
|
|
82
|
+
img {
|
|
83
|
+
width: 22px;
|
|
84
|
+
height: 22px;
|
|
85
|
+
margin-right: 20px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.rcom_userWarp {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
width: 142px;
|
|
94
|
+
height: 35px;
|
|
95
|
+
margin-right: 10px;
|
|
96
|
+
border: 1px solid #c8c8c8;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
.rcom_l {
|
|
99
|
+
margin-left: 4px;
|
|
100
|
+
img {
|
|
101
|
+
margin-right: 0;
|
|
102
|
+
width: 36px;
|
|
103
|
+
height: 36px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
.rcom_c {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
|
|
110
|
+
.rcom_ct {
|
|
111
|
+
color: #000000;
|
|
112
|
+
font-weight: 500;
|
|
113
|
+
font-size: 12px;
|
|
114
|
+
font-family: Montserrat, Montserrat-Medium;
|
|
115
|
+
line-height: 14px;
|
|
116
|
+
text-align: left;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rcom_cb {
|
|
120
|
+
color: #bfbfbf;
|
|
121
|
+
font-weight: 400;
|
|
122
|
+
font-size: 10px;
|
|
123
|
+
font-family: Montserrat, Montserrat-Regular;
|
|
124
|
+
line-height: 14px;
|
|
125
|
+
text-align: left;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.rcom_r {
|
|
129
|
+
margin-right: 9px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.rcom_.userWarp:hover,
|
|
134
|
+
.rcom_c:hover,
|
|
135
|
+
.rcom_l:hover,
|
|
136
|
+
.rcom_r:hover {
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.userDownWarp {
|
|
141
|
+
width: 217px;
|
|
142
|
+
// height: 310px;
|
|
143
|
+
margin-top: 4px;
|
|
144
|
+
background: #ffffff;
|
|
145
|
+
box-shadow: 0px 2px 4px 0px rgba(185, 185, 185, 0.5);
|
|
146
|
+
|
|
147
|
+
.userDownTop {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
align-items: center;
|
|
151
|
+
height: 155px;
|
|
152
|
+
padding: 20px 0;
|
|
153
|
+
border-bottom: 1px solid #d9d9d9;
|
|
154
|
+
|
|
155
|
+
.userDownTopT {
|
|
156
|
+
width: 68px;
|
|
157
|
+
height: 68px;
|
|
158
|
+
border-radius: 50%;
|
|
159
|
+
}
|
|
160
|
+
.userDownTopC {
|
|
161
|
+
color: #000000;
|
|
162
|
+
font-weight: 500;
|
|
163
|
+
font-size: 14px;
|
|
164
|
+
font-family: Montserrat, Montserrat-Medium;
|
|
165
|
+
line-height: 26px;
|
|
166
|
+
text-align: center;
|
|
167
|
+
}
|
|
168
|
+
.userDownTopB {
|
|
169
|
+
color: #bfbfbf;
|
|
170
|
+
font-weight: 400;
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
font-family: Montserrat, Montserrat-Regular;
|
|
173
|
+
line-height: 15px;
|
|
174
|
+
text-align: center;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.userDownB {
|
|
179
|
+
.userDownBList,
|
|
180
|
+
.userDownOut {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
height: 36px;
|
|
184
|
+
background: #ffffff;
|
|
185
|
+
border-bottom: 1px solid #f3f3f3;
|
|
186
|
+
|
|
187
|
+
.rcom_label {
|
|
188
|
+
margin: 0 4px 0 20px;
|
|
189
|
+
img {
|
|
190
|
+
width: 16px;
|
|
191
|
+
|
|
192
|
+
height: 16px;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
.rcom_name {
|
|
196
|
+
color: #000000;
|
|
197
|
+
font-weight: 400;
|
|
198
|
+
font-size: 12px;
|
|
199
|
+
font-family: PingFangSC, PingFangSC-Regular;
|
|
200
|
+
line-height: 16px;
|
|
201
|
+
text-align: left;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.userDownBList:hover,
|
|
206
|
+
.userDownOut:hover {
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.userDownOut {
|
|
211
|
+
height: 46px;
|
|
212
|
+
border-bottom: none;
|
|
213
|
+
.rcom_name {
|
|
214
|
+
color: #fe0300;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|