@bit-sun/business-component 3.0.0-alpha.21 → 3.0.0-alpha.23

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 (117) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  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 +1271 -1236
  9. package/dist/index.js +345 -310
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +82 -82
  18. package/src/assets/arrow_top.svg +17 -17
  19. package/src/assets/caidan.svg +11 -11
  20. package/src/assets/exportFail.svg +37 -37
  21. package/src/assets/exportProcessing.svg +28 -28
  22. package/src/assets/exportSuccess.svg +34 -34
  23. package/src/assets/fixed-left-active.svg +11 -11
  24. package/src/assets/fixed-right-active.svg +11 -11
  25. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  26. package/src/components/Business/AddSelectBusiness/index.tsx +1079 -1079
  27. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  28. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -193
  29. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -10
  30. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  31. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  32. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  33. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -163
  34. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  35. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  36. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +8 -8
  37. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -172
  38. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  39. package/src/components/Business/BsLayouts/index.tsx +1494 -1494
  40. package/src/components/Business/BsLayouts/service.ts +10 -10
  41. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -566
  42. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -5
  43. package/src/components/Business/BsSulaQueryTable/index.tsx +729 -729
  44. package/src/components/Business/BsSulaQueryTable/setting.tsx +892 -892
  45. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  46. package/src/components/Business/BsSulaQueryTable/utils.tsx +713 -713
  47. package/src/components/Business/CommodityEntry/index.tsx +3 -2
  48. package/src/components/Business/CommonAlert/index.tsx +23 -23
  49. package/src/components/Business/CommonGuideWrapper/index.less +121 -121
  50. package/src/components/Business/CommonGuideWrapper/index.tsx +94 -94
  51. package/src/components/Business/DetailPageWrapper/index.less +88 -88
  52. package/src/components/Business/DetailPageWrapper/index.tsx +326 -326
  53. package/src/components/Business/DetailPageWrapper/utils.tsx +164 -164
  54. package/src/components/Business/HomePageWrapper/index.less +33 -33
  55. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  56. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  57. package/src/components/Business/JsonQueryTable/components/Formula.tsx +206 -206
  58. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  59. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  60. package/src/components/Business/JsonQueryTable/index.tsx +535 -535
  61. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  62. package/src/components/Business/SearchSelect/{BusinessUtils.ts → BusinessUtils.tsx} +2139 -2076
  63. package/src/components/Business/SearchSelect/common.ts +134 -134
  64. package/src/components/Business/SearchSelect/index.md +1503 -1444
  65. package/src/components/Business/SearchSelect/index.tsx +55 -55
  66. package/src/components/Business/SearchSelect/utils.ts +101 -101
  67. package/src/components/Business/StateFlow/index.less +130 -130
  68. package/src/components/Business/TreeSearchSelect/index.md +185 -185
  69. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  70. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  71. package/src/components/Business/columnSettingTable/columnSetting.tsx +767 -767
  72. package/src/components/Business/columnSettingTable/index.tsx +235 -235
  73. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +243 -243
  74. package/src/components/Business/columnSettingTable/utils.tsx +70 -70
  75. package/src/components/Business/moreTreeTable/index.md +448 -448
  76. package/src/components/Functional/AddSelect/helps.ts +81 -81
  77. package/src/components/Functional/AddSelect/index.md +155 -155
  78. package/src/components/Functional/AddSelect/index.tsx +1217 -1217
  79. package/src/components/Functional/BillEntry/index.md +39 -39
  80. package/src/components/Functional/BillEntry/index.tsx +773 -773
  81. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  82. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  83. package/src/components/Functional/DataImport/index.md +44 -44
  84. package/src/components/Functional/DataImport/index.tsx +696 -696
  85. package/src/components/Functional/DataValidation/index.md +39 -39
  86. package/src/components/Functional/DataValidation/index.tsx +688 -688
  87. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  88. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  89. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -65
  90. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  91. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -129
  92. package/src/components/Functional/SearchSelect/index.less +121 -121
  93. package/src/components/Functional/SearchSelect/index.md +141 -141
  94. package/src/components/Functional/SearchSelect/index.tsx +1003 -1003
  95. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  96. package/src/components/Functional/TreeSearchSelect/index.tsx +206 -206
  97. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  98. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +637 -637
  99. package/src/components/Solution/RuleComponent/index.js +1428 -1428
  100. package/src/components/Solution/RuleComponent/ruleFiled.js +2281 -2281
  101. package/src/components/Solution/RuleComponent/services.ts +13 -13
  102. package/src/components/Solution/RuleComponent/util.js +143 -143
  103. package/src/index.ts +38 -38
  104. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  105. package/src/styles/bsDefault.less +1912 -1912
  106. package/src/utils/CustomLoginInfo.ts +55 -55
  107. package/src/utils/LocalstorageUtils.ts +95 -95
  108. package/src/utils/TableUtils.less +51 -51
  109. package/src/utils/TableUtils.tsx +691 -691
  110. package/src/utils/businessUtils.ts +441 -441
  111. package/src/utils/constant.ts +38 -38
  112. package/src/utils/index.ts +6 -6
  113. package/src/utils/request.ts +53 -53
  114. package/src/utils/requestUtils.ts +193 -193
  115. package/src/utils/utils.ts +238 -238
  116. package/tsconfig.json +29 -29
  117. package/typings.d.ts +4 -4
