@bit-sun/business-component 1.2.4-alpha.1 → 1.2.4

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 (167) hide show
  1. package/.fatherrc.ts +0 -1
  2. package/.umirc.ts +16 -31
  3. package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
  4. package/dist/components/Business/SearchSelect/common.d.ts +1 -5
  5. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  6. package/dist/components/Business/SearchSelect/utils.d.ts +1 -2
  7. package/dist/components/Functional/SearchSelect/index.d.ts +1 -2
  8. package/dist/index.d.ts +0 -15
  9. package/dist/index.esm.js +4456 -19407
  10. package/dist/index.js +4443 -19411
  11. package/package.json +5 -26
  12. package/src/components/Business/CommodityEntry/index.md +3 -4
  13. package/src/components/Business/CommodityEntry/index.tsx +2 -7
  14. package/src/components/Business/SearchSelect/BusinessUtils.ts +14 -107
  15. package/src/components/Business/SearchSelect/common.ts +1 -20
  16. package/src/components/Business/SearchSelect/index.md +30 -60
  17. package/src/components/Business/SearchSelect/index.tsx +12 -21
  18. package/src/components/Business/SearchSelect/utils.ts +4 -30
  19. package/src/components/Functional/DataImport/index.tsx +2 -1
  20. package/src/components/Functional/DataValidation/index.tsx +1 -1
  21. package/src/components/Functional/SearchSelect/index.tsx +121 -218
  22. package/src/index.ts +6 -15
  23. package/typings.d.ts +0 -3
  24. package/dist/components/Business/AddSelectBusiness/index.d.ts +0 -1
  25. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +0 -4
  26. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +0 -4
  27. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +0 -4
  28. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +0 -17
  29. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +0 -30
  30. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +0 -3
  31. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +0 -2
  32. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +0 -4
  33. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +0 -4
  34. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +0 -2
  35. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +0 -8
  36. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +0 -8
  37. package/dist/components/Business/BsLayouts/index.d.ts +0 -18
  38. package/dist/components/Business/BsLayouts/service.d.ts +0 -1
  39. package/dist/components/Business/BsLayouts/utils.d.ts +0 -13
  40. package/dist/components/Business/BsSulaQueryTable/index.d.ts +0 -2
  41. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +0 -58
  42. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +0 -98
  43. package/dist/components/Business/CommonAlert/index.d.ts +0 -3
  44. package/dist/components/Business/CommonGuideWrapper/index.d.ts +0 -6
  45. package/dist/components/Business/DetailPageWrapper/index.d.ts +0 -9
  46. package/dist/components/Business/DetailPageWrapper/utils.d.ts +0 -8
  47. package/dist/components/Business/HomePageWrapper/index.d.ts +0 -3
  48. package/dist/components/Business/StateFlow/index.d.ts +0 -3
  49. package/dist/components/Business/TreeSearchSelect/index.d.ts +0 -3
  50. package/dist/components/Business/TreeSearchSelect/utils.d.ts +0 -2
  51. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +0 -54
  52. package/dist/components/Business/columnSettingTable/index.d.ts +0 -16
  53. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +0 -17
  54. package/dist/components/Business/columnSettingTable/utils.d.ts +0 -8
  55. package/dist/components/Functional/AddSelect/index.d.ts +0 -3
  56. package/dist/components/Functional/BillEntry/index.d.ts +0 -4
  57. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +0 -12
  58. package/dist/components/Functional/TreeSearchSelect/index.d.ts +0 -2
  59. package/dist/utils/enumConfig.d.ts +0 -10
  60. package/dist/utils/requestUtils.d.ts +0 -1
  61. package/dist/utils/utils.d.ts +0 -3
  62. package/lib/assets/arrow_top.png +0 -0
  63. package/lib/assets/drag.svg +0 -17
  64. package/lib/assets/exportFail.svg +0 -38
  65. package/lib/assets/exportProcessing.svg +0 -29
  66. package/lib/assets/exportSuccess.svg +0 -35
  67. package/lib/assets/exportlogo.png +0 -0
  68. package/lib/assets/label_icon_bottom.svg +0 -26
  69. package/lib/assets/upExport.svg +0 -23
  70. package/src/assets/32.svg +0 -28
  71. package/src/assets/addIcon.svg +0 -18
  72. package/src/assets/allfunc.svg +0 -28
  73. package/src/assets/arrowRight.svg +0 -25
  74. package/src/assets/arrow_top.png +0 -0
  75. package/src/assets/btn-delete.svg +0 -30
  76. package/src/assets/btn-edit.svg +0 -20
  77. package/src/assets/btn-more.svg +0 -18
  78. package/src/assets/btn-submit.svg +0 -20
  79. package/src/assets/caidan.svg +0 -12
  80. package/src/assets/close.svg +0 -26
  81. package/src/assets/closeicon.png +0 -0
  82. package/src/assets/drag.svg +0 -17
  83. package/src/assets/exportFail.svg +0 -38
  84. package/src/assets/exportProcessing.svg +0 -29
  85. package/src/assets/exportSuccess.svg +0 -35
  86. package/src/assets/exportlogo.png +0 -0
  87. package/src/assets/fixed-left-active.svg +0 -12
  88. package/src/assets/fixed-left.svg +0 -16
  89. package/src/assets/fixed-right-active.svg +0 -12
  90. package/src/assets/fixed-right.svg +0 -16
  91. package/src/assets/guanbi.svg +0 -16
  92. package/src/assets/icon-quanping.svg +0 -16
  93. package/src/assets/icon-shezhi.svg +0 -18
  94. package/src/assets/label_icon_bottom.svg +0 -26
  95. package/src/assets/list-no-img.svg +0 -22
  96. package/src/assets/morentouxiang-32.svg +0 -24
  97. package/src/assets/right.png +0 -0
  98. package/src/assets/scanning.svg +0 -25
  99. package/src/assets/upExport.svg +0 -23
  100. package/src/assets/xinglan-icon-out.png +0 -0
  101. package/src/components/Business/AddSelectBusiness/index.md +0 -41
  102. package/src/components/Business/AddSelectBusiness/index.tsx +0 -290
  103. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +0 -112
  104. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +0 -153
  105. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +0 -70
  106. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +0 -90
  107. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +0 -38
  108. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +0 -243
  109. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +0 -385
  110. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +0 -286
  111. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +0 -75
  112. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +0 -171
  113. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +0 -65
  114. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +0 -154
  115. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +0 -73
  116. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +0 -158
  117. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +0 -85
  118. package/src/components/Business/BsLayouts/Components/RightContent/home.less +0 -218
  119. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +0 -156
  120. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +0 -161
  121. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +0 -76
  122. package/src/components/Business/BsLayouts/index.less +0 -80
  123. package/src/components/Business/BsLayouts/index.tsx +0 -1465
  124. package/src/components/Business/BsLayouts/service.ts +0 -11
  125. package/src/components/Business/BsLayouts/utils.tsx +0 -211
  126. package/src/components/Business/BsSulaQueryTable/index.less +0 -220
  127. package/src/components/Business/BsSulaQueryTable/index.tsx +0 -505
  128. package/src/components/Business/BsSulaQueryTable/setting.tsx +0 -799
  129. package/src/components/Business/BsSulaQueryTable/utils.less +0 -65
  130. package/src/components/Business/BsSulaQueryTable/utils.tsx +0 -688
  131. package/src/components/Business/CommonAlert/index.less +0 -0
  132. package/src/components/Business/CommonAlert/index.tsx +0 -23
  133. package/src/components/Business/CommonGuideWrapper/index.less +0 -112
  134. package/src/components/Business/CommonGuideWrapper/index.md +0 -39
  135. package/src/components/Business/CommonGuideWrapper/index.tsx +0 -84
  136. package/src/components/Business/DetailPageWrapper/index.less +0 -80
  137. package/src/components/Business/DetailPageWrapper/index.tsx +0 -335
  138. package/src/components/Business/DetailPageWrapper/utils.tsx +0 -101
  139. package/src/components/Business/HomePageWrapper/index.less +0 -33
  140. package/src/components/Business/HomePageWrapper/index.md +0 -45
  141. package/src/components/Business/HomePageWrapper/index.tsx +0 -162
  142. package/src/components/Business/StateFlow/index.less +0 -131
  143. package/src/components/Business/StateFlow/index.md +0 -60
  144. package/src/components/Business/StateFlow/index.tsx +0 -30
  145. package/src/components/Business/TreeSearchSelect/index.md +0 -126
  146. package/src/components/Business/TreeSearchSelect/index.tsx +0 -34
  147. package/src/components/Business/TreeSearchSelect/utils.ts +0 -60
  148. package/src/components/Business/columnSettingTable/columnSetting.tsx +0 -764
  149. package/src/components/Business/columnSettingTable/index.less +0 -247
  150. package/src/components/Business/columnSettingTable/index.md +0 -358
  151. package/src/components/Business/columnSettingTable/index.tsx +0 -233
  152. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +0 -241
  153. package/src/components/Business/columnSettingTable/utils.tsx +0 -69
  154. package/src/components/Functional/AddSelect/index.less +0 -367
  155. package/src/components/Functional/AddSelect/index.md +0 -122
  156. package/src/components/Functional/AddSelect/index.tsx +0 -962
  157. package/src/components/Functional/BillEntry/index.less +0 -371
  158. package/src/components/Functional/BillEntry/index.md +0 -39
  159. package/src/components/Functional/BillEntry/index.tsx +0 -613
  160. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +0 -37
  161. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +0 -59
  162. package/src/components/Functional/TreeSearchSelect/index.md +0 -47
  163. package/src/components/Functional/TreeSearchSelect/index.tsx +0 -149
  164. package/src/styles/bsDefault.less +0 -1907
  165. package/src/utils/enumConfig.ts +0 -10
  166. package/src/utils/requestUtils.ts +0 -33
  167. package/src/utils/utils.ts +0 -52
