smartbi-toolkit 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -10
- package/package.json +8 -2
- package/dist/index.d.ts +0 -22
- package/dist/index.js +0 -99
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -18
- package/dist/methods/AnalysisReportService.d.ts +0 -93
- package/dist/methods/AnalysisReportService.js +0 -126
- package/dist/methods/BusinessThemeService.d.ts +0 -8
- package/dist/methods/BusinessThemeService.js +0 -11
- package/dist/methods/BusinessViewService.d.ts +0 -94
- package/dist/methods/BusinessViewService.js +0 -120
- package/dist/methods/CatalogService.d.ts +0 -182
- package/dist/methods/CatalogService.js +0 -224
- package/dist/methods/ClientCombinedReportService.d.ts +0 -63
- package/dist/methods/ClientCombinedReportService.js +0 -82
- package/dist/methods/ClientInsightService.d.ts +0 -83
- package/dist/methods/ClientInsightService.js +0 -107
- package/dist/methods/ClientReportService.d.ts +0 -162
- package/dist/methods/ClientReportService.js +0 -206
- package/dist/methods/CombinedReportService.d.ts +0 -7
- package/dist/methods/CombinedReportService.js +0 -10
- package/dist/methods/DataSourceService.d.ts +0 -178
- package/dist/methods/DataSourceService.js +0 -220
- package/dist/methods/GraphicReportService.d.ts +0 -6
- package/dist/methods/GraphicReportService.js +0 -10
- package/dist/methods/InsightReport.d.ts +0 -71
- package/dist/methods/InsightReport.js +0 -98
- package/dist/methods/MetadataService.d.ts +0 -37
- package/dist/methods/MetadataService.js +0 -47
- package/dist/methods/OfficeReport.d.ts +0 -49
- package/dist/methods/OfficeReport.js +0 -65
- package/dist/methods/OfficeReportService.d.ts +0 -36
- package/dist/methods/OfficeReportService.js +0 -46
- package/dist/methods/OltpMetadataService.d.ts +0 -19
- package/dist/methods/OltpMetadataService.js +0 -25
- package/dist/methods/ParameterService.d.ts +0 -12
- package/dist/methods/ParameterService.js +0 -18
- package/dist/methods/PoolService.d.ts +0 -11
- package/dist/methods/PoolService.js +0 -17
- package/dist/methods/PortalService.d.ts +0 -66
- package/dist/methods/PortalService.js +0 -89
- package/dist/methods/Report.d.ts +0 -178
- package/dist/methods/Report.js +0 -230
- package/dist/methods/SSReport.d.ts +0 -86
- package/dist/methods/SSReport.js +0 -114
- package/dist/methods/ScheduleTaskService.d.ts +0 -12
- package/dist/methods/ScheduleTaskService.js +0 -18
- package/dist/methods/SimpleReportService.d.ts +0 -12
- package/dist/methods/SimpleReportService.js +0 -18
- package/dist/methods/SpreadSheetReportService.d.ts +0 -43
- package/dist/methods/SpreadSheetReportService.js +0 -55
- package/dist/methods/SystemConfigService.d.ts +0 -28
- package/dist/methods/SystemConfigService.js +0 -24
- package/dist/methods/TimeConsuming.d.ts +0 -6
- package/dist/methods/TimeConsuming.js +0 -9
- package/dist/methods/TimeConsumingService.d.ts +0 -5
- package/dist/methods/TimeConsumingService.js +0 -9
- package/dist/methods/UserManagerService.d.ts +0 -258
- package/dist/methods/UserManagerService.js +0 -332
- package/dist/types.d.ts +0 -442
- package/dist/types.js +0 -125
- package/dist/vite-plugin-smartbi/index.d.ts +0 -36
- package/dist/vite-plugin-smartbi/index.js +0 -107
package/README.md
CHANGED
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
### 在smartbi-toolkit中封装了通用的请求方法
|
|
7
7
|
|
|
8
|
-
* smartbi
|
|
9
|
-
|
|
8
|
+
* smartbi方法,RMI方法调用封装
|
|
10
9
|
```javascript
|
|
11
10
|
smartbi('服务名', '方法名', ['参数1', '参数2', '...']).then(res => {
|
|
12
11
|
})
|
|
13
12
|
```
|
|
13
|
+
* 登录方法
|
|
14
|
+
```javascript
|
|
15
|
+
login('用户名', '密码').then(res => {})
|
|
16
|
+
```
|
|
14
17
|
|
|
15
18
|
* setSmartbiEnv 为开发环境设置smartbi变量,注意账号密码安全问题,不要直接把账号密码写入,在开发环境设置后可实现自动登录,生产环境需要自行实现登录,或者运行在smartbi下,无需登录
|
|
16
19
|
|
|
@@ -19,23 +22,96 @@ setSmartbiEnv({
|
|
|
19
22
|
dev: {
|
|
20
23
|
username: 'admin',
|
|
21
24
|
password: 'manager',
|
|
22
|
-
}
|
|
25
|
+
}, // smartbi开发环境下的账号密码,注意打包时不要填写,避免信息暴露
|
|
26
|
+
mode:'dev', // dev/ prod 开发和生产模式 。默认dev模式,该参数可忽略,只影响到smartbi的判断
|
|
27
|
+
path:'/smartbi',// smartbi服务路径,默认为/smartbi,如果部署在tomcat的ROOT目录下,该参数改为 "/"
|
|
28
|
+
noop:30000 //心跳循环时间,默认30秒
|
|
23
29
|
})
|
|
24
30
|
```
|
|
31
|
+
* 开始心跳
|
|
32
|
+
```javascript
|
|
33
|
+
startHeartbeat()
|
|
34
|
+
```
|
|
35
|
+
* 停止心跳
|
|
36
|
+
```javascript
|
|
37
|
+
stopHeartbeat()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
* 心跳方法,不使用startHeartbeat()和stopHeartbeat()方法,手动实现心跳
|
|
41
|
+
```javascript
|
|
42
|
+
noop()
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### ext扩展包构建工具,通过vite实现
|
|
46
|
+
该工具为vite插件,可以一键生成ext扩展包,但需要有java和Apache Ant环境
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import vitePluginSmartbi from 'smartbi-toolkit/VitePluginSmartbi'
|
|
50
|
+
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
plugins: [
|
|
53
|
+
vitePluginSmartbi({
|
|
54
|
+
name:'ext-test',
|
|
55
|
+
})
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
#### 参数说明
|
|
60
|
+
```typescript
|
|
61
|
+
export type VitePluginSmartbiOptions = {
|
|
62
|
+
/**
|
|
63
|
+
* 插件名称
|
|
64
|
+
*/
|
|
65
|
+
name: string
|
|
66
|
+
/**
|
|
67
|
+
* 插件别名
|
|
68
|
+
*/
|
|
69
|
+
alias?: string
|
|
70
|
+
/**
|
|
71
|
+
* 插件描述
|
|
72
|
+
*/
|
|
73
|
+
desc?: string
|
|
74
|
+
/**
|
|
75
|
+
* 优先级
|
|
76
|
+
*/
|
|
77
|
+
priority?: number
|
|
78
|
+
/**
|
|
79
|
+
* 输出目录
|
|
80
|
+
*/
|
|
81
|
+
output?: string
|
|
82
|
+
/**
|
|
83
|
+
* html重命名
|
|
84
|
+
*/
|
|
85
|
+
indexRename?: string
|
|
86
|
+
/**
|
|
87
|
+
* vision到html中间的路径
|
|
88
|
+
*/
|
|
89
|
+
appendPath?: string,
|
|
90
|
+
/**
|
|
91
|
+
* 插件版本
|
|
92
|
+
*/
|
|
93
|
+
version?: string
|
|
94
|
+
};
|
|
95
|
+
```
|
|
96
|
+
|
|
25
97
|
|
|
26
98
|
### 在smartbi-toolkit/xxxxService中,实现你官方文档定义的接口
|
|
27
99
|
|
|
28
|
-
*
|
|
29
|
-
*
|
|
100
|
+
* 代码大部分由AI通过官方文档生成,基本和官方保持一致,部分ts类型等可能存在错误
|
|
101
|
+
* 如遇到接口不可用,可以尝试使用smartbi()方法调用,如果依旧不可以,请查看官方文档,官方文档内也有相当大的一部分方法不可以
|
|
102
|
+
* 大部分接口均由AI通过官方文档生成JsDoc
|
|
103
|
+
* 官方文档https://wiki.smartbi.com.cn/api/javaapi/index.html
|
|
104
|
+
|
|
30
105
|
|
|
31
|
-
### 在smartbi-toolkit/CatalogService内,通过官方文档实现了“资源目录服务”接口
|
|
32
|
-
* 参考文档https://wiki.smartbi.com.cn/api/javaapi/index.html?smartbi/sdk/service/catalog/CatalogService.html
|
|
33
106
|
|
|
34
107
|
|
|
35
108
|
### todo 开发中功能,后续实现
|
|
36
109
|
1. 其他服务接口
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
110
|
+
* Smartbi-SDK.jar中包含的,但官方文档没有的接口
|
|
111
|
+
* 其他可通过rmi调用的接口
|
|
112
|
+
2. TS类型优化
|
|
113
|
+
* TS类型没有完善,部分通过AI生成,后续需要从SDK中提取完整的类型信息
|
|
114
|
+
3. 封装参数
|
|
115
|
+
* 目前参数封装为数组,后续需要封装为对象
|
|
40
116
|
|
|
41
117
|
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smartbi-toolkit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"keys": [
|
|
6
6
|
"smartbi",
|
|
7
7
|
"扩展包",
|
|
8
8
|
"ext",
|
|
9
|
-
"typescript"
|
|
9
|
+
"typescript",
|
|
10
|
+
"smartbi-toolkit"
|
|
10
11
|
],
|
|
11
12
|
"type": "module",
|
|
12
13
|
"module": "./dist/index.js",
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
15
|
+
"description": "SmartBI 非官方JS sdk和ext构建工具",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/StillAlexLiu/smartbi-toolkit.git"
|
|
19
|
+
},
|
|
14
20
|
"exports": {
|
|
15
21
|
".": {
|
|
16
22
|
"import": "./dist/index.js",
|
package/dist/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type SmartbiDev = {
|
|
2
|
-
username: string;
|
|
3
|
-
password: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const setSmartbiEnv: ({ path, dev, noop, mode }: {
|
|
6
|
-
path?: "/smartbi" | "" | string;
|
|
7
|
-
dev?: SmartbiDev;
|
|
8
|
-
mode?: "dev" | "prod";
|
|
9
|
-
noop?: number;
|
|
10
|
-
}) => void;
|
|
11
|
-
type Status = 'pending' | 'online' | 'offline';
|
|
12
|
-
type PostStack = () => void;
|
|
13
|
-
export declare const emit: () => void, on: (call: PostStack) => void, handler: (requireLogin: boolean) => Promise<void>, setStatus: (value: Status) => void;
|
|
14
|
-
export declare const smartbi: <T>(className: string, methodName: string, params: Array<string | number | boolean | null | undefined>, requireLogin?: boolean) => Promise<T>;
|
|
15
|
-
/**
|
|
16
|
-
* 登录smartbi服务
|
|
17
|
-
*/
|
|
18
|
-
export declare const login: (form?: {
|
|
19
|
-
username: string;
|
|
20
|
-
password: string;
|
|
21
|
-
}) => Promise<unknown>;
|
|
22
|
-
export {};
|
package/dist/index.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
const __smartbi_env = {
|
|
3
|
-
username: '',
|
|
4
|
-
password: '',
|
|
5
|
-
smartbiPath: '/smartbi', mode: 'prod'
|
|
6
|
-
};
|
|
7
|
-
export const setSmartbiEnv = ({ path = '/smartbi', dev, noop = 3000, mode = 'prod' }) => {
|
|
8
|
-
console.log(path, dev, noop);
|
|
9
|
-
__smartbi_env.username = dev?.username || '';
|
|
10
|
-
__smartbi_env.username = dev?.username || '';
|
|
11
|
-
__smartbi_env.mode = mode;
|
|
12
|
-
if (dev) {
|
|
13
|
-
console.log("请勿将账号信息直接赋值到username和password中,避免暴露账号密码,如需要,可考虑从环境变量.env文件中获取");
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const postStack = () => {
|
|
17
|
-
const postList = new Set();
|
|
18
|
-
let status = 'offline';
|
|
19
|
-
return {
|
|
20
|
-
setStatus(value) {
|
|
21
|
-
status = value;
|
|
22
|
-
},
|
|
23
|
-
emit() {
|
|
24
|
-
postList.forEach(call => {
|
|
25
|
-
call();
|
|
26
|
-
});
|
|
27
|
-
postList.clear();
|
|
28
|
-
},
|
|
29
|
-
on(call) {
|
|
30
|
-
postList.add(call);
|
|
31
|
-
},
|
|
32
|
-
handler(requireLogin) {
|
|
33
|
-
return new Promise(resolve => {
|
|
34
|
-
if (requireLogin) {
|
|
35
|
-
if (status === 'offline') {
|
|
36
|
-
status = 'pending';
|
|
37
|
-
login().then(() => {
|
|
38
|
-
emit();
|
|
39
|
-
resolve();
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
else if (status === 'online') {
|
|
43
|
-
resolve();
|
|
44
|
-
}
|
|
45
|
-
else if (status === 'pending') {
|
|
46
|
-
on(() => {
|
|
47
|
-
resolve();
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export const { emit, on, handler, setStatus } = postStack();
|
|
59
|
-
export const smartbi = (className, methodName, params, requireLogin = __smartbi_env.mode === 'dev') => {
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
handler(requireLogin)
|
|
62
|
-
.then(() => {
|
|
63
|
-
return axios.post(`${__smartbi_env.smartbiPath}/vision/RMIServlet`, {
|
|
64
|
-
className,
|
|
65
|
-
methodName,
|
|
66
|
-
params: JSON.stringify(params),
|
|
67
|
-
}, {
|
|
68
|
-
headers: {
|
|
69
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
70
|
-
'X-Requested-With': 'XMLHttpRequest',
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
})
|
|
74
|
-
.then(res => {
|
|
75
|
-
if (res.data.retCode === 0) {
|
|
76
|
-
resolve(res.data.result);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
console.error('smartbi返回状态错误');
|
|
80
|
-
console.error(res.data.stackTrace);
|
|
81
|
-
reject(new Error(res.data.stackTrace));
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
.catch(e => {
|
|
85
|
-
reject(e);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* 登录smartbi服务
|
|
91
|
-
*/
|
|
92
|
-
export const login = (form) => {
|
|
93
|
-
return new Promise(resolve => {
|
|
94
|
-
smartbi('UserService', 'login', [form?.username || __smartbi_env.username, form?.password || __smartbi_env.password], false).then(value => {
|
|
95
|
-
setStatus('online');
|
|
96
|
-
resolve(value);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
package/dist/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/main.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { setSmartbiEnv } from './index';
|
|
2
|
-
import { getRootElements } from './methods/CatalogService';
|
|
3
|
-
setSmartbiEnv({
|
|
4
|
-
dev: {
|
|
5
|
-
username: 'admin',
|
|
6
|
-
password: 'Bi@2024!!!!!!!!',
|
|
7
|
-
},
|
|
8
|
-
mode: 'dev'
|
|
9
|
-
});
|
|
10
|
-
// smartbi('x', 'x', [1, 2, 3]).then(value => {
|
|
11
|
-
// console.log(value)
|
|
12
|
-
// })
|
|
13
|
-
getRootElements().then(value => {
|
|
14
|
-
console.log(value);
|
|
15
|
-
value.forEach(item => {
|
|
16
|
-
console.log(item.fullPath);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { IResult, RunningInfo, IParameter, Parameter, NameValuePair, AllExportTypeMap } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 打开多维报表
|
|
4
|
-
* @param reportId 报表ID
|
|
5
|
-
* @returns 返回报表客户端ID
|
|
6
|
-
*/
|
|
7
|
-
export declare const openAnalysisReport: (reportId: string) => Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* 打开多维报表(不初始化)
|
|
10
|
-
* @param reportId 报表ID
|
|
11
|
-
* @returns 返回报表客户端ID
|
|
12
|
-
*/
|
|
13
|
-
export declare const openOlapReportWithoutInit: (reportId: string) => Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* 关闭多维报表
|
|
16
|
-
* @param clientId 客户端ID
|
|
17
|
-
* @returns 无返回值
|
|
18
|
-
*/
|
|
19
|
-
export declare const closeAnalysisReport: (clientId: string) => Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* 设置多维报表参数值
|
|
22
|
-
* @param clientId 客户端ID
|
|
23
|
-
* @param id 参数ID
|
|
24
|
-
* @param value 参数值
|
|
25
|
-
* @param displayValue 参数显示值
|
|
26
|
-
* @returns 无返回值
|
|
27
|
-
*/
|
|
28
|
-
export declare const setParamValue: (clientId: string, id: string, value: string, displayValue: string) => Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* 执行多维查询
|
|
31
|
-
* @param clientId 客户端ID
|
|
32
|
-
* @returns 返回查询结果
|
|
33
|
-
*/
|
|
34
|
-
export declare const executeQuery: (clientId: string) => Promise<IResult>;
|
|
35
|
-
/**
|
|
36
|
-
* 导出报表
|
|
37
|
-
* @param clientId 客户端ID
|
|
38
|
-
* @param exportType 导出类型
|
|
39
|
-
* @param delimiter 分割符
|
|
40
|
-
* @param os 输出流
|
|
41
|
-
* @param resourceBasePath 资源路径前缀(可选)
|
|
42
|
-
* @param valueType 值类型(可选)
|
|
43
|
-
* @returns 无返回值
|
|
44
|
-
*/
|
|
45
|
-
export declare const doExport: (clientId: string, exportType: keyof AllExportTypeMap | string, delimiter: string, os: any, // 输出流
|
|
46
|
-
resourceBasePath?: string, valueType?: string) => Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* 设置参数为默认值
|
|
49
|
-
* @param clientId 客户端ID
|
|
50
|
-
* @param paramId 参数ID
|
|
51
|
-
* @returns 无返回值
|
|
52
|
-
*/
|
|
53
|
-
export declare const setParameterValueAsDefault: (clientId: string, paramId: string) => Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* 获取参数
|
|
56
|
-
* @param clientId 客户端ID
|
|
57
|
-
* @param paramId 参数ID
|
|
58
|
-
* @returns 返回参数信息
|
|
59
|
-
*/
|
|
60
|
-
export declare const getParameter: (clientId: string, paramId: string) => Promise<IParameter>;
|
|
61
|
-
/**
|
|
62
|
-
* 获取参数显示值
|
|
63
|
-
* @param clientId 客户端ID
|
|
64
|
-
* @param paramId 参数ID
|
|
65
|
-
* @returns 返回参数显示值
|
|
66
|
-
*/
|
|
67
|
-
export declare const getParameterDisplayValue: (clientId: string, paramId: string) => Promise<string>;
|
|
68
|
-
/**
|
|
69
|
-
* 获取参数默认值
|
|
70
|
-
* @param clientId 客户端ID
|
|
71
|
-
* @param paramId 参数ID
|
|
72
|
-
* @returns 返回参数默认值列表
|
|
73
|
-
*/
|
|
74
|
-
export declare const getParameterDefaultValue: (clientId: string, paramId: string) => Promise<string[]>;
|
|
75
|
-
/**
|
|
76
|
-
* 获取所有参数
|
|
77
|
-
* @param clientId 客户端ID
|
|
78
|
-
* @returns 返回参数列表
|
|
79
|
-
*/
|
|
80
|
-
export declare const getParameters: (clientId: string) => Promise<Parameter[]>;
|
|
81
|
-
/**
|
|
82
|
-
* 获取参数候选值列表
|
|
83
|
-
* @param clientId 客户端ID
|
|
84
|
-
* @param paramId 参数ID
|
|
85
|
-
* @returns 返回候选值列表
|
|
86
|
-
*/
|
|
87
|
-
export declare const getParamStandbyValue: (clientId: string, paramId: string) => Promise<NameValuePair[]>;
|
|
88
|
-
/**
|
|
89
|
-
* 获取执行状态
|
|
90
|
-
* @param clientId 客户端ID
|
|
91
|
-
* @returns 返回执行状态信息
|
|
92
|
-
*/
|
|
93
|
-
export declare const getExecutingState: (clientId: string) => Promise<RunningInfo>;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 打开多维报表
|
|
3
|
-
* @param reportId 报表ID
|
|
4
|
-
* @returns 返回报表客户端ID
|
|
5
|
-
*/
|
|
6
|
-
export const openAnalysisReport = (reportId) => {
|
|
7
|
-
return smartbi('AnalysisReportService', 'openAnalysisReport', [reportId]);
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* 打开多维报表(不初始化)
|
|
11
|
-
* @param reportId 报表ID
|
|
12
|
-
* @returns 返回报表客户端ID
|
|
13
|
-
*/
|
|
14
|
-
export const openOlapReportWithoutInit = (reportId) => {
|
|
15
|
-
return smartbi('AnalysisReportService', 'openOlapReportWithoutInit', [reportId]);
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 关闭多维报表
|
|
19
|
-
* @param clientId 客户端ID
|
|
20
|
-
* @returns 无返回值
|
|
21
|
-
*/
|
|
22
|
-
export const closeAnalysisReport = (clientId) => {
|
|
23
|
-
return smartbi('AnalysisReportService', 'closeAnalysisReport', [clientId]);
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* 设置多维报表参数值
|
|
27
|
-
* @param clientId 客户端ID
|
|
28
|
-
* @param id 参数ID
|
|
29
|
-
* @param value 参数值
|
|
30
|
-
* @param displayValue 参数显示值
|
|
31
|
-
* @returns 无返回值
|
|
32
|
-
*/
|
|
33
|
-
export const setParamValue = (clientId, id, value, displayValue) => {
|
|
34
|
-
return smartbi('AnalysisReportService', 'setParamValue', [clientId, id, value, displayValue]);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* 执行多维查询
|
|
38
|
-
* @param clientId 客户端ID
|
|
39
|
-
* @returns 返回查询结果
|
|
40
|
-
*/
|
|
41
|
-
export const executeQuery = (clientId) => {
|
|
42
|
-
return smartbi('AnalysisReportService', 'executeQuery', [clientId]);
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* 导出报表
|
|
46
|
-
* @param clientId 客户端ID
|
|
47
|
-
* @param exportType 导出类型
|
|
48
|
-
* @param delimiter 分割符
|
|
49
|
-
* @param os 输出流
|
|
50
|
-
* @param resourceBasePath 资源路径前缀(可选)
|
|
51
|
-
* @param valueType 值类型(可选)
|
|
52
|
-
* @returns 无返回值
|
|
53
|
-
*/
|
|
54
|
-
export const doExport = (clientId, exportType, delimiter, os, // 输出流
|
|
55
|
-
resourceBasePath, valueType) => {
|
|
56
|
-
const params = [clientId, exportType, delimiter, os];
|
|
57
|
-
if (resourceBasePath !== undefined) {
|
|
58
|
-
params.push(resourceBasePath);
|
|
59
|
-
if (valueType !== undefined) {
|
|
60
|
-
params.push(valueType);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return smartbi('AnalysisReportService', 'doExport', params);
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* 设置参数为默认值
|
|
67
|
-
* @param clientId 客户端ID
|
|
68
|
-
* @param paramId 参数ID
|
|
69
|
-
* @returns 无返回值
|
|
70
|
-
*/
|
|
71
|
-
export const setParameterValueAsDefault = (clientId, paramId) => {
|
|
72
|
-
return smartbi('AnalysisReportService', 'setParameterValueAsDefault', [clientId, paramId]);
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* 获取参数
|
|
76
|
-
* @param clientId 客户端ID
|
|
77
|
-
* @param paramId 参数ID
|
|
78
|
-
* @returns 返回参数信息
|
|
79
|
-
*/
|
|
80
|
-
export const getParameter = (clientId, paramId) => {
|
|
81
|
-
return smartbi('AnalysisReportService', 'getParameter', [clientId, paramId]);
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* 获取参数显示值
|
|
85
|
-
* @param clientId 客户端ID
|
|
86
|
-
* @param paramId 参数ID
|
|
87
|
-
* @returns 返回参数显示值
|
|
88
|
-
*/
|
|
89
|
-
export const getParameterDisplayValue = (clientId, paramId) => {
|
|
90
|
-
return smartbi('AnalysisReportService', 'getParameterDisplayValue', [clientId, paramId]);
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* 获取参数默认值
|
|
94
|
-
* @param clientId 客户端ID
|
|
95
|
-
* @param paramId 参数ID
|
|
96
|
-
* @returns 返回参数默认值列表
|
|
97
|
-
*/
|
|
98
|
-
export const getParameterDefaultValue = (clientId, paramId) => {
|
|
99
|
-
return smartbi('AnalysisReportService', 'getParameterDefaultValue', [clientId, paramId]);
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* 获取所有参数
|
|
103
|
-
* @param clientId 客户端ID
|
|
104
|
-
* @returns 返回参数列表
|
|
105
|
-
*/
|
|
106
|
-
export const getParameters = (clientId) => {
|
|
107
|
-
return smartbi('AnalysisReportService', 'getParameters', [clientId]);
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* 获取参数候选值列表
|
|
111
|
-
* @param clientId 客户端ID
|
|
112
|
-
* @param paramId 参数ID
|
|
113
|
-
* @returns 返回候选值列表
|
|
114
|
-
*/
|
|
115
|
-
export const getParamStandbyValue = (clientId, paramId) => {
|
|
116
|
-
return smartbi('AnalysisReportService', 'getParamStandbyValue', [clientId, paramId]);
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* 获取执行状态
|
|
120
|
-
* @param clientId 客户端ID
|
|
121
|
-
* @returns 返回执行状态信息
|
|
122
|
-
*/
|
|
123
|
-
export const getExecutingState = (clientId) => {
|
|
124
|
-
return smartbi('AnalysisReportService', 'getExecutingState', [clientId]);
|
|
125
|
-
};
|
|
126
|
-
import { smartbi } from "../index";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { smartbi } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* 创建业务对象
|
|
4
|
-
* @param businessThemeId 业务主题ID
|
|
5
|
-
* @param parentId 业务对象父ID
|
|
6
|
-
* @param tableId 表ID
|
|
7
|
-
* @returns 无返回值
|
|
8
|
-
*/
|
|
9
|
-
export const createBusinessThemeObject = (businessThemeId, parentId, tableId) => {
|
|
10
|
-
return smartbi('BusinessThemeService', 'createBusinessThemeObject', [businessThemeId, parentId, tableId]);
|
|
11
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { FieldProperty, ViewMetaData } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 根据数据集(可视化查询、原生SQL查询、SQL查询)的ID查询其SQL语句
|
|
4
|
-
* @param bizViewId (可视化查询、原生SQL查询、SQL查询)的ID
|
|
5
|
-
* @returns 返回其SQL语句
|
|
6
|
-
*/
|
|
7
|
-
export declare const getSqlString: (bizViewId: string) => Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* 打开业务查询以备读取结果集数据
|
|
10
|
-
* @param bizViewId 业务查询ID
|
|
11
|
-
* @param paramsJsonArrStr 报表的参数信息
|
|
12
|
-
* @param rowsPerPage 加载数据时每页返回的行数
|
|
13
|
-
* @param getTotalRows 是否获取总行数
|
|
14
|
-
* @returns 返回查询基本元数据信息
|
|
15
|
-
*/
|
|
16
|
-
export declare const openLoadDataView: (bizViewId: string, paramsJsonArrStr: string, rowsPerPage: number, getTotalRows: boolean) => Promise<ViewMetaData>;
|
|
17
|
-
/**
|
|
18
|
-
* 按页读取结果集数据
|
|
19
|
-
* @param loadDataClientId 打开查询后的客户端标识
|
|
20
|
-
* @param pageNum 页码(第1页的页码为0,第2页的页码为1,如此类推)
|
|
21
|
-
* @returns 返回原始报表数据
|
|
22
|
-
*/
|
|
23
|
-
export declare const loadViewData: (loadDataClientId: string, pageNum: number) => Promise<string[][]>;
|
|
24
|
-
/**
|
|
25
|
-
* 按页读取结果集数据
|
|
26
|
-
* @param loadDataClientId 打开查询后的客户端标识
|
|
27
|
-
* @param pageNum 页码(第1页的页码为0,第2页的页码为1,如此类推)
|
|
28
|
-
* @param dataFormatMap 数据格式映射,如:"DOUBLE", "<浮点型-默认值>",目前仅支持double
|
|
29
|
-
* @returns 返回原始报表数据
|
|
30
|
-
*/
|
|
31
|
-
export declare const loadViewDataWithDataformat: (loadDataClientId: string, pageNum: number, dataFormatMap: Map<string, string>) => Promise<string[][]>;
|
|
32
|
-
/**
|
|
33
|
-
* 关闭业务查询
|
|
34
|
-
* @param loadDataClientId 打开查询后的客户端标识
|
|
35
|
-
* @returns 无返回值
|
|
36
|
-
*/
|
|
37
|
-
export declare const closeLoadDataView: (loadDataClientId: string) => Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* 打开业务查询
|
|
40
|
-
* @param bizViewId 打开业务查询ID
|
|
41
|
-
* @returns 返回业务查询结果
|
|
42
|
-
*/
|
|
43
|
-
export declare const openBusinessView: (bizViewId: string) => Promise<any[]>;
|
|
44
|
-
/**
|
|
45
|
-
* 关闭业务查询
|
|
46
|
-
* @param bizViewClientId 打开查询后的客户端标识
|
|
47
|
-
* @returns 无返回值
|
|
48
|
-
*/
|
|
49
|
-
export declare const closeBusinessView: (bizViewClientId: string) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* 检测输出字段
|
|
52
|
-
* @param bizViewClientId 打开查询后的客户端标识
|
|
53
|
-
* @returns 无返回值
|
|
54
|
-
*/
|
|
55
|
-
export declare const getRawSqlOutputField: (bizViewClientId: string) => Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* 检测输出字段
|
|
58
|
-
* @param clientId 客户端ID
|
|
59
|
-
* @returns 返回输出字段
|
|
60
|
-
*/
|
|
61
|
-
export declare const detectOutputFields: (clientId: string) => Promise<any[]>;
|
|
62
|
-
/**
|
|
63
|
-
* 覆盖业务视图
|
|
64
|
-
* @param bizViewClientId 业务视图ID
|
|
65
|
-
* @returns 无返回值
|
|
66
|
-
*/
|
|
67
|
-
export declare const overwriteBusinessView: (bizViewClientId: string) => Promise<void>;
|
|
68
|
-
/**
|
|
69
|
-
* 创建"原生SQL查询"数据集,并保存到指定目录下
|
|
70
|
-
* @param datasourceId 数据源ID
|
|
71
|
-
* @param sql "原生SQL查询"的SQL语句
|
|
72
|
-
* @param name 数据集的名称
|
|
73
|
-
* @param alias 数据集的别名
|
|
74
|
-
* @param desc 数据集的描述
|
|
75
|
-
* @param folderId 用来保存数据集的指定目录ID
|
|
76
|
-
* @returns 返回所创建的"原生SQL查询"数据集ID
|
|
77
|
-
*/
|
|
78
|
-
export declare const createRawSqlQueryBusinessViewAndSave: (datasourceId: string, sql: string, name: string, alias: string, desc: string, folderId: string) => Promise<string>;
|
|
79
|
-
/**
|
|
80
|
-
* 更新指定的"原生SQL查询"数据集的SQL语句,并自动检测输出字段
|
|
81
|
-
* @param businessViewId "原生SQL查询"数据集ID
|
|
82
|
-
* @param sql 新的SQL语句
|
|
83
|
-
* @returns 返回数据集ID
|
|
84
|
-
*/
|
|
85
|
-
export declare const updateRawSqlQueryBusinessView: (businessViewId: string, sql: string) => Promise<string>;
|
|
86
|
-
/**
|
|
87
|
-
* 设置输出字段信息
|
|
88
|
-
* @param businessViewClientId clientId
|
|
89
|
-
* @param fieldId 字段信息
|
|
90
|
-
* @param propertyName 属性名,如alias,desc,dataType,dataFormat,orderby,transformRule
|
|
91
|
-
* @param propertyValue 属性值
|
|
92
|
-
* @returns 无返回值
|
|
93
|
-
*/
|
|
94
|
-
export declare const setOutputFieldInfo: (businessViewClientId: string, fieldId: string, propertyName: FieldProperty, propertyValue: string) => Promise<void>;
|