@ibiz-template/runtime 0.3.2 → 0.3.4
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/dist/index.esm.js +838 -316
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/out/app-hub.d.ts +5 -5
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +2 -2
- package/out/constant/sys-uiaction-tag.d.ts +4 -0
- package/out/constant/sys-uiaction-tag.d.ts.map +1 -1
- package/out/constant/sys-uiaction-tag.js +4 -0
- package/out/controller/common/control/control.controller.js +2 -2
- package/out/controller/control/app-menu/app-menu.controller.d.ts +2 -3
- package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/calendar/calendar.controller.d.ts +7 -0
- package/out/controller/control/calendar/calendar.controller.d.ts.map +1 -1
- package/out/controller/control/calendar/calendar.controller.js +28 -2
- package/out/controller/control/chart/chart.controller.d.ts +6 -0
- package/out/controller/control/chart/chart.controller.d.ts.map +1 -1
- package/out/controller/control/chart/chart.controller.js +5 -3
- package/out/controller/control/chart/generator/base-series-generator.d.ts +21 -6
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +51 -7
- package/out/controller/control/chart/generator/chart-options-generator.d.ts +15 -1
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +23 -3
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts +2 -3
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/funnel-series-generator.js +1 -5
- package/out/controller/control/chart/generator/pie-series-generator.d.ts +2 -3
- package/out/controller/control/chart/generator/pie-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/pie-series-generator.js +1 -5
- package/out/controller/control/chart/generator/radar-series-generator.d.ts +1 -2
- package/out/controller/control/chart/generator/radar-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/radar-series-generator.js +1 -4
- package/out/controller/control/exp-bar/chart-exp-bar.controller.d.ts +25 -1
- package/out/controller/control/exp-bar/chart-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/chart-exp-bar.controller.js +68 -2
- package/out/controller/control/form/search-form/search-form.controller.d.ts +9 -0
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +59 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts +23 -2
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +73 -21
- package/out/controller/control/panel/panel/panel.controller.d.ts +4 -1
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +17 -16
- package/out/controller/utils/data-file-util/data-file-util.d.ts +3 -3
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +10 -4
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +8 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +5 -5
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/common/i-app-service/i-app-service.d.ts +53 -0
- package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts +27 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-panel.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-panel.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-chart.state.d.ts +21 -0
- package/out/interface/controller/state/control/i-chart.state.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +66 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/model/utils/util.d.ts +5 -5
- package/out/model/utils/util.d.ts.map +1 -1
- package/out/model/utils/util.js +14 -6
- package/out/service/dto/method.dto.d.ts +2 -2
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +3 -1
- package/out/service/service/config/config.service.d.ts.map +1 -1
- package/out/service/service/control/control.service.d.ts +2 -2
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.d.ts +6 -0
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +18 -0
- package/out/service/service/entity/method/method.d.ts +2 -3
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/vo/chart-data/chart-data.d.ts +11 -0
- package/out/service/vo/chart-data/chart-data.d.ts.map +1 -0
- package/out/service/vo/chart-data/chart-data.js +50 -0
- package/out/service/vo/chart-data/index.d.ts +2 -0
- package/out/service/vo/chart-data/index.d.ts.map +1 -0
- package/out/service/vo/chart-data/index.js +1 -0
- package/out/service/vo/index.d.ts +1 -0
- package/out/service/vo/index.d.ts.map +1 -1
- package/out/service/vo/index.js +1 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts +24 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +128 -1
- package/out/ui-action/provider/sys-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/sys-ui-action-provider.js +2 -0
- package/package.json +3 -3
- package/src/app-hub.ts +5 -5
- package/src/constant/sys-uiaction-tag.ts +4 -0
- package/src/controller/common/control/control.controller.ts +2 -2
- package/src/controller/control/app-menu/app-menu.controller.ts +2 -2
- package/src/controller/control/calendar/calendar.controller.ts +29 -2
- package/src/controller/control/chart/chart.controller.ts +11 -3
- package/src/controller/control/chart/generator/base-series-generator.ts +71 -9
- package/src/controller/control/chart/generator/chart-options-generator.ts +24 -3
- package/src/controller/control/chart/generator/funnel-series-generator.ts +3 -7
- package/src/controller/control/chart/generator/pie-series-generator.ts +3 -7
- package/src/controller/control/chart/generator/radar-series-generator.ts +2 -6
- package/src/controller/control/exp-bar/chart-exp-bar.controller.ts +97 -4
- package/src/controller/control/form/search-form/search-form.controller.ts +64 -0
- package/src/controller/control/grid/grid/grid.controller.ts +110 -27
- package/src/controller/control/panel/panel/panel.controller.ts +15 -0
- package/src/controller/utils/data-file-util/data-file-util.ts +11 -3
- package/src/engine/md-view.engine.ts +8 -0
- package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +5 -5
- package/src/interface/common/i-app-service/i-app-service.ts +71 -0
- package/src/interface/controller/controller/control/i-grid.controller.ts +30 -1
- package/src/interface/controller/controller/control/i-panel.controller.ts +9 -0
- package/src/interface/controller/state/control/i-chart.state.ts +24 -0
- package/src/interface/service/service/i-app-de.service.ts +96 -0
- package/src/model/utils/util.ts +16 -6
- package/src/service/dto/method.dto.ts +5 -3
- package/src/service/service/config/config.service.ts +2 -3
- package/src/service/service/control/control.service.ts +2 -2
- package/src/service/service/entity/de.service.ts +48 -0
- package/src/service/service/entity/method/method.ts +2 -3
- package/src/service/service/work-flow/work-flow.service.ts +2 -3
- package/src/service/vo/chart-data/chart-data.ts +75 -0
- package/src/service/vo/chart-data/index.ts +1 -0
- package/src/service/vo/index.ts +1 -0
- package/src/ui-action/provider/front-ui-action-provider.ts +153 -1
- package/src/ui-action/provider/sys-ui-action-provider.ts +2 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IDEGrid } from '@ibiz/model-core';
|
|
1
|
+
import { IDEGrid, IAppCodeList, IDEDataExportItem } from '@ibiz/model-core';
|
|
2
2
|
import { ControlVO } from '../../../../service';
|
|
3
3
|
import { IGridEvent } from '../../event';
|
|
4
4
|
import { IGridRowState, IGridState } from '../../state';
|
|
5
5
|
import { IMDControlController } from './i-md-control.controller';
|
|
6
|
+
import { CodeListItem } from '../../../service';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 表格控制器
|
|
@@ -67,3 +68,31 @@ export interface IGridController
|
|
|
67
68
|
*/
|
|
68
69
|
validate(row: IGridRowState): Promise<boolean>;
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
interface AdditionalProperties {
|
|
73
|
+
/**
|
|
74
|
+
* 代码表模型
|
|
75
|
+
* @return {*}
|
|
76
|
+
* @author: zhujiamin
|
|
77
|
+
* @Date: 2023-11-21 14:13:45
|
|
78
|
+
*/
|
|
79
|
+
codeList?: IAppCodeList;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 代码表项
|
|
83
|
+
* @return {*}
|
|
84
|
+
* @author: zhujiamin
|
|
85
|
+
* @Date: 2023-11-21 14:13:45
|
|
86
|
+
*/
|
|
87
|
+
codeListItems?: readonly CodeListItem[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 封装的导出列模型
|
|
92
|
+
* @return {*}
|
|
93
|
+
* @author: zhujiamin
|
|
94
|
+
* @Date: 2023-11-21 19:04:27
|
|
95
|
+
*/
|
|
96
|
+
export interface IExportColumn
|
|
97
|
+
extends IDEDataExportItem,
|
|
98
|
+
AdditionalProperties {}
|
|
@@ -3,6 +3,7 @@ import { IPanelEvent } from '../../event';
|
|
|
3
3
|
import { IPanelState } from '../../state';
|
|
4
4
|
import { IControlController } from './i-control.controller';
|
|
5
5
|
import { IPanelItemController } from './panel-item';
|
|
6
|
+
import { IController } from '../i.controller';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 面板控制器
|
|
@@ -34,6 +35,14 @@ export interface IPanelController<
|
|
|
34
35
|
*/
|
|
35
36
|
data: IData;
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* 容器控制器(可能是视图控制器,也可能是部件控制器)
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2023-11-21 07:41:31
|
|
42
|
+
* @type {(IController)}
|
|
43
|
+
*/
|
|
44
|
+
container?: IController;
|
|
45
|
+
|
|
37
46
|
/**
|
|
38
47
|
* 部件加载
|
|
39
48
|
*
|
|
@@ -9,3 +9,27 @@ import { IMDControlState } from './i-md-control.state';
|
|
|
9
9
|
* @extends {IMDControlState}
|
|
10
10
|
*/
|
|
11
11
|
export interface IChartState extends IMDControlState {}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 图表数据格式
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export interface IChartData {
|
|
18
|
+
/**
|
|
19
|
+
* 序列模型id
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
_seriesModelId?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 分组名称
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
_groupName?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 分类值
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
_catalog?: string;
|
|
35
|
+
}
|
|
@@ -67,6 +67,102 @@ export interface IAppDEService {
|
|
|
67
67
|
params2?: IParams,
|
|
68
68
|
): Promise<IHttpResponse>;
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* 获取草稿数据[系统预置]
|
|
72
|
+
*
|
|
73
|
+
* @author chitanda
|
|
74
|
+
* @date 2023-11-21 16:11:34
|
|
75
|
+
* @param {IParams} context
|
|
76
|
+
* @param {(IData | IData[])} [params]
|
|
77
|
+
* @param {IParams} [params2]
|
|
78
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
79
|
+
*/
|
|
80
|
+
getDraft(
|
|
81
|
+
context: IParams,
|
|
82
|
+
params?: IData | IData[],
|
|
83
|
+
params2?: IParams,
|
|
84
|
+
): Promise<IHttpResponse>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 创建数据[系统预置]
|
|
88
|
+
*
|
|
89
|
+
* @author chitanda
|
|
90
|
+
* @date 2023-11-21 16:11:50
|
|
91
|
+
* @param {IParams} context
|
|
92
|
+
* @param {(IData | IData[])} [params]
|
|
93
|
+
* @param {IParams} [params2]
|
|
94
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
95
|
+
*/
|
|
96
|
+
create(
|
|
97
|
+
context: IParams,
|
|
98
|
+
params?: IData | IData[],
|
|
99
|
+
params2?: IParams,
|
|
100
|
+
): Promise<IHttpResponse>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 获取数据[系统预置]
|
|
104
|
+
*
|
|
105
|
+
* @author chitanda
|
|
106
|
+
* @date 2023-11-21 16:11:00
|
|
107
|
+
* @param {IParams} context
|
|
108
|
+
* @param {(IData | IData[])} [params]
|
|
109
|
+
* @param {IParams} [params2]
|
|
110
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
111
|
+
*/
|
|
112
|
+
get(
|
|
113
|
+
context: IParams,
|
|
114
|
+
params?: IData | IData[],
|
|
115
|
+
params2?: IParams,
|
|
116
|
+
): Promise<IHttpResponse>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 更新数据[系统预置]
|
|
120
|
+
*
|
|
121
|
+
* @author chitanda
|
|
122
|
+
* @date 2023-11-21 16:11:09
|
|
123
|
+
* @param {IParams} context
|
|
124
|
+
* @param {(IData | IData[])} [params]
|
|
125
|
+
* @param {IParams} [params2]
|
|
126
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
127
|
+
*/
|
|
128
|
+
update(
|
|
129
|
+
context: IParams,
|
|
130
|
+
params?: IData | IData[],
|
|
131
|
+
params2?: IParams,
|
|
132
|
+
): Promise<IHttpResponse>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 删除数据[系统预置]
|
|
136
|
+
*
|
|
137
|
+
* @author chitanda
|
|
138
|
+
* @date 2023-11-21 16:11:12
|
|
139
|
+
* @param {IParams} context
|
|
140
|
+
* @param {(IData | IData[])} [params]
|
|
141
|
+
* @param {IParams} [params2]
|
|
142
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
143
|
+
*/
|
|
144
|
+
remove(
|
|
145
|
+
context: IParams,
|
|
146
|
+
params?: IData | IData[],
|
|
147
|
+
params2?: IParams,
|
|
148
|
+
): Promise<IHttpResponse>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 获取默认数据集[系统预置]
|
|
152
|
+
*
|
|
153
|
+
* @author chitanda
|
|
154
|
+
* @date 2023-11-21 16:11:06
|
|
155
|
+
* @param {IParams} context
|
|
156
|
+
* @param {(IData | IData[])} [params]
|
|
157
|
+
* @param {IParams} [params2]
|
|
158
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
159
|
+
*/
|
|
160
|
+
fetchDefault(
|
|
161
|
+
context: IParams,
|
|
162
|
+
params?: IData | IData[],
|
|
163
|
+
params2?: IParams,
|
|
164
|
+
): Promise<IHttpResponse>;
|
|
165
|
+
|
|
70
166
|
/**
|
|
71
167
|
* 触发实体服务方法 ac 模式
|
|
72
168
|
*
|
package/src/model/utils/util.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
1
2
|
import {
|
|
2
3
|
IAppView,
|
|
3
4
|
IAppViewRef,
|
|
4
|
-
IApplication,
|
|
5
5
|
IControl,
|
|
6
6
|
IModelObject,
|
|
7
7
|
ISysPFPlugin,
|
|
@@ -118,14 +118,24 @@ export function parseUserParams(userParams: Record<string, string>): {
|
|
|
118
118
|
* 从应用里面获取插件配置参数
|
|
119
119
|
*
|
|
120
120
|
* @author chitanda
|
|
121
|
-
* @date 2023-11-
|
|
121
|
+
* @date 2023-11-21 14:11:06
|
|
122
122
|
* @export
|
|
123
|
-
* @param {
|
|
124
|
-
* @param {string}
|
|
123
|
+
* @param {string} id 插件标识
|
|
124
|
+
* @param {string} [appId] 当前所在应用标识
|
|
125
125
|
* @return {*} {ISysPFPlugin}
|
|
126
126
|
*/
|
|
127
|
-
export function getPFPlugin(
|
|
128
|
-
const
|
|
127
|
+
export function getPFPlugin(id: string, appId?: string): ISysPFPlugin {
|
|
128
|
+
const app = ibiz.hub.getApp(appId);
|
|
129
|
+
if (!app) {
|
|
130
|
+
throw new RuntimeModelError(app, '未找到应用');
|
|
131
|
+
}
|
|
132
|
+
const { model } = app;
|
|
133
|
+
if (!model.appPFPluginRefs) {
|
|
134
|
+
throw new RuntimeModelError(model, '应用未配置插件');
|
|
135
|
+
}
|
|
136
|
+
const plugin = model.appPFPluginRefs.find(
|
|
137
|
+
item => item.pluginCode!.toLowerCase() === id.toLowerCase(),
|
|
138
|
+
);
|
|
129
139
|
if (!plugin) {
|
|
130
140
|
throw new Error(`未找到插件${id}`);
|
|
131
141
|
}
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
IAppDEMethodDTOField,
|
|
6
6
|
} from '@ibiz/model-core';
|
|
7
7
|
import { ModelError } from '@ibiz-template/core';
|
|
8
|
-
import { Application } from '../../application';
|
|
9
8
|
import { AppDataEntity } from '../app-data-entity/app-data-entity';
|
|
10
9
|
import { findModelChild } from '../../model';
|
|
10
|
+
import { IAppService } from '../../interface';
|
|
11
11
|
|
|
12
12
|
interface listMap {
|
|
13
13
|
[key: number]: IData;
|
|
@@ -22,7 +22,7 @@ interface listMap {
|
|
|
22
22
|
* @class MethodDto
|
|
23
23
|
*/
|
|
24
24
|
export class MethodDto {
|
|
25
|
-
protected app?:
|
|
25
|
+
protected app?: IAppService;
|
|
26
26
|
|
|
27
27
|
protected fields!: IAppDEMethodDTOField[];
|
|
28
28
|
|
|
@@ -86,7 +86,9 @@ export class MethodDto {
|
|
|
86
86
|
const field = this.fields[i];
|
|
87
87
|
const key = field.codeName!.toLowerCase();
|
|
88
88
|
switch (field.type) {
|
|
89
|
-
case 'SIMPLE':
|
|
89
|
+
case 'SIMPLE':
|
|
90
|
+
case 'SIMPLES':
|
|
91
|
+
case 'DTO': {
|
|
90
92
|
break;
|
|
91
93
|
}
|
|
92
94
|
case 'DTOS': {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IConfigService } from '../../../interface';
|
|
1
|
+
import { IAppService, IConfigService } from '../../../interface';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* 应用配置存储服务
|
|
@@ -10,7 +9,7 @@ import { IConfigService } from '../../../interface';
|
|
|
10
9
|
* @class ConfigService
|
|
11
10
|
*/
|
|
12
11
|
export class ConfigService implements IConfigService {
|
|
13
|
-
private app:
|
|
12
|
+
private app: IAppService;
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Creates an instance of ConfigService.
|
|
@@ -2,10 +2,10 @@ import { IHttpResponse, clone } from '@ibiz-template/core';
|
|
|
2
2
|
import { IControl } from '@ibiz/model-core';
|
|
3
3
|
import { ControlVO } from '../../vo/control.vo';
|
|
4
4
|
import { UIMapField } from '../../vo/ui-map-field';
|
|
5
|
-
import {
|
|
5
|
+
import { IAppService } from '../../../interface';
|
|
6
6
|
|
|
7
7
|
export class ControlService<T extends IControl = IControl> {
|
|
8
|
-
app!:
|
|
8
|
+
app!: IAppService;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 部件模型
|
|
@@ -151,6 +151,54 @@ export class DEService implements IAppDEService {
|
|
|
151
151
|
throw new RuntimeError(`${this.model.codeName}未支持「${id}」方法`);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
getDraft(
|
|
155
|
+
context: IParams,
|
|
156
|
+
params?: IData | IData[],
|
|
157
|
+
params2?: IParams,
|
|
158
|
+
): Promise<IHttpResponse<IData>> {
|
|
159
|
+
return this.exec('GetDraft', context, params, params2);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
create(
|
|
163
|
+
context: IParams,
|
|
164
|
+
params?: IData | IData[],
|
|
165
|
+
params2?: IParams,
|
|
166
|
+
): Promise<IHttpResponse<IData>> {
|
|
167
|
+
return this.exec('Create', context, params, params2);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
get(
|
|
171
|
+
context: IParams,
|
|
172
|
+
params?: IData | IData[],
|
|
173
|
+
params2?: IParams,
|
|
174
|
+
): Promise<IHttpResponse<IData>> {
|
|
175
|
+
return this.exec('Get', context, params, params2);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
update(
|
|
179
|
+
context: IParams,
|
|
180
|
+
params?: IData | IData[],
|
|
181
|
+
params2?: IParams,
|
|
182
|
+
): Promise<IHttpResponse<IData>> {
|
|
183
|
+
return this.exec('Update', context, params, params2);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
remove(
|
|
187
|
+
context: IParams,
|
|
188
|
+
params?: IData | IData[],
|
|
189
|
+
params2?: IParams,
|
|
190
|
+
): Promise<IHttpResponse<IData>> {
|
|
191
|
+
return this.exec('Remove', context, params, params2);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
fetchDefault(
|
|
195
|
+
context: IParams,
|
|
196
|
+
params?: IData | IData[],
|
|
197
|
+
params2?: IParams,
|
|
198
|
+
): Promise<IHttpResponse<IData>> {
|
|
199
|
+
return this.exec('FetchDefault', context, params, params2);
|
|
200
|
+
}
|
|
201
|
+
|
|
154
202
|
/**
|
|
155
203
|
* 执行服务方法 ac 模式
|
|
156
204
|
*
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import { HttpResponse, RuntimeModelError } from '@ibiz-template/core';
|
|
3
3
|
import { IAppDataEntity, IAppDEMethod } from '@ibiz/model-core';
|
|
4
4
|
import { isArray } from 'lodash-es';
|
|
5
|
-
import { Application } from '../../../../application';
|
|
6
5
|
import { AppDataEntity } from '../../../app-data-entity/app-data-entity';
|
|
7
6
|
import { calcResPath } from '../../../utils';
|
|
8
7
|
import { MethodInput } from './method-input';
|
|
9
8
|
import { MethodReturn } from './method-renturn';
|
|
10
|
-
import { IAppDEService, IDataEntity } from '../../../../interface';
|
|
9
|
+
import { IAppDEService, IAppService, IDataEntity } from '../../../../interface';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* 应用实体方法
|
|
@@ -18,7 +17,7 @@ import { IAppDEService, IDataEntity } from '../../../../interface';
|
|
|
18
17
|
* @class Method
|
|
19
18
|
*/
|
|
20
19
|
export abstract class Method {
|
|
21
|
-
protected app!:
|
|
20
|
+
protected app!: IAppService;
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* 输入 DTO
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IHttpResponse, RuntimeError } from '@ibiz-template/core';
|
|
2
2
|
import { IAppDataEntity } from '@ibiz/model-core';
|
|
3
|
-
import {
|
|
4
|
-
import { IWorkFlowService } from '../../../interface';
|
|
3
|
+
import { IAppService, IWorkFlowService } from '../../../interface';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* 工作流服务
|
|
@@ -12,7 +11,7 @@ import { IWorkFlowService } from '../../../interface';
|
|
|
12
11
|
* @class WorkFlowService
|
|
13
12
|
*/
|
|
14
13
|
export class WorkFlowService implements IWorkFlowService {
|
|
15
|
-
private app!:
|
|
14
|
+
private app!: IAppService;
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* 常规基础路径
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable no-constructor-return */
|
|
2
|
+
import { createUUID } from 'qx-util';
|
|
3
|
+
import { IDEChartSeries } from '@ibiz/model-core';
|
|
4
|
+
import { IChartData } from '../../../interface';
|
|
5
|
+
|
|
6
|
+
// 更新属性,缺的补充定义
|
|
7
|
+
function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
8
|
+
keys.forEach(key => {
|
|
9
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
10
|
+
Object.defineProperty(target, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: undefined,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class ChartData implements IChartData {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
[key: string | symbol]: any;
|
|
23
|
+
|
|
24
|
+
_seriesModelId?: string;
|
|
25
|
+
|
|
26
|
+
_catalog?: string;
|
|
27
|
+
|
|
28
|
+
_groupName?: string;
|
|
29
|
+
|
|
30
|
+
_uuid?: string;
|
|
31
|
+
|
|
32
|
+
constructor(
|
|
33
|
+
deData: IData,
|
|
34
|
+
seriesModel?: IDEChartSeries,
|
|
35
|
+
catalog?: string,
|
|
36
|
+
groupName?: string,
|
|
37
|
+
) {
|
|
38
|
+
this._seriesModelId = seriesModel?.id;
|
|
39
|
+
|
|
40
|
+
this._catalog = catalog;
|
|
41
|
+
|
|
42
|
+
this._groupName = groupName;
|
|
43
|
+
|
|
44
|
+
this._uuid = createUUID();
|
|
45
|
+
|
|
46
|
+
return new Proxy<ChartData>(this, {
|
|
47
|
+
set(target, p, value): boolean {
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(deData, p)) {
|
|
49
|
+
deData[p] = value;
|
|
50
|
+
} else {
|
|
51
|
+
target[p] = value;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
get(target, p, _receiver): unknown {
|
|
57
|
+
if (target[p] !== undefined) {
|
|
58
|
+
return target[p];
|
|
59
|
+
}
|
|
60
|
+
if (deData[p] !== undefined) {
|
|
61
|
+
return deData[p];
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
ownKeys(target): ArrayLike<string | symbol> {
|
|
66
|
+
// 整合所有并排除重复
|
|
67
|
+
const allKeys = [
|
|
68
|
+
...new Set([...Object.keys(target), ...Object.keys(deData)]),
|
|
69
|
+
];
|
|
70
|
+
updateKeyDefine(target, allKeys);
|
|
71
|
+
return allKeys;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChartData } from './chart-data';
|
package/src/service/vo/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
StringUtil,
|
|
3
|
+
RuntimeModelError,
|
|
4
|
+
ModelError,
|
|
5
|
+
RuntimeError,
|
|
6
|
+
} from '@ibiz-template/core';
|
|
2
7
|
import { IAppDEUIAction, IUIAction } from '@ibiz/model-core';
|
|
3
8
|
import { OpenAppViewCommand } from '../../command';
|
|
4
9
|
import { IUILogicParams, IUIActionResult, IModalData } from '../../interface';
|
|
@@ -61,6 +66,15 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
61
66
|
|
|
62
67
|
break;
|
|
63
68
|
}
|
|
69
|
+
case 'PRINT':
|
|
70
|
+
await this.executePrint(action, args);
|
|
71
|
+
break;
|
|
72
|
+
case 'DATAIMP':
|
|
73
|
+
actionResult = await this.executeDataImport(action, args);
|
|
74
|
+
break;
|
|
75
|
+
case 'DATAEXP':
|
|
76
|
+
await this.executeDataExport(action, args);
|
|
77
|
+
break;
|
|
64
78
|
case 'OTHER':
|
|
65
79
|
actionResult = this.doOther(action, args);
|
|
66
80
|
break;
|
|
@@ -98,4 +112,142 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
98
112
|
}
|
|
99
113
|
throw new RuntimeModelError(action, '自定义类型缺少配置脚本代码');
|
|
100
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 执行打印行为
|
|
118
|
+
* @protected
|
|
119
|
+
* @param {IAppDEUIAction} action
|
|
120
|
+
* @param {IUILogicParams} args
|
|
121
|
+
* @return {*}
|
|
122
|
+
*/
|
|
123
|
+
protected async executePrint(
|
|
124
|
+
action: IAppDEUIAction,
|
|
125
|
+
args: IUILogicParams,
|
|
126
|
+
): Promise<void> {
|
|
127
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
128
|
+
action.appDataEntityId!,
|
|
129
|
+
);
|
|
130
|
+
const appDEPrint = appDataEntity.appDEPrints?.find(print => {
|
|
131
|
+
return print.id === action.appDEPrintId;
|
|
132
|
+
});
|
|
133
|
+
if (appDEPrint) {
|
|
134
|
+
let requestUrl: string = '';
|
|
135
|
+
const { context } = args;
|
|
136
|
+
if (context && context[appDataEntity.codeName!.toLowerCase()]) {
|
|
137
|
+
// TODO 临时写死printdata, 非标准,后续优化
|
|
138
|
+
requestUrl += `/${appDataEntity.codeName2?.toLowerCase()}/printdata/${
|
|
139
|
+
context[appDataEntity.codeName!.toLowerCase()]
|
|
140
|
+
}?srfprinttag=${appDEPrint.codeName}`;
|
|
141
|
+
} else {
|
|
142
|
+
throw new RuntimeError('没有找到数据主键');
|
|
143
|
+
}
|
|
144
|
+
const res = await ibiz.net.request(requestUrl, {
|
|
145
|
+
method: 'get',
|
|
146
|
+
responseType: 'blob',
|
|
147
|
+
});
|
|
148
|
+
if (res.ok) {
|
|
149
|
+
const link = window.URL.createObjectURL(res.data as Blob);
|
|
150
|
+
window.open(link, '_blank');
|
|
151
|
+
} else {
|
|
152
|
+
throw new RuntimeError('打印失败');
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
throw new RuntimeError('没有找到实体打印项');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 执行导入行为
|
|
161
|
+
* @protected
|
|
162
|
+
* @param {IAppDEUIAction} action
|
|
163
|
+
* @param {IUILogicParams} args
|
|
164
|
+
* @return {*}
|
|
165
|
+
*/
|
|
166
|
+
protected async executeDataImport(
|
|
167
|
+
action: IAppDEUIAction,
|
|
168
|
+
_args: IUILogicParams,
|
|
169
|
+
): Promise<IUIActionResult> {
|
|
170
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
171
|
+
action.appDataEntityId!,
|
|
172
|
+
);
|
|
173
|
+
const appDEDataImport = appDataEntity.appDEDataImports?.find(
|
|
174
|
+
dataImport => dataImport.id === action.appDEDataImportId,
|
|
175
|
+
);
|
|
176
|
+
if (appDEDataImport) {
|
|
177
|
+
const modal = ibiz.overlay.createModal(
|
|
178
|
+
'DataImport',
|
|
179
|
+
{
|
|
180
|
+
dismiss: () => modal.dismiss(),
|
|
181
|
+
appDataEntity,
|
|
182
|
+
dataImport: appDEDataImport,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
width: 'auto',
|
|
186
|
+
placement: 'center',
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
modal.present();
|
|
190
|
+
await modal.onWillDismiss();
|
|
191
|
+
return {
|
|
192
|
+
refresh: true,
|
|
193
|
+
refreshMode: 1,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
throw new RuntimeError('没有找到实体导入项');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 执行导出行为
|
|
201
|
+
* @protected
|
|
202
|
+
* @param {IAppDEUIAction} action
|
|
203
|
+
* @param {IUILogicParams} args
|
|
204
|
+
* @return {*}
|
|
205
|
+
*/
|
|
206
|
+
protected async executeDataExport(
|
|
207
|
+
action: IAppDEUIAction,
|
|
208
|
+
_args: IUILogicParams,
|
|
209
|
+
): Promise<void> {
|
|
210
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
211
|
+
action.appDataEntityId!,
|
|
212
|
+
);
|
|
213
|
+
const appDEDataExport = appDataEntity.appDEDataExports?.find(dataExport => {
|
|
214
|
+
return dataExport.id === action.appDEDataExportId;
|
|
215
|
+
});
|
|
216
|
+
if (appDEDataExport) {
|
|
217
|
+
// TODO 临时写死fetchdefault,应该从appDEDataExport的主表格上获取加载行为,但现在缺主表格模型,后续优化
|
|
218
|
+
const url: string = `/${appDataEntity.codeName2?.toLowerCase()}/exportdata/fetchdefault?srfexporttag=${
|
|
219
|
+
appDEDataExport.codeName
|
|
220
|
+
}`;
|
|
221
|
+
// 参数
|
|
222
|
+
const params: IData = {
|
|
223
|
+
page: 0,
|
|
224
|
+
size: appDEDataExport.maxRowCount ? appDEDataExport.maxRowCount : 1000,
|
|
225
|
+
responseType: 'blob',
|
|
226
|
+
};
|
|
227
|
+
const res = await ibiz.net.request(url, {
|
|
228
|
+
method: 'post',
|
|
229
|
+
data: params,
|
|
230
|
+
responseType: 'blob',
|
|
231
|
+
});
|
|
232
|
+
if (res.status === 200) {
|
|
233
|
+
let fileName = `${appDataEntity.logicName}表.xlsx`;
|
|
234
|
+
fileName = decodeURIComponent(fileName);
|
|
235
|
+
const blob = new Blob([res.data as Blob], {
|
|
236
|
+
type: 'application/vnd.ms-excel',
|
|
237
|
+
});
|
|
238
|
+
const elink = document.createElement('a');
|
|
239
|
+
elink.download = fileName;
|
|
240
|
+
elink.style.display = 'none';
|
|
241
|
+
elink.href = URL.createObjectURL(blob);
|
|
242
|
+
document.body.appendChild(elink);
|
|
243
|
+
elink.click();
|
|
244
|
+
URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
245
|
+
document.body.removeChild(elink);
|
|
246
|
+
} else {
|
|
247
|
+
throw new RuntimeError('导出请求失败');
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
throw new RuntimeError('没有找到实体导出项');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
101
253
|
}
|