win-chart 1.0.1 → 1.0.3

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 (185) hide show
  1. package/build/js/index.js +1 -0
  2. package/package.json +5 -2
  3. package/.eslintrc.json +0 -3
  4. package/.prettierrc.json +0 -5
  5. package/localhost-key.pem +0 -28
  6. package/localhost.pem +0 -25
  7. package/rsbuild.config.ts +0 -48
  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
  185. package/tsconfig.json +0 -33
@@ -1,96 +0,0 @@
1
- export interface IWinChartProps {
2
- theme?: 'light' | 'dark';
3
- sort?: 'asc' | 'desc';
4
- color?: string[];
5
- chartType?: WinChartType;
6
- xAxisLabelRotate?: number;
7
- xAxisLabelLength?: number;
8
- data?: ICharInfo[];
9
- extraData?: ICharInfo[];
10
- className?: string;
11
- style?: React.CSSProperties;
12
-
13
- /**
14
- * label 与 value 取值互换 (只作用饼图、环图、雷达图图表)
15
- */
16
- reserveValueWithLabelType?: boolean;
17
-
18
- /**
19
- * Y 轴起始值
20
- */
21
- yStart?: number[];
22
-
23
- /**
24
- * 自定义配置,优先级最高,会覆盖默认配置(采用deepmerge,只覆盖差异部分)
25
- */
26
- extraOption?: echarts.EChartsOption;
27
- }
28
-
29
- /**
30
- * 图表类型
31
- */
32
- export enum WinChartType {
33
- /**
34
- * MINI面积图
35
- */
36
- MINI_AREA,
37
-
38
- /**
39
- * 面积图
40
- */
41
- AREA,
42
-
43
- /**
44
- * 双轴图
45
- */
46
- DUAL_LINE_BAR,
47
-
48
- /**
49
- * 柱状图
50
- */
51
- COLUMN,
52
-
53
- /**
54
- * 堆叠柱状图
55
- */
56
- STACK_COLUMN,
57
-
58
- /**
59
- * 折线图
60
- */
61
- LINE,
62
-
63
- /**
64
- * 条形图
65
- */
66
- BAR,
67
-
68
- /**
69
- * 漏斗图
70
- */
71
- FUNNEL,
72
-
73
- /**
74
- * 饼图
75
- */
76
- PIE,
77
-
78
- /**
79
- * 环形图
80
- */
81
- CYCLE,
82
-
83
- /**
84
- * 雷达图
85
- */
86
- RADAR,
87
- }
88
-
89
- /**
90
- * 标准图表数据
91
- */
92
- export interface ICharInfo {
93
- label: string;
94
- value: number;
95
- type?: string;
96
- }
@@ -1,97 +0,0 @@
1
- import { HTMLAttributes, CSSProperties, useState, useEffect } from 'react';
2
-
3
- interface IconProps extends HTMLAttributes<SVGElement> {
4
- type?: string;
5
- size?:
6
- | number
7
- | 'xs'
8
- | 'small'
9
- | 'medium'
10
- | 'large'
11
- | 'xl'
12
- | 'xxl'
13
- | 'xxxl'
14
- | 'inherit';
15
- color?: string;
16
- }
17
-
18
- const sizeMap = {
19
- xs: '0.5em',
20
- small: '0.75em',
21
- medium: '1em',
22
- large: '1.25em',
23
- xl: '1.5em',
24
- xxl: '1.75em',
25
- xxxl: '2em',
26
- inherit: 'inherit',
27
- };
28
-
29
- export const createIconComponent = (scriptUrl: string) => {
30
- const Icon: React.FC<IconProps> = ({
31
- type,
32
- size = 'medium',
33
- color,
34
- style,
35
- className,
36
- ...restProps
37
- }) => {
38
- const scriptLoaded = useIconLoader(scriptUrl);
39
-
40
- if (!scriptLoaded) {
41
- return null; // 或者可以返回一个占位符或者加载状态
42
- }
43
-
44
- // 根据size属性转换尺寸
45
- const fontSize = typeof size === 'number' ? `${size}px` : sizeMap[size];
46
-
47
- // 定义图标样式
48
- const iconStyle: CSSProperties = {
49
- width: fontSize,
50
- height: fontSize,
51
- verticalAlign: '-0.15em',
52
- fill: color || 'currentColor',
53
- overflow: 'hidden',
54
- ...style, // 合并外部传入的style对象
55
- };
56
-
57
- // 使用type属性构建图标的引用链接
58
- const href = `#${type}`;
59
-
60
- // 合并额外的props和样式类名
61
- const svgClassName = `icon ${className || ''}`.trim();
62
-
63
- return (
64
- <svg
65
- className={svgClassName}
66
- aria-hidden="true"
67
- style={iconStyle}
68
- {...restProps}
69
- >
70
- <use xlinkHref={href}></use>
71
- </svg>
72
- );
73
- };
74
-
75
- return Icon;
76
- };
77
-
78
- export const useIconLoader = (scriptUrl: string) => {
79
- const [loaded, setLoaded] = useState(false);
80
-
81
- useEffect(() => {
82
- if (document.querySelector(`script[src="${scriptUrl}"]`)) {
83
- setLoaded(true);
84
- return;
85
- }
86
- const script = document.createElement('script');
87
- script.src = scriptUrl;
88
- script.async = true;
89
- script.onload = () => setLoaded(true);
90
- document.body.appendChild(script);
91
- return () => {
92
- document.body.removeChild(script);
93
- };
94
- }, [scriptUrl]);
95
-
96
- return loaded;
97
- };
@@ -1,9 +0,0 @@
1
- import { styled } from 'styled-components';
2
-
3
- export const EmptyBox = styled.img.attrs({
4
- src: 'https://img.alicdn.com/imgextra/i4/O1CN01bkhh1m21HH4wlsyY9_!!6000000006959-55-tps-96-64.svg',
5
- })`
6
- width: 50vw;
7
- object-fit: contain;
8
- margin-bottom: 0.64rem;
9
- `;
@@ -1,173 +0,0 @@
1
- import $i18n from 'panda-i18n';
2
- import { Box, CnButton, Input } from '@cainiaofe/cn-ui';
3
- import { useMemo } from 'react';
4
- import { css, styled } from 'styled-components';
5
- import { VDialogMsg } from './VDialogMsg';
6
- import { rgba } from 'polished';
7
- import { insertTimeMarkers } from '@/utils';
8
- import { CustomIcon } from '@/components/icon';
9
- import { IStyleProps } from '@/types';
10
- import { useVDialogCore } from '../hooks/useVDialogCore';
11
- import { BackMyVisionBtn, ToolBtnBox } from './VDialogBtn';
12
- import { useMobileState } from '@/hooks/useMobile';
13
-
14
- interface IProps extends IStyleProps {
15
- insertContent?: React.ReactNode;
16
- }
17
-
18
- export const VDialog = ({ style, insertContent }: IProps) => {
19
- const {
20
- dialogState,
21
- scrollContainerRef,
22
- handleSend,
23
- handleFocus,
24
- handleInputChange,
25
- handleQueryDialogList,
26
- } = useVDialogCore();
27
-
28
- // 对话列表
29
- const msgList = useMemo(() => {
30
- return insertTimeMarkers(dialogState.dialogList).map((item) => {
31
- const curIndex = dialogState.dialogList.findIndex(
32
- (ele) => ele.id === item.id,
33
- );
34
-
35
- const getRetryContent = () => {
36
- for (let i = curIndex - 1; i >= 0; i--) {
37
- if (dialogState.dialogList.at(i)?.sender !== '0') {
38
- return dialogState.dialogList.at(i)?.content;
39
- }
40
- }
41
- };
42
-
43
- return (
44
- <VDialogMsg key={item.id} data={item} retryMsg={getRetryContent()} />
45
- );
46
- });
47
- }, [dialogState.dialogList]);
48
- const isMobileDevice = useMobileState();
49
-
50
- return (
51
- <Wrapper style={style} $show={dialogState.show}>
52
- <MessageListWrapper ref={scrollContainerRef}>
53
- {insertContent}
54
- <ListBtnWrapper>
55
- <div style={{ height: 16 }}>
56
- <ListBtn
57
- $show={
58
- dialogState.dialogList.length < dialogState.paging.totalCount &&
59
- !dialogState.loading
60
- }
61
- onClick={() => {
62
- handleQueryDialogList(dialogState.paging.currentPage + 1);
63
- }}
64
- >
65
- {$i18n.get({ id: 'LoadMore', dm: '加载更多' })}
66
- </ListBtn>
67
- </div>
68
- </ListBtnWrapper>
69
- {msgList}
70
- </MessageListWrapper>
71
- <InputWrapper>
72
- {isMobileDevice && (
73
- <ToolBtnBox>
74
- <BackMyVisionBtn />
75
- </ToolBtnBox>
76
- )}
77
-
78
- <InputBox>
79
- <InputDecoration
80
- enterKeyHint="send"
81
- disabled={dialogState.loading}
82
- onFocus={() => {
83
- handleFocus(true);
84
- }}
85
- onBlur={() => {
86
- handleFocus(false);
87
- }}
88
- value={dialogState.input}
89
- onChange={handleInputChange}
90
- />
91
- <SendDecoration onClick={() => handleSend(dialogState.input)} />
92
- </InputBox>
93
- </InputWrapper>
94
- </Wrapper>
95
- );
96
- };
97
-
98
- const Wrapper = styled.div<{ $show?: boolean }>`
99
- width: 100%;
100
- height: 100%;
101
- background: ${rgba('#fff', 0.6)};
102
- padding: 16px;
103
- position: relative;
104
- display: flex;
105
- flex-direction: column;
106
-
107
- ${(props) =>
108
- !props.$show &&
109
- css`
110
- display: none;
111
- `}
112
- `;
113
-
114
- const MessageListWrapper = styled.div`
115
- display: grid;
116
- gap: 8px;
117
- flex: 1;
118
- overflow: auto;
119
- padding-bottom: 20px;
120
-
121
- &::-webkit-scrollbar {
122
- display: none;
123
- }
124
- `;
125
-
126
- const InputWrapper = styled.div`
127
- width: 100%;
128
- background: #fff;
129
- border-radius: 8px;
130
- padding: 12px;
131
- margin-top: 8px;
132
- `;
133
-
134
- const InputBox = styled.div`
135
- display: grid;
136
- grid: auto-flow / 1fr 30px;
137
- gap: 8px;
138
- place-items: end center;
139
- `;
140
-
141
- const InputDecoration = styled(Input.TextArea).attrs({
142
- hasBorder: false,
143
- placeholder: $i18n.get({ id: 'TERM.PleaseEnter', dm: '请输入' }),
144
- autoHeight: {
145
- minRows: 1,
146
- maxRows: 3,
147
- },
148
- })`
149
- width: 100%;
150
- `;
151
-
152
- const SendDecoration = styled(CustomIcon).attrs({ type: 'icon-fasong' })`
153
- cursor: pointer;
154
- margin-bottom: 8px;
155
- `;
156
-
157
- const ListBtnWrapper = styled(Box).attrs({
158
- direction: 'row',
159
- justify: 'center',
160
- })`
161
- margin: 16px 0;
162
- `;
163
-
164
- const ListBtn = styled(CnButton).attrs({
165
- text: true,
166
- type: 'primary',
167
- })<{ $show: boolean }>`
168
- ${(props) =>
169
- !props.$show &&
170
- css`
171
- display: none;
172
- `}
173
- `;
@@ -1,119 +0,0 @@
1
- import $i18n from 'panda-i18n';
2
- import { IDialogMsgInfo } from '@/types';
3
- import { CnBox, CnMessage } from '@cainiaofe/cn-ui';
4
- import { styled } from 'styled-components';
5
- import { CustomIcon } from '../../icon';
6
- import { useNavigate } from 'react-router-dom';
7
- import { CnButton } from '@cainiaofe/cn-ui-m';
8
- import { useVDialogOperate } from '../hooks/useVDialogOperate';
9
-
10
- export const OperateBtnBox = styled(CnBox).attrs({
11
- direction: 'row',
12
- justify: 'flex-end',
13
- onClick: (e: React.MouseEvent) => e.stopPropagation(),
14
- })`
15
- border-top: 1px solid #eef0f5;
16
- padding-top: 8px;
17
- margin-top: 8px;
18
- `;
19
-
20
- export const ToolBtnBox = styled(CnBox).attrs({
21
- direction: 'row',
22
- justify: 'flex-start',
23
- onClick: (e: React.MouseEvent) => e.stopPropagation(),
24
- })`
25
- border-bottom: 1px solid #eef0f5;
26
- padding-bottom: 8px;
27
- margin-bottom: 8px;
28
- `;
29
-
30
- const OperateBtn = styled.div`
31
- color: #828b9e;
32
- cursor: pointer;
33
- display: flex;
34
- justify-content: center;
35
- align-items: center;
36
- line-height: 1;
37
- margin-left: 16px;
38
-
39
- span {
40
- font-size: 12px;
41
- margin-left: 4px;
42
- }
43
- `;
44
-
45
- export const RetryBtn = (data: IDialogMsgInfo & { retryMsg?: string }) => {
46
- const { handleSend } = useVDialogOperate();
47
-
48
- return (
49
- <OperateBtn onClick={() => handleSend(data.retryMsg)}>
50
- <CustomIcon type="icon-refresh" />
51
- <span>{$i18n.get({ id: 'TryAgain', dm: '再试一次' })}</span>
52
- </OperateBtn>
53
- );
54
- };
55
-
56
- export const CopyBtn = (data: IDialogMsgInfo) => {
57
- return (
58
- <OperateBtn
59
- onClick={async () => {
60
- if (data.content) {
61
- await navigator.clipboard.writeText(data.content);
62
- CnMessage.success(
63
- $i18n.get({ id: 'TERM.CopySuccessful', dm: '复制成功' }),
64
- );
65
- }
66
- }}
67
- >
68
- <CustomIcon type="icon-fuzhi" />
69
- <span>{$i18n.get({ id: 'TERM.Copy', dm: '复制' })}</span>
70
- </OperateBtn>
71
- );
72
- };
73
-
74
- export const LikeBtn = (data: IDialogMsgInfo) => {
75
- const { handleUpdateDialogMsg } = useVDialogOperate();
76
- const handleLike = () => {
77
- handleUpdateDialogMsg({
78
- id: data.id,
79
- status: { 0: 2, 1: 2, 2: 1 }[data.status!],
80
- });
81
- };
82
-
83
- return (
84
- <OperateBtn onClick={handleLike}>
85
- <CustomIcon type={data.status === 2 ? 'icon-like-2' : 'icon-like-0'} />
86
- <span>{$i18n.get({ id: 'ThumbsUp', dm: '点赞' })}</span>
87
- </OperateBtn>
88
- );
89
- };
90
-
91
- export const FeedbackBtn = () => {
92
- const { handleSetDialogState } = useVDialogOperate();
93
- const handleFeedback = () => {
94
- handleSetDialogState((state) => ({
95
- ...state,
96
- input: '/问题反馈 ',
97
- }));
98
- };
99
-
100
- return (
101
- <OperateBtn onClick={handleFeedback}>
102
- <CustomIcon type="icon-fankui" />
103
- <span>{$i18n.get({ id: 'feedback', dm: '反馈' })}</span>
104
- </OperateBtn>
105
- );
106
- };
107
-
108
- export const BackMyVisionBtn = () => {
109
- const nav = useNavigate();
110
- const handleClick = async () => {
111
- nav('/');
112
- };
113
-
114
- return (
115
- <CnButton size="small" onClick={handleClick}>
116
- <span>{$i18n.get({ id: 'GoToMyVision', dm: '进入My Vision' })}</span>
117
- </CnButton>
118
- );
119
- };