@ibiz-template/runtime 0.5.7-alpha.8 → 0.5.7-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 +156 -31
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts.map +1 -1
- package/out/application.js +0 -1
- package/out/command/app/open-app-view/open-app-view.d.ts +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +4 -3
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +4 -3
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +27 -3
- package/out/hub/config/app-view-config-service.d.ts +14 -0
- package/out/hub/config/app-view-config-service.d.ts.map +1 -1
- package/out/hub/config/app-view-config-service.js +27 -11
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts +4 -0
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts.map +1 -1
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts +9 -0
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/service/service/i-mark-open-data.service.d.ts +20 -1
- package/out/interface/service/service/i-mark-open-data.service.d.ts.map +1 -1
- package/out/interface/service/service/index.d.ts +1 -1
- package/out/interface/service/service/index.d.ts.map +1 -1
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts +26 -1
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts.map +1 -1
- package/out/service/service/mark-open-data/mark-open-data.service.js +45 -0
- package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts +1 -1
- package/out/service/utils/dyna-sys-params/dyna-sys-params.js +4 -4
- package/out/ui-action/provider/front-ui-action-provider.d.ts +10 -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 +25 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +11 -1
- package/package.json +3 -3
- package/src/application.ts +0 -2
- package/src/command/app/open-app-view/open-app-view.ts +6 -3
- package/src/controller/control/grid/grid/grid.controller.ts +4 -5
- package/src/controller/control/search-bar/search-bar.controller.ts +44 -3
- package/src/hub/config/app-view-config-service.ts +29 -0
- package/src/interface/common/i-app-view-config-service/i-app-view-config-service.ts +4 -0
- package/src/interface/common/i-open-view-options/i-open-view-options.ts +10 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +8 -0
- package/src/interface/service/service/i-mark-open-data.service.ts +31 -1
- package/src/interface/service/service/index.ts +1 -0
- package/src/service/service/mark-open-data/mark-open-data.service.ts +61 -1
- package/src/service/utils/dyna-sys-params/dyna-sys-params.ts +6 -6
- package/src/ui-action/provider/front-ui-action-provider.ts +25 -1
- package/src/utils/open-redirect-view/open-redirect-view.ts +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.5.7-alpha.
|
|
3
|
+
"version": "0.5.7-alpha.9",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"author": "chitanda",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@ibiz-template/core": "^0.5.7-alpha.
|
|
33
|
+
"@ibiz-template/core": "^0.5.7-alpha.9",
|
|
34
34
|
"@ibiz/model-core": "^0.1.9",
|
|
35
35
|
"@types/animejs": "^3.1.12",
|
|
36
36
|
"@types/path-browserify": "^1.0.2",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"animejs": "^3.2.2"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "733e1918e2e640661bb99dd1c79cf19e0a25ada9"
|
|
68
68
|
}
|
package/src/application.ts
CHANGED
|
@@ -95,7 +95,7 @@ export class OpenAppViewCommand {
|
|
|
95
95
|
case 'POPUPAPP':
|
|
96
96
|
throw new ModelError(appView, '未支持的视图打开模式: POPUPAPP');
|
|
97
97
|
case 'POPOVER':
|
|
98
|
-
return this.openPopover(appView,
|
|
98
|
+
return this.openPopover(appView, context, params, opts);
|
|
99
99
|
case 'DRAWER_LEFT':
|
|
100
100
|
case 'DRAWER_RIGHT':
|
|
101
101
|
case 'DRAWER_TOP':
|
|
@@ -177,14 +177,17 @@ export class OpenAppViewCommand {
|
|
|
177
177
|
*/
|
|
178
178
|
protected async openPopover(
|
|
179
179
|
appView: IViewConfig,
|
|
180
|
-
event: MouseEvent | undefined,
|
|
181
180
|
context: IContext,
|
|
182
181
|
params: IParams = {},
|
|
182
|
+
opts: IOpenViewOptions = {},
|
|
183
183
|
): Promise<IModalData> {
|
|
184
|
+
const { event, modalOption } = opts;
|
|
184
185
|
if (!event) {
|
|
185
186
|
throw new RuntimeError('气泡打开缺少event');
|
|
186
187
|
}
|
|
187
|
-
return ibiz.openView.popover(appView.id, event, context, params
|
|
188
|
+
return ibiz.openView.popover(appView.id, event, context, params, {
|
|
189
|
+
...modalOption,
|
|
190
|
+
});
|
|
188
191
|
}
|
|
189
192
|
|
|
190
193
|
/**
|
|
@@ -1137,10 +1137,10 @@ export class GridController<
|
|
|
1137
1137
|
const getExportData = async (): Promise<IData[]> => {
|
|
1138
1138
|
const type = _args.params?.type;
|
|
1139
1139
|
let data: IData[] = [];
|
|
1140
|
-
|
|
1140
|
+
// 未指定类型时,默认导出当前页
|
|
1141
|
+
if (!type || type === 'activatedPage') {
|
|
1141
1142
|
data = this.state.rows.map(row => row.data);
|
|
1142
|
-
}
|
|
1143
|
-
if (type === 'maxRowCount' || type === 'customPage') {
|
|
1143
|
+
} else if (type === 'maxRowCount' || type === 'customPage') {
|
|
1144
1144
|
const { size } = this.state;
|
|
1145
1145
|
const { startPage, endPage } = _args.params;
|
|
1146
1146
|
const params =
|
|
@@ -1152,8 +1152,7 @@ export class GridController<
|
|
|
1152
1152
|
}
|
|
1153
1153
|
: { size: 1000, page: 0 };
|
|
1154
1154
|
data = await this.loadData({ viewParam: params });
|
|
1155
|
-
}
|
|
1156
|
-
if (type === 'selectedRows') {
|
|
1155
|
+
} else if (type === 'selectedRows') {
|
|
1157
1156
|
data = this.getData();
|
|
1158
1157
|
}
|
|
1159
1158
|
if (data.length === 0) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { mergeInLeft } from '@ibiz-template/core';
|
|
1
|
+
import { mergeInLeft, recursiveIterate } from '@ibiz-template/core';
|
|
2
2
|
import { IAppDataEntity, ISearchBar, ISearchBarFilter } from '@ibiz/model-core';
|
|
3
|
-
import { clone } from 'ramda';
|
|
3
|
+
import { clone, isNil } from 'ramda';
|
|
4
|
+
import { isString } from 'lodash-es';
|
|
4
5
|
import {
|
|
5
6
|
ISearchBarState,
|
|
6
7
|
ISearchBarEvent,
|
|
7
8
|
ISearchBarController,
|
|
8
9
|
IBackendSearchBarGroup,
|
|
9
10
|
IGridController,
|
|
11
|
+
IFilterNode,
|
|
10
12
|
} from '../../../interface';
|
|
11
13
|
import { convertNavData, ScriptFactory } from '../../../utils';
|
|
12
14
|
import { ControlController } from '../../common';
|
|
@@ -20,6 +22,8 @@ import {
|
|
|
20
22
|
parseFilters,
|
|
21
23
|
} from './use-searchcond';
|
|
22
24
|
|
|
25
|
+
const ScriptValueRegex = /\$\{[^}]*\}/; // 匹配${xxx}格式字符串
|
|
26
|
+
|
|
23
27
|
/**
|
|
24
28
|
* 搜索栏控制器
|
|
25
29
|
*
|
|
@@ -115,7 +119,8 @@ export class SearchBarController
|
|
|
115
119
|
* @Date: 2023-12-22 13:50:16
|
|
116
120
|
*/
|
|
117
121
|
get grid(): IGridController | undefined {
|
|
118
|
-
return this.ctx.getController('grid')
|
|
122
|
+
return (this.ctx.getController('grid') ||
|
|
123
|
+
this.ctx.getController('treegrid')) as IGridController;
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
/**
|
|
@@ -347,6 +352,27 @@ export class SearchBarController
|
|
|
347
352
|
return;
|
|
348
353
|
}
|
|
349
354
|
const searchconds = calcSearchConds(this.state.filterNodes);
|
|
355
|
+
|
|
356
|
+
if (searchconds) {
|
|
357
|
+
// 给多数据加载之前进行脚本值转换
|
|
358
|
+
|
|
359
|
+
recursiveIterate(
|
|
360
|
+
searchconds[0],
|
|
361
|
+
(node: IData) => {
|
|
362
|
+
if (
|
|
363
|
+
node.condtype === 'DEFIELD' &&
|
|
364
|
+
!isNil(node.value) &&
|
|
365
|
+
ScriptValueRegex.test(node.value)
|
|
366
|
+
) {
|
|
367
|
+
node.value = ScriptFactory.execSingleLine(`\`${node.value}\``, {
|
|
368
|
+
...this.getEventArgs(),
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{ childrenFields: ['searchconds'] },
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
350
376
|
return searchconds;
|
|
351
377
|
}
|
|
352
378
|
|
|
@@ -543,6 +569,21 @@ export class SearchBarController
|
|
|
543
569
|
} else {
|
|
544
570
|
this.state.filterNodes = getOriginFilterNodes();
|
|
545
571
|
}
|
|
572
|
+
|
|
573
|
+
// 把带有${}的条件禁用,不能修改
|
|
574
|
+
recursiveIterate(this.state.filterNodes[0], (node: IFilterNode) => {
|
|
575
|
+
if (node.leaf) {
|
|
576
|
+
if (
|
|
577
|
+
node.field &&
|
|
578
|
+
node.valueOP &&
|
|
579
|
+
isString(node.value) &&
|
|
580
|
+
ScriptValueRegex.test(node.value)
|
|
581
|
+
) {
|
|
582
|
+
node.disabled = true;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
|
|
546
587
|
if (this.grid && groupItem && groupItem.searchGroupData) {
|
|
547
588
|
this.grid.setGroupParams(groupItem.searchGroupData);
|
|
548
589
|
await this.grid.load({ isInitialLoad: true });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { IAppView } from '@ibiz/model-core';
|
|
2
3
|
import { IAppViewConfigService, IViewConfig } from '../../interface';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -38,6 +39,33 @@ export class AppViewConfigService implements IAppViewConfigService {
|
|
|
38
39
|
return id;
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* 获取视图自定义Option
|
|
44
|
+
*
|
|
45
|
+
* @author zk
|
|
46
|
+
* @date 2024-01-31 11:01:20
|
|
47
|
+
* @protected
|
|
48
|
+
* @param {IAppView} model
|
|
49
|
+
* @return {*} {IData}
|
|
50
|
+
* @memberof AppViewConfigService
|
|
51
|
+
*/
|
|
52
|
+
protected getCustomOption(model: IAppView): { modalOption: IData } {
|
|
53
|
+
const { appViewParams } = model;
|
|
54
|
+
// 解析ModalOption参数
|
|
55
|
+
const optionProperty = appViewParams?.find(
|
|
56
|
+
item => item.id === 'modaloption',
|
|
57
|
+
)?.value;
|
|
58
|
+
let modalOption = {};
|
|
59
|
+
if (optionProperty) {
|
|
60
|
+
try {
|
|
61
|
+
modalOption = JSON.parse(optionProperty);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { modalOption };
|
|
67
|
+
}
|
|
68
|
+
|
|
41
69
|
has(key: string): boolean {
|
|
42
70
|
const id = this.calcAppViewId(key);
|
|
43
71
|
return this.viewConfigs.has(id);
|
|
@@ -66,6 +94,7 @@ export class AppViewConfigService implements IAppViewConfigService {
|
|
|
66
94
|
height: model.height,
|
|
67
95
|
appDataEntityId: model.appDataEntityId,
|
|
68
96
|
redirectView: model.redirectView,
|
|
97
|
+
...this.getCustomOption(model),
|
|
69
98
|
});
|
|
70
99
|
}
|
|
71
100
|
return this.viewConfigs.get(id)!;
|
|
@@ -76,6 +76,14 @@ export interface IFilterLeafNode {
|
|
|
76
76
|
* @type {string}
|
|
77
77
|
*/
|
|
78
78
|
valueOP: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 禁用,禁止修改
|
|
82
|
+
* @author lxm
|
|
83
|
+
* @date 2024-02-01 02:51:40
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
86
|
+
disabled?: boolean;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
export type IFilterNode = IFilterBranchNode | IFilterLeafNode;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { IHttpResponse } from '@ibiz-template/core';
|
|
1
|
+
import { IHttpResponse, IMarkOpenData } from '@ibiz-template/core';
|
|
2
2
|
|
|
3
3
|
export type MarkOpenDataActionType = 'VIEW' | 'EDIT' | 'UPDATE' | 'CLOSE';
|
|
4
4
|
|
|
5
|
+
export type MarkOpenDataCallbackFun = (data: IMarkOpenData) => void;
|
|
6
|
+
|
|
5
7
|
export interface IMarkOpenDataService {
|
|
6
8
|
/**
|
|
7
9
|
* 获取站内信的集合
|
|
@@ -15,4 +17,32 @@ export interface IMarkOpenDataService {
|
|
|
15
17
|
key: string,
|
|
16
18
|
action: MarkOpenDataActionType,
|
|
17
19
|
): Promise<IHttpResponse>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 监听指定实体指定主键的消息
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2024-02-01 04:45:31
|
|
25
|
+
* @param {string} deName
|
|
26
|
+
* @param {string} key
|
|
27
|
+
* @param {CallbackFun} callback
|
|
28
|
+
*/
|
|
29
|
+
subscribe(
|
|
30
|
+
deName: string,
|
|
31
|
+
key: string,
|
|
32
|
+
callback: MarkOpenDataCallbackFun,
|
|
33
|
+
): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 取消监听指定实体指定主键的消息
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2024-02-01 04:48:19
|
|
39
|
+
* @param {string} deName
|
|
40
|
+
* @param {string} key
|
|
41
|
+
* @param {MarkOpenDataCallbackFun} callback
|
|
42
|
+
*/
|
|
43
|
+
unsubscribe(
|
|
44
|
+
deName: string,
|
|
45
|
+
key: string,
|
|
46
|
+
callback: MarkOpenDataCallbackFun,
|
|
47
|
+
): void;
|
|
18
48
|
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { IHttpResponse } from '@ibiz-template/core';
|
|
1
|
+
import { IHttpResponse, IMarkOpenData } from '@ibiz-template/core';
|
|
2
2
|
import {
|
|
3
3
|
IMarkOpenDataService,
|
|
4
4
|
MarkOpenDataActionType,
|
|
5
|
+
MarkOpenDataCallbackFun,
|
|
5
6
|
} from '../../../interface';
|
|
6
7
|
|
|
7
8
|
export class MarkOpenDataService implements IMarkOpenDataService {
|
|
9
|
+
/**
|
|
10
|
+
* 回调集合
|
|
11
|
+
* @author lxm
|
|
12
|
+
* @date 2024-02-01 04:41:45
|
|
13
|
+
*/
|
|
14
|
+
callbackMap = new Map<string, Array<MarkOpenDataCallbackFun>>();
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
ibiz.mc.command.markOpenData.on(msg => {
|
|
18
|
+
const data = msg.data as IMarkOpenData;
|
|
19
|
+
const { entity, key } = data;
|
|
20
|
+
const tag = `${entity}_${key}`;
|
|
21
|
+
if (this.callbackMap.has(tag)) {
|
|
22
|
+
this.callbackMap.get(tag)!.forEach(cb => cb(data));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
8
27
|
/**
|
|
9
28
|
* 基础路径
|
|
10
29
|
* @author lxm
|
|
@@ -22,4 +41,45 @@ export class MarkOpenDataService implements IMarkOpenDataService {
|
|
|
22
41
|
);
|
|
23
42
|
return res;
|
|
24
43
|
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 监听指定实体指定主键的消息
|
|
47
|
+
* @author lxm
|
|
48
|
+
* @date 2024-02-01 04:45:31
|
|
49
|
+
* @param {string} deName
|
|
50
|
+
* @param {string} key
|
|
51
|
+
* @param {MarkOpenDataCallbackFun} callback
|
|
52
|
+
*/
|
|
53
|
+
subscribe(
|
|
54
|
+
deName: string,
|
|
55
|
+
key: string,
|
|
56
|
+
callback: MarkOpenDataCallbackFun,
|
|
57
|
+
): void {
|
|
58
|
+
const tag = `${deName}_${key}`;
|
|
59
|
+
const callbacks = this.callbackMap.get(tag) || [];
|
|
60
|
+
callbacks.push(callback);
|
|
61
|
+
this.callbackMap.set(tag, callbacks);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 取消监听指定实体指定主键的消息
|
|
66
|
+
* @author lxm
|
|
67
|
+
* @date 2024-02-01 04:48:19
|
|
68
|
+
* @param {string} deName
|
|
69
|
+
* @param {string} key
|
|
70
|
+
* @param {MarkOpenDataCallbackFun} callback
|
|
71
|
+
*/
|
|
72
|
+
unsubscribe(
|
|
73
|
+
deName: string,
|
|
74
|
+
key: string,
|
|
75
|
+
callback: MarkOpenDataCallbackFun,
|
|
76
|
+
): void {
|
|
77
|
+
const tag = `${deName}_${key}`;
|
|
78
|
+
const callbacks = this.callbackMap.get(tag) || [];
|
|
79
|
+
const index = callbacks.indexOf(callback);
|
|
80
|
+
if (index > -1) {
|
|
81
|
+
callbacks.splice(index, 1);
|
|
82
|
+
this.callbackMap.set(tag, callbacks);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
25
85
|
}
|
|
@@ -22,14 +22,14 @@ export async function calcDynaSysParams(
|
|
|
22
22
|
): Promise<{
|
|
23
23
|
srfkey?: string | undefined;
|
|
24
24
|
srfparentkey?: string | undefined;
|
|
25
|
-
|
|
25
|
+
srfparentdename?: string | undefined;
|
|
26
26
|
}> {
|
|
27
27
|
const appId = opts.appId || context.srfappid;
|
|
28
28
|
const viewParams = opts.viewParams || {};
|
|
29
29
|
const loadModelParams: {
|
|
30
30
|
srfkey?: string;
|
|
31
31
|
srfparentkey?: string;
|
|
32
|
-
|
|
32
|
+
srfparentdename?: string;
|
|
33
33
|
} = {};
|
|
34
34
|
|
|
35
35
|
const appDe = await ibiz.hub.getAppDataEntity(appDataEntityId, appId);
|
|
@@ -47,9 +47,9 @@ export async function calcDynaSysParams(
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// *计算上层父实体主键和name
|
|
50
|
-
if (viewParams.srfparentkey && viewParams.
|
|
50
|
+
if (viewParams.srfparentkey && viewParams.srfparentdename) {
|
|
51
51
|
loadModelParams.srfparentkey = viewParams.srfparentkey;
|
|
52
|
-
loadModelParams.
|
|
52
|
+
loadModelParams.srfparentdename = viewParams.srfparentdename;
|
|
53
53
|
} else {
|
|
54
54
|
// 上层资源路径主实体名称和主键
|
|
55
55
|
const match = getMatchResPath(context, appDe);
|
|
@@ -57,8 +57,8 @@ export async function calcDynaSysParams(
|
|
|
57
57
|
const parentDeKey = match.keys[match.keys.length - 2];
|
|
58
58
|
loadModelParams.srfparentkey =
|
|
59
59
|
viewParams.srfparentkey || context[parentDeKey];
|
|
60
|
-
loadModelParams.
|
|
61
|
-
viewParams.
|
|
60
|
+
loadModelParams.srfparentdename =
|
|
61
|
+
viewParams.srfparentdename || parentDeKey;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -45,12 +45,14 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
45
45
|
data,
|
|
46
46
|
params,
|
|
47
47
|
);
|
|
48
|
+
// 解析自定义 视图 option 参数
|
|
49
|
+
const options = this.handleViewOptionParams(resultParams);
|
|
48
50
|
const res: IModalData | undefined = await ibiz.commands.execute(
|
|
49
51
|
OpenAppViewCommand.TAG,
|
|
50
52
|
frontPSAppView,
|
|
51
53
|
resultContext,
|
|
52
54
|
resultParams,
|
|
53
|
-
{ event, noWaitRoute },
|
|
55
|
+
{ event, noWaitRoute, ...options },
|
|
54
56
|
);
|
|
55
57
|
// 打开视图取消操作
|
|
56
58
|
if (!res?.ok) {
|
|
@@ -86,6 +88,28 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
86
88
|
return actionResult;
|
|
87
89
|
}
|
|
88
90
|
|
|
91
|
+
/**
|
|
92
|
+
* 处理打开视图配置自定义参数 modalOption
|
|
93
|
+
*
|
|
94
|
+
* @author zk
|
|
95
|
+
* @date 2024-02-01 01:02:28
|
|
96
|
+
* @param {IData} param
|
|
97
|
+
* @return {*} {IData}
|
|
98
|
+
* @memberof FrontUIActionProvider
|
|
99
|
+
*/
|
|
100
|
+
handleViewOptionParams(param: IData): IData {
|
|
101
|
+
if (param.modaloption) {
|
|
102
|
+
try {
|
|
103
|
+
const modalOption = JSON.parse(param.modaloption);
|
|
104
|
+
delete param.modaloption;
|
|
105
|
+
return { modalOption };
|
|
106
|
+
} catch (error) {
|
|
107
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return {};
|
|
111
|
+
}
|
|
112
|
+
|
|
89
113
|
/**
|
|
90
114
|
* 处理模式:用户自定义
|
|
91
115
|
* @author lxm
|
|
@@ -215,10 +215,19 @@ export async function getDERedirectToView(
|
|
|
215
215
|
const entity = await ibiz.hub.getAppDataEntity(entityId, appView.appId);
|
|
216
216
|
const rdTag = await calcDERdTag(entity, appView, params, curData);
|
|
217
217
|
let viewId = '';
|
|
218
|
-
// view://协议开头处理,值示例: view://{app}/{viewcodename}?srfwftag={wftag}
|
|
218
|
+
// view://协议开头处理,值示例: view://{app}/{viewcodename}?srfnavctx={"work_item":"6c797b6a6dfbd8f38652fe3ea3220fc1","project":"ee11e5a96002f4f3937ddba025ec7d44"}&srfwftag={wftag}
|
|
219
219
|
if (rdTag.startsWith('view://')) {
|
|
220
220
|
const url = new URL(rdTag);
|
|
221
221
|
if (url.searchParams.size > 0) {
|
|
222
|
+
const navCtx = url.searchParams.get('srfnavctx');
|
|
223
|
+
if (navCtx) {
|
|
224
|
+
try {
|
|
225
|
+
Object.assign(context, JSON.parse(navCtx));
|
|
226
|
+
} catch (error) {
|
|
227
|
+
ibiz.log.error(`重定向[${rdTag}] 中 srfnavctx 参数解析失败`, error);
|
|
228
|
+
}
|
|
229
|
+
url.searchParams.delete('srfnavctx');
|
|
230
|
+
}
|
|
222
231
|
url.searchParams.forEach((value, _key) => {
|
|
223
232
|
params[_key] = value;
|
|
224
233
|
});
|