@ibiz-template/runtime 0.3.1 → 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.
- package/dist/index.esm.js +603 -278
- 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/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +1 -0
- 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/form/edit-form/edit-form.service.js +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +1 -1
- 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 +31 -2
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +83 -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/common/i-global-config/i-global-grid-config.d.ts +9 -0
- package/out/interface/common/i-global-config/i-global-grid-config.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/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 +16 -8
- 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/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +5 -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/config/global-config.ts +1 -0
- 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/form/edit-form/edit-form.service.ts +1 -1
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +1 -1
- package/src/controller/control/form/search-form/search-form.controller.ts +64 -0
- package/src/controller/control/grid/grid/grid.controller.ts +121 -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/common/i-global-config/i-global-grid-config.ts +10 -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/service/service/i-app-de.service.ts +96 -0
- package/src/model/utils/util.ts +18 -8
- 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/tree-node-data/tree-data-set-node-data.ts +7 -1
- 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,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
|
}
|