win-chart 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/.vscode/settings.json +166 -0
  2. package/build/index.html +1 -0
  3. package/build/js/index.js +1 -0
  4. package/build/report-web.html +39 -0
  5. package/package.json +3 -1
  6. package/rsbuild.config.ts +5 -0
  7. package/tsconfig.json +1 -0
  8. package/src/api/README.md +0 -15
  9. package/src/api/index.js +0 -5
  10. package/src/api/layout/index.js +0 -32
  11. package/src/api/request.ts +0 -87
  12. package/src/api/url-map/index.js +0 -10
  13. package/src/api/user/index.js +0 -12
  14. package/src/components/FilterContext.tsx +0 -6
  15. package/src/components/GlobalStyle.tsx +0 -25
  16. package/src/components/HalfScreenBrowser.tsx +0 -95
  17. package/src/components/ImgBox.tsx +0 -19
  18. package/src/components/JumpBtn.tsx +0 -38
  19. package/src/components/MCardWrapper.tsx +0 -33
  20. package/src/components/NoContent/index.tsx +0 -85
  21. package/src/components/ResponsiveReactGridLayout.tsx +0 -218
  22. package/src/components/SliderDecoration.tsx +0 -27
  23. package/src/components/VisionUserConfigContext.ts +0 -6
  24. package/src/components/WinMenu/README.md +0 -11
  25. package/src/components/WinMenu/WinHeader.tsx +0 -5
  26. package/src/components/WinMenu/components/ExtraBox.tsx +0 -61
  27. package/src/components/WinMenu/components/FullMenuBox.tsx +0 -80
  28. package/src/components/WinMenu/components/FullMenuContainer.tsx +0 -50
  29. package/src/components/WinMenu/components/FullMenuItem.tsx +0 -128
  30. package/src/components/WinMenu/components/LangSwitch.tsx +0 -84
  31. package/src/components/WinMenu/components/LogoBox.tsx +0 -29
  32. package/src/components/WinMenu/components/PinDialog.tsx +0 -72
  33. package/src/components/WinMenu/components/PinnedMenuBox.tsx +0 -183
  34. package/src/components/WinMenu/components/UserBox.tsx +0 -83
  35. package/src/components/WinMenu/hooks/useUserInfo.ts +0 -21
  36. package/src/components/WinMenu/hooks/useUserMenu.ts +0 -35
  37. package/src/components/WinMenu/index.tsx +0 -100
  38. package/src/components/WinMenu/services/WinService.ts +0 -79
  39. package/src/components/WinMenu/services/request.ts +0 -53
  40. package/src/components/WinMenu/utils/const.ts +0 -80
  41. package/src/components/WinMenu/utils/enum.ts +0 -19
  42. package/src/components/WinMenu/utils/interface.ts +0 -61
  43. package/src/components/WinMenu/utils/map.ts +0 -39
  44. package/src/components/WinMenu/utils/tool.ts +0 -142
  45. package/src/components/WinMenu/utils/type.ts +0 -1
  46. package/src/components/hover-view.tsx +0 -48
  47. package/src/components/icon.tsx +0 -44
  48. package/src/components/indicator-remark.tsx +0 -25
  49. package/src/components/none-content.tsx +0 -93
  50. package/src/components/panel-tab.tsx +0 -150
  51. package/src/components/panel-title-tab.tsx +0 -60
  52. package/src/components/win-card/components/ChartContent.tsx +0 -47
  53. package/src/components/win-card/components/Indicator.tsx +0 -42
  54. package/src/components/win-card/components/IndicatorArea.tsx +0 -63
  55. package/src/components/win-card/components/IndicatorInfo.tsx +0 -78
  56. package/src/components/win-card/components/MatterContent.tsx +0 -121
  57. package/src/components/win-card/components/MatterList.tsx +0 -141
  58. package/src/components/win-card/components/NoticeContent.tsx +0 -73
  59. package/src/components/win-card/components/NoticeList.tsx +0 -68
  60. package/src/components/win-card/components/SelectDecoration.tsx +0 -34
  61. package/src/components/win-card/components/WinRankContent.tsx +0 -102
  62. package/src/components/win-card/index.tsx +0 -298
  63. package/src/components/win-card/utils/interface.ts +0 -12
  64. package/src/components/win-card/utils/tool.ts +0 -11
  65. package/src/components/win-card-mobile/components/ChartContent.tsx +0 -47
  66. package/src/components/win-card-mobile/components/DualLineBar.tsx +0 -61
  67. package/src/components/win-card-mobile/components/Indicator.tsx +0 -42
  68. package/src/components/win-card-mobile/components/IndicatorArea.tsx +0 -65
  69. package/src/components/win-card-mobile/components/IndicatorInfo.tsx +0 -83
  70. package/src/components/win-card-mobile/components/SelectDecoration.tsx +0 -28
  71. package/src/components/win-card-mobile/index.tsx +0 -235
  72. package/src/components/win-card-mobile/utils/interface.ts +0 -12
  73. package/src/components/win-card-mobile/utils/tool.ts +0 -9
  74. package/src/components/win-chart/components/chart-wrapper.tsx +0 -5
  75. package/src/components/win-chart/index.tsx +0 -59
  76. package/src/components/win-chart/theme/win-dark.json +0 -372
  77. package/src/components/win-chart/theme/win-light.json +0 -372
  78. package/src/components/win-chart/utils/const.ts +0 -37
  79. package/src/components/win-chart/utils/getAreaSpec.ts +0 -150
  80. package/src/components/win-chart/utils/getBarSpec.ts +0 -60
  81. package/src/components/win-chart/utils/getChartOptions.ts +0 -59
  82. package/src/components/win-chart/utils/getColumnSpec.ts +0 -112
  83. package/src/components/win-chart/utils/getDualSpec.ts +0 -79
  84. package/src/components/win-chart/utils/getFunnelSpec.ts +0 -70
  85. package/src/components/win-chart/utils/getLineSpec.ts +0 -53
  86. package/src/components/win-chart/utils/getPieSpec.ts +0 -124
  87. package/src/components/win-chart/utils/getRadarSpec.ts +0 -87
  88. package/src/components/win-chart/utils/tool.ts +0 -163
  89. package/src/components/win-chart/utils/type.ts +0 -96
  90. package/src/components/win-icon/index.tsx +0 -97
  91. package/src/components/win-v/components/EmptyBox.tsx +0 -9
  92. package/src/components/win-v/components/VDialog.tsx +0 -173
  93. package/src/components/win-v/components/VDialogBtn.tsx +0 -119
  94. package/src/components/win-v/components/VDialogMsg.tsx +0 -325
  95. package/src/components/win-v/components/VInput.tsx +0 -15
  96. package/src/components/win-v/components/VRemindMsgList.tsx +0 -303
  97. package/src/components/win-v/components/VRobot.tsx +0 -97
  98. package/src/components/win-v/hooks/useVDialogCore.ts +0 -102
  99. package/src/components/win-v/hooks/useVDialogOperate.ts +0 -132
  100. package/src/components/win-v/hooks/useVDialogState.ts +0 -52
  101. package/src/components/win-v/hooks/useVRemindMsgShow.ts +0 -15
  102. package/src/components/win-v/index.tsx +0 -205
  103. package/src/components/win-wrappers/card-wrapper.tsx +0 -103
  104. package/src/components/win-wrappers/dot-wrapper.tsx +0 -18
  105. package/src/components/win-wrappers/iframe-wrapper.tsx +0 -7
  106. package/src/components/win-wrappers/request-wrapper.tsx +0 -190
  107. package/src/global.d.ts +0 -53
  108. package/src/hooks/useCardOptionList.ts +0 -23
  109. package/src/hooks/useCostFiltersDicList.ts +0 -22
  110. package/src/hooks/useFbiUrl.ts +0 -22
  111. package/src/hooks/useHalfScreenState.ts +0 -50
  112. package/src/hooks/useHasIntersected.ts +0 -36
  113. package/src/hooks/useIndicatorCardInfo.ts +0 -26
  114. package/src/hooks/useIndicatorCardQueryList.ts +0 -22
  115. package/src/hooks/useIndicatorClassifyList.ts +0 -25
  116. package/src/hooks/useIndicatorDetailsDateList.ts +0 -22
  117. package/src/hooks/useIndicatorDetailsInfo.ts +0 -49
  118. package/src/hooks/useIndicatorDetailsTrend.ts +0 -25
  119. package/src/hooks/useIndicatorDicList.ts +0 -22
  120. package/src/hooks/useIndicatorLabelList.ts +0 -20
  121. package/src/hooks/useIndicatorList.ts +0 -24
  122. package/src/hooks/useIndicatorRangeList.ts +0 -20
  123. package/src/hooks/useIndicatorTypeList.ts +0 -20
  124. package/src/hooks/useIndicatorUnitList.ts +0 -21
  125. package/src/hooks/useListenQuery.ts +0 -29
  126. package/src/hooks/useMobile.ts +0 -58
  127. package/src/hooks/useNotice.ts +0 -42
  128. package/src/hooks/useOrgLevelList.ts +0 -23
  129. package/src/hooks/usePageSelection.ts +0 -121
  130. package/src/hooks/usePageState.ts +0 -22
  131. package/src/hooks/usePendingList.ts +0 -27
  132. package/src/hooks/usePortalPageInfo.ts +0 -43
  133. package/src/hooks/useRefreshByLocationChange.ts +0 -16
  134. package/src/hooks/useReportIndicatorList.ts +0 -21
  135. package/src/hooks/useReportInfo.ts +0 -45
  136. package/src/hooks/useReportPersonList.ts +0 -21
  137. package/src/hooks/useScriptLoader.ts +0 -22
  138. package/src/hooks/useUnreadMsgList.ts +0 -26
  139. package/src/hooks/useUserAvatar.ts +0 -23
  140. package/src/hooks/useVReportInfo.ts +0 -50
  141. package/src/hooks/useVisionUserConfig.ts +0 -25
  142. package/src/hooks/useWorkbenchOptions.ts +0 -63
  143. package/src/index.tsx +0 -20
  144. package/src/services/CardService.ts +0 -91
  145. package/src/services/CommonService.ts +0 -23
  146. package/src/services/CostService.ts +0 -56
  147. package/src/services/DialogService.ts +0 -74
  148. package/src/services/IndicatorService.ts +0 -406
  149. package/src/services/PageService.ts +0 -204
  150. package/src/services/ReportService.ts +0 -335
  151. package/src/services/WorkbenchService.ts +0 -411
  152. package/src/styles/README.md +0 -12
  153. package/src/styles/index.scss +0 -9
  154. package/src/styles/mixins/index.scss +0 -25
  155. package/src/styles/next-cover.scss +0 -4
  156. package/src/styles/normalize.scss +0 -27
  157. package/src/styles/utilities/index.scss +0 -5
  158. package/src/styles/vars/index.scss +0 -17
  159. package/src/types/enum-workbench.ts +0 -29
  160. package/src/types/enum.ts +0 -156
  161. package/src/types/index.ts +0 -19
  162. package/src/types/indicator.ts +0 -299
  163. package/src/types/interface.ts +0 -303
  164. package/src/types/portal.ts +0 -211
  165. package/src/types/report.ts +0 -28
  166. package/src/types/type.ts +0 -11
  167. package/src/types/user.ts +0 -28
  168. package/src/utils/README.md +0 -4
  169. package/src/utils/arms.ts +0 -59
  170. package/src/utils/arr.ts +0 -123
  171. package/src/utils/const-workbench.ts +0 -9
  172. package/src/utils/const.ts +0 -18
  173. package/src/utils/index.ts +0 -18
  174. package/src/utils/init.ts +0 -5
  175. package/src/utils/map-workbench.ts +0 -66
  176. package/src/utils/map.ts +0 -377
  177. package/src/utils/number.ts +0 -101
  178. package/src/utils/page.ts +0 -81
  179. package/src/utils/str.ts +0 -26
  180. package/src/utils/tools.ts +0 -44
  181. package/src/utils/tree.ts +0 -145
  182. package/src/utils/url.ts +0 -40
  183. package/src/utils/util.ts +0 -99
  184. package/src/utils/workbench.ts +0 -25
