@bit-sun/business-component 2.1.1 → 2.1.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.
Files changed (137) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +119 -92
  9. package/dist/index.js +119 -92
  10. package/dist/utils/enumConfig.d.ts +1 -0
  11. package/dist/utils/utils.d.ts +2 -0
  12. package/docs/index.md +21 -21
  13. package/lib/assets/drag.svg +17 -17
  14. package/lib/assets/exportFail.svg +37 -37
  15. package/lib/assets/exportProcessing.svg +28 -28
  16. package/lib/assets/exportSuccess.svg +34 -34
  17. package/lib/assets/label_icon_bottom.svg +25 -25
  18. package/lib/assets/upExport.svg +22 -22
  19. package/package.json +71 -71
  20. package/src/assets/32.svg +27 -27
  21. package/src/assets/addIcon.svg +17 -17
  22. package/src/assets/allfunc.svg +27 -27
  23. package/src/assets/arrowRight.svg +24 -24
  24. package/src/assets/btn-delete.svg +29 -29
  25. package/src/assets/btn-edit.svg +19 -19
  26. package/src/assets/btn-more.svg +17 -17
  27. package/src/assets/btn-submit.svg +19 -19
  28. package/src/assets/caidan.svg +11 -11
  29. package/src/assets/close.svg +26 -26
  30. package/src/assets/drag.svg +17 -17
  31. package/src/assets/exportFail.svg +37 -37
  32. package/src/assets/exportProcessing.svg +28 -28
  33. package/src/assets/exportSuccess.svg +34 -34
  34. package/src/assets/fixed-left-active.svg +11 -11
  35. package/src/assets/fixed-left.svg +15 -15
  36. package/src/assets/fixed-right-active.svg +11 -11
  37. package/src/assets/fixed-right.svg +15 -15
  38. package/src/assets/guanbi.svg +15 -15
  39. package/src/assets/icon-quanping.svg +15 -15
  40. package/src/assets/icon-shezhi.svg +17 -17
  41. package/src/assets/label_icon_bottom.svg +25 -25
  42. package/src/assets/list-no-img.svg +21 -21
  43. package/src/assets/morentouxiang-32.svg +23 -23
  44. package/src/assets/scanning.svg +24 -24
  45. package/src/assets/upExport.svg +22 -22
  46. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  47. package/src/components/Business/AddSelectBusiness/index.tsx +290 -290
  48. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  49. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  50. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  58. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  59. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  60. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  61. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  62. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  63. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  64. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -156
  65. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  66. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  67. package/src/components/Business/BsLayouts/index.less +79 -79
  68. package/src/components/Business/BsLayouts/index.tsx +1469 -1465
  69. package/src/components/Business/BsLayouts/service.ts +10 -10
  70. package/src/components/Business/BsLayouts/utils.tsx +210 -210
  71. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  72. package/src/components/Business/BsSulaQueryTable/index.tsx +505 -505
  73. package/src/components/Business/BsSulaQueryTable/setting.tsx +801 -799
  74. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  75. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -688
  76. package/src/components/Business/CommodityEntry/index.md +70 -70
  77. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  78. package/src/components/Business/CommonAlert/index.tsx +23 -23
  79. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  80. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  81. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  82. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  83. package/src/components/Business/DetailPageWrapper/index.tsx +335 -334
  84. package/src/components/Business/DetailPageWrapper/utils.tsx +102 -100
  85. package/src/components/Business/HomePageWrapper/index.less +33 -33
  86. package/src/components/Business/HomePageWrapper/index.md +45 -45
  87. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  88. package/src/components/Business/SearchSelect/BusinessUtils.ts +1458 -1458
  89. package/src/components/Business/SearchSelect/common.ts +53 -53
  90. package/src/components/Business/SearchSelect/index.md +1137 -1137
  91. package/src/components/Business/SearchSelect/index.tsx +51 -51
  92. package/src/components/Business/SearchSelect/utils.ts +100 -100
  93. package/src/components/Business/StateFlow/index.less +130 -130
  94. package/src/components/Business/StateFlow/index.md +60 -60
  95. package/src/components/Business/StateFlow/index.tsx +29 -29
  96. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  97. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  98. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  99. package/src/components/Business/columnSettingTable/columnSetting.tsx +765 -763
  100. package/src/components/Business/columnSettingTable/index.less +247 -247
  101. package/src/components/Business/columnSettingTable/index.md +357 -357
  102. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  103. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  104. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  105. package/src/components/Functional/AddSelect/index.less +367 -367
  106. package/src/components/Functional/AddSelect/index.md +122 -122
  107. package/src/components/Functional/AddSelect/index.tsx +994 -992
  108. package/src/components/Functional/BillEntry/index.less +371 -371
  109. package/src/components/Functional/BillEntry/index.md +39 -39
  110. package/src/components/Functional/BillEntry/index.tsx +643 -643
  111. package/src/components/Functional/DataImport/index.less +63 -63
  112. package/src/components/Functional/DataImport/index.md +44 -44
  113. package/src/components/Functional/DataImport/index.tsx +689 -689
  114. package/src/components/Functional/DataValidation/index.less +63 -63
  115. package/src/components/Functional/DataValidation/index.md +38 -38
  116. package/src/components/Functional/DataValidation/index.tsx +681 -681
  117. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  118. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  119. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  120. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  121. package/src/components/Functional/QueryMutipleInput/index.tsx +130 -128
  122. package/src/components/Functional/SearchSelect/index.less +115 -115
  123. package/src/components/Functional/SearchSelect/index.md +141 -141
  124. package/src/components/Functional/SearchSelect/index.tsx +814 -812
  125. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  126. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  127. package/src/index.ts +31 -31
  128. package/src/styles/bsDefault.less +1906 -1906
  129. package/src/utils/CheckOneUser/index.md +39 -39
  130. package/src/utils/CheckOneUser/index.ts +51 -51
  131. package/src/utils/checkUtils.ts +39 -39
  132. package/src/utils/enumConfig.ts +10 -9
  133. package/src/utils/index.ts +2 -2
  134. package/src/utils/requestUtils.ts +33 -33
  135. package/src/utils/utils.ts +69 -52
  136. package/tsconfig.json +29 -29
  137. package/typings.d.ts +4 -4
