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.
- package/.eslintrc.json +3 -0
- package/.prettierrc.json +5 -0
- package/README.md +0 -0
- package/localhost-key.pem +28 -0
- package/localhost.pem +25 -0
- package/package.json +65 -0
- package/rsbuild.config.ts +48 -0
- package/src/api/README.md +15 -0
- package/src/api/index.js +5 -0
- package/src/api/layout/index.js +32 -0
- package/src/api/request.ts +87 -0
- package/src/api/url-map/index.js +10 -0
- package/src/api/user/index.js +12 -0
- package/src/components/FilterContext.tsx +6 -0
- package/src/components/GlobalStyle.tsx +25 -0
- package/src/components/HalfScreenBrowser.tsx +95 -0
- package/src/components/ImgBox.tsx +19 -0
- package/src/components/JumpBtn.tsx +38 -0
- package/src/components/MCardWrapper.tsx +33 -0
- package/src/components/NoContent/index.tsx +85 -0
- package/src/components/ResponsiveReactGridLayout.tsx +218 -0
- package/src/components/SliderDecoration.tsx +27 -0
- package/src/components/VisionUserConfigContext.ts +6 -0
- package/src/components/WinMenu/README.md +11 -0
- package/src/components/WinMenu/WinHeader.tsx +5 -0
- package/src/components/WinMenu/components/ExtraBox.tsx +61 -0
- package/src/components/WinMenu/components/FullMenuBox.tsx +80 -0
- package/src/components/WinMenu/components/FullMenuContainer.tsx +50 -0
- package/src/components/WinMenu/components/FullMenuItem.tsx +128 -0
- package/src/components/WinMenu/components/LangSwitch.tsx +84 -0
- package/src/components/WinMenu/components/LogoBox.tsx +29 -0
- package/src/components/WinMenu/components/PinDialog.tsx +72 -0
- package/src/components/WinMenu/components/PinnedMenuBox.tsx +183 -0
- package/src/components/WinMenu/components/UserBox.tsx +83 -0
- package/src/components/WinMenu/hooks/useUserInfo.ts +21 -0
- package/src/components/WinMenu/hooks/useUserMenu.ts +35 -0
- package/src/components/WinMenu/index.tsx +100 -0
- package/src/components/WinMenu/services/WinService.ts +79 -0
- package/src/components/WinMenu/services/request.ts +53 -0
- package/src/components/WinMenu/utils/const.ts +80 -0
- package/src/components/WinMenu/utils/enum.ts +19 -0
- package/src/components/WinMenu/utils/interface.ts +61 -0
- package/src/components/WinMenu/utils/map.ts +39 -0
- package/src/components/WinMenu/utils/tool.ts +142 -0
- package/src/components/WinMenu/utils/type.ts +1 -0
- package/src/components/hover-view.tsx +48 -0
- package/src/components/icon.tsx +44 -0
- package/src/components/indicator-remark.tsx +25 -0
- package/src/components/none-content.tsx +93 -0
- package/src/components/panel-tab.tsx +150 -0
- package/src/components/panel-title-tab.tsx +60 -0
- package/src/components/win-card/components/ChartContent.tsx +47 -0
- package/src/components/win-card/components/Indicator.tsx +42 -0
- package/src/components/win-card/components/IndicatorArea.tsx +63 -0
- package/src/components/win-card/components/IndicatorInfo.tsx +78 -0
- package/src/components/win-card/components/MatterContent.tsx +121 -0
- package/src/components/win-card/components/MatterList.tsx +141 -0
- package/src/components/win-card/components/NoticeContent.tsx +73 -0
- package/src/components/win-card/components/NoticeList.tsx +68 -0
- package/src/components/win-card/components/SelectDecoration.tsx +34 -0
- package/src/components/win-card/components/WinRankContent.tsx +102 -0
- package/src/components/win-card/index.tsx +298 -0
- package/src/components/win-card/utils/interface.ts +12 -0
- package/src/components/win-card/utils/tool.ts +11 -0
- package/src/components/win-card-mobile/components/ChartContent.tsx +47 -0
- package/src/components/win-card-mobile/components/DualLineBar.tsx +61 -0
- package/src/components/win-card-mobile/components/Indicator.tsx +42 -0
- package/src/components/win-card-mobile/components/IndicatorArea.tsx +65 -0
- package/src/components/win-card-mobile/components/IndicatorInfo.tsx +83 -0
- package/src/components/win-card-mobile/components/SelectDecoration.tsx +28 -0
- package/src/components/win-card-mobile/index.tsx +235 -0
- package/src/components/win-card-mobile/utils/interface.ts +12 -0
- package/src/components/win-card-mobile/utils/tool.ts +9 -0
- package/src/components/win-chart/components/chart-wrapper.tsx +5 -0
- package/src/components/win-chart/index.tsx +59 -0
- package/src/components/win-chart/theme/win-dark.json +372 -0
- package/src/components/win-chart/theme/win-light.json +372 -0
- package/src/components/win-chart/utils/const.ts +37 -0
- package/src/components/win-chart/utils/getAreaSpec.ts +150 -0
- package/src/components/win-chart/utils/getBarSpec.ts +60 -0
- package/src/components/win-chart/utils/getChartOptions.ts +59 -0
- package/src/components/win-chart/utils/getColumnSpec.ts +112 -0
- package/src/components/win-chart/utils/getDualSpec.ts +79 -0
- package/src/components/win-chart/utils/getFunnelSpec.ts +70 -0
- package/src/components/win-chart/utils/getLineSpec.ts +53 -0
- package/src/components/win-chart/utils/getPieSpec.ts +124 -0
- package/src/components/win-chart/utils/getRadarSpec.ts +87 -0
- package/src/components/win-chart/utils/tool.ts +163 -0
- package/src/components/win-chart/utils/type.ts +96 -0
- package/src/components/win-icon/index.tsx +97 -0
- package/src/components/win-v/components/EmptyBox.tsx +9 -0
- package/src/components/win-v/components/VDialog.tsx +173 -0
- package/src/components/win-v/components/VDialogBtn.tsx +119 -0
- package/src/components/win-v/components/VDialogMsg.tsx +325 -0
- package/src/components/win-v/components/VInput.tsx +15 -0
- package/src/components/win-v/components/VRemindMsgList.tsx +303 -0
- package/src/components/win-v/components/VRobot.tsx +97 -0
- package/src/components/win-v/hooks/useVDialogCore.ts +102 -0
- package/src/components/win-v/hooks/useVDialogOperate.ts +132 -0
- package/src/components/win-v/hooks/useVDialogState.ts +52 -0
- package/src/components/win-v/hooks/useVRemindMsgShow.ts +15 -0
- package/src/components/win-v/index.tsx +205 -0
- package/src/components/win-wrappers/card-wrapper.tsx +103 -0
- package/src/components/win-wrappers/dot-wrapper.tsx +18 -0
- package/src/components/win-wrappers/iframe-wrapper.tsx +7 -0
- package/src/components/win-wrappers/request-wrapper.tsx +190 -0
- package/src/global.d.ts +53 -0
- package/src/hooks/useCardOptionList.ts +23 -0
- package/src/hooks/useCostFiltersDicList.ts +22 -0
- package/src/hooks/useFbiUrl.ts +22 -0
- package/src/hooks/useHalfScreenState.ts +50 -0
- package/src/hooks/useHasIntersected.ts +36 -0
- package/src/hooks/useIndicatorCardInfo.ts +26 -0
- package/src/hooks/useIndicatorCardQueryList.ts +22 -0
- package/src/hooks/useIndicatorClassifyList.ts +25 -0
- package/src/hooks/useIndicatorDetailsDateList.ts +22 -0
- package/src/hooks/useIndicatorDetailsInfo.ts +49 -0
- package/src/hooks/useIndicatorDetailsTrend.ts +25 -0
- package/src/hooks/useIndicatorDicList.ts +22 -0
- package/src/hooks/useIndicatorLabelList.ts +20 -0
- package/src/hooks/useIndicatorList.ts +24 -0
- package/src/hooks/useIndicatorRangeList.ts +20 -0
- package/src/hooks/useIndicatorTypeList.ts +20 -0
- package/src/hooks/useIndicatorUnitList.ts +21 -0
- package/src/hooks/useListenQuery.ts +29 -0
- package/src/hooks/useMobile.ts +58 -0
- package/src/hooks/useNotice.ts +42 -0
- package/src/hooks/useOrgLevelList.ts +23 -0
- package/src/hooks/usePageSelection.ts +121 -0
- package/src/hooks/usePageState.ts +22 -0
- package/src/hooks/usePendingList.ts +27 -0
- package/src/hooks/usePortalPageInfo.ts +43 -0
- package/src/hooks/useRefreshByLocationChange.ts +16 -0
- package/src/hooks/useReportIndicatorList.ts +21 -0
- package/src/hooks/useReportInfo.ts +45 -0
- package/src/hooks/useReportPersonList.ts +21 -0
- package/src/hooks/useScriptLoader.ts +22 -0
- package/src/hooks/useUnreadMsgList.ts +26 -0
- package/src/hooks/useUserAvatar.ts +23 -0
- package/src/hooks/useVReportInfo.ts +50 -0
- package/src/hooks/useVisionUserConfig.ts +25 -0
- package/src/hooks/useWorkbenchOptions.ts +63 -0
- package/src/index.tsx +20 -0
- package/src/services/CardService.ts +91 -0
- package/src/services/CommonService.ts +23 -0
- package/src/services/CostService.ts +56 -0
- package/src/services/DialogService.ts +74 -0
- package/src/services/IndicatorService.ts +406 -0
- package/src/services/PageService.ts +204 -0
- package/src/services/ReportService.ts +335 -0
- package/src/services/WorkbenchService.ts +411 -0
- package/src/styles/README.md +12 -0
- package/src/styles/index.scss +9 -0
- package/src/styles/mixins/index.scss +25 -0
- package/src/styles/next-cover.scss +4 -0
- package/src/styles/normalize.scss +27 -0
- package/src/styles/utilities/index.scss +5 -0
- package/src/styles/vars/index.scss +17 -0
- package/src/types/enum-workbench.ts +29 -0
- package/src/types/enum.ts +156 -0
- package/src/types/index.ts +19 -0
- package/src/types/indicator.ts +299 -0
- package/src/types/interface.ts +303 -0
- package/src/types/portal.ts +211 -0
- package/src/types/report.ts +28 -0
- package/src/types/type.ts +11 -0
- package/src/types/user.ts +28 -0
- package/src/utils/README.md +4 -0
- package/src/utils/arms.ts +59 -0
- package/src/utils/arr.ts +123 -0
- package/src/utils/const-workbench.ts +9 -0
- package/src/utils/const.ts +18 -0
- package/src/utils/index.ts +18 -0
- package/src/utils/init.ts +5 -0
- package/src/utils/map-workbench.ts +66 -0
- package/src/utils/map.ts +377 -0
- package/src/utils/number.ts +101 -0
- package/src/utils/page.ts +81 -0
- package/src/utils/str.ts +26 -0
- package/src/utils/tools.ts +44 -0
- package/src/utils/tree.ts +145 -0
- package/src/utils/url.ts +40 -0
- package/src/utils/util.ts +99 -0
- package/src/utils/workbench.ts +25 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { newRequest } from '@/api/request';
|
|
2
|
+
import { handleResult } from '@/utils';
|
|
3
|
+
import {
|
|
4
|
+
IIndicatorCardConfig,
|
|
5
|
+
IIndicatorDataInfo,
|
|
6
|
+
IIndicatorInfo,
|
|
7
|
+
IIndicatorInfoQuery,
|
|
8
|
+
IIndicatorTableDataQuery,
|
|
9
|
+
} from 'src/types';
|
|
10
|
+
import {
|
|
11
|
+
IListItem,
|
|
12
|
+
IKeyValueItem,
|
|
13
|
+
IChartListItem,
|
|
14
|
+
ICnTableData,
|
|
15
|
+
} from 'src/types/interface';
|
|
16
|
+
import { handleAddQuery } from 'src/utils';
|
|
17
|
+
|
|
18
|
+
export class IndicatorService {
|
|
19
|
+
/**
|
|
20
|
+
* 指标服务通用接口
|
|
21
|
+
* @param request
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
public static async getConfigInfo(request?: { url: string }) {
|
|
25
|
+
const resp = handleResult(
|
|
26
|
+
await newRequest<IIndicatorCardConfig>({
|
|
27
|
+
url: request?.url,
|
|
28
|
+
method: 'GET',
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return resp;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 指标服务通用接口 List
|
|
37
|
+
* @param request
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
public static async getDataInfoList(request?: { url: string }) {
|
|
41
|
+
const resp = handleResult(
|
|
42
|
+
await newRequest<IIndicatorDataInfo>({
|
|
43
|
+
url: request?.url,
|
|
44
|
+
method: 'GET',
|
|
45
|
+
withCredentials: true,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return resp;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 指标服务通用接口
|
|
54
|
+
* @param request
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
public static async getDataInfo(request: { url: string }) {
|
|
58
|
+
const resp = handleResult(
|
|
59
|
+
await newRequest<IIndicatorDataInfo>({
|
|
60
|
+
url: request.url,
|
|
61
|
+
method: 'GET',
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return resp;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 获取指标单位列表
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
public static async getUnitList() {
|
|
73
|
+
const resp = handleResult(
|
|
74
|
+
await newRequest<IListItem[]>({
|
|
75
|
+
url: '/config/card/unit',
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return resp;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 获取指标范围列表
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
public static async getRangeList() {
|
|
87
|
+
const resp = handleResult(
|
|
88
|
+
await newRequest<IListItem[]>({
|
|
89
|
+
url: '/show/head/range',
|
|
90
|
+
method: 'GET',
|
|
91
|
+
}),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
return resp;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 获取指标分类列表
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
public static async getClassifyList() {
|
|
102
|
+
const resp = handleResult(
|
|
103
|
+
await newRequest<IListItem[]>({
|
|
104
|
+
url: '/show/head/classify',
|
|
105
|
+
method: 'GET',
|
|
106
|
+
}),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
return resp;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 获取指标类别列表
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
public static async getTypeList() {
|
|
117
|
+
const resp = handleResult(
|
|
118
|
+
await newRequest<IListItem[]>({
|
|
119
|
+
url: '/show/head/type',
|
|
120
|
+
method: 'GET',
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return resp;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 获取指标标签列表
|
|
129
|
+
* @returns
|
|
130
|
+
*/
|
|
131
|
+
public static async getLabelList() {
|
|
132
|
+
const resp = handleResult(
|
|
133
|
+
await newRequest<IListItem[]>({
|
|
134
|
+
url: '/show/head/label',
|
|
135
|
+
method: 'GET',
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
return resp;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 获取指标标签列表
|
|
144
|
+
* @returns
|
|
145
|
+
*/
|
|
146
|
+
public static async getDicList(name: string) {
|
|
147
|
+
const resp = handleResult(
|
|
148
|
+
await newRequest<IListItem[]>({
|
|
149
|
+
url: `/show/head/dic?name=${name}`,
|
|
150
|
+
method: 'GET',
|
|
151
|
+
}),
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
return resp;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* 查询指标中心列表
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
public static async getCardList(data?: IKeyValueItem) {
|
|
162
|
+
const resp = handleResult(
|
|
163
|
+
await newRequest<IIndicatorInfo[]>({
|
|
164
|
+
url: '/show/card/show',
|
|
165
|
+
method: 'POST',
|
|
166
|
+
data,
|
|
167
|
+
}),
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
return resp;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 查询指标卡片数量
|
|
175
|
+
* @param data
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
public static async getCountList(data: IKeyValueItem) {
|
|
179
|
+
const resp = handleResult(
|
|
180
|
+
await newRequest<IChartListItem[]>({
|
|
181
|
+
url: '/show/card/number',
|
|
182
|
+
method: 'POST',
|
|
183
|
+
data,
|
|
184
|
+
}),
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return resp;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* 更新订阅状态
|
|
192
|
+
* @param subId
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
public static async updateFollow(subId: number) {
|
|
196
|
+
const resp = handleResult(
|
|
197
|
+
await newRequest<boolean>({
|
|
198
|
+
url: '/show/update/follow',
|
|
199
|
+
method: 'POST',
|
|
200
|
+
data: {
|
|
201
|
+
subId,
|
|
202
|
+
},
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
return resp;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* 获取单个卡片查询列表
|
|
211
|
+
* @param subId
|
|
212
|
+
* @returns
|
|
213
|
+
*/
|
|
214
|
+
public static async getCardQueryList(subId: number | string) {
|
|
215
|
+
const resp = handleResult(
|
|
216
|
+
await newRequest<IListItem[]>({
|
|
217
|
+
url: '/show/card/query',
|
|
218
|
+
method: 'POST',
|
|
219
|
+
data: {
|
|
220
|
+
subId,
|
|
221
|
+
},
|
|
222
|
+
}),
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
return resp;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 查询指标信息
|
|
230
|
+
* @param subId
|
|
231
|
+
* @returns
|
|
232
|
+
*/
|
|
233
|
+
public static async queryCard(subId: number | string, type: string) {
|
|
234
|
+
const { value, expectValue, ratio, selectLabel } = handleResult(
|
|
235
|
+
await newRequest<IIndicatorInfo>({
|
|
236
|
+
url: '/show/card/single',
|
|
237
|
+
method: 'POST',
|
|
238
|
+
data: {
|
|
239
|
+
subId,
|
|
240
|
+
type,
|
|
241
|
+
},
|
|
242
|
+
}),
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
value,
|
|
247
|
+
expectValue,
|
|
248
|
+
ratio,
|
|
249
|
+
selectLabel,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* 指标中心列表逐级查询
|
|
255
|
+
* @param data
|
|
256
|
+
* @returns
|
|
257
|
+
*/
|
|
258
|
+
public static async getTableDataList(data?: IIndicatorTableDataQuery) {
|
|
259
|
+
const resp = handleResult(
|
|
260
|
+
await newRequest<IIndicatorInfo[]>({
|
|
261
|
+
url: '/show/list/show',
|
|
262
|
+
method: 'POST',
|
|
263
|
+
data,
|
|
264
|
+
}),
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
return resp;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* 查询指标详情
|
|
272
|
+
* @param subId
|
|
273
|
+
* @returns
|
|
274
|
+
*/
|
|
275
|
+
public static async getDetails({
|
|
276
|
+
subId,
|
|
277
|
+
indicatorDate,
|
|
278
|
+
}: IIndicatorInfoQuery) {
|
|
279
|
+
const resp = handleResult(
|
|
280
|
+
await newRequest<IIndicatorInfo>({
|
|
281
|
+
url: '/show/details',
|
|
282
|
+
method: 'POST',
|
|
283
|
+
data: {
|
|
284
|
+
subId,
|
|
285
|
+
indicatorDate,
|
|
286
|
+
},
|
|
287
|
+
}),
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
return resp;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 查询下钻指标详情
|
|
295
|
+
* @param subId
|
|
296
|
+
* @returns
|
|
297
|
+
*/
|
|
298
|
+
public static async getDownDetails({
|
|
299
|
+
originId,
|
|
300
|
+
subId,
|
|
301
|
+
name,
|
|
302
|
+
type,
|
|
303
|
+
indicatorDate,
|
|
304
|
+
}: IIndicatorInfoQuery) {
|
|
305
|
+
const resp = handleResult(
|
|
306
|
+
await newRequest<IIndicatorInfo>({
|
|
307
|
+
url: '/show/details/down',
|
|
308
|
+
method: 'POST',
|
|
309
|
+
data: {
|
|
310
|
+
originId,
|
|
311
|
+
subId,
|
|
312
|
+
name,
|
|
313
|
+
type,
|
|
314
|
+
indicatorDate,
|
|
315
|
+
},
|
|
316
|
+
}),
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
return resp;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* 查询指标详情时间下拉数据源
|
|
324
|
+
* @param subId
|
|
325
|
+
* @returns
|
|
326
|
+
*/
|
|
327
|
+
public static async getDateList(subId: number | string) {
|
|
328
|
+
const resp = handleResult(
|
|
329
|
+
await newRequest<IListItem[]>({
|
|
330
|
+
url: '/show/details/date',
|
|
331
|
+
method: 'POST',
|
|
332
|
+
data: {
|
|
333
|
+
subId,
|
|
334
|
+
},
|
|
335
|
+
}),
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
return resp;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* 查询指标详情趋势图
|
|
343
|
+
* @param subId
|
|
344
|
+
* @returns
|
|
345
|
+
*/
|
|
346
|
+
public static async getDetailsTrend(subId: number | string, name: string) {
|
|
347
|
+
const resp = handleResult(
|
|
348
|
+
await newRequest<IListItem<number>[]>({
|
|
349
|
+
url: '/show/details/trend',
|
|
350
|
+
method: 'POST',
|
|
351
|
+
data: {
|
|
352
|
+
subId,
|
|
353
|
+
name,
|
|
354
|
+
},
|
|
355
|
+
}),
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
return resp;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* 查询指标实例列表
|
|
363
|
+
* @param timeSpan
|
|
364
|
+
* @param orgLevel
|
|
365
|
+
* @returns
|
|
366
|
+
*/
|
|
367
|
+
public static async queryIndicatorList(timeSpan?: string, orgLevel?: string) {
|
|
368
|
+
const resp = handleResult(
|
|
369
|
+
await newRequest<
|
|
370
|
+
ICnTableData<{
|
|
371
|
+
id: number;
|
|
372
|
+
instName: string;
|
|
373
|
+
}>
|
|
374
|
+
>({
|
|
375
|
+
url: handleAddQuery('/cone/queryIndicatorSubs', {
|
|
376
|
+
timeSpan,
|
|
377
|
+
orgLevel,
|
|
378
|
+
}),
|
|
379
|
+
method: 'GET',
|
|
380
|
+
}),
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
return resp.tableData.map((item) => ({
|
|
384
|
+
label: item.instName,
|
|
385
|
+
value: item.id,
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* 查询指标维度列表
|
|
391
|
+
* @param orgLevel
|
|
392
|
+
* @returns
|
|
393
|
+
*/
|
|
394
|
+
public static async getOrgLevelList(orgLevel: string) {
|
|
395
|
+
const resp = handleResult(
|
|
396
|
+
await newRequest<IListItem[]>({
|
|
397
|
+
url: '/indicator/permission/orgLevel',
|
|
398
|
+
params: {
|
|
399
|
+
orgLevel,
|
|
400
|
+
},
|
|
401
|
+
}),
|
|
402
|
+
);
|
|
403
|
+
|
|
404
|
+
return resp;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { newRequest } from '@/api/request';
|
|
2
|
+
import { handleResult } from '@/utils';
|
|
3
|
+
import {
|
|
4
|
+
ICardInfo,
|
|
5
|
+
ICnTableData,
|
|
6
|
+
IIndicatorCardConfig,
|
|
7
|
+
IPortalPageInfo,
|
|
8
|
+
IUnreadMsg,
|
|
9
|
+
IVisionUserConfig,
|
|
10
|
+
IWidgetSearch,
|
|
11
|
+
} from 'src/types';
|
|
12
|
+
|
|
13
|
+
export class PageService {
|
|
14
|
+
/**
|
|
15
|
+
* 添加/取消卡片订阅
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
public static async addOrUpdateIndicator(
|
|
19
|
+
pageCode?: string,
|
|
20
|
+
pageType?: string,
|
|
21
|
+
list?: ICardInfo[],
|
|
22
|
+
) {
|
|
23
|
+
const data = new FormData();
|
|
24
|
+
pageCode && data.append('code', pageCode);
|
|
25
|
+
pageType && data.append('pageType', pageType);
|
|
26
|
+
|
|
27
|
+
if (list) {
|
|
28
|
+
data.append('cardList', JSON.stringify(list));
|
|
29
|
+
data.append('content', JSON.stringify(list));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const resp = handleResult(
|
|
33
|
+
await newRequest({
|
|
34
|
+
url: '/cone/addOrUpdateIndicatorPageDef',
|
|
35
|
+
method: 'POST',
|
|
36
|
+
data,
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
return resp;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 更新页面内容
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
public static async updateIndicatorPage(code: string, list: string[]) {
|
|
47
|
+
const resp = handleResult(
|
|
48
|
+
await newRequest({
|
|
49
|
+
url: '/cone/updateIndicatorPageDef',
|
|
50
|
+
method: 'POST',
|
|
51
|
+
data: {
|
|
52
|
+
code,
|
|
53
|
+
content: list,
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
return resp;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 查询页面详情
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
public static async queryIndicatorPageDetail(
|
|
65
|
+
code?: string,
|
|
66
|
+
pageType?: string,
|
|
67
|
+
) {
|
|
68
|
+
const data = new FormData();
|
|
69
|
+
code && data.append('code', code);
|
|
70
|
+
pageType && data.append('pageType', pageType);
|
|
71
|
+
|
|
72
|
+
const resp = handleResult(
|
|
73
|
+
await newRequest<IPortalPageInfo | null>({
|
|
74
|
+
url: '/cone/queryIndicatorPageDefDetail',
|
|
75
|
+
method: 'POST',
|
|
76
|
+
data,
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
79
|
+
return {
|
|
80
|
+
...resp,
|
|
81
|
+
cardList: resp?.cardList ?? [],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 查询唯独消息
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
public static async queryUnreadMsg() {
|
|
90
|
+
const resp = handleResult(
|
|
91
|
+
await newRequest<IUnreadMsg[]>({
|
|
92
|
+
url: '/message/person',
|
|
93
|
+
method: 'POST',
|
|
94
|
+
data: {},
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
return resp;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 查询未读消息
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
public static async markUnreadMsg(id: string | number) {
|
|
106
|
+
const resp = handleResult(
|
|
107
|
+
await newRequest({
|
|
108
|
+
url: '/message/read',
|
|
109
|
+
method: 'POST',
|
|
110
|
+
data: {
|
|
111
|
+
id,
|
|
112
|
+
},
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
return resp;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 查询未读消息
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
public static async markUnreadMsgList(idList: number[]) {
|
|
124
|
+
const resp = handleResult(
|
|
125
|
+
await newRequest({
|
|
126
|
+
url: '/message/allRead',
|
|
127
|
+
method: 'POST',
|
|
128
|
+
data: {
|
|
129
|
+
idList,
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
return resp;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 查询卡片列表
|
|
138
|
+
public static async queryCardsList({
|
|
139
|
+
needSubscribeInfo = false,
|
|
140
|
+
subscribePageCode,
|
|
141
|
+
subscribePageType,
|
|
142
|
+
status,
|
|
143
|
+
bizCode,
|
|
144
|
+
typeGroup,
|
|
145
|
+
fuzzyLike,
|
|
146
|
+
filterMySubscription,
|
|
147
|
+
colWidthList,
|
|
148
|
+
}: IWidgetSearch) {
|
|
149
|
+
const resp = handleResult(
|
|
150
|
+
await newRequest<ICnTableData<IIndicatorCardConfig>>({
|
|
151
|
+
url: '/workbench/widget/query',
|
|
152
|
+
method: 'GET',
|
|
153
|
+
params: {
|
|
154
|
+
bizCode,
|
|
155
|
+
typeGroup,
|
|
156
|
+
fuzzyLike,
|
|
157
|
+
status,
|
|
158
|
+
subscribePageCode,
|
|
159
|
+
subscribePageType,
|
|
160
|
+
needSubscribeInfo,
|
|
161
|
+
filterMySubscription,
|
|
162
|
+
page: 1,
|
|
163
|
+
pageSize: 300,
|
|
164
|
+
colWidthList: colWidthList?.join(','),
|
|
165
|
+
},
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
return resp ?? {};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 获取工作台用户配置
|
|
174
|
+
* @returns
|
|
175
|
+
*/
|
|
176
|
+
public static async getVisionUserConfig() {
|
|
177
|
+
const resp = handleResult(
|
|
178
|
+
await newRequest<IVisionUserConfig>({
|
|
179
|
+
url: '/visionconf/getUserConfig',
|
|
180
|
+
}),
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
return resp ?? {};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 设置工作台用户配置
|
|
188
|
+
* @returns
|
|
189
|
+
*/
|
|
190
|
+
public static async setVisionUserConfig(data: IVisionUserConfig) {
|
|
191
|
+
const fd = new FormData();
|
|
192
|
+
fd.append('config', JSON.stringify(data));
|
|
193
|
+
|
|
194
|
+
const resp = handleResult(
|
|
195
|
+
await newRequest<boolean>({
|
|
196
|
+
url: '/visionconf/saveUserConfig',
|
|
197
|
+
method: 'POST',
|
|
198
|
+
data: fd,
|
|
199
|
+
}),
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
return resp;
|
|
203
|
+
}
|
|
204
|
+
}
|