win-chart 1.0.0

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/.eslintrc.json +3 -0
  2. package/.prettierrc.json +5 -0
  3. package/README.md +0 -0
  4. package/localhost-key.pem +28 -0
  5. package/localhost.pem +25 -0
  6. package/package.json +65 -0
  7. package/rsbuild.config.ts +48 -0
  8. package/src/api/README.md +15 -0
  9. package/src/api/index.js +5 -0
  10. package/src/api/layout/index.js +32 -0
  11. package/src/api/request.ts +87 -0
  12. package/src/api/url-map/index.js +10 -0
  13. package/src/api/user/index.js +12 -0
  14. package/src/components/FilterContext.tsx +6 -0
  15. package/src/components/GlobalStyle.tsx +25 -0
  16. package/src/components/HalfScreenBrowser.tsx +95 -0
  17. package/src/components/ImgBox.tsx +19 -0
  18. package/src/components/JumpBtn.tsx +38 -0
  19. package/src/components/MCardWrapper.tsx +33 -0
  20. package/src/components/NoContent/index.tsx +85 -0
  21. package/src/components/ResponsiveReactGridLayout.tsx +218 -0
  22. package/src/components/SliderDecoration.tsx +27 -0
  23. package/src/components/VisionUserConfigContext.ts +6 -0
  24. package/src/components/WinMenu/README.md +11 -0
  25. package/src/components/WinMenu/WinHeader.tsx +5 -0
  26. package/src/components/WinMenu/components/ExtraBox.tsx +61 -0
  27. package/src/components/WinMenu/components/FullMenuBox.tsx +80 -0
  28. package/src/components/WinMenu/components/FullMenuContainer.tsx +50 -0
  29. package/src/components/WinMenu/components/FullMenuItem.tsx +128 -0
  30. package/src/components/WinMenu/components/LangSwitch.tsx +84 -0
  31. package/src/components/WinMenu/components/LogoBox.tsx +29 -0
  32. package/src/components/WinMenu/components/PinDialog.tsx +72 -0
  33. package/src/components/WinMenu/components/PinnedMenuBox.tsx +183 -0
  34. package/src/components/WinMenu/components/UserBox.tsx +83 -0
  35. package/src/components/WinMenu/hooks/useUserInfo.ts +21 -0
  36. package/src/components/WinMenu/hooks/useUserMenu.ts +35 -0
  37. package/src/components/WinMenu/index.tsx +100 -0
  38. package/src/components/WinMenu/services/WinService.ts +79 -0
  39. package/src/components/WinMenu/services/request.ts +53 -0
  40. package/src/components/WinMenu/utils/const.ts +80 -0
  41. package/src/components/WinMenu/utils/enum.ts +19 -0
  42. package/src/components/WinMenu/utils/interface.ts +61 -0
  43. package/src/components/WinMenu/utils/map.ts +39 -0
  44. package/src/components/WinMenu/utils/tool.ts +142 -0
  45. package/src/components/WinMenu/utils/type.ts +1 -0
  46. package/src/components/hover-view.tsx +48 -0
  47. package/src/components/icon.tsx +44 -0
  48. package/src/components/indicator-remark.tsx +25 -0
  49. package/src/components/none-content.tsx +93 -0
  50. package/src/components/panel-tab.tsx +150 -0
  51. package/src/components/panel-title-tab.tsx +60 -0
  52. package/src/components/win-card/components/ChartContent.tsx +47 -0
  53. package/src/components/win-card/components/Indicator.tsx +42 -0
  54. package/src/components/win-card/components/IndicatorArea.tsx +63 -0
  55. package/src/components/win-card/components/IndicatorInfo.tsx +78 -0
  56. package/src/components/win-card/components/MatterContent.tsx +121 -0
  57. package/src/components/win-card/components/MatterList.tsx +141 -0
  58. package/src/components/win-card/components/NoticeContent.tsx +73 -0
  59. package/src/components/win-card/components/NoticeList.tsx +68 -0
  60. package/src/components/win-card/components/SelectDecoration.tsx +34 -0
  61. package/src/components/win-card/components/WinRankContent.tsx +102 -0
  62. package/src/components/win-card/index.tsx +298 -0
  63. package/src/components/win-card/utils/interface.ts +12 -0
  64. package/src/components/win-card/utils/tool.ts +11 -0
  65. package/src/components/win-card-mobile/components/ChartContent.tsx +47 -0
  66. package/src/components/win-card-mobile/components/DualLineBar.tsx +61 -0
  67. package/src/components/win-card-mobile/components/Indicator.tsx +42 -0
  68. package/src/components/win-card-mobile/components/IndicatorArea.tsx +65 -0
  69. package/src/components/win-card-mobile/components/IndicatorInfo.tsx +83 -0
  70. package/src/components/win-card-mobile/components/SelectDecoration.tsx +28 -0
  71. package/src/components/win-card-mobile/index.tsx +235 -0
  72. package/src/components/win-card-mobile/utils/interface.ts +12 -0
  73. package/src/components/win-card-mobile/utils/tool.ts +9 -0
  74. package/src/components/win-chart/components/chart-wrapper.tsx +5 -0
  75. package/src/components/win-chart/index.tsx +59 -0
  76. package/src/components/win-chart/theme/win-dark.json +372 -0
  77. package/src/components/win-chart/theme/win-light.json +372 -0
  78. package/src/components/win-chart/utils/const.ts +37 -0
  79. package/src/components/win-chart/utils/getAreaSpec.ts +150 -0
  80. package/src/components/win-chart/utils/getBarSpec.ts +60 -0
  81. package/src/components/win-chart/utils/getChartOptions.ts +59 -0
  82. package/src/components/win-chart/utils/getColumnSpec.ts +112 -0
  83. package/src/components/win-chart/utils/getDualSpec.ts +79 -0
  84. package/src/components/win-chart/utils/getFunnelSpec.ts +70 -0
  85. package/src/components/win-chart/utils/getLineSpec.ts +53 -0
  86. package/src/components/win-chart/utils/getPieSpec.ts +124 -0
  87. package/src/components/win-chart/utils/getRadarSpec.ts +87 -0
  88. package/src/components/win-chart/utils/tool.ts +163 -0
  89. package/src/components/win-chart/utils/type.ts +96 -0
  90. package/src/components/win-icon/index.tsx +97 -0
  91. package/src/components/win-v/components/EmptyBox.tsx +9 -0
  92. package/src/components/win-v/components/VDialog.tsx +173 -0
  93. package/src/components/win-v/components/VDialogBtn.tsx +119 -0
  94. package/src/components/win-v/components/VDialogMsg.tsx +325 -0
  95. package/src/components/win-v/components/VInput.tsx +15 -0
  96. package/src/components/win-v/components/VRemindMsgList.tsx +303 -0
  97. package/src/components/win-v/components/VRobot.tsx +97 -0
  98. package/src/components/win-v/hooks/useVDialogCore.ts +102 -0
  99. package/src/components/win-v/hooks/useVDialogOperate.ts +132 -0
  100. package/src/components/win-v/hooks/useVDialogState.ts +52 -0
  101. package/src/components/win-v/hooks/useVRemindMsgShow.ts +15 -0
  102. package/src/components/win-v/index.tsx +205 -0
  103. package/src/components/win-wrappers/card-wrapper.tsx +103 -0
  104. package/src/components/win-wrappers/dot-wrapper.tsx +18 -0
  105. package/src/components/win-wrappers/iframe-wrapper.tsx +7 -0
  106. package/src/components/win-wrappers/request-wrapper.tsx +190 -0
  107. package/src/global.d.ts +53 -0
  108. package/src/hooks/useCardOptionList.ts +23 -0
  109. package/src/hooks/useCostFiltersDicList.ts +22 -0
  110. package/src/hooks/useFbiUrl.ts +22 -0
  111. package/src/hooks/useHalfScreenState.ts +50 -0
  112. package/src/hooks/useHasIntersected.ts +36 -0
  113. package/src/hooks/useIndicatorCardInfo.ts +26 -0
  114. package/src/hooks/useIndicatorCardQueryList.ts +22 -0
  115. package/src/hooks/useIndicatorClassifyList.ts +25 -0
  116. package/src/hooks/useIndicatorDetailsDateList.ts +22 -0
  117. package/src/hooks/useIndicatorDetailsInfo.ts +49 -0
  118. package/src/hooks/useIndicatorDetailsTrend.ts +25 -0
  119. package/src/hooks/useIndicatorDicList.ts +22 -0
  120. package/src/hooks/useIndicatorLabelList.ts +20 -0
  121. package/src/hooks/useIndicatorList.ts +24 -0
  122. package/src/hooks/useIndicatorRangeList.ts +20 -0
  123. package/src/hooks/useIndicatorTypeList.ts +20 -0
  124. package/src/hooks/useIndicatorUnitList.ts +21 -0
  125. package/src/hooks/useListenQuery.ts +29 -0
  126. package/src/hooks/useMobile.ts +58 -0
  127. package/src/hooks/useNotice.ts +42 -0
  128. package/src/hooks/useOrgLevelList.ts +23 -0
  129. package/src/hooks/usePageSelection.ts +121 -0
  130. package/src/hooks/usePageState.ts +22 -0
  131. package/src/hooks/usePendingList.ts +27 -0
  132. package/src/hooks/usePortalPageInfo.ts +43 -0
  133. package/src/hooks/useRefreshByLocationChange.ts +16 -0
  134. package/src/hooks/useReportIndicatorList.ts +21 -0
  135. package/src/hooks/useReportInfo.ts +45 -0
  136. package/src/hooks/useReportPersonList.ts +21 -0
  137. package/src/hooks/useScriptLoader.ts +22 -0
  138. package/src/hooks/useUnreadMsgList.ts +26 -0
  139. package/src/hooks/useUserAvatar.ts +23 -0
  140. package/src/hooks/useVReportInfo.ts +50 -0
  141. package/src/hooks/useVisionUserConfig.ts +25 -0
  142. package/src/hooks/useWorkbenchOptions.ts +63 -0
  143. package/src/index.tsx +20 -0
  144. package/src/services/CardService.ts +91 -0
  145. package/src/services/CommonService.ts +23 -0
  146. package/src/services/CostService.ts +56 -0
  147. package/src/services/DialogService.ts +74 -0
  148. package/src/services/IndicatorService.ts +406 -0
  149. package/src/services/PageService.ts +204 -0
  150. package/src/services/ReportService.ts +335 -0
  151. package/src/services/WorkbenchService.ts +411 -0
  152. package/src/styles/README.md +12 -0
  153. package/src/styles/index.scss +9 -0
  154. package/src/styles/mixins/index.scss +25 -0
  155. package/src/styles/next-cover.scss +4 -0
  156. package/src/styles/normalize.scss +27 -0
  157. package/src/styles/utilities/index.scss +5 -0
  158. package/src/styles/vars/index.scss +17 -0
  159. package/src/types/enum-workbench.ts +29 -0
  160. package/src/types/enum.ts +156 -0
  161. package/src/types/index.ts +19 -0
  162. package/src/types/indicator.ts +299 -0
  163. package/src/types/interface.ts +303 -0
  164. package/src/types/portal.ts +211 -0
  165. package/src/types/report.ts +28 -0
  166. package/src/types/type.ts +11 -0
  167. package/src/types/user.ts +28 -0
  168. package/src/utils/README.md +4 -0
  169. package/src/utils/arms.ts +59 -0
  170. package/src/utils/arr.ts +123 -0
  171. package/src/utils/const-workbench.ts +9 -0
  172. package/src/utils/const.ts +18 -0
  173. package/src/utils/index.ts +18 -0
  174. package/src/utils/init.ts +5 -0
  175. package/src/utils/map-workbench.ts +66 -0
  176. package/src/utils/map.ts +377 -0
  177. package/src/utils/number.ts +101 -0
  178. package/src/utils/page.ts +81 -0
  179. package/src/utils/str.ts +26 -0
  180. package/src/utils/tools.ts +44 -0
  181. package/src/utils/tree.ts +145 -0
  182. package/src/utils/url.ts +40 -0
  183. package/src/utils/util.ts +99 -0
  184. package/src/utils/workbench.ts +25 -0
  185. package/tsconfig.json +33 -0