@@ -1,326 +1,326 @@
1
- // @ts-nocheck
2
- import { ArrowLeftOutlined } from '@ant-design/icons';
3
- import { Anchor, Tooltip, Button, Menu, Dropdown, Breadcrumb } from 'antd';
4
- import React, { useEffect, useState, useMemo, useRef } from 'react';
5
- import { history } from 'umi';
6
- import { getMainCrumbNameMap, doDetailPageAction, judgeIsEmpty, getDetailMatchRoute } from './utils';
7
- import { memoizeOneFormatter, go2BackAndClose } from '@/utils/utils';
8
- import './index.less';
9
- import quanping from '../../../assets/icon-quanping.svg';
10
- import scanning from '../../../assets/scanning.svg';
11
- import editIcon from '../../../assets/btn-edit.svg';
12
- import submitIcon from '../../../assets/btn-submit.svg';
13
- import deleteIcon from '../../../assets/btn-delete.svg';
14
- import moreIcon from '../../../assets/btn-more.svg';
15
- import { useLocation, formatMessage } from 'umi';
16
- import CommonAlert from '../CommonAlert';
17
- import ENUM from '@/utils/enumConfig';
18
- import { debounce } from 'lodash';
19
- import { useSize } from 'ahooks';
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 pathname={pathname} {...restProps} />
46
- {children}
47
- </div>
48
- );
49
- };
50
-
51
- const DetailWrapper = React.memo(
52
- ({
53
- pathname,
54
- actionList = [],
55
- routes = [],
56
- itemPath,
57
- alertProps,
58
- donotNeedShowScreenIcon = false,
59
- title,
60
- pathToRegexp,
61
- backHistoryPath,
62
- onBack,
63
- }: any) => {
64
- const [isFullScreen, setIsFnllScreen]: any = useState(false);
65
- const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
66
- const wrapperContainerRef = useRef<HTMLDivElement>(null)
67
-
68
- const asideWidth =
69
- (
70
- document.querySelector('.ant-layout-sider') ||
71
- window.parent?.document?.querySelector?.('.ant-layout-sider')
72
- )?.clientWidth ?? 0;
73
- const wrapperSize = useSize(wrapperContainerRef);
74
-
75
- const basePath = window.top == window ? '' : `/${itemPath}`;
76
-
77
- const menuRoutes =
78
- window.top == window
79
- ? routes.find((item) => item.path === '/')?.routes || []
80
- : JSON.parse(
81
- localStorage.getItem(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA) || '[]',
82
- );
83
-
84
- const breadcrumbNameMap = getMainCrumbNameMap(
85
- memoizeOneFormatter(menuRoutes, ''),
86
- );
87
- const matchParamsPath = (pathname: string, breadcrumbNameMap: object) => {
88
- const pathKey: any = Object.keys(breadcrumbNameMap).find((key) =>
89
- pathToRegexp ? pathToRegexp(key).test(pathname) : false,
90
- );
91
- return pathKey ? breadcrumbNameMap[pathKey] : undefined;
92
- };
93
-
94
- const getPageTitle = (pathname: string) => {
95
- const currRouterData = matchParamsPath(
96
- `${basePath}${pathname}`,
97
- breadcrumbNameMap,
98
- ) || getDetailMatchRoute(`${basePath}${pathname}`,breadcrumbNameMap,[]);
99
-
100
- if (!currRouterData) {
101
- return '';
102
- }
103
-
104
- let breadcrumbArrs = currRouterData.nameMap || [];
105
- if (title && breadcrumbArrs.length) {
106
- breadcrumbArrs.pop();
107
- breadcrumbArrs.push(title);
108
- }
109
- setBreadCrumbArr([...breadcrumbArrs]);
110
-
111
- const pageName = formatMessage({
112
- id: currRouterData.locale || currRouterData.name,
113
- defaultMessage: currRouterData.name,
114
- });
115
-
116
- return title
117
- ? title
118
- : window.top === window
119
- ? pageName
120
- : `${currRouterData.name}`;
121
- };
122
-
123
- const pageTitle = useMemo(() => getPageTitle(pathname), [pathname, title]);
124
-
125
- useEffect(() => {}, []);
126
-
127
- const ShowFullScreen = () => {
128
- const isFullScreen: any =
129
- window.top.document.fullScreen ||
130
- window.top.document.webkitIsFullScreen ||
131
- window.top.document.mozFullScreen;
132
- let contentEle: any = window.top.document.querySelector(`body`);
133
- // addTabsNavStyle(isFullScreen);
134
- if (contentEle && !isFullScreen) {
135
- let fullScreenEle =
136
- contentEle.requestFullscreen ||
137
- contentEle.mozRequestFullScreen ||
138
- contentEle.webkitRequestFullScreen ||
139
- contentEle.msRequestFullscreen;
140
- if (fullScreenEle) {
141
- fullScreenEle.call(contentEle);
142
- setIsFnllScreen(true);
143
- return;
144
- }
145
- }
146
- if (window.top.document && isFullScreen) {
147
- let exitFullScreen =
148
- window.top.document.exitFullscreen ||
149
- window.top.document.mozCancelFullScreen ||
150
- window.top.document.webkitCancelFullScreen ||
151
- window.top.document.msExitFullscreen;
152
- if (exitFullScreen) {
153
- exitFullScreen.call(window.top.document);
154
- setIsFnllScreen(false);
155
- return;
156
- }
157
- }
158
- };
159
-
160
- const renderPageActionList = (actionLists: Array<actionItem>) => {
161
- const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
162
- ? JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string)
163
- : [];
164
- let visibleActions = actionLists.filter(
165
- (action) =>
166
- ((action.visible && action.visible !== 'false') || judgeIsEmpty(action.visible)) &&
167
- (judgeIsEmpty(action.code) || authButton.filter(item => item === action.code)),
168
- );
169
-
170
- const renderButton = (item: actionItem, type?: any) => {
171
- return (
172
- <Button
173
- type={type || 'primary'}
174
- icon={item.icon ? iconMap[item.icon] : ''}
175
- danger={item.name === '删除' ? true : false}
176
- disabled={item.disabled}
177
- onClick={() => {
178
- if (typeof item.action === 'function') {
179
- item.action();
180
- } else {
181
- doDetailPageAction(item.action);
182
- }
183
- }}
184
- >
185
- {item.name}
186
- </Button>
187
- );
188
- };
189
-
190
- if (visibleActions.length <= 3) {
191
- return visibleActions.map((item) => {
192
- return renderButton(item);
193
- });
194
- }
195
-
196
- let moreOperate = visibleActions.splice(3);
197
- const menu = (
198
- <Menu>
199
- {moreOperate.map((item: any, index: number) => (
200
- <Menu.Item className="more-btn-action" key={index}>
201
- {renderButton(item, 'link')}
202
- </Menu.Item>
203
- ))}
204
- </Menu>
205
- );
206
- //按钮操作3个显示更多
207
- return (
208
- <div className="detail_btn_wrapper">
209
- {visibleActions.map((item: any, index: number) => {
210
- return renderButton(item);
211
- })}
212
- <Dropdown style={{ padding: '0px' }} overlay={menu}>
213
- <Button type="primary">
214
- <span style={{ margin: '0px' }}>更多</span>
215
- <img src={moreIcon} />
216
- </Button>
217
- </Dropdown>
218
- </div>
219
- );
220
- };
221
-
222
- return (
223
- <div style={{ height: '54px' }} ref={wrapperContainerRef}>
224
- <div
225
- className={'detail_page_head'}
226
- style={{
227
- width: wrapperSize?.width ?? `calc( 100vh - ${asideWidth}px )`,
228
- left: asideWidth,
229
- }}
230
- >
231
- <div
232
- className={'back_home_img_content'}
233
- onClick={() => {
234
- go2BackAndClose(backHistoryPath);
235
- // history.goBack();
236
- }}
237
- >
238
- <ArrowLeftOutlined />
239
- </div>
240
- <div className={'detail_page_title_box'}>
241
- <div className={'detail_page_title'}>{pageTitle}</div>
242
- <Breadcrumb>
243
- {breadcrumbArr.map((item) => (
244
- <Breadcrumb.Item
245
- key={item}
246
- onClick={() => {
247
- // if (
248
- // item.path &&
249
- // !item.children &&
250
- // !pathToRegexp(item.path).test(`${basePath}${pathname}`)
251
- // ) {
252
- // history.push({
253
- // pathname: item.path.replace(basePath, ''),
254
- // });
255
- // }
256
- }}
257
- >
258
- <span
259
- style={{
260
- // color:
261
- // item.path &&
262
- // pathToRegexp(item.path).test(`${basePath}${pathname}`)
263
- // ? '#000000d9'
264
- // : '',
265
- }}
266
- className="bread_name"
267
- >
268
- {item}
269
- </span>
270
- </Breadcrumb.Item>
271
- ))}
272
- </Breadcrumb>
273
- </div>
274
- <div
275
- className={'detail_page_btns'}
276
- style={{ marginRight: '20px', display: 'flex', gap: '8px' }}
277
- >
278
- {renderPageActionList(actionList)}
279
- {
280
- !donotNeedShowScreenIcon ? ( <a>
281
- {isFullScreen ? (
282
- <Tooltip title="取消全屏">
283
- <img
284
- onClick={() => {
285
- ShowFullScreen();
286
- }}
287
- width={32}
288
- src={scanning}
289
- />
290
- </Tooltip>
291
- ) : (
292
- <Tooltip title="全屏">
293
- <img
294
- onClick={() => {
295
- ShowFullScreen();
296
- }}
297
- width={32}
298
- src={quanping}
299
- />
300
- </Tooltip>
301
- )}
302
- </a>) : null
303
- }
304
- </div>
305
- </div>
306
- {
307
- alertProps && (
308
- <CommonAlert
309
- {
310
- ...alertProps
311
- }
312
- />
313
- )
314
- }
315
- </div>
316
- );
317
- },
318
- (prevProps, nextProps) => {
319
- if (
320
- (JSON.stringify(prevProps.actionList) != JSON.stringify(nextProps.actionList)) || prevProps.title !== nextProps.title
321
- ) {
322
- return false;
323
- }
324
- return true;
325
- },
326
- );
1
+ // @ts-nocheck
2
+ import { ArrowLeftOutlined } from '@ant-design/icons';
3
+ import { Anchor, Tooltip, Button, Menu, Dropdown, Breadcrumb } from 'antd';
4
+ import React, { useEffect, useState, useMemo, useRef } from 'react';
5
+ import { history } from 'umi';
6
+ import { getMainCrumbNameMap, doDetailPageAction, judgeIsEmpty, getDetailMatchRoute } from './utils';
7
+ import { memoizeOneFormatter, go2BackAndClose } from '@/utils/utils';
8
+ import './index.less';
9
+ import quanping from '../../../assets/icon-quanping.svg';
10
+ import scanning from '../../../assets/scanning.svg';
11
+ import editIcon from '../../../assets/btn-edit.svg';
12
+ import submitIcon from '../../../assets/btn-submit.svg';
13
+ import deleteIcon from '../../../assets/btn-delete.svg';
14
+ import moreIcon from '../../../assets/btn-more.svg';
15
+ import { useLocation, formatMessage } from 'umi';
16
+ import CommonAlert from '../CommonAlert';
17
+ import ENUM from '@/utils/enumConfig';
18
+ import { debounce } from 'lodash';
19
+ import { useSize } from 'ahooks';
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 pathname={pathname} {...restProps} />
46
+ {children}
47
+ </div>
48
+ );
49
+ };
50
+
51
+ const DetailWrapper = React.memo(
52
+ ({
53
+ pathname,
54
+ actionList = [],
55
+ routes = [],
56
+ itemPath,
57
+ alertProps,
58
+ donotNeedShowScreenIcon = false,
59
+ title,
60
+ pathToRegexp,
61
+ backHistoryPath,
62
+ onBack,
63
+ }: any) => {
64
+ const [isFullScreen, setIsFnllScreen]: any = useState(false);
65
+ const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
66
+ const wrapperContainerRef = useRef<HTMLDivElement>(null)
67
+
68
+ const asideWidth =
69
+ (
70
+ document.querySelector('.ant-layout-sider') ||
71
+ window.parent?.document?.querySelector?.('.ant-layout-sider')
72
+ )?.clientWidth ?? 0;
73
+ const wrapperSize = useSize(wrapperContainerRef);
74
+
75
+ const basePath = window.top == window ? '' : `/${itemPath}`;
76
+
77
+ const menuRoutes =
78
+ window.top == window
79
+ ? routes.find((item) => item.path === '/')?.routes || []
80
+ : JSON.parse(
81
+ localStorage.getItem(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA) || '[]',
82
+ );
83
+
84
+ const breadcrumbNameMap = getMainCrumbNameMap(
85
+ memoizeOneFormatter(menuRoutes, ''),
86
+ );
87
+ const matchParamsPath = (pathname: string, breadcrumbNameMap: object) => {
88
+ const pathKey: any = Object.keys(breadcrumbNameMap).find((key) =>
89
+ pathToRegexp ? pathToRegexp(key).test(pathname) : false,
90
+ );
91
+ return pathKey ? breadcrumbNameMap[pathKey] : undefined;
92
+ };
93
+
94
+ const getPageTitle = (pathname: string) => {
95
+ const currRouterData = matchParamsPath(
96
+ `${basePath}${pathname}`,
97
+ breadcrumbNameMap,
98
+ ) || getDetailMatchRoute(`${basePath}${pathname}`,breadcrumbNameMap,[]);
99
+
100
+ if (!currRouterData) {
101
+ return '';
102
+ }
103
+
104
+ let breadcrumbArrs = currRouterData.nameMap || [];
105
+ if (title && breadcrumbArrs.length) {
106
+ breadcrumbArrs.pop();
107
+ breadcrumbArrs.push(title);
108
+ }
109
+ setBreadCrumbArr([...breadcrumbArrs]);
110
+
111
+ const pageName = formatMessage({
112
+ id: currRouterData.locale || currRouterData.name,
113
+ defaultMessage: currRouterData.name,
114
+ });
115
+
116
+ return title
117
+ ? title
118
+ : window.top === window
119
+ ? pageName
120
+ : `${currRouterData.name}`;
121
+ };
122
+
123
+ const pageTitle = useMemo(() => getPageTitle(pathname), [pathname, title]);
124
+
125
+ useEffect(() => {}, []);
126
+
127
+ const ShowFullScreen = () => {
128
+ const isFullScreen: any =
129
+ window.top.document.fullScreen ||
130
+ window.top.document.webkitIsFullScreen ||
131
+ window.top.document.mozFullScreen;
132
+ let contentEle: any = window.top.document.querySelector(`body`);
133
+ // addTabsNavStyle(isFullScreen);
134
+ if (contentEle && !isFullScreen) {
135
+ let fullScreenEle =
136
+ contentEle.requestFullscreen ||
137
+ contentEle.mozRequestFullScreen ||
138
+ contentEle.webkitRequestFullScreen ||
139
+ contentEle.msRequestFullscreen;
140
+ if (fullScreenEle) {
141
+ fullScreenEle.call(contentEle);
142
+ setIsFnllScreen(true);
143
+ return;
144
+ }
145
+ }
146
+ if (window.top.document && isFullScreen) {
147
+ let exitFullScreen =
148
+ window.top.document.exitFullscreen ||
149
+ window.top.document.mozCancelFullScreen ||
150
+ window.top.document.webkitCancelFullScreen ||
151
+ window.top.document.msExitFullscreen;
152
+ if (exitFullScreen) {
153
+ exitFullScreen.call(window.top.document);
154
+ setIsFnllScreen(false);
155
+ return;
156
+ }
157
+ }
158
+ };
159
+
160
+ const renderPageActionList = (actionLists: Array<actionItem>) => {
161
+ const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
162
+ ? JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES) as string)
163
+ : [];
164
+ let visibleActions = actionLists.filter(
165
+ (action) =>
166
+ ((action.visible && action.visible !== 'false') || judgeIsEmpty(action.visible)) &&
167
+ (judgeIsEmpty(action.code) || authButton.filter(item => item === action.code)),
168
+ );
169
+
170
+ const renderButton = (item: actionItem, type?: any) => {
171
+ return (
172
+ <Button
173
+ type={type || 'primary'}
174
+ icon={item.icon ? iconMap[item.icon] : ''}
175
+ danger={item.name === '删除' ? true : false}
176
+ disabled={item.disabled}
177
+ onClick={() => {
178
+ if (typeof item.action === 'function') {
179
+ item.action();
180
+ } else {
181
+ doDetailPageAction(item.action);
182
+ }
183
+ }}
184
+ >
185
+ {item.name}
186
+ </Button>
187
+ );
188
+ };
189
+
190
+ if (visibleActions.length <= 3) {
191
+ return visibleActions.map((item) => {
192
+ return renderButton(item);
193
+ });
194
+ }
195
+
196
+ let moreOperate = visibleActions.splice(3);
197
+ const menu = (
198
+ <Menu>
199
+ {moreOperate.map((item: any, index: number) => (
200
+ <Menu.Item className="more-btn-action" key={index}>
201
+ {renderButton(item, 'link')}
202
+ </Menu.Item>
203
+ ))}
204
+ </Menu>
205
+ );
206
+ //按钮操作3个显示更多
207
+ return (
208
+ <div className="detail_btn_wrapper">
209
+ {visibleActions.map((item: any, index: number) => {
210
+ return renderButton(item);
211
+ })}
212
+ <Dropdown style={{ padding: '0px' }} overlay={menu}>
213
+ <Button type="primary">
214
+ <span style={{ margin: '0px' }}>更多</span>
215
+ <img src={moreIcon} />
216
+ </Button>
217
+ </Dropdown>
218
+ </div>
219
+ );
220
+ };
221
+
222
+ return (
223
+ <div style={{ height: '54px' }} ref={wrapperContainerRef}>
224
+ <div
225
+ className={'detail_page_head'}
226
+ style={{
227
+ width: wrapperSize?.width ?? `calc( 100vh - ${asideWidth}px )`,
228
+ left: asideWidth,
229
+ }}
230
+ >
231
+ <div
232
+ className={'back_home_img_content'}
233
+ onClick={() => {
234
+ go2BackAndClose(backHistoryPath);
235
+ // history.goBack();
236
+ }}
237
+ >
238
+ <ArrowLeftOutlined />
239
+ </div>
240
+ <div className={'detail_page_title_box'}>
241
+ <div className={'detail_page_title'}>{pageTitle}</div>
242
+ <Breadcrumb>
243
+ {breadcrumbArr.map((item) => (
244
+ <Breadcrumb.Item
245
+ key={item}
246
+ onClick={() => {
247
+ // if (
248
+ // item.path &&
249
+ // !item.children &&
250
+ // !pathToRegexp(item.path).test(`${basePath}${pathname}`)
251
+ // ) {
252
+ // history.push({
253
+ // pathname: item.path.replace(basePath, ''),
254
+ // });
255
+ // }
256
+ }}
257
+ >
258
+ <span
259
+ style={{
260
+ // color:
261
+ // item.path &&
262
+ // pathToRegexp(item.path).test(`${basePath}${pathname}`)
263
+ // ? '#000000d9'
264
+ // : '',
265
+ }}
266
+ className="bread_name"
267
+ >
268
+ {item}
269
+ </span>
270
+ </Breadcrumb.Item>
271
+ ))}
272
+ </Breadcrumb>
273
+ </div>
274
+ <div
275
+ className={'detail_page_btns'}
276
+ style={{ marginRight: '20px', display: 'flex', gap: '8px' }}
277
+ >
278
+ {renderPageActionList(actionList)}
279
+ {
280
+ !donotNeedShowScreenIcon ? ( <a>
281
+ {isFullScreen ? (
282
+ <Tooltip title="取消全屏">
283
+ <img
284
+ onClick={() => {
285
+ ShowFullScreen();
286
+ }}
287
+ width={32}
288
+ src={scanning}
289
+ />
290
+ </Tooltip>
291
+ ) : (
292
+ <Tooltip title="全屏">
293
+ <img
294
+ onClick={() => {
295
+ ShowFullScreen();
296
+ }}
297
+ width={32}
298
+ src={quanping}
299
+ />
300
+ </Tooltip>
301
+ )}
302
+ </a>) : null
303
+ }
304
+ </div>
305
+ </div>
306
+ {
307
+ alertProps && (
308
+ <CommonAlert
309
+ {
310
+ ...alertProps
311
+ }
312
+ />
313
+ )
314
+ }
315
+ </div>
316
+ );
317
+ },
318
+ (prevProps, nextProps) => {
319
+ if (
320
+ (JSON.stringify(prevProps.actionList) != JSON.stringify(nextProps.actionList)) || prevProps.title !== nextProps.title
321
+ ) {
322
+ return false;
323
+ }
324
+ return true;
325
+ },
326
+ );