@@ -1,335 +1,336 @@
1
- // @ts-nocheck
2
- import {
3
- ArrowLeftOutlined,
4
- } from '@ant-design/icons';
5
- import { Anchor, Tooltip, Button, Menu, Dropdown, Breadcrumb } from 'antd';
6
- import React, { useEffect, useState, useMemo } from 'react';
7
- import { history } from 'umi';
8
- import { getMainCrumbNameMap, doDetailPageAction, judgeIsEmpty } from './utils';
9
- import { memoizeOneFormatter } from '@/utils/utils';
10
- import './index.less';
11
- import quanping from '../../../assets/icon-quanping.svg';
12
- import scanning from '../../../assets/scanning.svg';
13
- import editIcon from '../../../assets/btn-edit.svg';
14
- import submitIcon from '../../../assets/btn-submit.svg';
15
- import deleteIcon from '../../../assets/btn-delete.svg';
16
- import moreIcon from '../../../assets/btn-more.svg';
17
- import { useLocation, formatMessage } from 'umi';
18
- import CommonAlert from '../CommonAlert';
19
- import ENUM from '@/utils/enumConfig';
20
-
21
- interface actionItem {
22
- type?: string;
23
- name: string;
24
- icon?: string;
25
- visible?: boolean | string;
26
- disabled?: boolean;
27
- code?: string; //权限过滤todo
28
- action: object;
29
- }
30
-
31
- export const iconMap = {
32
- edit: <img src={editIcon} />,
33
- delete: <img src={deleteIcon} />,
34
- submit: <img src={submitIcon} />,
35
- more: <img src={moreIcon} />,
36
- };
37
-
38
- export default (props: any) => {
39
- const { pathname } = useLocation();
40
- const [id]: any = useState(pathname + 'id');
41
- const { children, ...restProps } = props;
42
-
43
- return (
44
- <div id={id} className={'detail_page_wrapper'}>
45
- <DetailWrapper
46
- pathname={pathname}
47
- {
48
- ...restProps
49
- }
50
- />
51
- {children}
52
- </div>
53
- );
54
- };
55
-
56
- const DetailWrapper = React.memo(
57
- ({
58
- pathname,
59
- actionList=[],
60
- routes=[],
61
- itemPath,
62
- alertProps,
63
- donotNeedShowScreenIcon=false,
64
- title,
65
- pathToRegexp,
66
- }: any) => {
67
- const [isFullScreen, setIsFnllScreen]: any = useState(false);
68
- const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
69
-
70
- const basePath = window.top == window ? '' : `/${itemPath}`;
71
-
72
- const menuRoutes =
73
- window.top == window
74
- ? routes.find((item) => item.path === '/')?.routes || []
75
- : JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA) || '[]');
76
-
77
- const breadcrumbNameMap = getMainCrumbNameMap(
78
- memoizeOneFormatter(menuRoutes, ''),
79
- );
80
- const matchParamsPath = (pathname: string, breadcrumbNameMap: object) => {
81
- const pathKey: any = Object.keys(breadcrumbNameMap).find((key) =>
82
- pathToRegexp ? pathToRegexp(key).test(pathname) : false
83
- );
84
- return pathKey ? breadcrumbNameMap[pathKey] : undefined;
85
- };
86
-
87
- const getPageTitle = (pathname: string) => {
88
- const currRouterData = matchParamsPath(
89
- `${basePath}${pathname}`,
90
- breadcrumbNameMap,
91
- );
92
-
93
- if (!currRouterData) {
94
- return '';
95
- }
96
-
97
- let breadcrumbArrs = currRouterData.nameMap || [];
98
- if (title && breadcrumbArrs.length) {
99
- breadcrumbArrs.pop();
100
- breadcrumbArrs.push(title)
101
- }
102
- setBreadCrumbArr([...breadcrumbArrs])
103
-
104
- const pageName = formatMessage({
105
- id: currRouterData.locale || currRouterData.name,
106
- defaultMessage: currRouterData.name,
107
- });
108
-
109
- return title ? title : window.top === window ? pageName : `${currRouterData.name}`;
110
- };
111
-
112
- const pageTitle = useMemo(() => getPageTitle(pathname), [pathname, title]);
113
-
114
- // const breadcrumbArr = `${basePath}${pathname}`
115
- // .split('/')
116
- // .slice(1)
117
- // .map((_item, index, arr) =>
118
- // matchParamsPath(
119
- // `/${arr.slice(0, index + 1).join('/')}`,
120
- // breadcrumbNameMap,
121
- // ),
122
- // )
123
- // .filter((item) => item);
124
-
125
- useEffect(() => {}, []);
126
-
127
- const ShowFullScreen = () => {
128
- if (window.top != window) {
129
- window.parent.postMessage(
130
- {
131
- type: 'screenChange',
132
- id: itemPath,
133
- },
134
- '*',
135
- );
136
- setIsFnllScreen(!isFullScreen);
137
- } else {
138
- const isFullScreen: any =
139
- document.fullScreen ||
140
- document.webkitIsFullScreen ||
141
- document.mozFullScreen;
142
- let contentEle: any = document.querySelector(`body`);
143
- // addTabsNavStyle(isFullScreen);
144
- if (contentEle && !isFullScreen) {
145
- let fullScreenEle =
146
- contentEle.requestFullscreen ||
147
- contentEle.mozRequestFullScreen ||
148
- contentEle.webkitRequestFullScreen ||
149
- contentEle.msRequestFullscreen;
150
- if (fullScreenEle) {
151
- fullScreenEle.call(contentEle);
152
- setIsFnllScreen(true);
153
- return;
154
- }
155
- }
156
- if (document && isFullScreen) {
157
- let exitFullScreen =
158
- document.exitFullscreen ||
159
- document.mozCancelFullScreen ||
160
- document.webkitCancelFullScreen ||
161
- document.msExitFullscreen;
162
- if (exitFullScreen) {
163
- exitFullScreen.call(document);
164
- setIsFnllScreen(false);
165
- return;
166
- }
167
- }
168
- }
169
- };
170
-
171
- const renderPageActionList = (actionLists: Array<actionItem>) => {
172
- const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
173
- ? JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string)
174
- : [];
175
- let visibleActions = actionLists.filter(
176
- (action) =>
177
- ((action.visible && action.visible !== 'false') || judgeIsEmpty(action.visible)) &&
178
- (judgeIsEmpty(action.code) || authButton.filter(item => item === action.code)),
179
- );
180
-
181
- const renderButton = (item: actionItem, type?: any) => {
182
- return (
183
- <Button
184
- type={type || 'primary'}
185
- icon={item.icon ? iconMap[item.icon] : ''}
186
- danger={item.name === '删除' ? true : false}
187
- disabled={item.disabled}
188
- onClick={() => {
189
- if (typeof item.action === 'function') {
190
- item.action();
191
- } else {
192
- doDetailPageAction(item.action);
193
- }
194
- }}
195
- >
196
- {item.name}
197
- </Button>
198
- );
199
- };
200
-
201
- if (visibleActions.length <= 3) {
202
- return visibleActions.map((item) => {
203
- return renderButton(item);
204
- });
205
- }
206
-
207
- let moreOperate = visibleActions.splice(3);
208
- const menu = (
209
- <Menu>
210
- {moreOperate.map((item: any, index: number) => (
211
- <Menu.Item className="more-btn-action" key={index}>
212
- {renderButton(item, 'link')}
213
- </Menu.Item>
214
- ))}
215
- </Menu>
216
- );
217
- //按钮操作3个显示更多
218
- return (
219
- <div className="detail_btn_wrapper">
220
- {visibleActions.map((item: any, index: number) => {
221
- return renderButton(item);
222
- })}
223
- <Dropdown style={{ padding: '0px' }} overlay={menu}>
224
- <Button type="primary">
225
- <span style={{ margin: '0px' }}>更多</span>
226
- <img src={moreIcon} />
227
- </Button>
228
- </Dropdown>
229
- </div>
230
- );
231
- };
232
-
233
- return (
234
- <Anchor
235
- key={`${pathname}_anchor`}
236
- offsetTop={window.top == window ? 78 : 0}
237
- >
238
- <div>
239
- <div className={'detail_page_head'}>
240
- <div
241
- className={'back_home_img_content'}
242
- onClick={() => {
243
- history.goBack();
244
- }}
245
- >
246
- <ArrowLeftOutlined />
247
- </div>
248
- <div className={'detail_page_title_box'}>
249
- <div className={'detail_page_title'}>{pageTitle}</div>
250
- <Breadcrumb>
251
- {breadcrumbArr.map((item) => (
252
- <Breadcrumb.Item
253
- key={item}
254
- onClick={() => {
255
- // if (
256
- // item.path &&
257
- // !item.children &&
258
- // !pathToRegexp(item.path).test(`${basePath}${pathname}`)
259
- // ) {
260
- // history.push({
261
- // pathname: item.path.replace(basePath, ''),
262
- // });
263
- // }
264
- }}
265
- >
266
- <span
267
- style={{
268
- // color:
269
- // item.path &&
270
- // pathToRegexp(item.path).test(`${basePath}${pathname}`)
271
- // ? '#000000d9'
272
- // : '',
273
- }}
274
- className="bread_name"
275
- >
276
- {item}
277
- </span>
278
- </Breadcrumb.Item>
279
- ))}
280
- </Breadcrumb>
281
- </div>
282
- <div
283
- className={'detail_page_btns'}
284
- style={{ marginRight: '20px', display: 'flex', gap: '8px' }}
285
- >
286
- {renderPageActionList(actionList)}
287
- {
288
- !donotNeedShowScreenIcon ? ( <a>
289
- {isFullScreen ? (
290
- <Tooltip title="取消全屏">
291
- <img
292
- onClick={() => {
293
- ShowFullScreen();
294
- }}
295
- width={32}
296
- src={scanning}
297
- />
298
- </Tooltip>
299
- ) : (
300
- <Tooltip title="全屏">
301
- <img
302
- onClick={() => {
303
- ShowFullScreen();
304
- }}
305
- width={32}
306
- src={quanping}
307
- />
308
- </Tooltip>
309
- )}
310
- </a>) : null
311
- }
312
- </div>
313
- </div>
314
- {
315
- alertProps && (
316
- <CommonAlert
317
- {
318
- ...alertProps
319
- }
320
- />
321
- )
322
- }
323
- </div>
324
- </Anchor>
325
- );
326
- },
327
- (prevProps, nextProps) => {
328
- if (
329
- (JSON.stringify(prevProps.actionList) != JSON.stringify(nextProps.actionList)) || prevProps.title !== nextProps.title
330
- ) {
331
- return false;
332
- }
333
- return true;
334
- },
1
+ // @ts-nocheck
2
+ import {
3
+ ArrowLeftOutlined,
4
+ } from '@ant-design/icons';
5
+ import { Anchor, Tooltip, Button, Menu, Dropdown, Breadcrumb } from 'antd';
6
+ import React, { useEffect, useState, useMemo } from 'react';
7
+ import { history } from 'umi';
8
+ import { getMainCrumbNameMap, doDetailPageAction, judgeIsEmpty } from './utils';
9
+ import { memoizeOneFormatter, go2BackAndClose } from '@/utils/utils';
10
+ import './index.less';
11
+ import quanping from '../../../assets/icon-quanping.svg';
12
+ import scanning from '../../../assets/scanning.svg';
13
+ import editIcon from '../../../assets/btn-edit.svg';
14
+ import submitIcon from '../../../assets/btn-submit.svg';
15
+ import deleteIcon from '../../../assets/btn-delete.svg';
16
+ import moreIcon from '../../../assets/btn-more.svg';
17
+ import { useLocation, formatMessage } from 'umi';
18
+ import CommonAlert from '../CommonAlert';
19
+ import ENUM from '@/utils/enumConfig';
20
+
21
+ interface actionItem {
22
+ type?: string;
23
+ name: string;
24
+ icon?: string;
25
+ visible?: boolean | string;
26
+ disabled?: boolean;
27
+ code?: string; //权限过滤todo
28
+ action: object;
29
+ }
30
+
31
+ export const iconMap = {
32
+ edit: <img src={editIcon} />,
33
+ delete: <img src={deleteIcon} />,
34
+ submit: <img src={submitIcon} />,
35
+ more: <img src={moreIcon} />,
36
+ };
37
+
38
+ export default (props: any) => {
39
+ const { pathname } = useLocation();
40
+ const [id]: any = useState(pathname + 'id');
41
+ const { children, ...restProps } = props;
42
+
43
+ return (
44
+ <div id={id} className={'detail_page_wrapper'}>
45
+ <DetailWrapper
46
+ pathname={pathname}
47
+ {
48
+ ...restProps
49
+ }
50
+ />
51
+ {children}
52
+ </div>
53
+ );
54
+ };
55
+
56
+ const DetailWrapper = React.memo(
57
+ ({
58
+ pathname,
59
+ actionList=[],
60
+ routes=[],
61
+ itemPath,
62
+ alertProps,
63
+ donotNeedShowScreenIcon=false,
64
+ title,
65
+ pathToRegexp,
66
+ }: any) => {
67
+ const [isFullScreen, setIsFnllScreen]: any = useState(false);
68
+ const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
69
+
70
+ const basePath = window.top == window ? '' : `/${itemPath}`;
71
+
72
+ const menuRoutes =
73
+ window.top == window
74
+ ? routes.find((item) => item.path === '/')?.routes || []
75
+ : JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA) || '[]');
76
+
77
+ const breadcrumbNameMap = getMainCrumbNameMap(
78
+ memoizeOneFormatter(menuRoutes, ''),
79
+ );
80
+ const matchParamsPath = (pathname: string, breadcrumbNameMap: object) => {
81
+ const pathKey: any = Object.keys(breadcrumbNameMap).find((key) =>
82
+ pathToRegexp ? pathToRegexp(key).test(pathname) : false
83
+ );
84
+ return pathKey ? breadcrumbNameMap[pathKey] : undefined;
85
+ };
86
+
87
+ const getPageTitle = (pathname: string) => {
88
+ const currRouterData = matchParamsPath(
89
+ `${basePath}${pathname}`,
90
+ breadcrumbNameMap,
91
+ );
92
+
93
+ if (!currRouterData) {
94
+ return '';
95
+ }
96
+
97
+ let breadcrumbArrs = currRouterData.nameMap || [];
98
+ if (title && breadcrumbArrs.length) {
99
+ breadcrumbArrs.pop();
100
+ breadcrumbArrs.push(title)
101
+ }
102
+ setBreadCrumbArr([...breadcrumbArrs])
103
+
104
+ const pageName = formatMessage({
105
+ id: currRouterData.locale || currRouterData.name,
106
+ defaultMessage: currRouterData.name,
107
+ });
108
+
109
+ return title ? title : window.top === window ? pageName : `${currRouterData.name}`;
110
+ };
111
+
112
+ const pageTitle = useMemo(() => getPageTitle(pathname), [pathname, title]);
113
+
114
+ // const breadcrumbArr = `${basePath}${pathname}`
115
+ // .split('/')
116
+ // .slice(1)
117
+ // .map((_item, index, arr) =>
118
+ // matchParamsPath(
119
+ // `/${arr.slice(0, index + 1).join('/')}`,
120
+ // breadcrumbNameMap,
121
+ // ),
122
+ // )
123
+ // .filter((item) => item);
124
+
125
+ useEffect(() => {}, []);
126
+
127
+ const ShowFullScreen = () => {
128
+ if (window.top != window) {
129
+ window.parent.postMessage(
130
+ {
131
+ type: 'screenChange',
132
+ id: itemPath,
133
+ },
134
+ '*',
135
+ );
136
+ setIsFnllScreen(!isFullScreen);
137
+ } else {
138
+ const isFullScreen: any =
139
+ document.fullScreen ||
140
+ document.webkitIsFullScreen ||
141
+ document.mozFullScreen;
142
+ let contentEle: any = document.querySelector(`body`);
143
+ // addTabsNavStyle(isFullScreen);
144
+ if (contentEle && !isFullScreen) {
145
+ let fullScreenEle =
146
+ contentEle.requestFullscreen ||
147
+ contentEle.mozRequestFullScreen ||
148
+ contentEle.webkitRequestFullScreen ||
149
+ contentEle.msRequestFullscreen;
150
+ if (fullScreenEle) {
151
+ fullScreenEle.call(contentEle);
152
+ setIsFnllScreen(true);
153
+ return;
154
+ }
155
+ }
156
+ if (document && isFullScreen) {
157
+ let exitFullScreen =
158
+ document.exitFullscreen ||
159
+ document.mozCancelFullScreen ||
160
+ document.webkitCancelFullScreen ||
161
+ document.msExitFullscreen;
162
+ if (exitFullScreen) {
163
+ exitFullScreen.call(document);
164
+ setIsFnllScreen(false);
165
+ return;
166
+ }
167
+ }
168
+ }
169
+ };
170
+
171
+ const renderPageActionList = (actionLists: Array<actionItem>) => {
172
+ const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
173
+ ? JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string)
174
+ : [];
175
+ let visibleActions = actionLists.filter(
176
+ (action) =>
177
+ ((action.visible && action.visible !== 'false') || judgeIsEmpty(action.visible)) &&
178
+ (judgeIsEmpty(action.code) || authButton.filter(item => item === action.code)),
179
+ );
180
+
181
+ const renderButton = (item: actionItem, type?: any) => {
182
+ return (
183
+ <Button
184
+ type={type || 'primary'}
185
+ icon={item.icon ? iconMap[item.icon] : ''}
186
+ danger={item.name === '删除' ? true : false}
187
+ disabled={item.disabled}
188
+ onClick={() => {
189
+ if (typeof item.action === 'function') {
190
+ item.action();
191
+ } else {
192
+ doDetailPageAction(item.action);
193
+ }
194
+ }}
195
+ >
196
+ {item.name}
197
+ </Button>
198
+ );
199
+ };
200
+
201
+ if (visibleActions.length <= 3) {
202
+ return visibleActions.map((item) => {
203
+ return renderButton(item);
204
+ });
205
+ }
206
+
207
+ let moreOperate = visibleActions.splice(3);
208
+ const menu = (
209
+ <Menu>
210
+ {moreOperate.map((item: any, index: number) => (
211
+ <Menu.Item className="more-btn-action" key={index}>
212
+ {renderButton(item, 'link')}
213
+ </Menu.Item>
214
+ ))}
215
+ </Menu>
216
+ );
217
+ //按钮操作3个显示更多
218
+ return (
219
+ <div className="detail_btn_wrapper">
220
+ {visibleActions.map((item: any, index: number) => {
221
+ return renderButton(item);
222
+ })}
223
+ <Dropdown style={{ padding: '0px' }} overlay={menu}>
224
+ <Button type="primary">
225
+ <span style={{ margin: '0px' }}>更多</span>
226
+ <img src={moreIcon} />
227
+ </Button>
228
+ </Dropdown>
229
+ </div>
230
+ );
231
+ };
232
+
233
+ return (
234
+ <Anchor
235
+ key={`${pathname}_anchor`}
236
+ offsetTop={window.top == window ? 78 : 0}
237
+ >
238
+ <div>
239
+ <div className={'detail_page_head'}>
240
+ <div
241
+ className={'back_home_img_content'}
242
+ onClick={() => {
243
+ go2BackAndClose();
244
+ // history.goBack();
245
+ }}
246
+ >
247
+ <ArrowLeftOutlined />
248
+ </div>
249
+ <div className={'detail_page_title_box'}>
250
+ <div className={'detail_page_title'}>{pageTitle}</div>
251
+ <Breadcrumb>
252
+ {breadcrumbArr.map((item) => (
253
+ <Breadcrumb.Item
254
+ key={item}
255
+ onClick={() => {
256
+ // if (
257
+ // item.path &&
258
+ // !item.children &&
259
+ // !pathToRegexp(item.path).test(`${basePath}${pathname}`)
260
+ // ) {
261
+ // history.push({
262
+ // pathname: item.path.replace(basePath, ''),
263
+ // });
264
+ // }
265
+ }}
266
+ >
267
+ <span
268
+ style={{
269
+ // color:
270
+ // item.path &&
271
+ // pathToRegexp(item.path).test(`${basePath}${pathname}`)
272
+ // ? '#000000d9'
273
+ // : '',
274
+ }}
275
+ className="bread_name"
276
+ >
277
+ {item}
278
+ </span>
279
+ </Breadcrumb.Item>
280
+ ))}
281
+ </Breadcrumb>
282
+ </div>
283
+ <div
284
+ className={'detail_page_btns'}
285
+ style={{ marginRight: '20px', display: 'flex', gap: '8px' }}
286
+ >
287
+ {renderPageActionList(actionList)}
288
+ {
289
+ !donotNeedShowScreenIcon ? ( <a>
290
+ {isFullScreen ? (
291
+ <Tooltip title="取消全屏">
292
+ <img
293
+ onClick={() => {
294
+ ShowFullScreen();
295
+ }}
296
+ width={32}
297
+ src={scanning}
298
+ />
299
+ </Tooltip>
300
+ ) : (
301
+ <Tooltip title="全屏">
302
+ <img
303
+ onClick={() => {
304
+ ShowFullScreen();
305
+ }}
306
+ width={32}
307
+ src={quanping}
308
+ />
309
+ </Tooltip>
310
+ )}
311
+ </a>) : null
312
+ }
313
+ </div>
314
+ </div>
315
+ {
316
+ alertProps && (
317
+ <CommonAlert
318
+ {
319
+ ...alertProps
320
+ }
321
+ />
322
+ )
323
+ }
324
+ </div>
325
+ </Anchor>
326
+ );
327
+ },
328
+ (prevProps, nextProps) => {
329
+ if (
330
+ (JSON.stringify(prevProps.actionList) != JSON.stringify(nextProps.actionList)) || prevProps.title !== nextProps.title
331
+ ) {
332
+ return false;
333
+ }
334
+ return true;
335
+ },
335
336
  );