@bit-sun/business-component 2.0.37 → 2.0.39-alpha.0

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.
Files changed (153) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -4
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +77 -74
  7. package/README.md +27 -27
  8. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +4 -0
  9. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
  11. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
  12. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
  13. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +3 -0
  14. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +2 -0
  15. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
  16. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +4 -0
  17. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +2 -0
  18. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
  19. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
  20. package/dist/components/Business/BsLayouts/index.d.ts +18 -0
  21. package/dist/components/Business/BsLayouts/service.d.ts +1 -0
  22. package/dist/components/Business/BsLayouts/utils.d.ts +22 -0
  23. package/dist/components/Business/DetailPageWrapper/utils.d.ts +1 -2
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.esm.js +11703 -44
  26. package/dist/index.js +11678 -11
  27. package/dist/utils/enumConfig.d.ts +10 -0
  28. package/dist/utils/utils.d.ts +2 -1
  29. package/docs/index.md +21 -21
  30. package/lib/assets/drag.svg +17 -17
  31. package/lib/assets/exportFail.svg +37 -37
  32. package/lib/assets/exportProcessing.svg +28 -28
  33. package/lib/assets/exportSuccess.svg +34 -34
  34. package/lib/assets/label_icon_bottom.svg +25 -25
  35. package/lib/assets/upExport.svg +22 -22
  36. package/package.json +70 -66
  37. package/src/assets/32.svg +28 -0
  38. package/src/assets/addIcon.svg +18 -0
  39. package/src/assets/allfunc.svg +28 -0
  40. package/src/assets/arrowRight.svg +25 -0
  41. package/src/assets/btn-delete.svg +29 -29
  42. package/src/assets/btn-edit.svg +19 -19
  43. package/src/assets/btn-more.svg +17 -17
  44. package/src/assets/btn-submit.svg +19 -19
  45. package/src/assets/caidan.svg +12 -0
  46. package/src/assets/close.svg +26 -26
  47. package/src/assets/closeicon.png +0 -0
  48. package/src/assets/drag.svg +17 -17
  49. package/src/assets/exportFail.svg +37 -37
  50. package/src/assets/exportProcessing.svg +28 -28
  51. package/src/assets/exportSuccess.svg +34 -34
  52. package/src/assets/fixed-left-active.svg +11 -11
  53. package/src/assets/fixed-left.svg +15 -15
  54. package/src/assets/fixed-right-active.svg +11 -11
  55. package/src/assets/fixed-right.svg +15 -15
  56. package/src/assets/guanbi.svg +16 -0
  57. package/src/assets/icon-quanping.svg +15 -15
  58. package/src/assets/icon-shezhi.svg +17 -17
  59. package/src/assets/label_icon_bottom.svg +25 -25
  60. package/src/assets/morentouxiang-32.svg +24 -0
  61. package/src/assets/right.png +0 -0
  62. package/src/assets/scanning.svg +24 -24
  63. package/src/assets/upExport.svg +22 -22
  64. package/src/assets/xinglan-icon-out.png +0 -0
  65. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  66. package/src/components/Business/AddSelectBusiness/index.tsx +290 -290
  67. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
  68. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
  69. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
  72. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
  73. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
  74. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
  75. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
  76. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
  77. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
  78. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
  79. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
  80. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +158 -0
  81. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
  82. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
  83. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -0
  84. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +162 -0
  85. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
  86. package/src/components/Business/BsLayouts/index.less +80 -0
  87. package/src/components/Business/BsLayouts/index.tsx +1495 -0
  88. package/src/components/Business/BsLayouts/service.ts +11 -0
  89. package/src/components/Business/BsLayouts/utils.tsx +350 -0
  90. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  91. package/src/components/Business/BsSulaQueryTable/index.tsx +535 -534
  92. package/src/components/Business/BsSulaQueryTable/setting.tsx +818 -817
  93. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  94. package/src/components/Business/BsSulaQueryTable/utils.tsx +691 -690
  95. package/src/components/Business/CommodityEntry/index.md +70 -70
  96. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  97. package/src/components/Business/CommonAlert/index.tsx +23 -23
  98. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  99. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  100. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  101. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  102. package/src/components/Business/DetailPageWrapper/index.tsx +335 -324
  103. package/src/components/Business/DetailPageWrapper/utils.tsx +101 -111
  104. package/src/components/Business/HomePageWrapper/index.less +33 -33
  105. package/src/components/Business/HomePageWrapper/index.md +45 -45
  106. package/src/components/Business/HomePageWrapper/index.tsx +162 -150
  107. package/src/components/Business/SearchSelect/BusinessUtils.ts +1458 -1457
  108. package/src/components/Business/SearchSelect/common.ts +53 -53
  109. package/src/components/Business/SearchSelect/index.md +1137 -1137
  110. package/src/components/Business/SearchSelect/index.tsx +51 -51
  111. package/src/components/Business/SearchSelect/utils.ts +100 -99
  112. package/src/components/Business/StateFlow/index.less +130 -130
  113. package/src/components/Business/StateFlow/index.md +60 -60
  114. package/src/components/Business/StateFlow/index.tsx +29 -29
  115. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  116. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  117. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  118. package/src/components/Business/columnSettingTable/columnSetting.tsx +763 -762
  119. package/src/components/Business/columnSettingTable/index.less +247 -247
  120. package/src/components/Business/columnSettingTable/index.md +357 -357
  121. package/src/components/Business/columnSettingTable/index.tsx +226 -225
  122. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +234 -233
  123. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  124. package/src/components/Functional/AddSelect/index.less +367 -367
  125. package/src/components/Functional/AddSelect/index.md +122 -122
  126. package/src/components/Functional/AddSelect/index.tsx +962 -962
  127. package/src/components/Functional/BillEntry/index.less +371 -371
  128. package/src/components/Functional/BillEntry/index.md +39 -39
  129. package/src/components/Functional/BillEntry/index.tsx +613 -607
  130. package/src/components/Functional/DataImport/index.less +63 -63
  131. package/src/components/Functional/DataImport/index.md +44 -44
  132. package/src/components/Functional/DataImport/index.tsx +689 -689
  133. package/src/components/Functional/DataValidation/index.less +63 -63
  134. package/src/components/Functional/DataValidation/index.md +38 -38
  135. package/src/components/Functional/DataValidation/index.tsx +681 -681
  136. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  137. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  138. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  139. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  140. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  141. package/src/components/Functional/SearchSelect/index.less +115 -115
  142. package/src/components/Functional/SearchSelect/index.md +141 -141
  143. package/src/components/Functional/SearchSelect/index.tsx +812 -812
  144. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  145. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  146. package/src/index.ts +31 -30
  147. package/src/utils/CheckOneUser/index.md +39 -39
  148. package/src/utils/CheckOneUser/index.ts +51 -51
  149. package/src/utils/enumConfig.ts +10 -0
  150. package/src/utils/requestUtils.ts +33 -32
  151. package/src/utils/utils.ts +52 -22
  152. package/tsconfig.json +29 -29
  153. package/typings.d.ts +4 -4
