@ibiz-template/runtime 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/index.esm.js +583 -273
  2. package/dist/index.system.min.js +2 -2
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/app-hub.d.ts +5 -5
  5. package/out/app-hub.d.ts.map +1 -1
  6. package/out/app-hub.js +2 -2
  7. package/out/constant/sys-uiaction-tag.d.ts +4 -0
  8. package/out/constant/sys-uiaction-tag.d.ts.map +1 -1
  9. package/out/constant/sys-uiaction-tag.js +4 -0
  10. package/out/controller/common/control/control.controller.js +2 -2
  11. package/out/controller/control/app-menu/app-menu.controller.d.ts +2 -3
  12. package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
  13. package/out/controller/control/form/search-form/search-form.controller.d.ts +9 -0
  14. package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
  15. package/out/controller/control/form/search-form/search-form.controller.js +59 -0
  16. package/out/controller/control/grid/grid/grid.controller.d.ts +23 -2
  17. package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
  18. package/out/controller/control/grid/grid/grid.controller.js +73 -21
  19. package/out/controller/control/panel/panel/panel.controller.d.ts +4 -1
  20. package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
  21. package/out/controller/control/panel/panel/panel.controller.js +17 -16
  22. package/out/controller/utils/data-file-util/data-file-util.d.ts +3 -3
  23. package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
  24. package/out/controller/utils/data-file-util/data-file-util.js +10 -4
  25. package/out/engine/md-view.engine.d.ts.map +1 -1
  26. package/out/engine/md-view.engine.js +8 -0
  27. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +5 -5
  28. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  29. package/out/interface/common/i-app-service/i-app-service.d.ts +53 -0
  30. package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
  31. package/out/interface/controller/controller/control/i-grid.controller.d.ts +27 -1
  32. package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
  33. package/out/interface/controller/controller/control/i-panel.controller.d.ts +8 -0
  34. package/out/interface/controller/controller/control/i-panel.controller.d.ts.map +1 -1
  35. package/out/interface/service/service/i-app-de.service.d.ts +66 -0
  36. package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
  37. package/out/model/utils/util.d.ts +5 -5
  38. package/out/model/utils/util.d.ts.map +1 -1
  39. package/out/model/utils/util.js +14 -6
  40. package/out/service/dto/method.dto.d.ts +2 -2
  41. package/out/service/dto/method.dto.d.ts.map +1 -1
  42. package/out/service/dto/method.dto.js +3 -1
  43. package/out/service/service/config/config.service.d.ts.map +1 -1
  44. package/out/service/service/control/control.service.d.ts +2 -2
  45. package/out/service/service/control/control.service.d.ts.map +1 -1
  46. package/out/service/service/entity/de.service.d.ts +6 -0
  47. package/out/service/service/entity/de.service.d.ts.map +1 -1
  48. package/out/service/service/entity/de.service.js +18 -0
  49. package/out/service/service/entity/method/method.d.ts +2 -3
  50. package/out/service/service/entity/method/method.d.ts.map +1 -1
  51. package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
  52. package/out/ui-action/provider/front-ui-action-provider.d.ts +24 -0
  53. package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
  54. package/out/ui-action/provider/front-ui-action-provider.js +128 -1
  55. package/out/ui-action/provider/sys-ui-action-provider.d.ts.map +1 -1
  56. package/out/ui-action/provider/sys-ui-action-provider.js +2 -0
  57. package/package.json +2 -2
  58. package/src/app-hub.ts +5 -5
  59. package/src/constant/sys-uiaction-tag.ts +4 -0
  60. package/src/controller/common/control/control.controller.ts +2 -2
  61. package/src/controller/control/app-menu/app-menu.controller.ts +2 -2
  62. package/src/controller/control/form/search-form/search-form.controller.ts +64 -0
  63. package/src/controller/control/grid/grid/grid.controller.ts +110 -27
  64. package/src/controller/control/panel/panel/panel.controller.ts +15 -0
  65. package/src/controller/utils/data-file-util/data-file-util.ts +11 -3
  66. package/src/engine/md-view.engine.ts +8 -0
  67. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +5 -5
  68. package/src/interface/common/i-app-service/i-app-service.ts +71 -0
  69. package/src/interface/controller/controller/control/i-grid.controller.ts +30 -1
  70. package/src/interface/controller/controller/control/i-panel.controller.ts +9 -0
  71. package/src/interface/service/service/i-app-de.service.ts +96 -0
  72. package/src/model/utils/util.ts +16 -6
  73. package/src/service/dto/method.dto.ts +5 -3
  74. package/src/service/service/config/config.service.ts +2 -3
  75. package/src/service/service/control/control.service.ts +2 -2
  76. package/src/service/service/entity/de.service.ts +48 -0
  77. package/src/service/service/entity/method/method.ts +2 -3
  78. package/src/service/service/work-flow/work-flow.service.ts +2 -3
  79. package/src/ui-action/provider/front-ui-action-provider.ts +153 -1
  80. package/src/ui-action/provider/sys-ui-action-provider.ts +2 -0
@@ -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
  }
@@ -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
  *
@@ -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
  *
@@ -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-01 17:11:28
121
+ * @date 2023-11-21 14:11:06
122
122
  * @export
123
- * @param {IApplication} app
124
- * @param {string} id
123
+ * @param {string} id 插件标识
124
+ * @param {string} [appId] 当前所在应用标识
125
125
  * @return {*} {ISysPFPlugin}
126
126
  */
127
- export function getPFPlugin(app: IApplication, id: string): ISysPFPlugin {
128
- const plugin = app.appPFPluginRefs?.find(item => item.id === id);
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?: Application;
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 { Application } from '../../../application';
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: Application;
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 { Application } from '../../../application';
5
+ import { IAppService } from '../../../interface';
6
6
 
7
7
  export class ControlService<T extends IControl = IControl> {
8
- app!: Application;
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!: Application;
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 { Application } from '../../../application';
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!: Application;
14
+ private app!: IAppService;
16
15
 
17
16
  /**
18
17
  * 常规基础路径
@@ -1,4 +1,9 @@
1
- import { StringUtil, RuntimeModelError, ModelError } from '@ibiz-template/core';
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
  }
@@ -49,6 +49,8 @@ export class SysUIActionProvider extends UIActionProviderBase {
49
49
  ['GRIDVIEW_SAVEROWACTION', 'SaveRow'],
50
50
  ['APP_LOGIN', 'Login'],
51
51
  ['APP_LOGOUT', 'logout'],
52
+ ['UTIL_RESET', 'Reset'],
53
+ ['UTIL_SEARCH', 'Search'],
52
54
  ]);
53
55
 
54
56
  async execAction(