@ibiz-template/runtime 0.7.41-alpha.7 → 0.7.41-alpha.9
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 +535 -356
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/editor/code-list-editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/code-list-editor.controller.js +6 -0
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +3 -0
- package/out/controller/control/data-view/data-view.controller.d.ts +9 -11
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +30 -37
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +5 -1
- package/out/controller/control/kanban/kanban.controller.d.ts +31 -12
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +146 -50
- package/out/controller/ctx/ctx.js +2 -2
- package/out/engine/md-view.engine.d.ts +2 -2
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +2 -1
- package/out/engine/view-base.engine.d.ts +2 -2
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/interface/api/call/i-api-index-view.call.d.ts +20 -0
- package/out/interface/api/call/i-api-index-view.call.d.ts.map +1 -0
- package/out/interface/api/call/i-api-index-view.call.js +1 -0
- package/out/interface/api/call/i-api-md-custom-view.call.d.ts +79 -0
- package/out/interface/api/call/i-api-md-custom-view.call.d.ts.map +1 -0
- package/out/interface/api/call/i-api-md-custom-view.call.js +1 -0
- package/out/interface/api/call/i-api-opt-view.call.d.ts +10 -0
- package/out/interface/api/call/i-api-opt-view.call.d.ts.map +1 -1
- package/out/interface/api/call/i-api-portal-view.call.d.ts +20 -0
- package/out/interface/api/call/i-api-portal-view.call.d.ts.map +1 -0
- package/out/interface/api/call/i-api-portal-view.call.js +1 -0
- package/out/interface/api/call/index.d.ts +3 -0
- package/out/interface/api/call/index.d.ts.map +1 -1
- package/out/interface/api/controller/control/i-api-edit-form.controller.d.ts +1 -0
- package/out/interface/api/controller/control/i-api-edit-form.controller.d.ts.map +1 -1
- package/out/interface/api/controller/control/i-api-kanban.controller.d.ts +2 -0
- package/out/interface/api/controller/control/i-api-kanban.controller.d.ts.map +1 -1
- package/out/interface/api/util/i-api-file-util.d.ts +3 -3
- package/out/interface/api/util/i-api-file-util.d.ts.map +1 -1
- package/out/interface/common/i-modal/i-modal.d.ts +3 -0
- package/out/interface/common/i-modal/i-modal.d.ts.map +1 -1
- package/out/interface/controller/controller/common/i-drag-change-info.d.ts +22 -14
- package/out/interface/controller/controller/common/i-drag-change-info.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +43 -8
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/util/i-app-util/i-app-util.d.ts +6 -0
- package/out/interface/util/i-app-util/i-app-util.d.ts.map +1 -1
- package/out/locale/en/index.d.ts +1 -0
- package/out/locale/en/index.d.ts.map +1 -1
- package/out/locale/en/index.js +1 -0
- package/out/locale/zh-CN/index.d.ts +1 -0
- package/out/locale/zh-CN/index.d.ts.map +1 -1
- package/out/locale/zh-CN/index.js +1 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +2 -1
- package/out/service/utils/util/util.d.ts +7 -0
- package/out/service/utils/util/util.d.ts.map +1 -1
- package/out/service/utils/util/util.js +26 -0
- package/out/ui-action/provider/custom-ui-action-provider.js +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +69 -43
- package/out/ui-action/provider/ui-action-provider-base.d.ts +1 -0
- package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
- package/out/ui-action/provider/ui-action-provider-base.js +20 -2
- package/out/ui-action/uiaction-util.js +2 -2
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +5 -1
- package/out/utils/modal/modal.d.ts +3 -0
- package/out/utils/modal/modal.d.ts.map +1 -1
- package/out/utils/modal/modal.js +7 -0
- package/out/utils/open-redirect-view/open-redirect-view.js +3 -3
- package/package.json +5 -5
|
@@ -82,3 +82,29 @@ export function convertListMapToArray(obj) {
|
|
|
82
82
|
});
|
|
83
83
|
return result;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* @description 获取没有预置字段的上下文
|
|
87
|
+
* @export
|
|
88
|
+
* @param {IContext} context
|
|
89
|
+
* @returns {*} {IData}
|
|
90
|
+
*/
|
|
91
|
+
export function getTempContext(context) {
|
|
92
|
+
const result = {};
|
|
93
|
+
// 预置上下文字段
|
|
94
|
+
const presetContext = [
|
|
95
|
+
'srfappid',
|
|
96
|
+
'srfsimple',
|
|
97
|
+
'srfviewid',
|
|
98
|
+
'srfrunmode',
|
|
99
|
+
'srfreadonly',
|
|
100
|
+
'srfnavctrlid',
|
|
101
|
+
'srfsessionid',
|
|
102
|
+
'srfnavlogicid',
|
|
103
|
+
];
|
|
104
|
+
Object.keys(context).forEach(key => {
|
|
105
|
+
if (!presetContext.includes(key)) {
|
|
106
|
+
result[key] = context[key];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
@@ -6,7 +6,7 @@ export class CustomUIActionProvider extends UIActionProviderBase {
|
|
|
6
6
|
const { scriptCode } = action;
|
|
7
7
|
const { context, params, data, event, view, ctrl } = args;
|
|
8
8
|
if (scriptCode) {
|
|
9
|
-
const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl }, scriptCode));
|
|
9
|
+
const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl, action }, scriptCode));
|
|
10
10
|
return result || {};
|
|
11
11
|
}
|
|
12
12
|
throw new RuntimeModelError(action, ibiz.i18n.t('runtime.uiAction.missingConfigurationScriptCode'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,cAAc,EACd,WAAW,EACX,aAAa,EAEd,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EACd,eAAe,EAKhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKjE;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA8F3B;;;;;;;;OAQG;cACa,OAAO,CACrB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAoB3B;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IA0EhB;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA+B3B;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IA4EhB;;;;;;;;OAQG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA4D3B;;;;;;;;OAQG;cACa,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAuD3B;;;;;;;;OAQG;IACH,SAAS,CAAC,kBAAkB,CAC1B,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,WAAW,CAAC,EAAE,aAAa,GAC1B,WAAW,GAAG,SAAS;IAc1B;;;;;;;;OAQG;cACa,UAAU,CACxB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;CA0B5B"}
|
|
@@ -5,6 +5,7 @@ import { ScriptFactory } from '../../utils';
|
|
|
5
5
|
import { UIActionProviderBase } from './ui-action-provider-base';
|
|
6
6
|
import { openDataImport } from '../../controller/utils';
|
|
7
7
|
import { SysUIActionTag } from '../../constant';
|
|
8
|
+
import { calcResPath } from '../../service';
|
|
8
9
|
/**
|
|
9
10
|
* 前台调用界面行为适配器
|
|
10
11
|
*
|
|
@@ -96,7 +97,7 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
96
97
|
return result || {};
|
|
97
98
|
}
|
|
98
99
|
if (scriptCode) {
|
|
99
|
-
const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl }, scriptCode));
|
|
100
|
+
const result = (await ScriptFactory.asyncExecScriptFn({ context, params, data, el: event === null || event === void 0 ? void 0 : event.target, view, ctrl, action }, scriptCode));
|
|
100
101
|
return result || {};
|
|
101
102
|
}
|
|
102
103
|
throw new RuntimeModelError(action, ibiz.i18n.t('runtime.uiAction.missingConfigurationScriptCode'));
|
|
@@ -109,52 +110,63 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
109
110
|
* @return {*}
|
|
110
111
|
*/
|
|
111
112
|
async executePrint(action, args) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (appDEPrint) {
|
|
120
|
-
let requestUrl = '';
|
|
121
|
-
if (resultContext &&
|
|
122
|
-
resultContext[appDataEntity.codeName.toLowerCase()]) {
|
|
123
|
-
// TODO 临时写死printdata, 非标准,后续优化
|
|
124
|
-
requestUrl += `/${appDataEntity.deapicodeName2}/printdata/${resultContext[appDataEntity.codeName.toLowerCase()]}`;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.dataPrimaryKey'));
|
|
128
|
-
}
|
|
129
|
-
const res = await ibiz.net.request(requestUrl, {
|
|
130
|
-
method: 'get',
|
|
131
|
-
responseType: 'blob',
|
|
132
|
-
params: Object.assign({ srfprinttag: appDEPrint.codeName }, resultParams),
|
|
113
|
+
const execute = async (data) => {
|
|
114
|
+
var _a;
|
|
115
|
+
// 处理参数
|
|
116
|
+
const { resultContext, resultParams } = await this.handleParams(action, args.context, data, args.params);
|
|
117
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
|
|
118
|
+
const appDEPrint = (_a = appDataEntity.appDEPrints) === null || _a === void 0 ? void 0 : _a.find(print => {
|
|
119
|
+
return print.id === action.appDEPrintId;
|
|
133
120
|
});
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
121
|
+
if (appDEPrint) {
|
|
122
|
+
let requestUrl = '';
|
|
123
|
+
if (resultContext &&
|
|
124
|
+
resultContext[appDataEntity.codeName.toLowerCase()]) {
|
|
125
|
+
// TODO 临时写死printdata, 非标准,后续优化
|
|
126
|
+
const resPath = calcResPath(resultContext, appDataEntity);
|
|
127
|
+
requestUrl += `${resPath}/${appDataEntity.deapicodeName2}/printdata/${resultContext[appDataEntity.codeName.toLowerCase()]}`;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.dataPrimaryKey'));
|
|
131
|
+
}
|
|
132
|
+
const app = await ibiz.hub.getAppAsync(action.appId);
|
|
133
|
+
const res = await app.net.request(requestUrl, {
|
|
134
|
+
method: 'get',
|
|
135
|
+
responseType: 'blob',
|
|
136
|
+
params: Object.assign({ srfprinttag: appDEPrint.codeName }, resultParams),
|
|
137
|
+
});
|
|
138
|
+
if (res.ok) {
|
|
139
|
+
// 存在srfcontenttype参数需响应文件
|
|
140
|
+
if (resultParams && resultParams.srfcontenttype) {
|
|
141
|
+
const fileName = ibiz.util.file.getFileName(res);
|
|
142
|
+
const href = URL.createObjectURL(res.data);
|
|
143
|
+
const a = document.createElement('a');
|
|
144
|
+
a.href = href;
|
|
145
|
+
a.download = fileName;
|
|
146
|
+
document.body.appendChild(a);
|
|
147
|
+
a.click();
|
|
148
|
+
document.body.removeChild(a);
|
|
149
|
+
URL.revokeObjectURL(href);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const link = window.URL.createObjectURL(res.data);
|
|
153
|
+
window.open(link, '_blank');
|
|
154
|
+
}
|
|
146
155
|
}
|
|
147
156
|
else {
|
|
148
|
-
|
|
149
|
-
window.open(link, '_blank');
|
|
157
|
+
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.printFailure'));
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
160
|
else {
|
|
153
|
-
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.
|
|
161
|
+
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.physicalPrint'));
|
|
154
162
|
}
|
|
163
|
+
};
|
|
164
|
+
const isMultiData = ['MULTIKEY', 'MULTIDATA'].includes(action.actionTarget);
|
|
165
|
+
if (isMultiData) {
|
|
166
|
+
await Promise.all(args.data.map(item => execute([item])));
|
|
155
167
|
}
|
|
156
168
|
else {
|
|
157
|
-
|
|
169
|
+
await execute(args.data);
|
|
158
170
|
}
|
|
159
171
|
}
|
|
160
172
|
/**
|
|
@@ -191,16 +203,29 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
191
203
|
* @return {*}
|
|
192
204
|
*/
|
|
193
205
|
async executeDataExport(action, args) {
|
|
194
|
-
var _a;
|
|
206
|
+
var _a, _b;
|
|
195
207
|
// 处理参数
|
|
196
|
-
const { resultContext, resultParams } = await this.handleParams(action, args.context, args.data, args.params);
|
|
208
|
+
const { resultContext, resultParams, presetParams } = await this.handleParams(action, args.context, args.data, args.params);
|
|
197
209
|
const appDataEntity = await ibiz.hub.getAppDataEntity(action.appDataEntityId, action.appId);
|
|
198
210
|
const appDEDataExport = (_a = appDataEntity.appDEDataExports) === null || _a === void 0 ? void 0 : _a.find(dataExport => {
|
|
199
211
|
return dataExport.id === action.appDEDataExportId;
|
|
200
212
|
});
|
|
201
213
|
if (appDEDataExport) {
|
|
202
|
-
//
|
|
203
|
-
|
|
214
|
+
// 导出数据集优先通过界面行为参数srfexportdataset获取,若未配置则获取当前界面行为实体默认数据集,都没有则抛出异常
|
|
215
|
+
let exportDatasetCodeName = presetParams.srfexportdataset;
|
|
216
|
+
if (!exportDatasetCodeName) {
|
|
217
|
+
const defaultDataset = (_b = appDataEntity.appDEMethods) === null || _b === void 0 ? void 0 : _b.find(appDEMethod => {
|
|
218
|
+
return appDEMethod.dataSetTag === 'Default';
|
|
219
|
+
});
|
|
220
|
+
if (defaultDataset) {
|
|
221
|
+
exportDatasetCodeName = defaultDataset.codeName;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (!exportDatasetCodeName) {
|
|
225
|
+
throw new RuntimeError(ibiz.i18n.t('runtime.uiAction.exportWithNoDataSet'));
|
|
226
|
+
}
|
|
227
|
+
const resPath = calcResPath(resultContext, appDataEntity);
|
|
228
|
+
const url = `${resPath}/${appDataEntity.deapicodeName2}/exportdata/${exportDatasetCodeName}`;
|
|
204
229
|
// 查询参数
|
|
205
230
|
const queryParam = { srfexporttag: appDEDataExport.codeName };
|
|
206
231
|
if (resultContext === null || resultContext === void 0 ? void 0 : resultContext.srfdatatype) {
|
|
@@ -208,7 +233,8 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
208
233
|
}
|
|
209
234
|
// 参数
|
|
210
235
|
const params = Object.assign(Object.assign({ page: 0, size: appDEDataExport.maxRowCount ? appDEDataExport.maxRowCount : 1000 }, args.params), resultParams);
|
|
211
|
-
const
|
|
236
|
+
const app = await ibiz.hub.getAppAsync(action.appId);
|
|
237
|
+
const res = await app.net.request(url, {
|
|
212
238
|
method: 'post',
|
|
213
239
|
responseType: 'blob',
|
|
214
240
|
params: queryParam,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAgC,MAAM,kBAAkB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,8BAAsB,oBAAqB,YAAW,iBAAiB;IACrE;;;;;;;OAOG;IACG,IAAI,CACR,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA4F3B;;;;;;;;OAQG;IACH,SAAS,CAAC,iBAAiB,CACzB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,eAAe,GACtB,cAAc;IASjB;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CACnB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,eAAe,GACpB,eAAe;IAUlB;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC;IAWnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAOvC;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,QAAQ,CAAC;QACxB,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAkHF;;;;;;;;;OASG;IACH,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,MAAM,GAAG,SAAS;IA4CrB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAc5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-prototype-builtins */
|
|
1
2
|
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
3
|
import { calcDeCodeNameById } from '../../model';
|
|
3
4
|
import { execUILogic } from '../../ui-logic';
|
|
@@ -26,7 +27,7 @@ export class UIActionProviderBase {
|
|
|
26
27
|
refreshMode: action.refreshMode,
|
|
27
28
|
closeView: action.closeEditView,
|
|
28
29
|
};
|
|
29
|
-
const { view } = args;
|
|
30
|
+
const { context, params, data, view } = args;
|
|
30
31
|
if (action.closeEditView) {
|
|
31
32
|
view.state.isClosing = true;
|
|
32
33
|
}
|
|
@@ -46,6 +47,11 @@ export class UIActionProviderBase {
|
|
|
46
47
|
}
|
|
47
48
|
// ** 执行不同类型的界面行为独有逻辑,并且合并result
|
|
48
49
|
const _result = await this.execAction(action, args);
|
|
50
|
+
// 预置属性相关处理
|
|
51
|
+
const { presetParams } = await this.handleParams(action, context, data, params);
|
|
52
|
+
if (presetParams.ignoredirtycheck === 'true') {
|
|
53
|
+
view.modal.ignoreDismissCheck = true;
|
|
54
|
+
}
|
|
49
55
|
Object.assign(result, _result);
|
|
50
56
|
// 如果是取消操作则中断后续处理逻辑。
|
|
51
57
|
if (result.cancel === true) {
|
|
@@ -236,7 +242,19 @@ export class UIActionProviderBase {
|
|
|
236
242
|
navContexts,
|
|
237
243
|
navParams,
|
|
238
244
|
}, tempContext);
|
|
239
|
-
|
|
245
|
+
// 预置属性处理
|
|
246
|
+
// ignoredirtycheck
|
|
247
|
+
const presetParams = {};
|
|
248
|
+
if (resultParams.hasOwnProperty('ignoredirtycheck')) {
|
|
249
|
+
presetParams.ignoredirtycheck = resultParams.ignoredirtycheck;
|
|
250
|
+
delete resultParams.ignoredirtycheck;
|
|
251
|
+
}
|
|
252
|
+
// srfexportdataset
|
|
253
|
+
if (resultParams.hasOwnProperty('srfexportdataset')) {
|
|
254
|
+
presetParams.srfexportdataset = resultParams.srfexportdataset;
|
|
255
|
+
delete resultParams.srfexportdataset;
|
|
256
|
+
}
|
|
257
|
+
return { resultContext, resultData, resultParams, presetParams };
|
|
240
258
|
}
|
|
241
259
|
/**
|
|
242
260
|
* 计算消息信息(动态,多语言资源)
|
|
@@ -46,8 +46,8 @@ export class UIActionUtil {
|
|
|
46
46
|
var _a, _b;
|
|
47
47
|
const result = await this.exec(actionId, params, appId);
|
|
48
48
|
if (result.closeView) {
|
|
49
|
-
//
|
|
50
|
-
|
|
49
|
+
// 编辑器失焦后,调整数据后直接点击关闭按钮导致无法触发自动保存通过modal中preDismiss钩子执行,shouldDismiss钩子仅负责计算是否可关闭视图参数,不能混为一谈
|
|
50
|
+
params.view.modal.ignoreDismissCheck = true;
|
|
51
51
|
params.view.closeView({ ok: true });
|
|
52
52
|
}
|
|
53
53
|
else if (result.refresh) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAmBL,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IA2BN,SAAS,CAAC,KAAK,EAAE,UAAU;IA1BvC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;;;;OAKG;gBACmB,KAAK,EAAE,UAAU;IA+FvC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IASpD;;;;;;;;;OASG;IACG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBxD;;;;;;;;;;;;;OAaG;cACa,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
|
package/out/ui-logic/ui-logic.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
|
-
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { IBizContext, ModelError, RuntimeModelError, } from '@ibiz-template/core';
|
|
3
|
+
import { clone } from 'ramda';
|
|
3
4
|
import { UILogicContext } from './ui-logic-context';
|
|
4
5
|
import { AppendParamNode, BindParamNode, CopyParamNode, DataSetNode, DEActionNode, DebugParamNode, DEUIActionNode, EndNode, ExecuteDELogicNode, MsgBoxNode, PFPluginNode, PrepareJSParamNode, RawJSCodeNode, RenewParamNode, ResetParamNode, SortParamNode, StartNode, ThrowExceptionNode, ViewCtrlFireEventNode, ViewCtrlInvokeNode, } from './ui-logic-node';
|
|
5
6
|
import { UILogicParam } from './ui-logic-param/ui-logic-param';
|
|
@@ -156,6 +157,9 @@ export class UILogic {
|
|
|
156
157
|
* @return {*} {Promise<IData>}
|
|
157
158
|
*/
|
|
158
159
|
async exec(parameters) {
|
|
160
|
+
// 克隆传入应用上下文参数和视图参数
|
|
161
|
+
parameters.context = IBizContext.create(parameters.context);
|
|
162
|
+
parameters.params = clone(parameters.params || {});
|
|
159
163
|
const ctx = new UILogicContext(this.params, parameters);
|
|
160
164
|
this.initLogicParams(ctx);
|
|
161
165
|
const { startDEUILogicNodeId } = this.model;
|
|
@@ -18,6 +18,9 @@ export declare class Modal implements IModal {
|
|
|
18
18
|
viewUsage: number;
|
|
19
19
|
ignoreDismissCheck: boolean;
|
|
20
20
|
hooks: {
|
|
21
|
+
preDismiss: AsyncSeriesHook<[], {
|
|
22
|
+
allowNext?: boolean | undefined;
|
|
23
|
+
}>;
|
|
21
24
|
shouldDismiss: AsyncSeriesHook<[], {
|
|
22
25
|
allowClose?: boolean | undefined;
|
|
23
26
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/utils/modal/modal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErD,KAAK,eAAe,GAAG;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC,CAAC;AACF,qBAAa,KAAM,YAAW,MAAM;IAClC,IAAI,EAAE,QAAQ,CAAkB;IAEhC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAK;IAEtB,kBAAkB,EAAE,OAAO,CAAS;IAEpC,KAAK
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/utils/modal/modal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErD,KAAK,eAAe,GAAG;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC,CAAC;AACF,qBAAa,KAAM,YAAW,MAAM;IAClC,IAAI,EAAE,QAAQ,CAAkB;IAEhC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAK;IAEtB,kBAAkB,EAAE,OAAO,CAAS;IAEpC,KAAK;;;;;;;;MAIH;gBAEU,IAAI,EAAE,eAAe;IAejC;;;;OAIG;IACH,QAAQ,SAAU,UAAU,KAAG,IAAI,CAKjC;IAEF;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAIlD,OAAO,CAAC,IAAI,GAAE,UAAoC,GAAG,OAAO,CAAC,OAAO,CAAC;IA2B3E;;;;;OAKG;IACH,SAAS,CAAC,OAAO,IAAI,IAAI;CAK1B"}
|
package/out/utils/modal/modal.js
CHANGED
|
@@ -7,6 +7,7 @@ export class Modal {
|
|
|
7
7
|
this.viewUsage = 4;
|
|
8
8
|
this.ignoreDismissCheck = false;
|
|
9
9
|
this.hooks = {
|
|
10
|
+
preDismiss: new AsyncSeriesHook(),
|
|
10
11
|
shouldDismiss: new AsyncSeriesHook(),
|
|
11
12
|
beforeDismiss: new AsyncSeriesHook(),
|
|
12
13
|
};
|
|
@@ -42,6 +43,11 @@ export class Modal {
|
|
|
42
43
|
}
|
|
43
44
|
async dismiss(data = { ok: false, data: [] }) {
|
|
44
45
|
const context = {};
|
|
46
|
+
// 关闭前执行操作
|
|
47
|
+
await this.hooks.preDismiss.call(context);
|
|
48
|
+
if (context.allowNext === false) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
45
51
|
if (this.ignoreDismissCheck !== true) {
|
|
46
52
|
// 判断是否执行关闭
|
|
47
53
|
await this.hooks.shouldDismiss.call(context);
|
|
@@ -64,6 +70,7 @@ export class Modal {
|
|
|
64
70
|
* @protected
|
|
65
71
|
*/
|
|
66
72
|
destroy() {
|
|
73
|
+
this.hooks.preDismiss.clear();
|
|
67
74
|
this.hooks.shouldDismiss.clear();
|
|
68
75
|
this.hooks.beforeDismiss.clear();
|
|
69
76
|
}
|
|
@@ -362,7 +362,7 @@ export async function calcDERdTag(entity, rdView, params, data) {
|
|
|
362
362
|
// 自定义重定向
|
|
363
363
|
if (typeFieldId) {
|
|
364
364
|
const { codeName } = findFieldById(entity, typeFieldId);
|
|
365
|
-
const value = data[codeName.toLowerCase()]
|
|
365
|
+
const value = `${data[codeName.toLowerCase()]}`;
|
|
366
366
|
if (notNilEmpty(value)) {
|
|
367
367
|
// 如果是 view://协议开头直接返回,示例: view://{app}/{viewcodename}?srfwftag={wftag}
|
|
368
368
|
if (value.startsWith('view://')) {
|
|
@@ -389,13 +389,13 @@ export async function calcDERdTag(entity, rdView, params, data) {
|
|
|
389
389
|
// 从索引属性获取重定向视图类型
|
|
390
390
|
if (entity.indexTypeAppDEFieldId) {
|
|
391
391
|
const { codeName } = findFieldById(entity, entity.indexTypeAppDEFieldId);
|
|
392
|
-
typeValue = data[codeName.toLowerCase()]
|
|
392
|
+
typeValue = `${data[codeName.toLowerCase()]}`;
|
|
393
393
|
}
|
|
394
394
|
if (isNilOrEmpty(typeValue)) {
|
|
395
395
|
// 从多表单属性判断重定向视图类型
|
|
396
396
|
if (entity.formTypeAppDEFieldId) {
|
|
397
397
|
const { codeName } = findFieldById(entity, entity.formTypeAppDEFieldId);
|
|
398
|
-
typeValue = data[codeName.toLowerCase()]
|
|
398
|
+
typeValue = `${data[codeName.toLowerCase()]}`;
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
if (notNilEmpty(typeValue)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.9",
|
|
4
4
|
"description": "运行时逻辑库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"jsencrypt": "^3.3.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ibiz-template/core": "^0.7.41-alpha.
|
|
41
|
-
"@ibiz/model-core": "^0.1.
|
|
40
|
+
"@ibiz-template/core": "^0.7.41-alpha.9",
|
|
41
|
+
"@ibiz/model-core": "^0.1.78",
|
|
42
42
|
"@types/animejs": "^3.1.12",
|
|
43
43
|
"@types/path-browserify": "^1.0.2",
|
|
44
44
|
"@types/qs": "^6.9.11",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@ibiz-template/core": "^0.6.0",
|
|
59
|
-
"@ibiz/model-core": "^0.1.
|
|
59
|
+
"@ibiz/model-core": "^0.1.78",
|
|
60
60
|
"async-validator": "^4.2.5",
|
|
61
61
|
"dayjs": "^1.11.7",
|
|
62
62
|
"echarts": "^5.4.3",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"qx-util": "^0.4.8",
|
|
69
69
|
"ramda": "^0.29.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b3e1bdd577e6a55f67748a769f1b9123e7b557c4"
|
|
72
72
|
}
|