@@ -0,0 +1,335 @@
1
+ import { newRequest } from '@/api/request';
2
+ import {
3
+ getAliyuncsNewSrc,
4
+ replaceSrcValues,
5
+ } from '@/pages/brief-report/utils/tool';
6
+ import { handleResult } from '@/utils';
7
+ import {
8
+ IIndicatorInfo,
9
+ IListItem,
10
+ IOssSign,
11
+ IOssUploadData,
12
+ IReportContentInfo,
13
+ IReportTplInfo,
14
+ } from 'src/types';
15
+
16
+ export class ReportService {
17
+ /**
18
+ * 获取模版
19
+ * @returns
20
+ */
21
+ public static async getTemplateList() {
22
+ const resp = handleResult(
23
+ await newRequest<IReportTplInfo[]>({
24
+ url: '/weekly/report/template/list',
25
+ }),
26
+ );
27
+
28
+ return resp;
29
+ }
30
+
31
+ /**
32
+ * 删除模版
33
+ * @param templateId
34
+ * @returns
35
+ */
36
+ public static async deleteTemplateById(templateId: number) {
37
+ const resp = handleResult(
38
+ await newRequest<boolean>({
39
+ url: '/weekly/report/template/delete',
40
+ method: 'POST',
41
+ data: {
42
+ templateId,
43
+ },
44
+ }),
45
+ );
46
+
47
+ return resp;
48
+ }
49
+
50
+ /**
51
+ * 保存模版
52
+ * @param data
53
+ * @returns
54
+ */
55
+ public static async saveTemplate(data: Partial<IReportTplInfo>) {
56
+ const resp = handleResult(
57
+ await newRequest<boolean>({
58
+ url: '/weekly/report/template/save',
59
+ method: 'POST',
60
+ data,
61
+ }),
62
+ );
63
+
64
+ return resp;
65
+ }
66
+
67
+ /**
68
+ * 获取模版详情
69
+ * @param templateId
70
+ * @returns
71
+ */
72
+ public static async getTemplateDetails(templateId: string | number) {
73
+ const resp = handleResult(
74
+ await newRequest<IReportTplInfo>({
75
+ url: '/weekly/report/template/details',
76
+ method: 'POST',
77
+ data: {
78
+ templateId,
79
+ },
80
+ }),
81
+ );
82
+
83
+ return {
84
+ ...resp,
85
+ ...(resp.content && {
86
+ content: JSON.stringify(
87
+ await replaceSrcValues(JSON.parse(resp.content), getAliyuncsNewSrc),
88
+ ),
89
+ }),
90
+ };
91
+ }
92
+
93
+ /**
94
+ * 获取使用人
95
+ * @returns
96
+ */
97
+ public static async getPersonList() {
98
+ const resp = handleResult(
99
+ await newRequest<IListItem[]>({
100
+ url: '/weekly/report/person',
101
+ }),
102
+ );
103
+
104
+ return resp;
105
+ }
106
+
107
+ /**
108
+ * 获取指标列表
109
+ * @returns
110
+ */
111
+ public static async getIndicatorList() {
112
+ const resp = handleResult(
113
+ await newRequest<IListItem[]>({
114
+ url: '/weekly/report/indicator/list',
115
+ method: 'POST',
116
+ data: {},
117
+ }),
118
+ );
119
+
120
+ return resp;
121
+ }
122
+
123
+ /**
124
+ * 获取指标详情
125
+ * @param subId
126
+ * @returns
127
+ */
128
+ public static async getIndicatorInfo(subId: number | string) {
129
+ const resp = handleResult(
130
+ await newRequest<IIndicatorInfo>({
131
+ url: '/weekly/report/indicator/init',
132
+ method: 'POST',
133
+ data: {
134
+ subId,
135
+ },
136
+ }),
137
+ );
138
+
139
+ return resp;
140
+ }
141
+
142
+ /**
143
+ * 查询指标信息
144
+ * @param subId
145
+ * @returns
146
+ */
147
+ public static async queryIndicatorInfo(subId: number, type: string) {
148
+ const {
149
+ value,
150
+ expectValue,
151
+ ratio,
152
+ selectLabel,
153
+ uniqueCode,
154
+ indicatorType,
155
+ } = handleResult(
156
+ await newRequest<IIndicatorInfo>({
157
+ url: '/weekly/report/card/single',
158
+ method: 'POST',
159
+ data: {
160
+ subId,
161
+ type,
162
+ },
163
+ }),
164
+ );
165
+
166
+ return {
167
+ value,
168
+ expectValue,
169
+ ratio,
170
+ selectLabel,
171
+ indicatorType,
172
+ uniqueCode,
173
+ };
174
+ }
175
+
176
+ /**
177
+ * 获取内容
178
+ * @returns
179
+ */
180
+ public static async getContentList() {
181
+ const resp = handleResult(
182
+ await newRequest<IReportContentInfo[]>({
183
+ url: '/weekly/report/content/list',
184
+ method: 'POST',
185
+ data: {},
186
+ }),
187
+ );
188
+
189
+ return resp;
190
+ }
191
+
192
+ /**
193
+ * 保存内容
194
+ * @param data
195
+ * @returns
196
+ */
197
+ public static async saveContent(data: Partial<IReportContentInfo>) {
198
+ const resp = handleResult(
199
+ await newRequest<boolean>({
200
+ url: '/weekly/report/content/save',
201
+ method: 'POST',
202
+ data,
203
+ }),
204
+ );
205
+
206
+ return resp;
207
+ }
208
+
209
+ /**
210
+ * 获取内容详情
211
+ * @param templateId
212
+ * @returns
213
+ */
214
+ public static async getContentDetails(
215
+ templateId: string | number,
216
+ importType?: string,
217
+ ) {
218
+ const resp = handleResult(
219
+ await newRequest<IReportContentInfo>({
220
+ url: '/weekly/report/content/import',
221
+ method: 'POST',
222
+ data: {
223
+ templateId,
224
+ importType,
225
+ },
226
+ }),
227
+ );
228
+
229
+ return {
230
+ ...resp,
231
+ ...(resp.content && {
232
+ content: JSON.stringify(
233
+ await replaceSrcValues(JSON.parse(resp.content), getAliyuncsNewSrc),
234
+ ),
235
+ }),
236
+ };
237
+ }
238
+
239
+ /**
240
+ * 获取钉钉跳转链接
241
+ * @param content
242
+ * @returns
243
+ */
244
+ public static async getDingLink(content: string, contentType = 'asl') {
245
+ const resp = handleResult(
246
+ await newRequest<string>({
247
+ url: '/weekly/report/ding',
248
+ method: 'POST',
249
+ data: {
250
+ content,
251
+ contentType,
252
+ },
253
+ }),
254
+ );
255
+
256
+ return resp;
257
+ }
258
+
259
+ /**
260
+ * 根据 key 获取地址
261
+ * @param key
262
+ * @returns
263
+ */
264
+ public static async getUrlByKey(key: string) {
265
+ const resp = handleResult(
266
+ await newRequest<string>({
267
+ url: '/weekly/report/OssUrl',
268
+ params: {
269
+ key,
270
+ },
271
+ }),
272
+ );
273
+
274
+ return resp;
275
+ }
276
+
277
+ /**
278
+ * 获取图片上传签名
279
+ * @returns
280
+ */
281
+ public static async getOssSign() {
282
+ const resp = handleResult(
283
+ await newRequest<IOssSign>({
284
+ url: '/weekly/report/generateOssPolicy',
285
+ }),
286
+ );
287
+
288
+ return resp;
289
+ }
290
+
291
+ /**
292
+ * 获取图片上传
293
+ * @returns
294
+ */
295
+ public static async ossUpload({
296
+ key,
297
+ policy,
298
+ ossAccessKeyId,
299
+ signature,
300
+ host,
301
+ file,
302
+ securityToken,
303
+ }: IOssUploadData) {
304
+ const data = new FormData();
305
+ data.append('x-oss-security-token', securityToken);
306
+ data.append('signature', signature);
307
+ data.append('policy', policy);
308
+ data.append('OSSAccessKeyId', ossAccessKeyId);
309
+ data.append('key', key);
310
+ data.append('file', file);
311
+
312
+ await fetch(host, {
313
+ method: 'POST',
314
+ body: data,
315
+ });
316
+ }
317
+
318
+ /**
319
+ * AI 生成
320
+ * @returns
321
+ */
322
+ public static async getAiSearch(content: string) {
323
+ const resp = handleResult(
324
+ await newRequest<string>({
325
+ url: '/weekly/report/ai/search',
326
+ method: 'POST',
327
+ data: {
328
+ content,
329
+ },
330
+ }),
331
+ );
332
+
333
+ return resp;
334
+ }
335
+ }