@ibiz-template/runtime 0.6.0-alpha.2 → 0.6.0-alpha.4
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 +207 -156
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +12 -0
- package/out/controller/control/caption-bar/caption-bar.controller.d.ts.map +1 -1
- package/out/controller/control/caption-bar/caption-bar.controller.js +3 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +9 -0
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +5 -0
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +6 -1
- package/out/controller/control/tree/tree.controller.js +2 -2
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.js +1 -7
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.js +1 -8
- package/out/controller/utils/button-state/button-container.state.d.ts +1 -0
- package/out/controller/utils/button-state/button-container.state.d.ts.map +1 -1
- package/out/controller/utils/button-state/button-container.state.js +5 -0
- package/out/controller/utils/button-state/ui-action-button.state.d.ts +1 -1
- package/out/controller/utils/button-state/ui-action-button.state.d.ts.map +1 -1
- package/out/controller/utils/button-state/ui-action-button.state.js +4 -0
- package/out/engine/view-base.engine.d.ts +8 -0
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +11 -0
- package/out/interface/controller/common/button-state/i-button-container.state.d.ts +7 -0
- package/out/interface/controller/common/button-state/i-button-container.state.d.ts.map +1 -1
- package/out/interface/controller/common/button-state/i-button.state.d.ts +7 -0
- package/out/interface/controller/common/button-state/i-button.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-toolbar.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-toolbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.d.ts +1 -0
- package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.js +1 -0
- package/out/ui-action/provider/backend-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/backend-ui-action-provider.js +3 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts +0 -10
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +0 -22
- package/out/ui-action/provider/ui-action-provider-base.d.ts +10 -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 +22 -0
- package/out/utils/index.d.ts +1 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -1
- package/out/utils/nav-params/nav-params.js +2 -2
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +17 -0
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +51 -25
- package/package.json +9 -6
- package/src/controller/common/editor/editor.controller.ts +12 -0
- package/src/controller/control/caption-bar/caption-bar.controller.ts +3 -0
- package/src/controller/control/grid/grid/grid.controller.ts +9 -0
- package/src/controller/control/panel/panel/panel-item.controller.ts +6 -0
- package/src/controller/control/toolbar/toolbar.controllerr.ts +6 -1
- package/src/controller/control/tree/tree.controller.ts +2 -2
- package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.ts +1 -11
- package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts +1 -12
- package/src/controller/utils/button-state/button-container.state.ts +8 -0
- package/src/controller/utils/button-state/ui-action-button.state.ts +6 -1
- package/src/engine/view-base.engine.ts +12 -0
- package/src/interface/controller/common/button-state/i-button-container.state.ts +8 -0
- package/src/interface/controller/common/button-state/i-button.state.ts +8 -0
- package/src/interface/controller/state/control/i-grid.state.ts +8 -0
- package/src/interface/controller/state/control/i-toolbar.state.ts +8 -0
- package/src/interface/controller/state/control/i-tree.state.ts +8 -0
- package/src/service/vo/tree-node-data/tree-node-data.ts +3 -0
- package/src/ui-action/provider/backend-ui-action-provider.ts +3 -1
- package/src/ui-action/provider/front-ui-action-provider.ts +0 -22
- package/src/ui-action/provider/ui-action-provider-base.ts +22 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/nav-params/nav-params.ts +2 -2
- package/src/utils/open-redirect-view/open-redirect-view.ts +55 -23
|
@@ -262,4 +262,26 @@ export class UIActionProviderBase {
|
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* 处理打开视图配置自定义参数 modalOption
|
|
267
|
+
*
|
|
268
|
+
* @author zk
|
|
269
|
+
* @date 2024-02-01 01:02:28
|
|
270
|
+
* @param {IData} param
|
|
271
|
+
* @return {*} {IData}
|
|
272
|
+
* @memberof FrontUIActionProvider
|
|
273
|
+
*/
|
|
274
|
+
handleViewOptionParams(param) {
|
|
275
|
+
if (param.modaloption) {
|
|
276
|
+
try {
|
|
277
|
+
const modalOption = JSON.parse(param.modaloption);
|
|
278
|
+
delete param.modaloption;
|
|
279
|
+
return { modalOption };
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {};
|
|
286
|
+
}
|
|
265
287
|
}
|
package/out/utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './error-handler';
|
|
|
2
2
|
export { HandlebarsUtil } from './handlebars/handlebars';
|
|
3
3
|
export { calcNavParams } from './nav-params/calc-nav-params';
|
|
4
4
|
export * from './nav-params/nav-params';
|
|
5
|
-
export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, } from './open-redirect-view/open-redirect-view';
|
|
5
|
+
export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, parseViewProtocol, } from './open-redirect-view/open-redirect-view';
|
|
6
6
|
export * from './verify';
|
|
7
7
|
export { LayoutPanelUtil } from './layout-panel-util/layout-panel-util';
|
|
8
8
|
export * from './wf-helper/wf-helper';
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export * from './error-handler';
|
|
|
2
2
|
export { HandlebarsUtil } from './handlebars/handlebars';
|
|
3
3
|
export { calcNavParams } from './nav-params/calc-nav-params';
|
|
4
4
|
export * from './nav-params/nav-params';
|
|
5
|
-
export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, } from './open-redirect-view/open-redirect-view';
|
|
5
|
+
export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, parseViewProtocol, } from './open-redirect-view/open-redirect-view';
|
|
6
6
|
export * from './verify';
|
|
7
7
|
export { LayoutPanelUtil } from './layout-panel-util/layout-panel-util';
|
|
8
8
|
export * from './wf-helper/wf-helper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEmpty } from 'lodash-es';
|
|
1
|
+
import { isEmpty, isNil } from 'lodash-es';
|
|
2
2
|
import { isNilOrEmpty, notNilEmpty } from 'qx-util';
|
|
3
3
|
/**
|
|
4
4
|
* 把对象格式的导航参数转换成数组格式的导航参数
|
|
@@ -102,7 +102,7 @@ export function convertNavDataByArray(naviDatas, ...origins) {
|
|
|
102
102
|
// 去掉${},适配平台模型转小写取值
|
|
103
103
|
key.slice(2, -1).toLowerCase());
|
|
104
104
|
if (find) {
|
|
105
|
-
valueStr = valueStr.replace(key, `${value}`);
|
|
105
|
+
valueStr = valueStr.replace(key, `${isNil(value) ? '' : value}`);
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
result[naviData.key.toLowerCase()] = valueStr;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { IAppDERedirectView, IAppDataEntity, IAppRedirectView } from '@ibiz/model-core';
|
|
2
2
|
import { IModalData, IOpenViewOptions } from '../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 解析view://协议的字符串
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2024-02-06 09:26:20
|
|
7
|
+
* @export
|
|
8
|
+
* @param {string} urlStr
|
|
9
|
+
* @return {*} {{
|
|
10
|
+
* context: IParams;
|
|
11
|
+
* params: IParams;
|
|
12
|
+
* viewId: string;
|
|
13
|
+
* }}
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseViewProtocol(urlStr: string): {
|
|
16
|
+
context: IParams;
|
|
17
|
+
params: IParams;
|
|
18
|
+
viewId: string;
|
|
19
|
+
};
|
|
3
20
|
type ToViewParams = {
|
|
4
21
|
context: IContext;
|
|
5
22
|
params: IParams;
|
|
@@ -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;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAiCA;AAED,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,CAyH3E;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"}
|
|
@@ -4,6 +4,53 @@ import qs from 'qs';
|
|
|
4
4
|
import { OpenAppViewCommand } from '../../command';
|
|
5
5
|
import { convertNavData } from '../nav-params/nav-params';
|
|
6
6
|
import { calcDeCodeNameById, findFieldById } from '../../model';
|
|
7
|
+
/**
|
|
8
|
+
* 解析view://协议的字符串
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2024-02-06 09:26:20
|
|
11
|
+
* @export
|
|
12
|
+
* @param {string} urlStr
|
|
13
|
+
* @return {*} {{
|
|
14
|
+
* context: IParams;
|
|
15
|
+
* params: IParams;
|
|
16
|
+
* viewId: string;
|
|
17
|
+
* }}
|
|
18
|
+
*/
|
|
19
|
+
export function parseViewProtocol(urlStr) {
|
|
20
|
+
const url = new URL(urlStr);
|
|
21
|
+
const context = {};
|
|
22
|
+
const params = {};
|
|
23
|
+
let viewId = '';
|
|
24
|
+
if (url.searchParams.size > 0) {
|
|
25
|
+
const navCtx = url.searchParams.get('srfnavctx');
|
|
26
|
+
if (navCtx) {
|
|
27
|
+
try {
|
|
28
|
+
Object.assign(context, JSON.parse(navCtx));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
ibiz.log.error(`重定向[${urlStr}] 中 srfnavctx 参数解析失败`, error);
|
|
32
|
+
}
|
|
33
|
+
url.searchParams.delete('srfnavctx');
|
|
34
|
+
}
|
|
35
|
+
url.searchParams.forEach((value, _key) => {
|
|
36
|
+
params[_key] = value;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const rdTagItems = url.pathname.replace('//', '').split('/');
|
|
40
|
+
// 当只有一个时,为视图标识。当有两个时,第二个是视图标识
|
|
41
|
+
const [appOrViewTag, viewTag] = rdTagItems;
|
|
42
|
+
if (viewTag) {
|
|
43
|
+
viewId = viewTag;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
viewId = appOrViewTag;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
context,
|
|
50
|
+
params,
|
|
51
|
+
viewId,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
7
54
|
/**
|
|
8
55
|
* 打开重定向视图
|
|
9
56
|
*
|
|
@@ -154,31 +201,10 @@ export async function getDERedirectToView(appView, context, params = {}, opts =
|
|
|
154
201
|
let viewId = '';
|
|
155
202
|
// view://协议开头处理,值示例: view://{app}/{viewcodename}?srfnavctx={"work_item":"6c797b6a6dfbd8f38652fe3ea3220fc1","project":"ee11e5a96002f4f3937ddba025ec7d44"}&srfwftag={wftag}
|
|
156
203
|
if (rdTag.startsWith('view://')) {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
}
|
|
169
|
-
url.searchParams.forEach((value, _key) => {
|
|
170
|
-
params[_key] = value;
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
const rdTagItems = url.pathname.replace('//', '').split('/');
|
|
174
|
-
// 当只有一个时,为视图标识。当有两个时,第二个是视图标识
|
|
175
|
-
const [appOrViewTag, viewTag] = rdTagItems;
|
|
176
|
-
if (viewTag) {
|
|
177
|
-
viewId = viewTag;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
viewId = appOrViewTag;
|
|
181
|
-
}
|
|
204
|
+
const result = parseViewProtocol(rdTag);
|
|
205
|
+
Object.assign(context, result.context);
|
|
206
|
+
Object.assign(params, result.params);
|
|
207
|
+
viewId = result.viewId;
|
|
182
208
|
}
|
|
183
209
|
else {
|
|
184
210
|
// !!!工作流临时补充特殊处理标识, 避免补充了工作流流程匹配不上, 再从默认tag匹配!!!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.6.0-alpha.
|
|
3
|
+
"version": "0.6.0-alpha.4",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"build:rollup": "rollup -c",
|
|
22
22
|
"lint": "eslint 'src/**/*.ts'",
|
|
23
23
|
"lint:fix": "eslint --fix 'src/**/*.ts'",
|
|
24
|
+
"test": "vitest",
|
|
25
|
+
"test:ui": "vitest --ui",
|
|
26
|
+
"test:run": "vitest run",
|
|
24
27
|
"publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
|
|
25
28
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
26
29
|
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
@@ -29,8 +32,11 @@
|
|
|
29
32
|
},
|
|
30
33
|
"author": "chitanda",
|
|
31
34
|
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"animejs": "^3.2.2"
|
|
37
|
+
},
|
|
32
38
|
"devDependencies": {
|
|
33
|
-
"@ibiz-template/core": "^0.
|
|
39
|
+
"@ibiz-template/core": "^0.6.0-alpha.4",
|
|
34
40
|
"@ibiz/model-core": "^0.1.11",
|
|
35
41
|
"@types/animejs": "^3.1.12",
|
|
36
42
|
"@types/path-browserify": "^1.0.2",
|
|
@@ -61,8 +67,5 @@
|
|
|
61
67
|
"qx-util": "^0.4.8",
|
|
62
68
|
"ramda": "^0.29.0"
|
|
63
69
|
},
|
|
64
|
-
"
|
|
65
|
-
"animejs": "^3.2.2"
|
|
66
|
-
},
|
|
67
|
-
"gitHead": "f12ee6bf410373ab9446f755828f6c7f1e68c2c7"
|
|
70
|
+
"gitHead": "7eb997a859a84a17580e503519163e0980f8c5ca"
|
|
68
71
|
}
|
|
@@ -167,6 +167,18 @@ export class EditorController<T extends IEditor = IEditor>
|
|
|
167
167
|
this.style.height = `${height}px`;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
+
if (this.model.cssStyle) {
|
|
171
|
+
// 解析字符串形式的cssStyle为对象
|
|
172
|
+
const stylesObject: IData = {};
|
|
173
|
+
const stylesArray = this.model.cssStyle.split(';').filter(Boolean);
|
|
174
|
+
stylesArray.forEach(style => {
|
|
175
|
+
const [key, value] = style.split(':');
|
|
176
|
+
if (key && value) {
|
|
177
|
+
stylesObject[key.trim()] = value.trim();
|
|
178
|
+
}
|
|
179
|
+
Object.assign(this.style, stylesObject);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
170
182
|
// 值项过滤掉自身
|
|
171
183
|
if (this.model.editorItems) {
|
|
172
184
|
this.model.editorItems = this.model.editorItems.filter(
|
|
@@ -361,6 +361,7 @@ export class GridController<
|
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
+
this.calcColumnFixed();
|
|
364
365
|
}
|
|
365
366
|
|
|
366
367
|
async afterLoad(
|
|
@@ -733,6 +734,7 @@ export class GridController<
|
|
|
733
734
|
caption: column.caption!,
|
|
734
735
|
hidden: !!column.hideDefault || !!column.hiddenDataItem,
|
|
735
736
|
uaColumn: column.columnType === 'UAGRIDCOLUMN',
|
|
737
|
+
adaptive: column.widthUnit === 'STAR',
|
|
736
738
|
});
|
|
737
739
|
}
|
|
738
740
|
},
|
|
@@ -754,7 +756,11 @@ export class GridController<
|
|
|
754
756
|
);
|
|
755
757
|
const allNum = showColumns.length;
|
|
756
758
|
const { frozenFirstColumn, frozenLastColumn } = this.model;
|
|
759
|
+
this.hasAdaptiveColumn = false;
|
|
757
760
|
showColumns.forEach((column, index) => {
|
|
761
|
+
if (column.adaptive) {
|
|
762
|
+
this.hasAdaptiveColumn = true;
|
|
763
|
+
}
|
|
758
764
|
if (column.uaColumn) {
|
|
759
765
|
column.fixed = index + 1 <= Math.floor(allNum / 2) ? 'left' : 'right';
|
|
760
766
|
} else if (frozenFirstColumn && index < frozenFirstColumn) {
|
|
@@ -1308,6 +1314,7 @@ export class GridController<
|
|
|
1308
1314
|
*/
|
|
1309
1315
|
setColumnVisible(columnState: IColumnState): void {
|
|
1310
1316
|
columnState.hidden = !columnState.hidden;
|
|
1317
|
+
this.calcColumnFixed();
|
|
1311
1318
|
this.saveColumnStates();
|
|
1312
1319
|
}
|
|
1313
1320
|
|
|
@@ -1326,6 +1333,7 @@ export class GridController<
|
|
|
1326
1333
|
}
|
|
1327
1334
|
if (data.columnstates) {
|
|
1328
1335
|
this.state.columnStates = data.columnstates;
|
|
1336
|
+
this.calcColumnFixed();
|
|
1329
1337
|
} else {
|
|
1330
1338
|
this.initColumnStates();
|
|
1331
1339
|
}
|
|
@@ -1349,6 +1357,7 @@ export class GridController<
|
|
|
1349
1357
|
// 移除元素从旧位置,将元素插入到新位置
|
|
1350
1358
|
this.state.columnStates.splice(oldIndex, 1);
|
|
1351
1359
|
this.state.columnStates.splice(newIndex, 0, columnState);
|
|
1360
|
+
this.calcColumnFixed();
|
|
1352
1361
|
// 存本地缓存
|
|
1353
1362
|
this.saveColumnStates();
|
|
1354
1363
|
}
|
|
@@ -92,6 +92,12 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
92
92
|
* @returns {*} {Promise<void>}
|
|
93
93
|
*/
|
|
94
94
|
async init(): Promise<void> {
|
|
95
|
+
const hasVisibleLogic = !!this.model.panelItemGroupLogics?.find(
|
|
96
|
+
logic => logic.logicCat === 'PANELVISIBLE',
|
|
97
|
+
);
|
|
98
|
+
if (hasVisibleLogic) {
|
|
99
|
+
this.state.visible = false;
|
|
100
|
+
}
|
|
95
101
|
await this.onInit();
|
|
96
102
|
}
|
|
97
103
|
|
|
@@ -129,7 +129,12 @@ export class ToolbarController<
|
|
|
129
129
|
},
|
|
130
130
|
{ childrenFields: ['detoolbarItems'] },
|
|
131
131
|
);
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
if (!this.state.manualCalcButtonState) {
|
|
134
|
+
await this.calcButtonState();
|
|
135
|
+
} else {
|
|
136
|
+
await this.state.buttonsState.init();
|
|
137
|
+
}
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
/**
|
|
@@ -403,8 +403,8 @@ export class TreeController<
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
-
//
|
|
407
|
-
if (this.state.singleSelect) {
|
|
406
|
+
// 单选时,单击才会触发选中逻辑,禁止选择的时候不触发
|
|
407
|
+
if (this.state.singleSelect && !nodeData._disableSelect) {
|
|
408
408
|
// 选中相关处理
|
|
409
409
|
const { selectedData } = this.state;
|
|
410
410
|
// 选中里没有则添加,有则删除
|
|
@@ -419,17 +419,7 @@ export class TreeGridExNodeColumnController
|
|
|
419
419
|
event: MouseEvent,
|
|
420
420
|
): Promise<void> {
|
|
421
421
|
const actionId = detail.uiactionId;
|
|
422
|
-
await
|
|
423
|
-
actionId!,
|
|
424
|
-
{
|
|
425
|
-
context: this.context,
|
|
426
|
-
params: this.params,
|
|
427
|
-
data: [row.data],
|
|
428
|
-
view: this.treeGrid.view,
|
|
429
|
-
event,
|
|
430
|
-
},
|
|
431
|
-
detail.appId,
|
|
432
|
-
);
|
|
422
|
+
await this.treeGrid.doUIAction(actionId!, row.data, event, detail.appId);
|
|
433
423
|
}
|
|
434
424
|
|
|
435
425
|
/**
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
IUIActionGroup,
|
|
6
6
|
IUIActionGroupDetail,
|
|
7
7
|
} from '@ibiz/model-core';
|
|
8
|
-
import { UIActionUtil } from '../../../../../ui-action';
|
|
9
8
|
import { ButtonContainerState, UIActionButtonState } from '../../../../utils';
|
|
10
9
|
import { TreeGridExColumnController } from '../tree-grid-ex-column/tree-grid-ex-column.controller';
|
|
11
10
|
import { ITreeGridExRowState } from '../../../../../interface';
|
|
@@ -128,17 +127,7 @@ export class TreeGridExUAColumnController extends TreeGridExColumnController<IDE
|
|
|
128
127
|
event: MouseEvent,
|
|
129
128
|
): Promise<void> {
|
|
130
129
|
const actionId = detail.uiactionId;
|
|
131
|
-
await
|
|
132
|
-
actionId!,
|
|
133
|
-
{
|
|
134
|
-
context: this.context,
|
|
135
|
-
params: this.params,
|
|
136
|
-
data: [row.data],
|
|
137
|
-
view: this.treeGrid.view,
|
|
138
|
-
event,
|
|
139
|
-
},
|
|
140
|
-
detail.appId,
|
|
141
|
-
);
|
|
130
|
+
await this.treeGrid.doUIAction(actionId!, row.data, event, detail.appId);
|
|
142
131
|
}
|
|
143
132
|
|
|
144
133
|
gridStateNotify(row: TreeGridExRowState, state: TreeGridExNotifyState): void {
|
|
@@ -88,7 +88,7 @@ export class UIActionButtonState implements IButtonState {
|
|
|
88
88
|
* @protected
|
|
89
89
|
* @return {*}
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
async init(): Promise<void> {
|
|
92
92
|
if (!this.uiActionId) {
|
|
93
93
|
this.isInit = true;
|
|
94
94
|
return;
|
|
@@ -114,6 +114,11 @@ export class UIActionButtonState implements IButtonState {
|
|
|
114
114
|
this.visible = false;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
if ([2, 6].includes(noPrivDisplayMode!) && this.dataAccessAction) {
|
|
118
|
+
// 有权限标识且无权限隐藏的,先隐藏
|
|
119
|
+
this.visible = false;
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
// 数据目标不为空,和一些要数据的预置界面行为,没数据的时候禁用
|
|
118
123
|
if (
|
|
119
124
|
(actionTarget && actionTarget !== 'NONE') ||
|
|
@@ -84,9 +84,21 @@ export class ViewEngineBase implements IViewEngine {
|
|
|
84
84
|
* @param {IViewController} view 视图控制器
|
|
85
85
|
*/
|
|
86
86
|
constructor(protected view: IViewController) {
|
|
87
|
+
this.init();
|
|
87
88
|
this.initViewState();
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
/**
|
|
92
|
+
* 引擎内部初始化
|
|
93
|
+
*
|
|
94
|
+
* @author chitanda
|
|
95
|
+
* @date 2024-02-05 22:02:12
|
|
96
|
+
* @protected
|
|
97
|
+
*/
|
|
98
|
+
protected init(): void {
|
|
99
|
+
// 引擎初始化
|
|
100
|
+
}
|
|
101
|
+
|
|
90
102
|
async onCreated(): Promise<void> {
|
|
91
103
|
const { childNames } = this.view;
|
|
92
104
|
childNames.push('captionbar', 'toolbar');
|
|
@@ -50,5 +50,13 @@ export interface IButtonContainerState {
|
|
|
50
50
|
*/
|
|
51
51
|
update(data?: IData, appDeId?: string): Promise<void>;
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* 初始化
|
|
55
|
+
* @author lxm
|
|
56
|
+
* @date 2024-02-05 06:36:18
|
|
57
|
+
* @return {*} {Promise<void>}
|
|
58
|
+
*/
|
|
59
|
+
init(): Promise<void>;
|
|
60
|
+
|
|
53
61
|
[p: string]: any;
|
|
54
62
|
}
|
|
@@ -55,4 +55,12 @@ export interface IButtonState {
|
|
|
55
55
|
* @return {*} {Promise<void>}
|
|
56
56
|
*/
|
|
57
57
|
update(data?: IData, appDeId?: string): Promise<void>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 初始化
|
|
61
|
+
* @author lxm
|
|
62
|
+
* @date 2024-02-05 06:37:06
|
|
63
|
+
* @return {*} {Promise<void>}
|
|
64
|
+
*/
|
|
65
|
+
init(): Promise<void>;
|
|
58
66
|
}
|
|
@@ -190,6 +190,14 @@ export interface IColumnState {
|
|
|
190
190
|
* @type {('left' | 'right')}
|
|
191
191
|
*/
|
|
192
192
|
fixed?: 'left' | 'right';
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 是否是自适应列
|
|
196
|
+
* @author lxm
|
|
197
|
+
* @date 2024-02-05 01:51:07
|
|
198
|
+
* @type {boolean}
|
|
199
|
+
*/
|
|
200
|
+
adaptive?: boolean;
|
|
193
201
|
}
|
|
194
202
|
|
|
195
203
|
/**
|
|
@@ -26,6 +26,14 @@ export interface IToolbarState extends IControlState {
|
|
|
26
26
|
* @type {ExtraButtons}
|
|
27
27
|
*/
|
|
28
28
|
extraButtons: IExtraButtons;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 手动计算按钮状态(工具栏自身默认不计算)
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2024-02-05 06:02:49
|
|
34
|
+
* @type {boolean}
|
|
35
|
+
*/
|
|
36
|
+
manualCalcButtonState: boolean;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -188,6 +188,14 @@ export interface ITreeNodeData {
|
|
|
188
188
|
*/
|
|
189
189
|
_textHtml?: string;
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* 是否禁止选择
|
|
193
|
+
* @author lxm
|
|
194
|
+
* @date 2024-02-07 09:28:14
|
|
195
|
+
* @type {boolean}
|
|
196
|
+
*/
|
|
197
|
+
_disableSelect?: boolean;
|
|
198
|
+
|
|
191
199
|
/**
|
|
192
200
|
* 作为实体数据时的主键
|
|
193
201
|
* @author lxm
|
|
@@ -42,6 +42,8 @@ export abstract class TreeNodeData implements ITreeNodeData {
|
|
|
42
42
|
|
|
43
43
|
_textHtml?: string;
|
|
44
44
|
|
|
45
|
+
_disableSelect?: boolean;
|
|
46
|
+
|
|
45
47
|
constructor(
|
|
46
48
|
model: IDETreeNode,
|
|
47
49
|
parentNodeData: ITreeNodeData | undefined,
|
|
@@ -50,6 +52,7 @@ export abstract class TreeNodeData implements ITreeNodeData {
|
|
|
50
52
|
this._leaf = opts.leaf === true;
|
|
51
53
|
this._parent = parentNodeData;
|
|
52
54
|
this._nodeType = model.treeNodeType!;
|
|
55
|
+
this._disableSelect = model.disableSelect === true;
|
|
53
56
|
|
|
54
57
|
// 所有节点都要继承父的上下文,如果父存在则复制父的资源上下文,否则返回空对象。
|
|
55
58
|
if (this._parent) {
|
|
@@ -38,12 +38,14 @@ export class BackendUIActionProvider extends UIActionProviderBase {
|
|
|
38
38
|
// 如果有打开视图,打开视图,并把返回的数据作为子实体数据
|
|
39
39
|
const frontPSAppView = action.frontAppViewId;
|
|
40
40
|
if (frontPSAppView) {
|
|
41
|
+
// 解析自定义 视图 option 参数
|
|
42
|
+
const options = this.handleViewOptionParams(resultParams);
|
|
41
43
|
const res: IModalData | undefined = await ibiz.commands.execute(
|
|
42
44
|
OpenAppViewCommand.TAG,
|
|
43
45
|
frontPSAppView,
|
|
44
46
|
resultContext,
|
|
45
47
|
resultParams,
|
|
46
|
-
{ event },
|
|
48
|
+
{ event, ...options },
|
|
47
49
|
);
|
|
48
50
|
if (!res?.ok) {
|
|
49
51
|
actionResult.cancel = true;
|
|
@@ -88,28 +88,6 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
88
88
|
return actionResult;
|
|
89
89
|
}
|
|
90
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
|
-
|
|
113
91
|
/**
|
|
114
92
|
* 处理模式:用户自定义
|
|
115
93
|
* @author lxm
|
|
@@ -362,4 +362,26 @@ export abstract class UIActionProviderBase implements IUIActionProvider {
|
|
|
362
362
|
}) as string;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* 处理打开视图配置自定义参数 modalOption
|
|
368
|
+
*
|
|
369
|
+
* @author zk
|
|
370
|
+
* @date 2024-02-01 01:02:28
|
|
371
|
+
* @param {IData} param
|
|
372
|
+
* @return {*} {IData}
|
|
373
|
+
* @memberof FrontUIActionProvider
|
|
374
|
+
*/
|
|
375
|
+
handleViewOptionParams(param: IData): IData {
|
|
376
|
+
if (param.modaloption) {
|
|
377
|
+
try {
|
|
378
|
+
const modalOption = JSON.parse(param.modaloption);
|
|
379
|
+
delete param.modaloption;
|
|
380
|
+
return { modalOption };
|
|
381
|
+
} catch (error) {
|
|
382
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return {};
|
|
386
|
+
}
|
|
365
387
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INavigateParam } from '@ibiz/model-core';
|
|
2
|
-
import { isEmpty } from 'lodash-es';
|
|
2
|
+
import { isEmpty, isNil } from 'lodash-es';
|
|
3
3
|
import { isNilOrEmpty, notNilEmpty } from 'qx-util';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -122,7 +122,7 @@ export function convertNavDataByArray(
|
|
|
122
122
|
key.slice(2, -1).toLowerCase(),
|
|
123
123
|
);
|
|
124
124
|
if (find) {
|
|
125
|
-
valueStr = valueStr.replace(key, `${value}`);
|
|
125
|
+
valueStr = valueStr.replace(key, `${isNil(value) ? '' : value}`);
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
result[naviData.key!.toLowerCase()] = valueStr;
|