@@ -0,0 +1,75 @@
1
+ // @ts-nocheck
2
+ import React, {useState} from "react";
3
+ import { Button, Drawer } from "antd";
4
+ import DrawContent from "./DrawContent";
5
+ import caidan from '../../../../../../assets/caidan.svg';
6
+ import guanbi from '../../../../../../assets/guanbi.svg';
7
+
8
+ const CustomerMenuHeader = ({collapsed, handleClose, originRoutes, itemPath}: any) => {
9
+ const [isDrawer, setIsDrawer] = useState(false);
10
+ const onClose = () => {
11
+ setIsDrawer(false)
12
+ }
13
+ return (
14
+ <>
15
+ <div style={{width: '190px' }} className={'header_style'}>
16
+ <div
17
+ style={{
18
+ padding: '0',
19
+ }}
20
+ >
21
+ <div style={{display: 'flex',alignItems: 'center'}}>
22
+ <Button
23
+ // key={Math.random()}
24
+ style={{
25
+ width: '50px',
26
+ height: '50px',
27
+ borderRadius: '0px'
28
+ }}
29
+ type="primary"
30
+ icon={
31
+ !isDrawer ?
32
+ <img style={{marginLeft: '-2px', height: '48px'}} src={caidan} width={48} height={48} /> :
33
+ <img style={{marginLeft: '-2px', height: '48px'}} src={guanbi} width={48} height={48} />
34
+ }
35
+ onClick={(e) => {
36
+ handleClose();
37
+ e.stopPropagation();
38
+ setIsDrawer(!isDrawer)
39
+ }}
40
+ />
41
+ <div>
42
+ {
43
+ React.createElement('img', {
44
+ src: './xinglan-logo.png',
45
+ style: {
46
+ width: '116px',
47
+ height: '30px',
48
+ marginLeft: '19px',
49
+
50
+ },
51
+ })
52
+ }
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ <Drawer
58
+ style={{ top: 50, padding: '0' }}
59
+ // title={<span style={{ fontWeight: 'bold', fontSize: 18 }}></span>}
60
+ zIndex={9999}
61
+ destroyOnClose
62
+ headerStyle={{display: 'none'}}
63
+ width={1080}
64
+ className={'global_menu_draw'}
65
+ placement="left"
66
+ onClose={onClose}
67
+ visible={isDrawer}
68
+ >
69
+ <DrawContent itemPath={itemPath} originRoutes={originRoutes} onClose={onClose} />
70
+ </Drawer>
71
+ </>
72
+ )
73
+ }
74
+
75
+ export default CustomerMenuHeader;
@@ -0,0 +1,171 @@
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: #1890ff;
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
+ .global_menu_draw_content {
63
+ display: flex;
64
+ height: 100%;
65
+ .allFunsList {
66
+ margin-bottom: 10px;
67
+ }
68
+ .drawerWarp_left {
69
+ width: 150px;
70
+ height: 100%;
71
+ flex-shrink: 0;
72
+ border-right: 1px solid #f0f0f0;
73
+
74
+ .left_item_title {
75
+ font-family: PingFangSC-Regular;
76
+ font-weight: 400;
77
+ font-size: 12px;
78
+ color: #8c8c8c;
79
+ letter-spacing: 0;
80
+ line-height: 20px;
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ white-space: nowrap;
84
+ margin: 20px 0px;
85
+ padding-left: 10px;
86
+ }
87
+
88
+ .left_item {
89
+ font-family: PingFangSC-Regular;
90
+ font-weight: 400;
91
+ font-size: 14px;
92
+ color: #000000;
93
+ letter-spacing: 0;
94
+ line-height: 20px;
95
+ overflow: hidden;
96
+ text-overflow: ellipsis;
97
+ white-space: nowrap;
98
+ cursor: pointer;
99
+ margin: 20px 0px;
100
+ padding-left: 10px;
101
+ }
102
+
103
+ .left_item:hover {
104
+ color: #1890ff !important;
105
+ }
106
+ }
107
+ .drawerWarp_right {
108
+ column-count: 4;
109
+ flex-grow: 1;
110
+ padding-left: 10px;
111
+ .ant-list-header {
112
+ padding: 0 0 0 10px !important;
113
+ line-height: 30px;
114
+ border: 0px !important;
115
+ b {
116
+ width: 100%;
117
+ box-sizing: border-box;
118
+ display: inline-block;
119
+ border-bottom: 1px solid #f0f0f0;
120
+ }
121
+ }
122
+ .ant-list-item {
123
+ padding: 0 0 0 10px !important;
124
+ line-height: 30px !important;
125
+ }
126
+
127
+ .ant-drawer-close {
128
+ position: absolute;
129
+ right: 0;
130
+ }
131
+ }
132
+ .search_menu_content {
133
+ flex-grow: 1;
134
+ display: flex;
135
+ flex-wrap: wrap;
136
+ background-color: #ffffff;
137
+ div {
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ padding: 8px 20px;
142
+ font-size: 14px;
143
+ font-weight: 400;
144
+ color: #000000;
145
+ background: #f8f9fa;
146
+ border-radius: 100px;
147
+ margin-right: 10px;
148
+ margin-bottom: 10px;
149
+ }
150
+ div:hover {
151
+ cursor: pointer;
152
+ }
153
+ }
154
+ .allFunsListWarp {
155
+ width: 200px;
156
+ margin-right: 10px;
157
+ border-radius: 4px;
158
+
159
+ break-inside: avoid;
160
+ }
161
+ .choosedStyle {
162
+ .ant-list-header {
163
+ background-color: #005CFF;
164
+ opacity: 0.8;
165
+ b {
166
+ border-bottom: 1px solid #005CFF;
167
+ }
168
+ }
169
+ }
170
+
171
+ }
@@ -0,0 +1,65 @@
1
+ .customer_menu_content {
2
+ color: #b1bad4;
3
+ background: #141620;
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ font-size: 18px;
8
+ height: 45px;
9
+ border-bottom: 1px solid #3d4047;
10
+ .ant-btn-link {
11
+ color: #b1bad4 !important;
12
+ font-size: 16px;
13
+ height: 36px;
14
+ }
15
+ .ant-drawer-body {
16
+ padding: 10px !important;
17
+ }
18
+ }
19
+
20
+ .menu_drawer_header_warp {
21
+ .ant-drawer-body {
22
+ background-color: #F8F9FA;
23
+ padding: 10px 0 0 0 !important;
24
+ }
25
+ }
26
+
27
+ .menu_title_line {
28
+ font-size: 16px;
29
+ font-weight: bold;
30
+ color: #b1bad4;
31
+ text-align: center;
32
+ margin-bottom: 10px;
33
+ }
34
+
35
+ .menu_item {
36
+ line-height: 30px;
37
+ color: rgba(44, 47, 46);
38
+ overflow: hidden;
39
+ text-overflow: ellipsis;
40
+ white-space: nowrap;
41
+ }
42
+
43
+ .link_style:hover {
44
+ background-color: #E4E7ED;
45
+ cursor: pointer;
46
+ }
47
+
48
+
49
+
50
+ .header_style {
51
+ height: 50px;
52
+ position: fixed;
53
+ top: 0;
54
+ left: 0;
55
+ padding: 0;
56
+ display: flex;
57
+ align-items: center;
58
+ background-color: #ffffff;
59
+ }
60
+
61
+ .global_menu_draw {
62
+ .ant-drawer-body {
63
+ padding: 10px !important;
64
+ }
65
+ }
@@ -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,158 @@
1
+ // @ts-nocheck
2
+ import React, { useState } from "react";
3
+ import RightContent from '../RightContent';
4
+ import { Input } from 'antd';
5
+ import { SearchOutlined } from '@ant-design/icons';
6
+ import { debounce, cloneDeep } from 'lodash';
7
+ import { formatMessage, history } from 'umi';
8
+ import ENUM from '@/utils/enumConfig';
9
+ import './index.less';
10
+
11
+
12
+ export const judgeIsEmpty = (value: any) => {
13
+ if (value == null || value == undefined || String(value).trim() == '') {
14
+ return true;
15
+ }
16
+ return false;
17
+ };
18
+
19
+ const GlobalHeaderCom = (props: any) => {
20
+ const { route: {routes=[]}} = props;
21
+ const [keyWord, setKeyWord] = useState('');
22
+ const [routeList, setroutesData] = useState<any[]>([]);
23
+
24
+ const getFullPathName = (nameId:string) => {
25
+ const nameIdArr = nameId.split('.');
26
+ let nameStr = '';
27
+ for (let i = 0; i < nameIdArr.length; i++) {
28
+ let itemId = nameIdArr.slice(0, i+1).join('.');
29
+ nameStr += `${i === 0 ? '': '-'}${formatMessage({ id: `menu.${itemId}` })}`;
30
+ }
31
+ return nameStr;
32
+ }
33
+ const initRoute = (router: any, name?: any) => {
34
+ const resultList: any = [];
35
+ const newRouter = cloneDeep(router);
36
+ const btnAuth = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) || '[]');
37
+ const deep = (router: any) => {
38
+ if (router && Array.isArray(router)) {
39
+ router.forEach((item) => {
40
+ if (item.routes && Array.isArray(item.routes)) {
41
+ item.routes.forEach((d: any) => {
42
+ if (!d.nameEdit) {
43
+ d.name = item.name + '.' + d.name;
44
+ d.nameEdit = true;
45
+ }
46
+ });
47
+ deep(item.routes);
48
+ } else if (
49
+ !item.hideInMenu &&
50
+ (name
51
+ ? formatMessage({ id: `menu.${item.name}` }).indexOf(name) !== -1
52
+ : true)
53
+ && btnAuth.find((d: any) => d === item.code)
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: '#1890ff'}}>{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
+ &nbsp;&nbsp;
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
+ <RightContent />
154
+ </div>
155
+ )
156
+ }
157
+
158
+ export default GlobalHeaderCom;