@@ -1,112 +0,0 @@
1
- .form-guide {
2
- cursor: pointer;
3
- position: fixed;
4
- right: 5px;
5
- color: #B1BAD4;
6
- padding: 5px 0;
7
- width: 48px;
8
- z-index: 10;
9
- top: 50%;
10
- transform: translateY(-50%);
11
- background-color: #141620;
12
- .form-guide-top {
13
- padding: 0px 10px;
14
- display: flex;
15
- justify-content: center;
16
- }
17
- border-radius: 5px;
18
- .form-guide-center {
19
- border-top: 1px solid #6E7588;
20
- border-bottom: 1px solid #6E7588;
21
- padding: 0px 10px;
22
- }
23
- .form-guide-item {
24
- width: 28px;
25
- padding: 5px 0;
26
- display: block;
27
- word-break: break-all;
28
- color: #B1BAD4;
29
- font-size: 14px;
30
- line-height: 16px;
31
- position: relative;
32
- }
33
- .form-guide-item::after {
34
- content: '';
35
- display: block;
36
- width: 15px;
37
- height: 1px;
38
- background-color: #6E7588;
39
- position: absolute;
40
- bottom: 0px;
41
- left: 7px;
42
- }
43
-
44
- .form-guide-bottom {
45
- padding: 5px 10px;
46
- display: flex;
47
- justify-content: center;
48
- }
49
- .form-guide-item:last-child::after {
50
- content: '';
51
- display: none;
52
- width: 15px;
53
- height: 1px;
54
- background-color: #6E7588;
55
- position: absolute;
56
- bottom: 0px;
57
- left: 7px;
58
- }
59
- }
60
-
61
- .white-card.bitsun-form-card-class {
62
- .ant-card-body {
63
- background-color: #FFFFFF;
64
- padding: 0px;
65
- }
66
- }
67
-
68
- .bitsun-form-card-class {
69
- &>.ant-card-body {
70
- margin-bottom: 10px;
71
- }
72
- }
73
-
74
- .bitsun-form-card-class {
75
- .ant-card-head {
76
- border: 0px;
77
- padding: 0px;
78
- height: 48px;
79
- }
80
-
81
- .ant-card-body {
82
- padding: 12px 0 0;
83
- margin-top: -4px;
84
- background-color: #F3F3F3;
85
- }
86
-
87
- .ant-card-head-title {
88
- display: flex;
89
- align-items: center;
90
- font-size: 16px;
91
- color: #000000;
92
- font-weight: 600;
93
- font-family: PingFangSC;
94
- background-color: #FFFFFF;
95
- padding: 8px 0;
96
- margin: 0px;
97
- .title-left-line {
98
- display: inline-block;
99
- width: 4px;
100
- height: 100%;
101
- background-color: #005CFF;
102
- height: 20px;
103
- margin-right: 16px;
104
- }
105
- }
106
- }
107
-
108
- .field-group-hidden {
109
- .ant-card-body {
110
- display: none !important;
111
- }
112
- }
@@ -1,39 +0,0 @@
1
- ---
2
- nav:
3
- title: '组件'
4
- order: 1
5
- group:
6
- title: 业务组件
7
- order: 1
8
- title: 模块导航容器组件
9
- order: 1
10
- ---
11
-
12
- # GuideWrapper
13
-
14
-
15
- ## 容器模块导航
16
-
17
- ```tsx
18
- import React, { useState } from 'react';
19
- import { GuideWrapper } from '../../../index.ts';
20
-
21
- export default () => {
22
- const { Field } = GuideWrapper;
23
-
24
- return (
25
- <GuideWrapper>
26
- <Field id='test1' title='基础信息'>
27
- <div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块一</div>
28
- </Field>
29
- <Field id='test2' title='销售信息' isWhiteCard={true}>
30
- <div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块二</div>
31
- </Field>
32
- <Field id='test3' title='其他信息'>
33
- <div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块三</div>
34
- </Field>
35
- </GuideWrapper>
36
-
37
- );
38
- };
39
- ```
@@ -1,84 +0,0 @@
1
- import React, { Component } from "react";
2
- import dragImg from '../../../assets/drag.svg';
3
- import label_icon_bottom from '../../../assets/label_icon_bottom.svg';
4
- import arrow_top from '../../../assets/arrow_top.png';
5
- import './index.less';
6
-
7
- const Field = ({ children, ...props }: any) => {
8
- const [fieldGroupVisible, setVisible] = React.useState(true);
9
- return (
10
- <div
11
- className={
12
- `bitsun-form-card-class
13
- ${fieldGroupVisible ? '' : 'field-group-hidden'}
14
- ${props.isWhiteCard ? 'white-card' : ''}
15
- `
16
- }
17
- id={props.id}
18
- >
19
- <div className="ant-card-head">
20
- <div className="ant-card-head-title">
21
- <span className='title-left-line'></span>
22
- <span style={{ marginRight: '5px' }}>
23
- {props?.title}
24
- </span>
25
- <img
26
- width={24}
27
- style={{
28
- transform: fieldGroupVisible ? 'inherit' : 'rotate(180deg)',
29
- cursor: 'pointer'
30
- }}
31
- src={arrow_top}
32
- onClick={(e) => {
33
- e.stopPropagation();
34
- setVisible(!fieldGroupVisible);
35
- }}
36
- />
37
- </div>
38
- </div>
39
- <div className="ant-card-body">
40
- {children}
41
- </div>
42
- </div>
43
- )
44
- }
45
-
46
- export default class GuideWrapper extends Component {
47
- static Field = Field;
48
- render() {
49
- const { children = [], ...props }: any = this.props;
50
- let cardGroups = children.filter((item:any) => item?.props?.id && item?.props?.title);
51
- return (
52
- <div {...props}>
53
- {children}
54
- <div
55
- className='form-guide'
56
- >
57
- <div className='form-guide-top'>
58
- <img width={24} src={dragImg} />
59
- </div>
60
- <div className='form-guide-center'>
61
- {
62
- cardGroups.map((item:any) => {
63
- return (
64
- <span
65
- className='form-guide-item'
66
- onClick={() => {
67
- let currentDom = document.getElementById(item.props.id);
68
- currentDom && currentDom.scrollIntoView({ block: 'center', behavior: 'smooth' });
69
- }}
70
- >
71
- {item.props.title}
72
- </span>
73
- )
74
- })
75
- }
76
- </div>
77
- <div className='form-guide-bottom'>
78
- <img width={24} src={label_icon_bottom} />
79
- </div>
80
- </div>
81
- </div>
82
- )
83
- }
84
- }
@@ -1,80 +0,0 @@
1
- .detail_page_head {
2
- height: 54px;
3
- display: flex;
4
- align-items: center;
5
- background-color: #FFFFFF;
6
- border-bottom: 1px solid #f0f0f0;
7
- .ant-breadcrumb {
8
- display: block !important;
9
- .ant-breadcrumb-separator {
10
- margin: 0 2px;
11
- }
12
- li .bread_name {
13
- color: #8A8F8D;
14
- font-size: 12px;
15
- cursor: pointer;
16
- }
17
- li .bread_name:hover {
18
- color: #000000d9;
19
- }
20
- }
21
- }
22
- .detail_page_wrapper {
23
- // padding-top: 51px;
24
- }
25
-
26
- .back_home_img_content {
27
- display: inline-block;
28
- height: 28px;
29
- width: 28px;
30
- border: 1px solid #BABABA;
31
- margin: 0 12px 0 20px;
32
- border-radius: 14px;
33
- display: flex;
34
- align-items: center;
35
- justify-content: center;
36
- cursor: pointer;
37
- .anticon-arrow-left {
38
- color: #BABABA;
39
- }
40
- }
41
-
42
- .back_home_img_content:hover {
43
- background-color: #005CFF;
44
- border: 1px solid #005CFF;
45
- .anticon-arrow-left {
46
- color: #FFFFFF;
47
- }
48
- }
49
-
50
- .detail_page_title_box {
51
- flex-grow: 1;
52
- }
53
-
54
- .detail_page_title {
55
- height: 20px;
56
- font-family: PingFangSC;
57
- font-weight: 600;
58
- font-size: 16px;
59
- margin-top: 2px;
60
- color: #000000;
61
- letter-spacing: 0;
62
- line-height: 20px;
63
- }
64
-
65
- .detail_page_btns {
66
- display: flex;
67
- gap: 8px;
68
- margin-right: 20px;
69
- button {
70
- height: 32px !important;
71
- display: flex;
72
- align-items: center;
73
- gap: 2px;
74
- border-radius: 3px;
75
- padding: 0 10px;
76
- }
77
- .ant-btn-dangerous {
78
- background-color: #EC5246 !important;
79
- }
80
- }
@@ -1,335 +0,0 @@
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
- },
335
- );