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
package/src/utils/map.ts DELETED
@@ -1,377 +0,0 @@
1
- import { WinChartType } from 'src/components/win-chart';
2
- import {
3
- IListItem,
4
- MatterType,
5
- WinCardChartType,
6
- WinCardType,
7
- } from 'src/types';
8
-
9
- /**
10
- * 时间范围列表
11
- */
12
- export const timeRangeList = [
13
- { label: '天', value: 'DAY' },
14
- { label: '月', value: 'MONTH' },
15
- { label: '季度', value: 'QUARTER' },
16
- { label: '年', value: 'YEAR' },
17
- { label: '财季', value: 'FQUARTER' },
18
- { label: '财年', value: 'FYEAR' },
19
- { label: '周_列日', value: 'WEEK_LIEGE' },
20
- { label: '月底及最新', value: 'MONTH_LATEST' },
21
- { label: '季度底及最新', value: 'QUARTER_LATEST' },
22
- ];
23
-
24
- /**
25
- * 结构化属性
26
- */
27
- export const orgLevelList = [
28
- { label: '维度项', value: 'LEVEL_1' },
29
- { label: '业务线', value: 'LEVEL_2' },
30
- { label: '区域', value: 'LEVEL_3' },
31
- { label: '项目', value: 'LEVEL_4' },
32
- { label: '园区', value: 'LEVEL_5' },
33
- ];
34
-
35
- /**
36
- * 结构化属性
37
- */
38
- export const labelFieldList = [
39
- // { label: '地网级指标', value: 'LEVEL_1' },
40
- // { label: '业务线指标', value: 'LEVEL_2' },
41
- // { label: '区区域级指标', value: 'LEVEL_3' },
42
- // { label: '项目级指标', value: 'LEVEL_4' },
43
- // { label: '园区级指标', value: 'LEVEL_5' },
44
- { label: '指标项', value: 'label' },
45
- { label: '日期', value: 'date' },
46
- ];
47
-
48
- /**
49
- * 卡片状态列表
50
- */
51
- export const cardStatusList = [
52
- { label: '启用', value: 'ONLINE' },
53
- { label: '禁用', value: 'OFFLINE' },
54
- ];
55
-
56
- /**
57
- * 单位列表
58
- */
59
- export const unitList = [
60
- { label: '平米', value: 'smeter' },
61
- { label: '元', value: 'yuan' },
62
- { label: '%', value: 'percent' },
63
- { label: '个', value: 'number' },
64
- { label: '分', value: 'score' },
65
- { label: '万元', value: 'wan_yuan' },
66
- { label: '百万', value: 'million' },
67
- { label: '亿元', value: 'billion' },
68
- { label: '万方', value: 'wan_square' },
69
- ];
70
-
71
- /**
72
- * 卡片模版列表
73
- */
74
- export const chartTypeList = [
75
- {
76
- label: '',
77
- value: WinCardChartType.INDICATOR,
78
- },
79
- ];
80
-
81
- export const searchResTypeMap = new Map<
82
- string,
83
- { label: string; logo?: string }
84
- >()
85
- .set('ALL', {
86
- label: '全部',
87
- })
88
- .set('CARD', {
89
- label: '卡片',
90
- })
91
- .set('MENU', {
92
- label: '菜单',
93
- })
94
- .set('REPORT', {
95
- label: '报表',
96
- })
97
- .set('CONTRACT', {
98
- label: '招商合同',
99
- })
100
- .set('BUSINESS_APPLY', {
101
- label: '商务条件申请',
102
- })
103
- .set('SECURITY', {
104
- label: '安全隐患',
105
- })
106
- .set('RISK', {
107
- label: '风险',
108
- })
109
- .set('PARK_REFORM', {
110
- label: '园区改造',
111
- });
112
-
113
- export const matterTitleList = [
114
- { label: '待办清单', value: MatterType.PENDING },
115
- { label: '我发出的', value: MatterType.CREATE },
116
- { label: '已办事项', value: MatterType.COMPLETE },
117
- ];
118
-
119
- export const showTypeList = [
120
- { label: '菜鸟', value: 'CN' },
121
- { label: 'WLCC', value: 'wlcc' },
122
- ];
123
-
124
- export const rentTypeList = [
125
- { label: '综合', value: '综合' },
126
- { label: '仓', value: '仓' },
127
- { label: '配', value: '配' },
128
- ];
129
-
130
- /**
131
- * 卡片类型
132
- */
133
- export const indicatorChartTypeList = [
134
- {
135
- label: '单指标卡片',
136
- value: WinCardChartType.INDICATOR,
137
- },
138
- {
139
- label: '指标趋势卡片',
140
- value: WinCardChartType.INDICATOR_AREA,
141
- },
142
- {
143
- label: '面积图卡片',
144
- value: WinCardChartType.AREA_CHART,
145
- },
146
- {
147
- label: '折线图卡片',
148
- value: WinCardChartType.LINE_CHART,
149
- },
150
- {
151
- label: '双轴图卡片',
152
- value: WinCardChartType.DUAL_LINE_BAR_CHART,
153
- },
154
- {
155
- label: '柱状图卡片',
156
- value: WinCardChartType.COLUMN_CHART,
157
- },
158
- {
159
- label: '堆叠柱状图卡片',
160
- value: WinCardChartType.STACK_COLUMN_CHART,
161
- },
162
- {
163
- label: '条形图卡片',
164
- value: WinCardChartType.BAR_CHART,
165
- },
166
- {
167
- label: '漏斗图卡片',
168
- value: WinCardChartType.FUNNEL_CHART,
169
- },
170
- {
171
- label: '饼图卡片',
172
- value: WinCardChartType.PIE_CHART,
173
- },
174
- {
175
- label: '饼图卡片(指标项展示)',
176
- value: WinCardChartType.PIE_CHART_RESERVE,
177
- },
178
- {
179
- label: '环图卡片',
180
- value: WinCardChartType.CYCLE_CHART,
181
- },
182
- {
183
- label: '雷达图卡片',
184
- value: WinCardChartType.RADAR_CHART,
185
- },
186
- {
187
- label: '雷达图卡片(指标项展示)',
188
- value: WinCardChartType.RADAR_CHART_RESERVE,
189
- },
190
- ];
191
-
192
- /**
193
- * 卡片类别信息映射
194
- */
195
- export const winCardChartTypeMap = new Map<
196
- WinCardChartType,
197
- {
198
- templateUrl: string;
199
- type: WinCardType;
200
- sizeList: IListItem[];
201
- winChartType?: WinChartType;
202
- }
203
- >();
204
-
205
- winCardChartTypeMap.set(WinCardChartType.CUSTOM_CARD, {
206
- templateUrl:
207
- 'https://img.alicdn.com/imgextra/i3/O1CN011Bi11a1YzaZCM32a3_!!6000000003130-2-tps-1376-800.png',
208
- type: 'Custom',
209
- sizeList: [
210
- { label: '1行 × 1列', value: '1,1' },
211
- { label: '1行 × 2列', value: '1,2' },
212
- { label: '2行 × 1列', value: '2,1' },
213
- { label: '2行 × 2列', value: '2,2' },
214
- { label: '2行 × 4列', value: '2,4' },
215
- { label: '4行 × 4列', value: '4,4' },
216
- ],
217
- });
218
-
219
- winCardChartTypeMap.set(WinCardChartType.DUAL_LINE_BAR_CHART, {
220
- templateUrl:
221
- 'https://img.alicdn.com/imgextra/i1/O1CN01oW8CLa1lrsvlcyBHV_!!6000000004873-2-tps-680-560.png',
222
- type: 'Chart',
223
- sizeList: [
224
- { label: '2行 × 2列', value: '2,2' },
225
- { label: '2行 × 4列', value: '2,4' },
226
- { label: '2行 × 6列', value: '2,6' },
227
- ],
228
- });
229
-
230
- winCardChartTypeMap.set(WinCardChartType.INDICATOR, {
231
- templateUrl:
232
- 'https://img.alicdn.com/imgextra/i4/O1CN01FnE5KR1EV5typW3ya_!!6000000000356-2-tps-332-272.png',
233
- type: 'Indicator',
234
- sizeList: [{ label: '1行 × 1列', value: '1,1' }],
235
- });
236
-
237
- winCardChartTypeMap.set(WinCardChartType.INDICATOR_AREA, {
238
- templateUrl:
239
- 'https://img.alicdn.com/imgextra/i3/O1CN01IiUDn81hQctefyf11_!!6000000004272-2-tps-680-272.png',
240
- type: 'IndicatorChart',
241
- sizeList: [{ label: '1行 × 2列', value: '1,2' }],
242
- });
243
-
244
- winCardChartTypeMap.set(WinCardChartType.AREA_CHART, {
245
- templateUrl:
246
- 'https://img.alicdn.com/imgextra/i2/O1CN01I6IkaB1iE5fcXcIXU_!!6000000004380-2-tps-680-560.png',
247
- type: 'Chart',
248
- sizeList: [
249
- { label: '2行 × 2列', value: '2,2' },
250
- { label: '2行 × 4列', value: '2,4' },
251
- ],
252
- winChartType: WinChartType.AREA,
253
- });
254
-
255
- winCardChartTypeMap.set(WinCardChartType.LINE_CHART, {
256
- templateUrl:
257
- 'https://img.alicdn.com/imgextra/i2/O1CN0181hNue1nRRIIpXPUf_!!6000000005086-2-tps-1376-560.png',
258
- type: 'Chart',
259
- sizeList: [
260
- { label: '2行 × 2列', value: '2,2' },
261
- { label: '2行 × 4列', value: '2,4' },
262
- { label: '2行 × 6列', value: '2,6' },
263
- ],
264
- winChartType: WinChartType.LINE,
265
- });
266
-
267
- winCardChartTypeMap.set(WinCardChartType.COLUMN_CHART, {
268
- templateUrl:
269
- 'https://img.alicdn.com/imgextra/i4/O1CN01iIxIfy1jYWxlzTSGb_!!6000000004560-2-tps-680-560.png',
270
- type: 'Chart',
271
- sizeList: [
272
- { label: '2行 × 2列', value: '2,2' },
273
- { label: '2行 × 4列', value: '2,4' },
274
- { label: '2行 × 6列', value: '2,6' },
275
- ],
276
- });
277
-
278
- winCardChartTypeMap.set(WinCardChartType.STACK_COLUMN_CHART, {
279
- templateUrl:
280
- 'https://img.alicdn.com/imgextra/i3/O1CN01G9tHC81ImHE4RVLbC_!!6000000000935-2-tps-680-560.png',
281
- type: 'Chart',
282
- sizeList: [
283
- { label: '2行 × 2列', value: '2,2' },
284
- { label: '2行 × 4列', value: '2,4' },
285
- { label: '2行 × 6列', value: '2,6' },
286
- ],
287
- });
288
-
289
- winCardChartTypeMap.set(WinCardChartType.BAR_CHART, {
290
- templateUrl:
291
- 'https://img.alicdn.com/imgextra/i1/O1CN01fS4z2F1lBI66teufq_!!6000000004780-2-tps-680-560.png',
292
- type: 'Chart',
293
- sizeList: [
294
- { label: '2行 × 2列', value: '2,2' },
295
- { label: '2行 × 4列', value: '2,4' },
296
- ],
297
- });
298
-
299
- winCardChartTypeMap.set(WinCardChartType.PIE_CHART, {
300
- templateUrl:
301
- 'https://img.alicdn.com/imgextra/i4/O1CN01aG0pam21xPZ0KAldD_!!6000000007051-2-tps-680-560.png',
302
- type: 'Chart',
303
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
304
- });
305
-
306
- winCardChartTypeMap.set(WinCardChartType.PIE_CHART_RESERVE, {
307
- templateUrl:
308
- 'https://img.alicdn.com/imgextra/i4/O1CN01aG0pam21xPZ0KAldD_!!6000000007051-2-tps-680-560.png',
309
- type: 'Chart',
310
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
311
- });
312
-
313
- winCardChartTypeMap.set(WinCardChartType.CYCLE_CHART, {
314
- templateUrl:
315
- 'https://img.alicdn.com/imgextra/i2/O1CN01ZkptA11f6M8UT8XGw_!!6000000003957-2-tps-680-560.png',
316
- type: 'Chart',
317
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
318
- });
319
-
320
- winCardChartTypeMap.set(WinCardChartType.FUNNEL_CHART, {
321
- templateUrl:
322
- 'https://img.alicdn.com/imgextra/i1/O1CN01Cmqcqi1HWsHscvuPN_!!6000000000766-2-tps-680-560.png',
323
- type: 'Chart',
324
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
325
- });
326
-
327
- winCardChartTypeMap.set(WinCardChartType.RADAR_CHART, {
328
- templateUrl:
329
- 'https://img.alicdn.com/imgextra/i2/O1CN01Pk7XU01hztOlrBMQe_!!6000000004349-2-tps-680-560.png',
330
- type: 'Chart',
331
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
332
- });
333
-
334
- winCardChartTypeMap.set(WinCardChartType.RADAR_CHART_RESERVE, {
335
- templateUrl:
336
- 'https://img.alicdn.com/imgextra/i2/O1CN01Pk7XU01hztOlrBMQe_!!6000000004349-2-tps-680-560.png',
337
- type: 'Chart',
338
- sizeList: [{ label: '2行 × 2列', value: '2,2' }],
339
- });
340
-
341
- export const sortList = [
342
- { label: '升序', value: 'asc' },
343
- { label: '降序', value: 'desc' },
344
- ];
345
-
346
- export const msgBizTypeMap = new Map<
347
- string,
348
- { iconType: string; color: string }
349
- >()
350
- .set('INDICATOR_CENTER', {
351
- iconType: 'icon-zhibiaozhongxin1',
352
- color: '#347FFF',
353
- })
354
- .set('NEWS_NOTICE', {
355
- iconType: 'icon-xinxiansudi1',
356
- color: '#00C267',
357
- })
358
- .set('EARTH_SCREEN', {
359
- iconType: 'icon-xinxiansudi1',
360
- color: '#00C267',
361
- })
362
- .set('GOOD_HABITS', {
363
- iconType: 'icon-v-function',
364
- color: '#347FFF',
365
- })
366
- .set('OPERATE_SCORE', {
367
- iconType: 'icon-jingyingpaihang',
368
- color: '#FFA101',
369
- })
370
- .set('QUARTERLY_SCORE', {
371
- iconType: 'icon-jidupingfen',
372
- color: '#FFA101',
373
- })
374
- .set('RISK', {
375
- iconType: 'icon-fengxiandapan1',
376
- color: '#F15451',
377
- });
@@ -1,101 +0,0 @@
1
- import { format } from 'd3';
2
-
3
- /**
4
- * 数值转换(除,默认除 10000)
5
- * @param number
6
- * @param num
7
- * @returns
8
- */
9
- export const divide = (number: number, num = 10000) =>
10
- Number((number / num).toFixed(2));
11
-
12
- /**
13
- * 根据单位转换数值
14
- * @param value
15
- * @param unit
16
- * @param withUnit
17
- * @returns
18
- */
19
- export const convertValueWithUnit = (value?: number | null, unit?: string) => {
20
- if (value === undefined || value === null) {
21
- return '-';
22
- }
23
-
24
- if (unit && ['万元', '万'].includes(unit)) {
25
- return divide(value, 10000);
26
- }
27
-
28
- if (unit === '%') {
29
- return divide(value, 0.01);
30
- }
31
-
32
- return value;
33
- };
34
-
35
- interface IChartMeta {
36
- [p: string]: {
37
- unit?: string;
38
- alias?: string;
39
- formatter?(value: number): string;
40
- };
41
- }
42
-
43
- export const handleMeta = (meta: IChartMeta) => {
44
- // eslint-disable-next-line no-restricted-syntax, guard-for-in
45
- for (const key in meta) {
46
- if (meta[key].unit === '%') {
47
- // meta[key] = {
48
- // ...meta,
49
- // formatter: (value: number) => `${convertValueWithUnit(value, '%')}%`,
50
- // };
51
- meta[key].formatter = (value: number) =>
52
- `${convertValueWithUnit(value, '%')}%`;
53
- }
54
-
55
- if (meta[key].unit && ['万元', '万'].includes(meta[key].unit!)) {
56
- // meta[key] = {
57
- // ...meta,
58
- // formatter: (value: number) => `${convertValueWithUnit(value, '万元')}万元`,
59
- // };
60
- meta[key].formatter = (value: number) =>
61
- `${convertValueWithUnit(value, '万元')}${meta[key].unit}`;
62
- }
63
- }
64
-
65
- return meta;
66
- };
67
-
68
- /**
69
- * 数据转百分比
70
- * @param value
71
- * @param num
72
- */
73
- export const handleToPercent = (value: unknown, num = 2) =>
74
- typeof value === 'number' ? `${Number((value * 100).toFixed(num))}%` : '-%';
75
-
76
- /**
77
- * 打点分割,保留两位小数
78
- * @param data
79
- * @param num 保留小数位数
80
- * @returns
81
- */
82
- export const handleNumberShowStr = (data: any, num = 2) => {
83
- if (!data) {
84
- return data;
85
- }
86
-
87
- const fix = format(`,.${num}f`);
88
- return fix(Number(data));
89
- };
90
-
91
- /**
92
- * 转换成数字,保留两位小数
93
- * @param data
94
- * @param num 保留小数数位
95
- * @returns
96
- */
97
- export const handleNumber = (data: any, num = 2) => {
98
- const fix = format(`.${num}f`);
99
-
100
- return Number(fix(Number(data)));
101
- };
package/src/utils/page.ts DELETED
@@ -1,81 +0,0 @@
1
- import { RESPONSIVE_BREAKPOINT } from './const';
2
- import { getSearchParams } from './url';
3
-
4
- /**
5
- * 像素转 vw
6
- * @param px
7
- * @returns
8
- */
9
- export const vw = (px = 0) => {
10
- return `${(px / 1440) * 100}vw`;
11
- };
12
-
13
- /**
14
- * 像素转 vh
15
- * @param px
16
- * @returns
17
- */
18
- export const vh = (px = 0) => {
19
- return `${(px / 900) * 100}vh`;
20
- };
21
-
22
- /**
23
- * 移动设备(根据页面宽度判定 main)
24
- * @returns
25
- */
26
- export function isMobileDevice() {
27
- const match = window.matchMedia(`(max-width: ${RESPONSIVE_BREAKPOINT})`);
28
- return match.matches;
29
- }
30
-
31
- /**
32
- * 移动设备(根据设备判定)
33
- * @returns
34
- */
35
- export function isMobileDeviceByDevice() {
36
- const match = window.matchMedia('(pointer:coarse)');
37
- if (match && match.matches) {
38
- return true;
39
- }
40
- return false;
41
- }
42
-
43
- /**
44
- * 错误页面
45
- * @returns
46
- */
47
- export const isErrorPage = () => {
48
- return window.location.href.includes('/loginContextError');
49
- };
50
-
51
- /**
52
- * 移动页面
53
- * @returns
54
- */
55
- export function isMobilePage() {
56
- if (window.location.href.includes('/h5')) {
57
- return true;
58
- }
59
-
60
- return isMobileDevice();
61
- }
62
-
63
- /**
64
- * 中转,空页面
65
- * @returns
66
- */
67
- const isEmptyPage = () => {
68
- return window.location.href.includes('/empty');
69
- };
70
-
71
- export const isHideNav = () => {
72
- if (isMobilePage() || isErrorPage() || isEmptyPage()) {
73
- return true;
74
- }
75
-
76
- if (getSearchParams()?.hideNav) {
77
- return true;
78
- }
79
-
80
- return false;
81
- };
package/src/utils/str.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * 获取一个随机字符串
3
- * @param num
4
- * @returns
5
- */
6
- export const getRadomStr = (num = 4) =>
7
- Math.random()
8
- .toString(36)
9
- .slice(2, 2 + num);
10
-
11
- /**
12
- * 判断是否是JSON字符串
13
- * @param str
14
- * @returns
15
- */
16
- export function isJsonString(str?: string): boolean {
17
- if (!str) return false;
18
-
19
- try {
20
- JSON.parse(str);
21
- } catch (e) {
22
- return false;
23
- }
24
-
25
- return true;
26
- }
@@ -1,44 +0,0 @@
1
- import dayjs from 'dayjs';
2
-
3
- export const env = globalThis.location.hostname.includes('test')
4
- ? 'test'
5
- : globalThis.location.hostname.includes('pre')
6
- ? 'pre'
7
- : 'pro';
8
-
9
- export const apiBaseUrl = () => {
10
- return {
11
- test: 'https://cn-x-gateway.cainiao.test/vision/dwork-data',
12
- pre: 'https://pre-cn-x-gateway.cainiao.com/vision/dwork-data',
13
- pro: 'https://cn-x-gateway.cainiao.com/vision/dwork-data',
14
- }[env];
15
- };
16
-
17
- export const bossBucOrigin = (() => {
18
- return {
19
- test: 'https://dwork-cnstr-staff.cainiao.test',
20
- pre: 'https://pre-boss.cainiao-inc.com',
21
- pro: 'https://boss.cainiao-inc.com',
22
- }[env];
23
- })();
24
-
25
- export const bossCaiNiaoOrigin = (() => {
26
- return {
27
- test: 'https://dwork-cnstr-cp.cainiao.test',
28
- pre: 'https://pre-cnstr.cainiao.com',
29
- pro: 'https://boss.cainiao.com',
30
- }[env];
31
- })();
32
-
33
- export const getBossOrigin = (isInside?: boolean) =>
34
- isInside ? bossBucOrigin : bossCaiNiaoOrigin;
35
-
36
- export const visionMocklayURL = apiBaseUrl();
37
-
38
- export const getInDays = (time?: number) => {
39
- if (!time) {
40
- return '1001';
41
- }
42
-
43
- return dayjs().diff(time, 'day') + 1;
44
- };