@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,10 +1,10 @@
|
|
|
1
1
|
import { IChartSeriesPie } from '@ibiz/model-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PieSeriesOption, SeriesOption } from 'echarts';
|
|
3
3
|
import { BaseSeriesGenerator, CatalogData } from './base-series-generator';
|
|
4
4
|
|
|
5
5
|
interface pieSeriesData {
|
|
6
6
|
name: string;
|
|
7
|
-
value: IData
|
|
7
|
+
value: Array<number | IData | undefined>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -30,13 +30,9 @@ export class PieSeriesGenerator extends BaseSeriesGenerator<IChartSeriesPie> {
|
|
|
30
30
|
catalogData.forEach((catalog, key) => {
|
|
31
31
|
temData.push({
|
|
32
32
|
name: key,
|
|
33
|
-
value: [catalog.value, catalog.
|
|
33
|
+
value: [catalog.value, catalog.chartData],
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
return temData;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
getSrfkeyByParams(params: ECElementEvent): string {
|
|
40
|
-
return (params.value as IData)[1];
|
|
41
|
-
}
|
|
42
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IChartSeriesRadar } from '@ibiz/model-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RadarSeriesOption, SeriesOption } from 'echarts';
|
|
3
3
|
import { mergeDeepRight } from 'ramda';
|
|
4
4
|
import { BaseSeriesGenerator, DEFAULT_GROUP } from './base-series-generator';
|
|
5
5
|
import { RadarCoordSystem } from './radar-coord-system';
|
|
@@ -53,7 +53,7 @@ export class RadarSeriesGenerator extends BaseSeriesGenerator<IChartSeriesRadar>
|
|
|
53
53
|
const catalogData = groupData[group];
|
|
54
54
|
const value = radar.indicatorKeys.map(key => {
|
|
55
55
|
if (catalogData.has(key)) {
|
|
56
|
-
return catalogData.get(key);
|
|
56
|
+
return catalogData.get(key)!.value;
|
|
57
57
|
}
|
|
58
58
|
return 0;
|
|
59
59
|
});
|
|
@@ -73,8 +73,4 @@ export class RadarSeriesGenerator extends BaseSeriesGenerator<IChartSeriesRadar>
|
|
|
73
73
|
|
|
74
74
|
return options as SeriesOption;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
getSrfkeyByParams(params: ECElementEvent): string {
|
|
78
|
-
return (params.value as IData)[1];
|
|
79
|
-
}
|
|
80
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IChartExpBar, IDEChart } from '@ibiz/model-core';
|
|
1
|
+
import { IChartExpBar, IDEChart, INavigatable } from '@ibiz/model-core';
|
|
2
2
|
import {
|
|
3
3
|
IChartExpBarState,
|
|
4
4
|
IChartExpBarEvent,
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
INavViewMsg,
|
|
7
7
|
} from '../../../interface';
|
|
8
8
|
import { ExpBarControlController } from './exp-bar.controller';
|
|
9
|
+
import { ChartController } from '../chart';
|
|
10
|
+
import { convertNavData } from '../../../utils';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* 图表导航栏控制器
|
|
@@ -23,6 +25,90 @@ export class ChartExpBarController
|
|
|
23
25
|
>
|
|
24
26
|
implements IChartExpBarController
|
|
25
27
|
{
|
|
28
|
+
/**
|
|
29
|
+
* 导航页面首次打开且没有回显时,
|
|
30
|
+
* 默认取第一条数据进行导航
|
|
31
|
+
* 对于不同的导航,第一条可导航的数据可能定义不同,可以重写改方法。
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2023-08-10 03:58:15
|
|
34
|
+
* @protected
|
|
35
|
+
*/
|
|
36
|
+
protected navByFirstItem(): void {
|
|
37
|
+
const data = this.xDataController.state.items[0];
|
|
38
|
+
if (!data) {
|
|
39
|
+
// 导航视图传空让他导航占位绘制空界面
|
|
40
|
+
this.state.srfnav = '';
|
|
41
|
+
this._evt.emit('onNavViewChange', {
|
|
42
|
+
navViewMsg: {
|
|
43
|
+
key: '',
|
|
44
|
+
isCache: this.isCache,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// 默认选中并激活第一项(这里的第一项是我们自己封装的chartData)
|
|
50
|
+
const activeSeriesGenerator = (
|
|
51
|
+
this.xDataController as ChartController
|
|
52
|
+
).generator.seriesGenerators.find(generator => {
|
|
53
|
+
return generator.chartDataArr.length > 0 && generator.model.navAppViewId;
|
|
54
|
+
});
|
|
55
|
+
if (activeSeriesGenerator) {
|
|
56
|
+
this.xDataController.setActive(activeSeriesGenerator.chartDataArr[0]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 解析参数
|
|
62
|
+
*
|
|
63
|
+
* @author zk
|
|
64
|
+
* @date 2023-05-29 04:05:52
|
|
65
|
+
* @param {IDETabViewPanel} tabViewPanel
|
|
66
|
+
* @return {*}
|
|
67
|
+
* @memberof ExpBarControlController
|
|
68
|
+
*/
|
|
69
|
+
prepareParams(
|
|
70
|
+
XDataModel: INavigatable & { appDataEntityId?: string },
|
|
71
|
+
data: IData,
|
|
72
|
+
context: IContext,
|
|
73
|
+
params: IParams,
|
|
74
|
+
): { context: IContext; params: IParams } {
|
|
75
|
+
const { context: tempContext, params: tempParams } = super.prepareParams(
|
|
76
|
+
XDataModel,
|
|
77
|
+
data,
|
|
78
|
+
context,
|
|
79
|
+
params,
|
|
80
|
+
);
|
|
81
|
+
// 序列上或配置导航相关参数
|
|
82
|
+
if (data._seriesModelId) {
|
|
83
|
+
const seriesModel = (XDataModel as IDEChart).dechartSerieses?.find(
|
|
84
|
+
series => {
|
|
85
|
+
return series.id === data._seriesModelId;
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
if (seriesModel) {
|
|
89
|
+
const { navigateContexts, navigateParams } = seriesModel;
|
|
90
|
+
// 序列上配的导航视图参数和上下文
|
|
91
|
+
const tempContext2 = convertNavData(
|
|
92
|
+
navigateContexts,
|
|
93
|
+
data,
|
|
94
|
+
params,
|
|
95
|
+
tempContext,
|
|
96
|
+
);
|
|
97
|
+
const tempParams2 = convertNavData(
|
|
98
|
+
navigateParams,
|
|
99
|
+
data,
|
|
100
|
+
params,
|
|
101
|
+
tempParams,
|
|
102
|
+
);
|
|
103
|
+
return {
|
|
104
|
+
context: Object.assign(tempContext.clone(), tempContext2),
|
|
105
|
+
params: tempParams2,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { context: tempContext, params: tempParams };
|
|
110
|
+
}
|
|
111
|
+
|
|
26
112
|
/**
|
|
27
113
|
* 获取导航视图
|
|
28
114
|
*
|
|
@@ -37,11 +123,18 @@ export class ChartExpBarController
|
|
|
37
123
|
context: IContext,
|
|
38
124
|
params: IParams,
|
|
39
125
|
): INavViewMsg {
|
|
40
|
-
|
|
41
|
-
|
|
126
|
+
let viewModelId;
|
|
127
|
+
if (data._seriesModelId) {
|
|
128
|
+
const seriesModel = (this.XDataModel as IDEChart).dechartSerieses?.find(
|
|
129
|
+
series => {
|
|
130
|
+
return series.id === data._seriesModelId;
|
|
131
|
+
},
|
|
132
|
+
);
|
|
133
|
+
viewModelId = seriesModel?.navAppViewId;
|
|
134
|
+
}
|
|
42
135
|
const result = this.prepareParams(this.XDataModel!, data, context, params);
|
|
43
136
|
return {
|
|
44
|
-
key: data
|
|
137
|
+
key: data._uuid,
|
|
45
138
|
context: result.context,
|
|
46
139
|
params: result.params,
|
|
47
140
|
viewId: viewModelId,
|
|
@@ -34,6 +34,7 @@ export class SearchFormController
|
|
|
34
34
|
|
|
35
35
|
protected async onCreated(): Promise<void> {
|
|
36
36
|
await super.onCreated();
|
|
37
|
+
this.preprocessLayoutPanel();
|
|
37
38
|
// 实例部件服务
|
|
38
39
|
this.service = new SearchFormService(this.model);
|
|
39
40
|
await this.service.init(this.context);
|
|
@@ -159,4 +160,67 @@ export class SearchFormController
|
|
|
159
160
|
await this.onSearchButtonClick();
|
|
160
161
|
}
|
|
161
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 根据搜索表单的按钮位置和按钮样式
|
|
166
|
+
* 预处理部件布局面板模型
|
|
167
|
+
* @author lxm
|
|
168
|
+
* @date 2023-11-21 04:17:43
|
|
169
|
+
* @protected
|
|
170
|
+
* @return {*}
|
|
171
|
+
*/
|
|
172
|
+
protected preprocessLayoutPanel(): void {
|
|
173
|
+
if (!this.controlPanel) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const { searchButtonStyle } = this.model;
|
|
177
|
+
let deleteRight = false;
|
|
178
|
+
let deleteBottom = false;
|
|
179
|
+
const searchButtonPos = this.model.searchButtonPos || 'RIGHT';
|
|
180
|
+
deleteRight = searchButtonPos === 'BOTTOM';
|
|
181
|
+
deleteBottom = searchButtonPos !== 'BOTTOM';
|
|
182
|
+
|
|
183
|
+
if (searchButtonStyle === 'NONE') {
|
|
184
|
+
deleteRight = true;
|
|
185
|
+
deleteBottom = true;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 递归面板项
|
|
190
|
+
* @author lxm
|
|
191
|
+
* @date 2023-11-21 04:16:36
|
|
192
|
+
* @param {IData} parent
|
|
193
|
+
*/
|
|
194
|
+
const recursivePanelItems = (parent: IData): void => {
|
|
195
|
+
let children: IData[] | undefined;
|
|
196
|
+
let childrenKey = '';
|
|
197
|
+
['rootPanelItems', 'panelItems'].find(key => {
|
|
198
|
+
if (parent[key]) {
|
|
199
|
+
children = parent[key];
|
|
200
|
+
childrenKey = key;
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
});
|
|
205
|
+
if (children && children.length > 0) {
|
|
206
|
+
const newArr: IData[] = [];
|
|
207
|
+
children.forEach((item: IData) => {
|
|
208
|
+
const isDelete =
|
|
209
|
+
(deleteRight && item.id === 'control_buttons_right') ||
|
|
210
|
+
(deleteBottom && item.id === 'control_buttons_bottom');
|
|
211
|
+
if (!isDelete) {
|
|
212
|
+
newArr.push(item);
|
|
213
|
+
recursivePanelItems(item);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
if (newArr.length < children.length) {
|
|
217
|
+
parent[childrenKey] = newArr;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
if (deleteBottom || deleteRight) {
|
|
223
|
+
recursivePanelItems(this.controlPanel);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
162
226
|
}
|
|
@@ -8,7 +8,12 @@ import {
|
|
|
8
8
|
RuntimeError,
|
|
9
9
|
RuntimeModelError,
|
|
10
10
|
} from '@ibiz-template/core';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
IDEGrid,
|
|
13
|
+
IDEGridGroupColumn,
|
|
14
|
+
IDEGridColumn,
|
|
15
|
+
IDEDataExport,
|
|
16
|
+
} from '@ibiz/model-core';
|
|
12
17
|
import { clone } from 'ramda';
|
|
13
18
|
import { GridFieldColumnController } from '../grid-column/grid-field-column/grid-field-column.controller';
|
|
14
19
|
import { GridColumnController } from './grid-column.controller';
|
|
@@ -26,6 +31,7 @@ import {
|
|
|
26
31
|
CodeListItem,
|
|
27
32
|
MDCtrlLoadParams,
|
|
28
33
|
IGridRowState,
|
|
34
|
+
IExportColumn,
|
|
29
35
|
} from '../../../../interface';
|
|
30
36
|
import { calcDeCodeNameById } from '../../../../model';
|
|
31
37
|
import { getGridColumnProvider } from '../../../../register';
|
|
@@ -134,6 +140,22 @@ export class GridController
|
|
|
134
140
|
*/
|
|
135
141
|
aggTitle: string = '合计';
|
|
136
142
|
|
|
143
|
+
/**
|
|
144
|
+
* 数据导出对象
|
|
145
|
+
* @author lxm
|
|
146
|
+
* @date 2023-08-07 04:11:00
|
|
147
|
+
* @type {IDEDataExport}
|
|
148
|
+
*/
|
|
149
|
+
dataExport: IDEDataExport | undefined;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 数据导出列
|
|
153
|
+
* @author lxm
|
|
154
|
+
* @date 2023-08-07 04:11:00
|
|
155
|
+
* @type {IDEDataExport}
|
|
156
|
+
*/
|
|
157
|
+
allExportColumns: IExportColumn[] | undefined;
|
|
158
|
+
|
|
137
159
|
/**
|
|
138
160
|
* 分组代码表项集合
|
|
139
161
|
* @author lxm
|
|
@@ -913,6 +935,35 @@ export class GridController
|
|
|
913
935
|
return res.data;
|
|
914
936
|
}
|
|
915
937
|
|
|
938
|
+
/**
|
|
939
|
+
* 初始化数据导出列
|
|
940
|
+
* @return {*}
|
|
941
|
+
* @author: zhujiamin
|
|
942
|
+
* @Date: 2023-11-21 18:54:16
|
|
943
|
+
*/
|
|
944
|
+
async findAllExportColumns(
|
|
945
|
+
dataExport: IDEDataExport,
|
|
946
|
+
): Promise<IExportColumn[] | undefined> {
|
|
947
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
948
|
+
const exportColumnsPromises: Promise<IExportColumn>[] | undefined =
|
|
949
|
+
dataExport.dedataExportItems?.map(async item => {
|
|
950
|
+
const tempExportColumn: IExportColumn = { ...item };
|
|
951
|
+
if (item.codeListId) {
|
|
952
|
+
// 加载代码表模型
|
|
953
|
+
tempExportColumn.codeList = app.codeList.getCodeList(item.codeListId);
|
|
954
|
+
tempExportColumn.codeListItems = await app.codeList.get(
|
|
955
|
+
item.codeListId,
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
return tempExportColumn;
|
|
959
|
+
});
|
|
960
|
+
// 使用 Promise.all 等待所有 Promise 解析
|
|
961
|
+
if (exportColumnsPromises) {
|
|
962
|
+
return Promise.all(exportColumnsPromises);
|
|
963
|
+
}
|
|
964
|
+
return undefined;
|
|
965
|
+
}
|
|
966
|
+
|
|
916
967
|
/**
|
|
917
968
|
* 数据导出
|
|
918
969
|
*
|
|
@@ -921,35 +972,55 @@ export class GridController
|
|
|
921
972
|
* @memberof MDControlController
|
|
922
973
|
*/
|
|
923
974
|
async exportData(_args: { event: MouseEvent; params: IData }): Promise<void> {
|
|
924
|
-
//
|
|
925
|
-
|
|
926
|
-
this.
|
|
975
|
+
// 初始化导出对象
|
|
976
|
+
if (this.model.dedataExportId && !this.dataExport) {
|
|
977
|
+
this.dataExport = this.dataEntity.appDEDataExports?.find(dataExport => {
|
|
978
|
+
return dataExport.id === this.model.dedataExportId;
|
|
979
|
+
});
|
|
980
|
+
if (this.dataExport) {
|
|
981
|
+
this.allExportColumns = await this.findAllExportColumns(
|
|
982
|
+
this.dataExport,
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
927
986
|
// 数据格式化
|
|
928
987
|
const formatExcelData = (data: IData[]): IData[] => {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
988
|
+
const codeListMap: Map<string, readonly CodeListItem[]> = new Map();
|
|
989
|
+
if (this.allExportColumns && this.allExportColumns.length > 0) {
|
|
990
|
+
this.allExportColumns?.forEach((exportColumn: IExportColumn) => {
|
|
991
|
+
if (exportColumn.codeListItems) {
|
|
992
|
+
codeListMap.set(
|
|
993
|
+
exportColumn.appDEFieldId!,
|
|
994
|
+
exportColumn.codeListItems!,
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
} else {
|
|
999
|
+
Object.keys(this.fieldColumns).forEach((key: string) => {
|
|
1000
|
+
if (this.fieldColumns[key].codeList) {
|
|
1001
|
+
codeListMap.set(key, this.fieldColumns[key].codeListItems!);
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
935
1005
|
const cloneData = clone(
|
|
936
1006
|
data.map(item => {
|
|
937
1007
|
return item.getOrigin();
|
|
938
1008
|
}),
|
|
939
1009
|
);
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1010
|
+
cloneData.forEach(item => {
|
|
1011
|
+
const fields = Object.keys(item);
|
|
1012
|
+
fields.forEach((key: string) => {
|
|
1013
|
+
if (codeListMap.get(key)) {
|
|
1014
|
+
item[key] =
|
|
1015
|
+
codeListMap.get(key)!.find(_item => {
|
|
1016
|
+
return _item.value === item[key];
|
|
1017
|
+
})?.text || item[key];
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
});
|
|
951
1021
|
return cloneData;
|
|
952
1022
|
};
|
|
1023
|
+
// 获取导出数据
|
|
953
1024
|
const getExportData = async (): Promise<IData[]> => {
|
|
954
1025
|
const type = _args.params?.type;
|
|
955
1026
|
let data: IData[] = [];
|
|
@@ -988,14 +1059,26 @@ export class GridController
|
|
|
988
1059
|
});
|
|
989
1060
|
});
|
|
990
1061
|
};
|
|
1062
|
+
|
|
991
1063
|
// 头部id数组
|
|
992
|
-
|
|
993
|
-
(key: string) => items[key].model.id!,
|
|
994
|
-
);
|
|
1064
|
+
let filterVal: string[] = [];
|
|
995
1065
|
// 表头数组
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1066
|
+
let header: string[] = [];
|
|
1067
|
+
if (this.allExportColumns && this.allExportColumns.length > 0) {
|
|
1068
|
+
filterVal = this.allExportColumns.map(
|
|
1069
|
+
(column: IExportColumn) => column.appDEFieldId!,
|
|
1070
|
+
);
|
|
1071
|
+
header = this.allExportColumns.map(
|
|
1072
|
+
(column: IExportColumn) => column.caption!,
|
|
1073
|
+
);
|
|
1074
|
+
} else {
|
|
1075
|
+
filterVal = Object.keys(this.fieldColumns).map(
|
|
1076
|
+
(key: string) => this.fieldColumns[key].model.id!,
|
|
1077
|
+
);
|
|
1078
|
+
header = Object.keys(this.fieldColumns).map(
|
|
1079
|
+
(key: string) => this.fieldColumns[key].model.caption!,
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
999
1082
|
// 二维数组
|
|
1000
1083
|
const data = formatArrayData(filterVal, await getExportData());
|
|
1001
1084
|
await exportData(header, data, this.model.logicName!);
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
IPanelItemProvider,
|
|
16
16
|
IControlProvider,
|
|
17
17
|
IPanelItemContainerController,
|
|
18
|
+
IController,
|
|
18
19
|
} from '../../../../interface';
|
|
19
20
|
import { getAllPanelField } from '../../../../model';
|
|
20
21
|
import { getPanelItemProvider } from '../../../../register';
|
|
@@ -22,6 +23,7 @@ import { PanelData } from '../../../../service/vo';
|
|
|
22
23
|
import { ControlController } from '../../../common';
|
|
23
24
|
import { PanelNotifyState } from '../../../constant';
|
|
24
25
|
import { ControllerEvent } from '../../../utils';
|
|
26
|
+
import { CTX } from '../../../ctx';
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* 面板部件控制器
|
|
@@ -72,6 +74,8 @@ export class PanelController<
|
|
|
72
74
|
*/
|
|
73
75
|
inputData: IData | undefined;
|
|
74
76
|
|
|
77
|
+
container?: IController;
|
|
78
|
+
|
|
75
79
|
/**
|
|
76
80
|
* 面板数据
|
|
77
81
|
*
|
|
@@ -84,6 +88,17 @@ export class PanelController<
|
|
|
84
88
|
return this.state.data;
|
|
85
89
|
}
|
|
86
90
|
|
|
91
|
+
constructor(
|
|
92
|
+
model: T,
|
|
93
|
+
context: IContext,
|
|
94
|
+
params: IParams,
|
|
95
|
+
ctx: CTX,
|
|
96
|
+
container?: IController,
|
|
97
|
+
) {
|
|
98
|
+
super(model, context, params, ctx);
|
|
99
|
+
this.container = container;
|
|
100
|
+
}
|
|
101
|
+
|
|
87
102
|
protected initState(): void {
|
|
88
103
|
super.initState();
|
|
89
104
|
this.state.data = {};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
IPortalMessage,
|
|
4
4
|
RuntimeError,
|
|
5
5
|
} from '@ibiz-template/core';
|
|
6
|
-
import { IAppDataEntity } from '@ibiz/model-core';
|
|
6
|
+
import { IAppDEDataImport, IAppDataEntity } from '@ibiz/model-core';
|
|
7
7
|
|
|
8
8
|
// 异步导入URL
|
|
9
9
|
const asyncImportUrl = 'asyncimportdata2';
|
|
@@ -65,10 +65,14 @@ function listenAsyncAction(id: string): Promise<void> {
|
|
|
65
65
|
export async function asyncImportData(
|
|
66
66
|
file: File,
|
|
67
67
|
appDataEntity: IAppDataEntity,
|
|
68
|
+
dataImport?: IAppDEDataImport,
|
|
68
69
|
): Promise<void> {
|
|
69
70
|
const data = new FormData();
|
|
70
71
|
data.append('file', file);
|
|
71
|
-
|
|
72
|
+
let url = `${appDataEntity.codeName2!.toLowerCase()}/${asyncImportUrl}`;
|
|
73
|
+
if (dataImport?.codeName) {
|
|
74
|
+
url += `?srfimporttag=${dataImport.codeName}`;
|
|
75
|
+
}
|
|
72
76
|
const res = await ibiz.net.request(url, {
|
|
73
77
|
method: 'post',
|
|
74
78
|
data,
|
|
@@ -95,10 +99,14 @@ export async function asyncImportData(
|
|
|
95
99
|
export async function importData(
|
|
96
100
|
file: File,
|
|
97
101
|
appDataEntity: IAppDataEntity,
|
|
102
|
+
dataImport?: IAppDEDataImport,
|
|
98
103
|
): Promise<ImportDataResult> {
|
|
99
104
|
const data = new FormData();
|
|
100
105
|
data.append('file', file);
|
|
101
|
-
|
|
106
|
+
let url = `${appDataEntity.codeName2!.toLowerCase()}/${importUrl}`;
|
|
107
|
+
if (dataImport?.codeName) {
|
|
108
|
+
url += `?srfimporttag=${dataImport.codeName}`;
|
|
109
|
+
}
|
|
102
110
|
const res = await ibiz.net.request(url, {
|
|
103
111
|
method: 'post',
|
|
104
112
|
data,
|
|
@@ -187,6 +187,14 @@ export class MDViewEngine extends ViewEngineBase {
|
|
|
187
187
|
await this.exportData(args);
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
|
+
if (key === SysUIActionTag.SEARCH) {
|
|
191
|
+
await this.searchForm.search();
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
if (key === SysUIActionTag.RESET) {
|
|
195
|
+
await this.searchForm.reset();
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
190
198
|
if (key === SysUIActionTag.COPY) {
|
|
191
199
|
this.copy(args);
|
|
192
200
|
return null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IAppDataEntity, IAppView, IApplication } from '@ibiz/model-core';
|
|
2
|
-
import { Application } from '../../../application';
|
|
3
2
|
import { Convert } from '../../../hub';
|
|
4
3
|
import { ModelLoaderProvider } from '../../provider';
|
|
5
4
|
import { IAppConfigService } from '../i-app-config-service/i-app-config-service';
|
|
6
5
|
import { IHubController } from '../../controller';
|
|
7
6
|
import { IConfigService } from '../../service';
|
|
7
|
+
import { IAppService } from '../i-app-service/i-app-service';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 应用 hub 服务
|
|
@@ -152,9 +152,9 @@ export interface IAppHubService {
|
|
|
152
152
|
* @author chitanda
|
|
153
153
|
* @date 2023-04-23 15:04:46
|
|
154
154
|
* @param {string} [appId=ibiz.env.appId]
|
|
155
|
-
* @return {*} {Promise<
|
|
155
|
+
* @return {*} {Promise<IAppService>}
|
|
156
156
|
*/
|
|
157
|
-
getAppAsync(appId?: string): Promise<
|
|
157
|
+
getAppAsync(appId?: string): Promise<IAppService>;
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* 获取应用实例
|
|
@@ -162,7 +162,7 @@ export interface IAppHubService {
|
|
|
162
162
|
* @author chitanda
|
|
163
163
|
* @date 2023-04-23 15:04:24
|
|
164
164
|
* @param {(string | IApplication)} [app]
|
|
165
|
-
* @return {*} {
|
|
165
|
+
* @return {*} {IAppService}
|
|
166
166
|
*/
|
|
167
|
-
getApp(app?: string | IApplication):
|
|
167
|
+
getApp(app?: string | IApplication): IAppService;
|
|
168
168
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Net } from '@ibiz-template/core';
|
|
2
|
+
import {
|
|
3
|
+
IAppDEUIAction,
|
|
4
|
+
IAppFunc,
|
|
5
|
+
IApplication,
|
|
6
|
+
IDEOPPriv,
|
|
7
|
+
IDEUILogic,
|
|
8
|
+
} from '@ibiz/model-core';
|
|
2
9
|
import {
|
|
3
10
|
AuthorityService,
|
|
4
11
|
CodeListService,
|
|
@@ -24,6 +31,15 @@ export interface IAppService {
|
|
|
24
31
|
*/
|
|
25
32
|
readonly appId: string;
|
|
26
33
|
|
|
34
|
+
/**
|
|
35
|
+
* 应用模型
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2023-11-21 15:11:33
|
|
39
|
+
* @type {IApplication}
|
|
40
|
+
*/
|
|
41
|
+
readonly model: IApplication;
|
|
42
|
+
|
|
27
43
|
/**
|
|
28
44
|
* 请求服务
|
|
29
45
|
*
|
|
@@ -68,4 +84,59 @@ export interface IAppService {
|
|
|
68
84
|
* @type {AuthorityService}
|
|
69
85
|
*/
|
|
70
86
|
readonly authority: AuthorityService;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 应用实体名称到应用实体代码名称的映射
|
|
90
|
+
*
|
|
91
|
+
* @author chitanda
|
|
92
|
+
* @date 2023-11-21 15:11:18
|
|
93
|
+
* @type {Map<string, string>}
|
|
94
|
+
*/
|
|
95
|
+
readonly deName2DeCodeName: Map<string, string>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 根据 id 查找应用功能
|
|
99
|
+
*
|
|
100
|
+
* @author chitanda
|
|
101
|
+
* @date 2023-04-20 17:04:24
|
|
102
|
+
* @param {string} id
|
|
103
|
+
* @return {*} {(IAppFunc | null)}
|
|
104
|
+
*/
|
|
105
|
+
getAppFunc(id: string): IAppFunc | null;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 获取界面行为模型
|
|
109
|
+
* @author lxm
|
|
110
|
+
* @date 2023-04-28 05:44:14
|
|
111
|
+
* @param {string} actionId
|
|
112
|
+
* @param {string} [_appDataEntityId]
|
|
113
|
+
* @return {*}
|
|
114
|
+
*/
|
|
115
|
+
getUIAction(actionId: string): Promise<IAppDEUIAction | undefined>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 获取操作标识模型
|
|
119
|
+
* @author lxm
|
|
120
|
+
* @date 2023-05-10 11:24:17
|
|
121
|
+
* @param {string} id
|
|
122
|
+
* @param {string} [appDataEntityId]
|
|
123
|
+
* @return {*} {(Promise<IDEOPPriv | undefined>)}
|
|
124
|
+
*/
|
|
125
|
+
getOPPriv(
|
|
126
|
+
id: string,
|
|
127
|
+
appDataEntityId?: string,
|
|
128
|
+
): Promise<IDEOPPriv | undefined>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 查找实体的界面逻辑模型
|
|
132
|
+
* @author lxm
|
|
133
|
+
* @date 2023-06-14 07:20:30
|
|
134
|
+
* @param {string} deUILogicId
|
|
135
|
+
* @param {string} appDataEntityId
|
|
136
|
+
* @return {*} {(Promise<IDEUILogic | undefined>)}
|
|
137
|
+
*/
|
|
138
|
+
getDEUILogic(
|
|
139
|
+
deUILogicId: string,
|
|
140
|
+
appDataEntityId: string,
|
|
141
|
+
): Promise<IDEUILogic | undefined>;
|
|
71
142
|
}
|