@@ -1,218 +0,0 @@
1
- import { styled } from 'styled-components';
2
- import { WidthProvider, Responsive, ResponsiveProps } from 'react-grid-layout';
3
-
4
- export type { ResponsiveProps };
5
-
6
- export const ResponsiveReactGridLayout = styled(WidthProvider(Responsive))`
7
- position: relative;
8
-
9
- .react-grid-layout {
10
- position: relative;
11
- transition: height 200ms ease;
12
- }
13
-
14
- .react-grid-item {
15
- transition: all 200ms ease;
16
- transition-property: left, top, width, height;
17
- }
18
-
19
- .react-grid-item img {
20
- pointer-events: none;
21
- user-select: none;
22
- }
23
-
24
- .react-grid-item.cssTransforms {
25
- transition-property: transform, width, height;
26
- }
27
-
28
- .react-grid-item.resizing {
29
- transition: none;
30
- z-index: 1;
31
- will-change: width, height;
32
- }
33
-
34
- .react-grid-item.react-draggable-dragging {
35
- transition: none;
36
- z-index: 3;
37
- will-change: transform;
38
- }
39
-
40
- .react-grid-item.dropping {
41
- visibility: hidden;
42
- }
43
-
44
- .react-grid-item.react-grid-placeholder {
45
- background: red;
46
- opacity: 0.2;
47
- transition-duration: 100ms;
48
- z-index: 2;
49
- -webkit-user-select: none;
50
- -moz-user-select: none;
51
- -ms-user-select: none;
52
- -o-user-select: none;
53
- user-select: none;
54
- }
55
-
56
- .react-grid-item.react-grid-placeholder.placeholder-resizing {
57
- transition: none;
58
- }
59
-
60
- .react-grid-item > .react-resizable-handle {
61
- position: absolute;
62
- width: 20px;
63
- height: 20px;
64
- }
65
-
66
- .react-grid-item > .react-resizable-handle::after {
67
- content: '';
68
- position: absolute;
69
- right: 3px;
70
- bottom: 3px;
71
- width: 5px;
72
- height: 5px;
73
- border-right: 2px solid rgba(0, 0, 0, 0.4);
74
- border-bottom: 2px solid rgba(0, 0, 0, 0.4);
75
- }
76
-
77
- .react-resizable-hide > .react-resizable-handle {
78
- display: none;
79
- }
80
-
81
- .react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
82
- bottom: 0;
83
- left: 0;
84
- cursor: sw-resize;
85
- transform: rotate(90deg);
86
- }
87
-
88
- .react-grid-item > .react-resizable-handle.react-resizable-handle-se {
89
- bottom: 0;
90
- right: 0;
91
- cursor: se-resize;
92
- }
93
-
94
- .react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
95
- top: 0;
96
- left: 0;
97
- cursor: nw-resize;
98
- transform: rotate(180deg);
99
- }
100
-
101
- .react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
102
- top: 0;
103
- right: 0;
104
- cursor: ne-resize;
105
- transform: rotate(270deg);
106
- }
107
-
108
- .react-grid-item > .react-resizable-handle.react-resizable-handle-w,
109
- .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
110
- top: 50%;
111
- margin-top: -10px;
112
- cursor: ew-resize;
113
- }
114
-
115
- .react-grid-item > .react-resizable-handle.react-resizable-handle-w {
116
- left: 0;
117
- transform: rotate(135deg);
118
- }
119
-
120
- .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
121
- right: 0;
122
- transform: rotate(315deg);
123
- }
124
-
125
- .react-grid-item > .react-resizable-handle.react-resizable-handle-n,
126
- .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
127
- left: 50%;
128
- margin-left: -10px;
129
- cursor: ns-resize;
130
- }
131
-
132
- .react-grid-item > .react-resizable-handle.react-resizable-handle-n {
133
- top: 0;
134
- transform: rotate(225deg);
135
- }
136
-
137
- .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
138
- bottom: 0;
139
- transform: rotate(45deg);
140
- }
141
-
142
- .react-resizable {
143
- position: relative;
144
- }
145
-
146
- .react-resizable-handle {
147
- position: absolute;
148
- width: 20px;
149
- height: 20px;
150
- background-repeat: no-repeat;
151
- background-origin: content-box;
152
- box-sizing: border-box;
153
- background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
154
- background-position: bottom right;
155
- padding: 0 3px 3px 0;
156
- }
157
-
158
- .react-resizable-handle-sw {
159
- bottom: 0;
160
- left: 0;
161
- cursor: sw-resize;
162
- transform: rotate(90deg);
163
- }
164
-
165
- .react-resizable-handle-se {
166
- bottom: 0;
167
- right: 0;
168
- cursor: se-resize;
169
- }
170
-
171
- .react-resizable-handle-nw {
172
- top: 0;
173
- left: 0;
174
- cursor: nw-resize;
175
- transform: rotate(180deg);
176
- }
177
-
178
- .react-resizable-handle-ne {
179
- top: 0;
180
- right: 0;
181
- cursor: ne-resize;
182
- transform: rotate(270deg);
183
- }
184
-
185
- .react-resizable-handle-w,
186
- .react-resizable-handle-e {
187
- top: 50%;
188
- margin-top: -10px;
189
- cursor: ew-resize;
190
- }
191
-
192
- .react-resizable-handle-w {
193
- left: 0;
194
- transform: rotate(135deg);
195
- }
196
-
197
- .react-resizable-handle-e {
198
- right: 0;
199
- transform: rotate(315deg);
200
- }
201
-
202
- .react-resizable-handle-n,
203
- .react-resizable-handle-s {
204
- left: 50%;
205
- margin-left: -10px;
206
- cursor: ns-resize;
207
- }
208
-
209
- .react-resizable-handle-n {
210
- top: 0;
211
- transform: rotate(225deg);
212
- }
213
-
214
- .react-resizable-handle-s {
215
- bottom: 0;
216
- transform: rotate(45deg);
217
- }
218
- `;
@@ -1,27 +0,0 @@
1
- import { Slider } from '@cainiaofe/cn-ui';
2
- import { rgba } from 'polished';
3
- import { css, styled } from 'styled-components';
4
-
5
- export const SliderDecoration = styled(Slider).attrs({
6
- pauseOnHover: true,
7
- autoplay: true,
8
- autoplaySpeed: 5000,
9
- arrows: false,
10
- dotsRender: (index, current) => <Dot checked={index === current} />,
11
- })``;
12
-
13
- const Dot = styled.span<{ checked?: boolean }>`
14
- display: inline-block;
15
- width: 6px;
16
- height: 6px;
17
- border-radius: 500px;
18
- background-color: ${rgba('#828c9e', 0.5)};
19
- transform: translateY(32px);
20
-
21
- ${({ checked }) =>
22
- checked &&
23
- css`
24
- width: 18px;
25
- background-color: #828c9e;
26
- `}
27
- `;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { IVisionUserConfig } from 'src/types';
3
-
4
- export const VisionUserConfigContext = React.createContext<
5
- IVisionUserConfig | undefined
6
- >(undefined);
@@ -1,11 +0,0 @@
1
- # 更新日志
2
-
3
- ## 231013
4
-
5
- 1. 根据地址判定请求参数
6
- 2. 未登入 Query 失效修复
7
-
8
- ## 231017
9
-
10
- 1. 幻视获取全路径
11
- 2. 更改查询菜单统一入参
@@ -1,5 +0,0 @@
1
- import { IKeyValueItem } from '@/types';
2
- import Header from '@alife/dwork-cnstr-header';
3
- import { styled } from 'styled-components';
4
-
5
- export const WinHeader = styled(Header)<IKeyValueItem>``;
@@ -1,61 +0,0 @@
1
- import { styled } from 'styled-components';
2
- import { LangSwitch } from './LangSwitch';
3
- import { CnBox, CnTooltip } from '@cainiaofe/cn-ui';
4
- import { IMenuItem } from '../utils/interface';
5
- import { getHandleOpenLink, menuTreeFind } from '../utils/tool';
6
- import { RELATED_SYSTEM_LOGO } from '../utils/const';
7
-
8
- interface IProps {
9
- data?: IMenuItem[];
10
- downloadCenterUrl?: string;
11
- }
12
-
13
- export const ExtraBox = ({ data = [], downloadCenterUrl }: IProps) => {
14
- const curItem = menuTreeFind(
15
- data,
16
- (item) => !!item.menuUrl && location.href.includes(item.menuUrl),
17
- );
18
-
19
- return (
20
- <CnBox direction='row' spacing={16} align='center'>
21
- {!!curItem?.docName && (
22
- <CnTooltip
23
- trigger={
24
- <img
25
- alt=''
26
- src={RELATED_SYSTEM_LOGO}
27
- onClick={getHandleOpenLink(curItem.docUrl)}
28
- style={{
29
- margin: '0 8px',
30
- cursor: 'pointer',
31
- display: 'inline-block',
32
- width: 20,
33
- height: 20,
34
- objectFit: 'contain',
35
- }}
36
- />
37
- }
38
- align='br'
39
- popupStyle={{
40
- marginTop: 20,
41
- }}
42
- >
43
- {curItem.docName}
44
- </CnTooltip>
45
- )}
46
- {downloadCenterUrl && (
47
- <MainLinkItem onClick={getHandleOpenLink(downloadCenterUrl)}>
48
- 下载中心
49
- </MainLinkItem>
50
- )}
51
- <LangSwitch />
52
- </CnBox>
53
- );
54
- };
55
-
56
- const MainLinkItem = styled.div`
57
- width: 70px;
58
- font-size: 16px;
59
- color: #fff;
60
- cursor: pointer;
61
- `;
@@ -1,80 +0,0 @@
1
- import { CnIcon, CnPopup, CnTooltip } from '@cainiaofe/cn-ui';
2
- import { IWinHeaderProps } from '../utils/interface';
3
- import { FullMenuContainer } from './FullMenuContainer';
4
- import { GLOBAL_MENU_TITLE } from '../utils/const';
5
- import { rgba } from 'polished';
6
- import { styled } from 'styled-components';
7
- import { checkEntityArr } from '../utils/tool';
8
-
9
- export const FullMenuBox = ({ data, onPinned }: IWinHeaderProps) => {
10
- return (
11
- <CnPopup
12
- trigger={
13
- <div
14
- style={{
15
- zIndex: 1000,
16
- transform: 'translateY(2px)',
17
- }}
18
- >
19
- <CnTooltip
20
- trigger={
21
- <CnIcon
22
- type='hamburger'
23
- color='#fff'
24
- size='large'
25
- style={{
26
- cursor: 'pointer',
27
- }}
28
- />
29
- }
30
- align='br'
31
- popupStyle={{
32
- marginTop: 20,
33
- }}
34
- >
35
- {GLOBAL_MENU_TITLE}
36
- </CnTooltip>
37
- </div>
38
- }
39
- triggerType='click'
40
- align='tl bl'
41
- followTrigger
42
- >
43
- {checkEntityArr(data) && (
44
- <FullMenuWrapper>
45
- <div className='menu-title'>
46
- <h3>{GLOBAL_MENU_TITLE}</h3>
47
- </div>
48
- <div className='menu-list'>
49
- <FullMenuContainer data={data} onPinned={onPinned} />
50
- </div>
51
- </FullMenuWrapper>
52
- )}
53
- </CnPopup>
54
- );
55
- };
56
-
57
- const FullMenuWrapper = styled.div`
58
- left: -20px !important;
59
- top: -40px !important;
60
- z-index: 998 !important;
61
- background-color: #fff;
62
- box-shadow: 0 8px 16px 0 ${rgba('#272e3a', 0.2)};
63
-
64
- .menu-title {
65
- padding: 17px 24px 18px;
66
- font-size: 20px;
67
- color: #272e3a;
68
-
69
- h3 {
70
- margin: 0;
71
- font-weight: 500;
72
- }
73
- }
74
-
75
- .menu-list {
76
- box-shadow: 0 -1px 0 0 #e2e5eb;
77
- max-height: calc(100vh - 130px);
78
- overflow: auto;
79
- }
80
- `;
@@ -1,50 +0,0 @@
1
- import { useState } from 'react';
2
- import { Grid } from '@cainiaofe/cn-ui';
3
- import { FullMenuItem } from './FullMenuItem';
4
- import { IWinHeaderProps } from '../utils/interface';
5
- import { checkEntityArr } from '../utils/tool';
6
-
7
- export function FullMenuContainer({ data = [], onPinned }: IWinHeaderProps) {
8
- const [active, setActive] = useState<string>();
9
-
10
- return (
11
- <Grid.Row>
12
- <div
13
- style={{
14
- boxShadow: '-1px 0 0 0 #e2e5eb',
15
- }}
16
- >
17
- {data.map((item) => {
18
- return (
19
- <div
20
- key={item.menuCode}
21
- onMouseOver={() => {
22
- setActive(item.menuCode);
23
- }}
24
- >
25
- <FullMenuItem
26
- itemInfo={item}
27
- isSelect={active === item.menuCode}
28
- onPinned={onPinned}
29
- />
30
- </div>
31
- );
32
- })}
33
- </div>
34
- <Grid.Row>
35
- {data.map((item) => {
36
- return (
37
- active === item.menuCode &&
38
- checkEntityArr(item.children) && (
39
- <FullMenuContainer
40
- key={item.menuCode}
41
- data={item.children}
42
- onPinned={onPinned}
43
- />
44
- )
45
- );
46
- })}
47
- </Grid.Row>
48
- </Grid.Row>
49
- );
50
- }
@@ -1,128 +0,0 @@
1
- import { Box } from '@cainiaofe/cn-ui';
2
- import { styled } from 'styled-components';
3
- import { noSelectImg, selectImg } from '../utils/const';
4
- import { IMenuItem, IWinHeaderProps } from '../utils/interface';
5
- import { checkCurLink, checkEntityArr, getHandleJump } from '../utils/tool';
6
-
7
- interface IProps extends IWinHeaderProps {
8
- isSelect: boolean;
9
- itemInfo: IMenuItem;
10
- }
11
-
12
- export function FullMenuItem({ isSelect, itemInfo, onPinned }: IProps) {
13
- const isCurLink =
14
- !checkEntityArr(itemInfo.children) && checkCurLink(itemInfo);
15
-
16
- return (
17
- <BoxDecoration
18
- direction='row'
19
- style={{
20
- backgroundColor: isSelect ? '#f7f8fa' : 'transparent',
21
- }}
22
- >
23
- <Box justify='center' className='text' onClick={getHandleJump(itemInfo)}>
24
- <span
25
- className='menu-item-text'
26
- style={{
27
- color: isSelect || isCurLink ? '#3076FC' : '#394252',
28
- }}
29
- >
30
- {itemInfo.menuTitle}
31
- </span>
32
- </Box>
33
- {(checkEntityArr(itemInfo.children) || itemInfo.pinned) && (
34
- <Box
35
- className='no-select'
36
- justify='center'
37
- style={{
38
- marginLeft: 20,
39
- }}
40
- >
41
- <div
42
- style={{
43
- cursor: 'pointer',
44
- }}
45
- onClick={(e) => {
46
- e.stopPropagation();
47
- onPinned?.(itemInfo);
48
- }}
49
- >
50
- <img
51
- src={itemInfo.pinned ? selectImg : noSelectImg}
52
- alt='tackSelect'
53
- />
54
- </div>
55
- </Box>
56
- )}
57
- <Box
58
- style={{
59
- marginLeft: 32,
60
- }}
61
- justify='center'
62
- >
63
- <div
64
- className='iconRight'
65
- style={{
66
- borderColor: isSelect ? '#3076FC' : '#394252',
67
- opacity: checkEntityArr(itemInfo.children) ? 1 : 0,
68
- }}
69
- />
70
- </Box>
71
- </BoxDecoration>
72
- );
73
- }
74
-
75
- const BoxDecoration = styled(Box)`
76
- min-width: 240px;
77
- height: 44px;
78
- padding: 0 20px 0 25px;
79
- transition: all 0.2s;
80
- cursor: pointer;
81
-
82
- & > div:first-child {
83
- max-width: 180px;
84
- overflow: hidden;
85
- text-overflow: ellipsis;
86
- white-space: nowrap;
87
- }
88
-
89
- &:hover {
90
- background-color: #f7f8fa;
91
- }
92
-
93
- &:hover .text span {
94
- color: #3076fc !important;
95
- }
96
-
97
- &:hover .iconRight {
98
- border-color: #3076fc !important;
99
- }
100
-
101
- .menu-item-icon {
102
- span {
103
- background: rgb(129, 140, 161);
104
- height: 16px;
105
- line-height: 16px;
106
- color: #fff;
107
- }
108
- }
109
-
110
- .menu-item-text {
111
- text-overflow: ellipsis;
112
- white-space: nowrap;
113
- overflow: hidden;
114
- }
115
-
116
- .iconRight {
117
- width: 8px;
118
- height: 8px;
119
- transform: rotateZ(45deg);
120
- border-right: 1px solid;
121
- border-top: 1px solid;
122
- }
123
-
124
- .text {
125
- flex: 1;
126
- padding-left: 4px;
127
- }
128
- `;
@@ -1,84 +0,0 @@
1
- import { Box, CnCard, CnIcon, Icon } from '@cainiaofe/cn-ui';
2
- import { styled } from 'styled-components';
3
- import $i18n from 'panda-i18n';
4
- import { langList } from '../utils/map';
5
- import { THEME } from '../utils/const';
6
- import { getListLabelByValue } from '../utils/tool';
7
- import { WinLanguage } from '../utils/type';
8
-
9
- const lang = $i18n.getLang();
10
- const handleSetLang = (lang: WinLanguage) => {
11
- $i18n.setLang(lang);
12
- location.reload();
13
- };
14
-
15
- export const LangSwitch = () => {
16
- return (
17
- <Wrapper>
18
- <Box direction="row" align="center" spacing={4}>
19
- {/* <IconBox src={LANG_LOGO} size={16} /> */}
20
- <div>
21
- <span data-lang-label>{getListLabelByValue(langList, lang)}</span>
22
- <CnIcon type="arrow-down" size={12} />
23
- </div>
24
- </Box>
25
- <LangCard data-card>
26
- <Box spacing={16}>
27
- {langList.map((item, index) => (
28
- <Box
29
- key={index}
30
- data-lang-list-item
31
- direction="row"
32
- justify="space-between"
33
- onClick={() => handleSetLang(item.value)}
34
- >
35
- <span>{item.label}</span>
36
- {item.value === lang && (
37
- <Icon
38
- type="select"
39
- style={{
40
- color: THEME.mainColor,
41
- }}
42
- />
43
- )}
44
- </Box>
45
- ))}
46
- </Box>
47
- </LangCard>
48
- </Wrapper>
49
- );
50
- };
51
-
52
- const Wrapper = styled.div`
53
- color: #fff;
54
- position: relative;
55
- height: 56px;
56
- display: flex;
57
- justify-content: center;
58
- align-items: center;
59
-
60
- &:hover {
61
- [data-name='CnCard'] {
62
- transform: scaleY(1);
63
- }
64
- }
65
-
66
- [data-lang-label] {
67
- margin-right: 2px;
68
- }
69
-
70
- [data-lang-list-item] {
71
- width: 100px;
72
- cursor: pointer;
73
- }
74
- `;
75
-
76
- const LangCard = styled(CnCard)`
77
- position: absolute;
78
- right: -12px;
79
- top: 64px;
80
- color: ${THEME.defaultColor};
81
- transform: scaleY(0);
82
- transform-origin: 0 0;
83
- transition: 0.5s;
84
- `;
@@ -1,29 +0,0 @@
1
- import { Box, Divider } from '@cainiaofe/cn-ui';
2
- import { styled } from 'styled-components';
3
-
4
- export const LogoBox = ({ src = '', text = '' }) => {
5
- return (
6
- <Box direction='row' align='center' style={{ width: 'max-content' }}>
7
- <ImgBox
8
- src={src}
9
- alt=''
10
- onClick={() => {
11
- location.href = `/`;
12
- }}
13
- />
14
- <Divider direction={'ver'} style={{ height: 20 }} />
15
- <TextBox>{text}</TextBox>
16
- </Box>
17
- );
18
- };
19
-
20
- const ImgBox = styled.img({
21
- objectFit: 'contain',
22
- height: '24px',
23
- cursor: 'pointer',
24
- });
25
-
26
- const TextBox = styled.span({
27
- color: '#fff',
28
- fontSize: '20px',
29
- });