@ibiz-template/runtime 0.5.7-alpha.7 → 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 +177 -33
- package/dist/index.system.min.js +1 -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 +28 -4
- 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/install.d.ts.map +1 -1
- package/out/install.js +2 -5
- 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 +32 -0
- package/out/interface/service/service/i-mark-open-data.service.d.ts.map +1 -0
- package/out/interface/service/service/i-mark-open-data.service.js +1 -0
- package/out/interface/service/service/index.d.ts +1 -0
- package/out/interface/service/service/index.d.ts.map +1 -1
- package/out/service/service/index.d.ts +1 -0
- package/out/service/service/index.d.ts.map +1 -1
- package/out/service/service/index.js +1 -0
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts +37 -0
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts.map +1 -0
- package/out/service/service/mark-open-data/mark-open-data.service.js +59 -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/types.d.ts +8 -17
- package/out/types.d.ts.map +1 -1
- 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/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 +45 -4
- package/src/hub/config/app-view-config-service.ts +29 -0
- package/src/install.ts +2 -6
- 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 +48 -0
- package/src/interface/service/service/index.ts +5 -0
- package/src/service/service/index.ts +1 -0
- package/src/service/service/mark-open-data/mark-open-data.service.ts +85 -0
- package/src/service/utils/dyna-sys-params/dyna-sys-params.ts +6 -6
- package/src/types.ts +9 -20
- package/src/ui-action/provider/front-ui-action-provider.ts +25 -1
- package/src/utils/open-redirect-view/open-redirect-view.ts +10 -1
|
@@ -12,6 +12,16 @@ import { UIActionProviderBase } from './ui-action-provider-base';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class FrontUIActionProvider extends UIActionProviderBase {
|
|
14
14
|
execAction(action: IAppDEUIAction, args: IUILogicParams): Promise<IUIActionResult>;
|
|
15
|
+
/**
|
|
16
|
+
* 处理打开视图配置自定义参数 modalOption
|
|
17
|
+
*
|
|
18
|
+
* @author zk
|
|
19
|
+
* @date 2024-02-01 01:02:28
|
|
20
|
+
* @param {IData} param
|
|
21
|
+
* @return {*} {IData}
|
|
22
|
+
* @memberof FrontUIActionProvider
|
|
23
|
+
*/
|
|
24
|
+
handleViewOptionParams(param: IData): IData;
|
|
15
25
|
/**
|
|
16
26
|
* 处理模式:用户自定义
|
|
17
27
|
* @author lxm
|
|
@@ -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":"AAMA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAc,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"front-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/front-ui-action-provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAc,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,UAAU,CACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAiE3B;;;;;;;;OAQG;IACH,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAa3C;;;;;;;;OAQG;IAEH,SAAS,CAAC,OAAO,CACf,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,eAAe;IAalB;;;;;;OAMG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;IAiEhB;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IA4C3B;;;;;;OAMG;cACa,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC;CAqDjB"}
|
|
@@ -29,7 +29,9 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
29
29
|
}
|
|
30
30
|
// 处理参数
|
|
31
31
|
const { resultContext, resultParams } = await this.handleParams(action, context, data, params);
|
|
32
|
-
|
|
32
|
+
// 解析自定义 视图 option 参数
|
|
33
|
+
const options = this.handleViewOptionParams(resultParams);
|
|
34
|
+
const res = await ibiz.commands.execute(OpenAppViewCommand.TAG, frontPSAppView, resultContext, resultParams, Object.assign({ event, noWaitRoute }, options));
|
|
33
35
|
// 打开视图取消操作
|
|
34
36
|
if (!(res === null || res === void 0 ? void 0 : res.ok)) {
|
|
35
37
|
actionResult.cancel = true;
|
|
@@ -58,6 +60,28 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
58
60
|
}
|
|
59
61
|
return actionResult;
|
|
60
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* 处理打开视图配置自定义参数 modalOption
|
|
65
|
+
*
|
|
66
|
+
* @author zk
|
|
67
|
+
* @date 2024-02-01 01:02:28
|
|
68
|
+
* @param {IData} param
|
|
69
|
+
* @return {*} {IData}
|
|
70
|
+
* @memberof FrontUIActionProvider
|
|
71
|
+
*/
|
|
72
|
+
handleViewOptionParams(param) {
|
|
73
|
+
if (param.modaloption) {
|
|
74
|
+
try {
|
|
75
|
+
const modalOption = JSON.parse(param.modaloption);
|
|
76
|
+
delete param.modaloption;
|
|
77
|
+
return { modalOption };
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return {};
|
|
84
|
+
}
|
|
61
85
|
/**
|
|
62
86
|
* 处理模式:用户自定义
|
|
63
87
|
* @author lxm
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/utils/open-redirect-view/open-redirect-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAK/D,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAoDvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"open-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/utils/open-redirect-view/open-redirect-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAK/D,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAoDvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CA4I3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CA+BrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,MAAM,CAAC,CAiDjB"}
|
|
@@ -152,10 +152,20 @@ export async function getDERedirectToView(appView, context, params = {}, opts =
|
|
|
152
152
|
const entity = await ibiz.hub.getAppDataEntity(entityId, appView.appId);
|
|
153
153
|
const rdTag = await calcDERdTag(entity, appView, params, curData);
|
|
154
154
|
let viewId = '';
|
|
155
|
-
// view://协议开头处理,值示例: view://{app}/{viewcodename}?srfwftag={wftag}
|
|
155
|
+
// view://协议开头处理,值示例: view://{app}/{viewcodename}?srfnavctx={"work_item":"6c797b6a6dfbd8f38652fe3ea3220fc1","project":"ee11e5a96002f4f3937ddba025ec7d44"}&srfwftag={wftag}
|
|
156
156
|
if (rdTag.startsWith('view://')) {
|
|
157
157
|
const url = new URL(rdTag);
|
|
158
158
|
if (url.searchParams.size > 0) {
|
|
159
|
+
const navCtx = url.searchParams.get('srfnavctx');
|
|
160
|
+
if (navCtx) {
|
|
161
|
+
try {
|
|
162
|
+
Object.assign(context, JSON.parse(navCtx));
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
ibiz.log.error(`重定向[${rdTag}] 中 srfnavctx 参数解析失败`, error);
|
|
166
|
+
}
|
|
167
|
+
url.searchParams.delete('srfnavctx');
|
|
168
|
+
}
|
|
159
169
|
url.searchParams.forEach((value, _key) => {
|
|
160
170
|
params[_key] = value;
|
|
161
171
|
});
|
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
|
}
|
|
@@ -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
|
*
|
|
@@ -106,7 +110,7 @@ export class SearchBarController
|
|
|
106
110
|
* @author lxm
|
|
107
111
|
* @date 2024-01-05 10:10:37
|
|
108
112
|
*/
|
|
109
|
-
addSchemaFilters =
|
|
113
|
+
addSchemaFilters = false;
|
|
110
114
|
|
|
111
115
|
/**
|
|
112
116
|
* 表格控制器
|
|
@@ -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)!;
|
package/src/install.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { GlobalConfig } from './config/global-config';
|
|
|
2
2
|
import { RegisterCenter } from './register/register-center';
|
|
3
3
|
import { installCommand } from './command';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
InternalMessageService,
|
|
5
|
+
MarkOpenDataService,
|
|
7
6
|
presetAppCounterProvider,
|
|
8
7
|
presetDEMethodProvider,
|
|
9
8
|
V7AuthService,
|
|
@@ -36,14 +35,11 @@ export function install(): void {
|
|
|
36
35
|
ibiz.config = new GlobalConfig();
|
|
37
36
|
// 挂载认证服务
|
|
38
37
|
ibiz.auth = new V7AuthService();
|
|
39
|
-
// 挂载异步操作服务
|
|
40
|
-
ibiz.asyncAction = new AsyncActionService();
|
|
41
|
-
// 挂载站内信服务
|
|
42
|
-
ibiz.internalMessage = new InternalMessageService();
|
|
43
38
|
// 挂载引擎工厂
|
|
44
39
|
ibiz.engine = new EngineFactory();
|
|
45
40
|
// 挂载界面域管理
|
|
46
41
|
ibiz.uiDomainManager = new UIDomainManager();
|
|
42
|
+
ibiz.markOpenData = new MarkOpenDataService();
|
|
47
43
|
// 安装默认指令
|
|
48
44
|
installCommand();
|
|
49
45
|
// 注册界面行为适配器
|
|
@@ -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;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IHttpResponse, IMarkOpenData } from '@ibiz-template/core';
|
|
2
|
+
|
|
3
|
+
export type MarkOpenDataActionType = 'VIEW' | 'EDIT' | 'UPDATE' | 'CLOSE';
|
|
4
|
+
|
|
5
|
+
export type MarkOpenDataCallbackFun = (data: IMarkOpenData) => void;
|
|
6
|
+
|
|
7
|
+
export interface IMarkOpenDataService {
|
|
8
|
+
/**
|
|
9
|
+
* 获取站内信的集合
|
|
10
|
+
* @author lxm
|
|
11
|
+
* @date 2023-11-15 10:55:25
|
|
12
|
+
* @param {IParams} [params={}]
|
|
13
|
+
* @return {*} {Promise<IHttpResponse<IInternalMessage[]>>}
|
|
14
|
+
*/
|
|
15
|
+
action(
|
|
16
|
+
deName: string,
|
|
17
|
+
key: string,
|
|
18
|
+
action: MarkOpenDataActionType,
|
|
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;
|
|
48
|
+
}
|
|
@@ -6,3 +6,8 @@ export type { IFileService } from './i-file.service';
|
|
|
6
6
|
export type { IWorkFlowService } from './i-wf.service';
|
|
7
7
|
export type { IAsyncActionService } from './i-async-action.service';
|
|
8
8
|
export type { IInternalMessageService } from './i-internal-message.service';
|
|
9
|
+
export type {
|
|
10
|
+
MarkOpenDataActionType,
|
|
11
|
+
IMarkOpenDataService,
|
|
12
|
+
MarkOpenDataCallbackFun,
|
|
13
|
+
} from './i-mark-open-data.service';
|
|
@@ -9,3 +9,4 @@ export { V7AuthService } from './auth/v7-auth.service';
|
|
|
9
9
|
export { AsyncActionService } from './async-action/async-action.service';
|
|
10
10
|
export * from './entity/method';
|
|
11
11
|
export { InternalMessageService } from './internal-message/internal-message.service';
|
|
12
|
+
export { MarkOpenDataService } from './mark-open-data/mark-open-data.service';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IHttpResponse, IMarkOpenData } from '@ibiz-template/core';
|
|
2
|
+
import {
|
|
3
|
+
IMarkOpenDataService,
|
|
4
|
+
MarkOpenDataActionType,
|
|
5
|
+
MarkOpenDataCallbackFun,
|
|
6
|
+
} from '../../../interface';
|
|
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
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 基础路径
|
|
29
|
+
* @author lxm
|
|
30
|
+
* @date 2024-01-23 02:06:47
|
|
31
|
+
*/
|
|
32
|
+
protected baseUrl = '/portal/markopendata';
|
|
33
|
+
|
|
34
|
+
async action(
|
|
35
|
+
deName: string,
|
|
36
|
+
key: string,
|
|
37
|
+
action: MarkOpenDataActionType,
|
|
38
|
+
): Promise<IHttpResponse> {
|
|
39
|
+
const res = await ibiz.net.get(
|
|
40
|
+
`${this.baseUrl}/${deName}/${key}/${action}`,
|
|
41
|
+
);
|
|
42
|
+
return res;
|
|
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
|
+
}
|
|
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
|
|
package/src/types.ts
CHANGED
|
@@ -13,10 +13,9 @@ import {
|
|
|
13
13
|
IGlobalConfig,
|
|
14
14
|
IAppHubService,
|
|
15
15
|
IAuthService,
|
|
16
|
-
IAsyncActionService,
|
|
17
16
|
IPlatformProvider,
|
|
18
|
-
IInternalMessageService,
|
|
19
17
|
INoticeUtil,
|
|
18
|
+
IMarkOpenDataService,
|
|
20
19
|
} from './interface';
|
|
21
20
|
import { LogicSchedulerCenter } from './logic-scheduler';
|
|
22
21
|
import { RegisterCenter } from './register/register-center';
|
|
@@ -145,24 +144,6 @@ declare module '@ibiz-template/core' {
|
|
|
145
144
|
*/
|
|
146
145
|
auth: IAuthService;
|
|
147
146
|
|
|
148
|
-
/**
|
|
149
|
-
* 异步操作服务
|
|
150
|
-
*
|
|
151
|
-
* @author chitanda
|
|
152
|
-
* @date 2022-07-20 10:07:33
|
|
153
|
-
* @type {IAuthService}
|
|
154
|
-
*/
|
|
155
|
-
asyncAction: IAsyncActionService;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* 站内信服务
|
|
159
|
-
*
|
|
160
|
-
* @author chitanda
|
|
161
|
-
* @date 2022-07-20 10:07:33
|
|
162
|
-
* @type {IAuthService}
|
|
163
|
-
*/
|
|
164
|
-
internalMessage: IInternalMessageService;
|
|
165
|
-
|
|
166
147
|
/**
|
|
167
148
|
* 引擎工厂
|
|
168
149
|
* @author lxm
|
|
@@ -215,6 +196,14 @@ declare module '@ibiz-template/core' {
|
|
|
215
196
|
* @type {UIDomainManager}
|
|
216
197
|
*/
|
|
217
198
|
uiDomainManager: UIDomainManager;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 标记打开数据服务
|
|
202
|
+
* @author lxm
|
|
203
|
+
* @date 2024-01-31 10:40:59
|
|
204
|
+
* @type {IMarkOpenDataService}
|
|
205
|
+
*/
|
|
206
|
+
markOpenData: IMarkOpenDataService;
|
|
218
207
|
}
|
|
219
208
|
|
|
220
209
|
interface IEnvironment {
|
|
@@ -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
|