@ibiz-template/runtime 0.0.1-beta.17 → 0.0.2-beta.1
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/system/index.system.js +1 -1
- package/out/application.d.ts +55 -0
- package/out/application.d.ts.map +1 -0
- package/out/application.js +35 -0
- package/out/constant/index.d.ts +1 -1
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -1
- package/out/controller/control/app-menu.d.ts +5 -3
- package/out/controller/control/app-menu.d.ts.map +1 -1
- package/out/controller/control/app-menu.js +10 -6
- package/out/controller/control/grid/grid-column.d.ts +3 -1
- package/out/controller/control/grid/grid-column.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column.js +1 -0
- package/out/controller/control/grid/grid-field-column.js +1 -1
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/tree.d.ts +34 -0
- package/out/controller/control/tree.d.ts.map +1 -0
- package/out/controller/control/tree.js +32 -0
- package/out/controller/editor/code-list-editor.js +1 -1
- package/out/controller/editor/editor.d.ts +9 -0
- package/out/controller/editor/editor.d.ts.map +1 -1
- package/out/controller/editor/editor.js +1 -0
- package/out/controller/editor/picker.js +1 -1
- package/out/controller/editor/upload.js +1 -1
- package/out/controller/interface/ability/control/i-tree-ability.d.ts +12 -0
- package/out/controller/interface/ability/control/i-tree-ability.d.ts.map +1 -0
- package/out/controller/interface/ability/control/i-tree-ability.js +1 -0
- package/out/controller/interface/ability/control/index.d.ts +1 -0
- package/out/controller/interface/ability/control/index.d.ts.map +1 -1
- package/out/controller/interface/ability/control/index.js +1 -0
- package/out/controller/interface/ability/view/i-tree-exp-view-ability.d.ts +12 -0
- package/out/controller/interface/ability/view/i-tree-exp-view-ability.d.ts.map +1 -0
- package/out/controller/interface/ability/view/i-tree-exp-view-ability.js +1 -0
- package/out/controller/interface/ability/view/index.d.ts +1 -0
- package/out/controller/interface/ability/view/index.d.ts.map +1 -1
- package/out/controller/interface/ability/view/index.js +1 -0
- package/out/controller/interface/event/control/i-tree-event.d.ts +11 -0
- package/out/controller/interface/event/control/i-tree-event.d.ts.map +1 -0
- package/out/controller/interface/event/control/i-tree-event.js +1 -0
- package/out/controller/interface/event/control/index.d.ts +1 -0
- package/out/controller/interface/event/control/index.d.ts.map +1 -1
- package/out/controller/interface/event/control/index.js +1 -0
- package/out/controller/interface/event/view/i-tree-exp-view-event.d.ts +12 -0
- package/out/controller/interface/event/view/i-tree-exp-view-event.d.ts.map +1 -0
- package/out/controller/interface/event/view/i-tree-exp-view-event.js +1 -0
- package/out/controller/interface/event/view/index.d.ts +1 -0
- package/out/controller/interface/event/view/index.d.ts.map +1 -1
- package/out/controller/interface/event/view/index.js +1 -0
- package/out/controller/interface/provider/i-control-provider.d.ts +1 -1
- package/out/controller/interface/provider/i-editor-provider.d.ts +2 -2
- package/out/controller/interface/provider/i-editor-provider.d.ts.map +1 -1
- package/out/controller/interface/provider/i-form-detail-provider.d.ts +1 -1
- package/out/controller/interface/provider/i-form-detail-provider.d.ts.map +1 -1
- package/out/controller/interface/provider/i-grid-column-provider.d.ts +1 -1
- package/out/controller/interface/provider/i-grid-column-provider.d.ts.map +1 -1
- package/out/controller/interface/provider/i-portlet-part-provider.d.ts +1 -1
- package/out/controller/interface/provider/i-view-provider.d.ts +1 -1
- package/out/controller/neuron/nerve/control/index.d.ts +1 -0
- package/out/controller/neuron/nerve/control/index.d.ts.map +1 -1
- package/out/controller/neuron/nerve/control/index.js +1 -0
- package/out/controller/neuron/nerve/control/tree-nerve.d.ts +16 -0
- package/out/controller/neuron/nerve/control/tree-nerve.d.ts.map +1 -0
- package/out/controller/neuron/nerve/control/tree-nerve.js +16 -0
- package/out/controller/neuron/nerve/view/index.d.ts +1 -0
- package/out/controller/neuron/nerve/view/index.d.ts.map +1 -1
- package/out/controller/neuron/nerve/view/index.js +1 -0
- package/out/controller/neuron/nerve/view/tree-exp-view-nerve.d.ts +19 -0
- package/out/controller/neuron/nerve/view/tree-exp-view-nerve.d.ts.map +1 -0
- package/out/controller/neuron/nerve/view/tree-exp-view-nerve.js +28 -0
- package/out/controller/neuron/neuron/view.d.ts +4 -2
- package/out/controller/neuron/neuron/view.d.ts.map +1 -1
- package/out/controller/neuron/neuron/view.js +3 -0
- package/out/controller/neuron/neuron/widget.d.ts +4 -2
- package/out/controller/neuron/neuron/widget.d.ts.map +1 -1
- package/out/controller/neuron/neuron/widget.js +2 -0
- package/out/controller/utils/button-state/button-state.d.ts +2 -0
- package/out/controller/utils/button-state/button-state.d.ts.map +1 -1
- package/out/controller/utils/button-state/button-state.js +2 -1
- package/out/controller/view/edit-view.js +1 -1
- package/out/controller/view/index.d.ts +1 -0
- package/out/controller/view/index.d.ts.map +1 -1
- package/out/controller/view/index.js +1 -0
- package/out/controller/view/tree-exp-view.d.ts +25 -0
- package/out/controller/view/tree-exp-view.d.ts.map +1 -0
- package/out/controller/view/tree-exp-view.js +41 -0
- package/out/controller/view/view.d.ts +9 -0
- package/out/controller/view/view.d.ts.map +1 -1
- package/out/controller/view/view.js +3 -2
- package/out/controller/view/wf-step-trace-view.js +1 -1
- package/out/install.d.ts.map +1 -1
- package/out/install.js +6 -7
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +1 -1
- package/out/model.d.ts +88 -0
- package/out/model.d.ts.map +1 -0
- package/out/model.js +166 -0
- package/out/runtime-hub.d.ts +35 -0
- package/out/runtime-hub.d.ts.map +1 -0
- package/out/runtime-hub.js +66 -0
- package/out/service/authority/authority.service.d.ts +4 -1
- package/out/service/authority/authority.service.d.ts.map +1 -1
- package/out/service/authority/authority.service.js +7 -3
- package/out/service/dto/method.dto.d.ts +2 -0
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +9 -3
- package/out/service/index.d.ts +1 -0
- package/out/service/index.d.ts.map +1 -1
- package/out/service/index.js +1 -0
- package/out/service/service/code-list/code-list.service.d.ts +4 -3
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +5 -7
- package/out/service/service/entity/method/de-action.js +5 -5
- package/out/service/service/entity/method/method-renturn.d.ts +2 -0
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +2 -1
- package/out/service/service/entity/method/method.d.ts +2 -0
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +6 -5
- package/out/service/service/widget/control-service.d.ts +2 -0
- package/out/service/service/widget/control-service.d.ts.map +1 -1
- package/out/service/service/widget/control-service.js +2 -1
- package/out/service/service/widget/index.d.ts +2 -1
- package/out/service/service/widget/index.d.ts.map +1 -1
- package/out/service/service/widget/index.js +2 -1
- package/out/service/service/widget/tree-service.d.ts +51 -0
- package/out/service/service/widget/tree-service.d.ts.map +1 -0
- package/out/service/service/widget/tree-service.js +100 -0
- package/out/service/service/work-flow/work-flow.service.d.ts +0 -8
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.js +10 -10
- package/out/service/service-util.d.ts +13 -5
- package/out/service/service-util.d.ts.map +1 -1
- package/out/service/service-util.js +15 -9
- package/out/service/utils/app-counter/app-counter.d.ts +2 -0
- package/out/service/utils/app-counter/app-counter.d.ts.map +1 -1
- package/out/service/utils/app-counter/app-counter.js +2 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +2 -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 +3 -2
- package/out/service/utils/service-path-util/service-path-util.d.ts.map +1 -1
- package/out/service/utils/service-path-util/service-path-util.js +1 -2
- package/out/service/vo/tree-node-data.d.ts +44 -0
- package/out/service/vo/tree-node-data.d.ts.map +1 -0
- package/out/service/vo/tree-node-data.js +1 -0
- package/out/types.d.ts +19 -25
- package/out/types.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +2 -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 +2 -1
- package/package.json +6 -6
- package/src/application.ts +73 -0
- package/src/constant/index.ts +1 -1
- package/src/controller/control/app-menu.ts +11 -7
- package/src/controller/control/grid/grid-column.ts +5 -1
- package/src/controller/control/grid/grid-field-column.ts +1 -1
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/tree.ts +47 -0
- package/src/controller/editor/code-list-editor.ts +1 -1
- package/src/controller/editor/editor.ts +11 -0
- package/src/controller/editor/picker.ts +1 -1
- package/src/controller/editor/upload.ts +1 -1
- package/src/controller/interface/ability/control/i-tree-ability.ts +12 -0
- package/src/controller/interface/ability/control/index.ts +1 -0
- package/src/controller/interface/ability/view/i-tree-exp-view-ability.ts +12 -0
- package/src/controller/interface/ability/view/index.ts +1 -0
- package/src/controller/interface/event/control/i-tree-event.ts +11 -0
- package/src/controller/interface/event/control/index.ts +1 -0
- package/src/controller/interface/event/view/i-tree-exp-view-event.ts +12 -0
- package/src/controller/interface/event/view/index.ts +1 -0
- package/src/controller/interface/provider/i-control-provider.ts +1 -1
- package/src/controller/interface/provider/i-editor-provider.ts +4 -3
- package/src/controller/interface/provider/i-form-detail-provider.ts +1 -2
- package/src/controller/interface/provider/i-grid-column-provider.ts +1 -2
- package/src/controller/interface/provider/i-portlet-part-provider.ts +1 -1
- package/src/controller/interface/provider/i-view-provider.ts +1 -1
- package/src/controller/neuron/nerve/control/index.ts +1 -0
- package/src/controller/neuron/nerve/control/tree-nerve.ts +18 -0
- package/src/controller/neuron/nerve/view/index.ts +1 -0
- package/src/controller/neuron/nerve/view/tree-exp-view-nerve.ts +38 -0
- package/src/controller/neuron/neuron/view.ts +8 -0
- package/src/controller/neuron/neuron/widget.ts +3 -0
- package/src/controller/utils/button-state/button-state.ts +5 -1
- package/src/controller/view/edit-view.ts +1 -1
- package/src/controller/view/index.ts +1 -0
- package/src/controller/view/tree-exp-view.ts +49 -0
- package/src/controller/view/view.ts +12 -5
- package/src/controller/view/wf-step-trace-view.ts +1 -1
- package/src/install.ts +6 -12
- package/src/interface/i-plugin-factory/i-plugin-factory.ts +1 -1
- package/src/model.ts +188 -0
- package/src/runtime-hub.ts +76 -0
- package/src/service/authority/authority.service.ts +9 -2
- package/src/service/dto/method.dto.ts +11 -3
- package/src/service/index.ts +1 -0
- package/src/service/service/code-list/code-list.service.ts +6 -6
- package/src/service/service/entity/method/de-action.ts +5 -5
- package/src/service/service/entity/method/method-renturn.ts +5 -1
- package/src/service/service/entity/method/method.ts +9 -5
- package/src/service/service/widget/control-service.ts +5 -1
- package/src/service/service/widget/index.ts +2 -1
- package/src/service/service/widget/tree-service.ts +143 -0
- package/src/service/service/work-flow/work-flow.service.ts +13 -20
- package/src/service/service-util.ts +15 -8
- package/src/service/utils/app-counter/app-counter.ts +7 -2
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +6 -2
- package/src/service/utils/service-path-util/service-path-util.ts +2 -2
- package/src/service/vo/tree-node-data.ts +47 -0
- package/src/types.ts +27 -33
- package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +2 -1
- package/src/utils/open-redirect-view/open-redirect-view.ts +2 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ViewNerve, TreeExpViewNeuron, TreeNeuron, Neuron } from '../..';
|
|
2
|
+
import { TreeExpViewController } from '../../..';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 树导航视图神经系统
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-14 14:10:48
|
|
9
|
+
* @export
|
|
10
|
+
* @class TreeExpViewNerve
|
|
11
|
+
* @extends {ViewNerve<TreeExpViewNeuron, TreeExpViewController>}
|
|
12
|
+
*/
|
|
13
|
+
export class TreeExpViewNerve extends ViewNerve<
|
|
14
|
+
TreeExpViewNeuron,
|
|
15
|
+
TreeExpViewController
|
|
16
|
+
> {
|
|
17
|
+
tree!: TreeNeuron;
|
|
18
|
+
|
|
19
|
+
protected createNeuron(): TreeExpViewNeuron {
|
|
20
|
+
return new TreeExpViewNeuron(this.bindAbility());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
inclusive(name: string): boolean {
|
|
24
|
+
return name === 'tree' || super.inclusive(name);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
connect(name: string, neuron: Neuron): void {
|
|
28
|
+
super.connect(name, neuron);
|
|
29
|
+
if (name === 'tree') {
|
|
30
|
+
this.tree = neuron as TreeNeuron;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
destroy(): void {
|
|
35
|
+
super.destroy();
|
|
36
|
+
this.tree = undefined as never;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
IOptViewAbility,
|
|
11
11
|
IPickupGridViewAbility,
|
|
12
12
|
IPickupViewAbility,
|
|
13
|
+
ITreeExpViewAbility,
|
|
13
14
|
IViewAbility,
|
|
14
15
|
IWFDynaActionViewAbility,
|
|
15
16
|
IWFDynaEditView3Ability,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
IOptViewEvent,
|
|
28
29
|
IPickupGridViewEvent,
|
|
29
30
|
IPickupViewEvent,
|
|
31
|
+
ITreeExpViewEvent,
|
|
30
32
|
IViewEvent,
|
|
31
33
|
IWFDynaActionViewEvent,
|
|
32
34
|
IWFDynaEditView3Event,
|
|
@@ -91,3 +93,9 @@ export class AppPortalViewNeuron extends Neuron<
|
|
|
91
93
|
IAppPortalViewEvent,
|
|
92
94
|
IAppPortalViewAbility
|
|
93
95
|
> {}
|
|
96
|
+
|
|
97
|
+
// 导航类
|
|
98
|
+
export class TreeExpViewNeuron extends Neuron<
|
|
99
|
+
ITreeExpViewEvent,
|
|
100
|
+
ITreeExpViewAbility
|
|
101
|
+
> {}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
IPickupViewPanelAbility,
|
|
13
13
|
ISearchFormAbility,
|
|
14
14
|
IToolbarAbility,
|
|
15
|
+
ITreeAbility,
|
|
15
16
|
IViewPanelAbility,
|
|
16
17
|
} from '../../interface/ability';
|
|
17
18
|
import {
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
IPickupViewPanelEvent,
|
|
27
28
|
ISearchFormEvent,
|
|
28
29
|
IToolbarEvent,
|
|
30
|
+
ITreeEvent,
|
|
29
31
|
IViewPanelEvent,
|
|
30
32
|
} from '../../interface/event';
|
|
31
33
|
|
|
@@ -46,6 +48,7 @@ export class MDControlNeuron extends Neuron<
|
|
|
46
48
|
> {}
|
|
47
49
|
export class GridNeuron extends Neuron<IGridEvent, IGridAbility> {}
|
|
48
50
|
export class ListNeuron extends Neuron<IListEvent, IListAbility> {}
|
|
51
|
+
export class TreeNeuron extends Neuron<ITreeEvent, ITreeAbility> {}
|
|
49
52
|
|
|
50
53
|
// *面板部件
|
|
51
54
|
export class ViewPanelNeuron extends Neuron<
|
|
@@ -3,9 +3,12 @@ import {
|
|
|
3
3
|
IPSAppDEUIAction,
|
|
4
4
|
IPSUIAction,
|
|
5
5
|
} from '@ibiz-template/model';
|
|
6
|
+
import { Application } from '../../../application';
|
|
6
7
|
import { IButtonState } from '../../interface';
|
|
7
8
|
|
|
8
9
|
export class ButtonState implements IButtonState {
|
|
10
|
+
protected app: Application;
|
|
11
|
+
|
|
9
12
|
disabled: boolean = false;
|
|
10
13
|
|
|
11
14
|
visible: boolean = true;
|
|
@@ -23,6 +26,7 @@ export class ButtonState implements IButtonState {
|
|
|
23
26
|
declare entity: AppEntityModel;
|
|
24
27
|
|
|
25
28
|
constructor(name: string, uiAction: IPSUIAction, entity: AppEntityModel) {
|
|
29
|
+
this.app = ibiz.hub.getApp(entity.modelService.app);
|
|
26
30
|
this.name = name;
|
|
27
31
|
// 赋值uiAction
|
|
28
32
|
Object.defineProperty(this, 'uiAction', {
|
|
@@ -49,7 +53,7 @@ export class ButtonState implements IButtonState {
|
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
update(data?: IData | undefined): void {
|
|
52
|
-
const permitted =
|
|
56
|
+
const permitted = this.app.authority.hasUIActionPermitted(
|
|
53
57
|
this.uiAction,
|
|
54
58
|
data,
|
|
55
59
|
this.entity,
|
|
@@ -38,7 +38,7 @@ export class EditViewController<
|
|
|
38
38
|
|
|
39
39
|
protected async onInit(): Promise<void> {
|
|
40
40
|
await super.onInit();
|
|
41
|
-
this.entityService = await
|
|
41
|
+
this.entityService = await this.app.es.getService(
|
|
42
42
|
this.model.appEntity.codeName,
|
|
43
43
|
this.context,
|
|
44
44
|
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TreeExpViewModel } from '@ibiz-template/model';
|
|
2
|
+
import { ViewMode } from '../../constant';
|
|
3
|
+
import { TreeExpViewNerve } from '../neuron';
|
|
4
|
+
import { ViewController } from './view';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 树导航视图控制器
|
|
8
|
+
*
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2022-09-08 16:09:49
|
|
11
|
+
* @export
|
|
12
|
+
* @class TreeExpViewController
|
|
13
|
+
* @extends {ViewController}
|
|
14
|
+
*/
|
|
15
|
+
export class TreeExpViewController<
|
|
16
|
+
T extends TreeExpViewModel = TreeExpViewModel,
|
|
17
|
+
> extends ViewController<T> {
|
|
18
|
+
declare nerve: TreeExpViewNerve;
|
|
19
|
+
|
|
20
|
+
protected createNerve(): TreeExpViewNerve {
|
|
21
|
+
return new TreeExpViewNerve(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected async onInit(): Promise<void> {
|
|
25
|
+
await super.onInit();
|
|
26
|
+
// 数据看板适配器
|
|
27
|
+
const { tree } = this.model;
|
|
28
|
+
if (tree) {
|
|
29
|
+
this.providers[tree.name] = await ibiz.register.control.get(tree);
|
|
30
|
+
}
|
|
31
|
+
this.nerve.self.evt.on('mounted', () => {
|
|
32
|
+
if (this.modal.mode !== ViewMode.EMBED && this.model.source.loadDefault) {
|
|
33
|
+
this.load();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 加载方法
|
|
40
|
+
*
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2022-08-31 11:08:10
|
|
43
|
+
*/
|
|
44
|
+
async load(): Promise<IData[]> {
|
|
45
|
+
// 调用数部件加载
|
|
46
|
+
const { tree } = this.nerve;
|
|
47
|
+
return tree.call.load();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
DefectModelError,
|
|
4
4
|
IPSAppViewLogic,
|
|
5
5
|
IPSDETBUIActionItem,
|
|
6
|
-
ModelUtil,
|
|
7
6
|
ViewModel,
|
|
8
7
|
} from '@ibiz-template/model';
|
|
9
8
|
import { createUUID, notNilEmpty } from 'qx-util';
|
|
@@ -15,6 +14,7 @@ import { IModal, IModalData } from '../../interface';
|
|
|
15
14
|
import { ViewMode } from '../../constant';
|
|
16
15
|
import { convertNavData } from '../../utils';
|
|
17
16
|
import { executeViewLogic } from '../../view-logic';
|
|
17
|
+
import { Application } from '../../application';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* 视图控制器
|
|
@@ -35,6 +35,15 @@ export class ViewController<T extends ViewModel = ViewModel> {
|
|
|
35
35
|
*/
|
|
36
36
|
model!: T;
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* 当前视图所归属的应用
|
|
40
|
+
*
|
|
41
|
+
* @author chitanda
|
|
42
|
+
* @date 2022-12-21 11:12:29
|
|
43
|
+
* @type {Application}
|
|
44
|
+
*/
|
|
45
|
+
app!: Application;
|
|
46
|
+
|
|
38
47
|
/**
|
|
39
48
|
* 当为模态、飘窗等非路由模式打开时,外部会注入此方法,用于关闭视图。
|
|
40
49
|
*
|
|
@@ -175,10 +184,8 @@ export class ViewController<T extends ViewModel = ViewModel> {
|
|
|
175
184
|
*/
|
|
176
185
|
protected async onInit(): Promise<void> {
|
|
177
186
|
this.emit('neuronInit', this.nerve.self);
|
|
178
|
-
this.model = (await
|
|
179
|
-
|
|
180
|
-
this.context,
|
|
181
|
-
)) as T;
|
|
187
|
+
this.model = (await ibiz.model.getView(this.modelPath)) as T;
|
|
188
|
+
this.app = ibiz.hub.getApp(this.model.modelService.app);
|
|
182
189
|
|
|
183
190
|
// 处理上下文和导航参数
|
|
184
191
|
this.handleViewParams();
|
|
@@ -44,7 +44,7 @@ export class WFStepTraceViewController extends ViewController {
|
|
|
44
44
|
if (!this.deName) {
|
|
45
45
|
throw new RuntimeError('没有接收到deName');
|
|
46
46
|
}
|
|
47
|
-
this.entityService = await
|
|
47
|
+
this.entityService = await this.app.es.getService(
|
|
48
48
|
this.deName,
|
|
49
49
|
this.context,
|
|
50
50
|
);
|
package/src/install.ts
CHANGED
|
@@ -2,12 +2,9 @@ import { GlobalConfig } from './config/global-config';
|
|
|
2
2
|
import { RegisterCenter } from './register/register-center';
|
|
3
3
|
import { installCommand } from './command';
|
|
4
4
|
import { presetUIActionProvider } from './provider';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
CodeListService,
|
|
9
|
-
ServiceUtil,
|
|
10
|
-
} from './service';
|
|
5
|
+
import { AuthService } from './service';
|
|
6
|
+
import { GlobalModel } from './model';
|
|
7
|
+
import { RuntimeHub } from './runtime-hub';
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* 安装运行时
|
|
@@ -18,18 +15,15 @@ import {
|
|
|
18
15
|
*/
|
|
19
16
|
export function install(): void {
|
|
20
17
|
const { ibiz } = window;
|
|
18
|
+
ibiz.hub = new RuntimeHub();
|
|
19
|
+
// 全局模型对象
|
|
20
|
+
ibiz.model = new GlobalModel();
|
|
21
21
|
// 挂载注册中心
|
|
22
22
|
ibiz.register = new RegisterCenter();
|
|
23
23
|
// 初始化全局配置
|
|
24
24
|
ibiz.config = new GlobalConfig();
|
|
25
|
-
// 代码表服务
|
|
26
|
-
ibiz.codeListService = new CodeListService();
|
|
27
|
-
// 应用实体服务工具类
|
|
28
|
-
ibiz.entityService = new ServiceUtil();
|
|
29
25
|
// 挂载认证服务
|
|
30
26
|
ibiz.auth = new AuthService();
|
|
31
|
-
// 挂载权限服务
|
|
32
|
-
ibiz.authority = new AuthorityService();
|
|
33
27
|
// 安装默认指令
|
|
34
28
|
installCommand();
|
|
35
29
|
// 注册预置的界面行为适配器
|
package/src/model.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppMenuItemModel,
|
|
3
|
+
DefectModelError,
|
|
4
|
+
IModelService,
|
|
5
|
+
IPSAppFunc,
|
|
6
|
+
IPSAppView,
|
|
7
|
+
IPSSubAppRef,
|
|
8
|
+
ModelConst,
|
|
9
|
+
ModelService,
|
|
10
|
+
ModelUtil,
|
|
11
|
+
SubModelService,
|
|
12
|
+
ViewModel,
|
|
13
|
+
} from '@ibiz-template/model';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 全局模型处理
|
|
17
|
+
*
|
|
18
|
+
* @author chitanda
|
|
19
|
+
* @date 2022-12-20 17:12:34
|
|
20
|
+
* @export
|
|
21
|
+
* @class GlobalModel
|
|
22
|
+
*/
|
|
23
|
+
export class GlobalModel {
|
|
24
|
+
protected util = new ModelUtil();
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 所有视图对应的应用标识
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2022-12-20 19:12:37
|
|
31
|
+
* @protected
|
|
32
|
+
* @type {Map<string, string>} Map<视图模型标识, 应用标识>
|
|
33
|
+
*/
|
|
34
|
+
protected views: Map<string, string> = new Map();
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 初始化模型加载
|
|
38
|
+
*
|
|
39
|
+
* @author chitanda
|
|
40
|
+
* @date 2022-12-22 21:12:37
|
|
41
|
+
* @param {string} [dynaModelTag]
|
|
42
|
+
* @return {*} {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
async init(dynaModelTag?: string): Promise<void> {
|
|
45
|
+
// 构造跟 hub 模型加载
|
|
46
|
+
const help = await this.util.create(async modelPath => {
|
|
47
|
+
const url = `${ibiz.env.remoteModelUrl}${modelPath}?dynamodeltag=${dynaModelTag}`;
|
|
48
|
+
const res = await ibiz.net.get(url);
|
|
49
|
+
if (res.ok) {
|
|
50
|
+
if (modelPath.endsWith('PSSYSAPP.json')) {
|
|
51
|
+
res.data.id = ibiz.env.appId;
|
|
52
|
+
}
|
|
53
|
+
return res.data as IModel;
|
|
54
|
+
}
|
|
55
|
+
return {};
|
|
56
|
+
}, ibiz.env.hub);
|
|
57
|
+
// 根模型对象
|
|
58
|
+
const root = (await help.getModelService()) as unknown as ModelService;
|
|
59
|
+
this.setViews(
|
|
60
|
+
ModelConst.DEFAULT_SANDBOX,
|
|
61
|
+
root.app.getAllPSAppViews() || [],
|
|
62
|
+
);
|
|
63
|
+
await ibiz.hub.createApp(ModelConst.DEFAULT_SANDBOX, root);
|
|
64
|
+
const appRefs = root.app.getAllPSSubAppRefs();
|
|
65
|
+
if (appRefs) {
|
|
66
|
+
for (let i = 0; i < appRefs.length; i++) {
|
|
67
|
+
const app = appRefs[i];
|
|
68
|
+
this.setViews(app.M.id, app.getAllPSAppViews() || []);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 初始化子应用模型实例
|
|
75
|
+
*
|
|
76
|
+
* @author chitanda
|
|
77
|
+
* @date 2022-12-20 18:12:05
|
|
78
|
+
* @protected
|
|
79
|
+
* @param {IPSSubAppRef} app
|
|
80
|
+
* @return {*} {Promise<SubModelService>}
|
|
81
|
+
*/
|
|
82
|
+
protected async initSubApp(appRef: IPSSubAppRef): Promise<SubModelService> {
|
|
83
|
+
const appId = appRef.M.id;
|
|
84
|
+
const help = await this.util.createSub(async modelPath => {
|
|
85
|
+
const url = `${ibiz.env.remoteModelUrl}/subapps/${appId}${modelPath}?dynamodeltag=${appRef.M.dynamodeltag}`;
|
|
86
|
+
const res = await ibiz.net.get(url);
|
|
87
|
+
if (res.ok) {
|
|
88
|
+
if (modelPath.endsWith('PSSYSAPP.json')) {
|
|
89
|
+
res.data.id = appId;
|
|
90
|
+
}
|
|
91
|
+
return res.data as IModel;
|
|
92
|
+
}
|
|
93
|
+
return {};
|
|
94
|
+
}, appId);
|
|
95
|
+
const service =
|
|
96
|
+
(await help.getModelService()) as unknown as SubModelService;
|
|
97
|
+
await ibiz.hub.createApp(appId, service);
|
|
98
|
+
return service;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 设置视图指定层级缓存
|
|
103
|
+
*
|
|
104
|
+
* @author chitanda
|
|
105
|
+
* @date 2022-12-20 19:12:23
|
|
106
|
+
* @protected
|
|
107
|
+
* @param {string} appTag
|
|
108
|
+
* @param {IPSAppView[]} views
|
|
109
|
+
*/
|
|
110
|
+
protected setViews(appTag: string, views: IPSAppView[]): void {
|
|
111
|
+
views.forEach(view => {
|
|
112
|
+
this.views.set(view.modelPath!, appTag);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 获取指定应用的模型服务,服务不存在则创建
|
|
118
|
+
*
|
|
119
|
+
* @author chitanda
|
|
120
|
+
* @date 2022-12-22 15:12:03
|
|
121
|
+
* @protected
|
|
122
|
+
* @param {string} appTag
|
|
123
|
+
* @return {*} {Promise<IModelService>}
|
|
124
|
+
*/
|
|
125
|
+
protected async getAppModelService(appTag: string): Promise<IModelService> {
|
|
126
|
+
try {
|
|
127
|
+
const service = await this.util.getModelService(appTag);
|
|
128
|
+
return service;
|
|
129
|
+
} catch (error) {
|
|
130
|
+
const rootService = await this.util.getModelService();
|
|
131
|
+
const app = rootService.app.findPSSubAppRef(appTag);
|
|
132
|
+
if (!app) {
|
|
133
|
+
throw new DefectModelError(rootService.app, `子应用[${appTag}]不存在`);
|
|
134
|
+
}
|
|
135
|
+
return this.initSubApp(app!);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 根据路径
|
|
141
|
+
*
|
|
142
|
+
* @author chitanda
|
|
143
|
+
* @date 2022-12-20 20:12:54
|
|
144
|
+
* @param {string} path
|
|
145
|
+
* @return {*} {Promise<ViewModel>}
|
|
146
|
+
*/
|
|
147
|
+
async getView(path: string): Promise<ViewModel> {
|
|
148
|
+
if (!this.views.has(path)) {
|
|
149
|
+
throw new Error(`未找到视图模型: ${path}`);
|
|
150
|
+
}
|
|
151
|
+
const appTag = this.views.get(path)!;
|
|
152
|
+
const service = await this.getAppModelService(appTag);
|
|
153
|
+
const view = await service.factory.getView(path);
|
|
154
|
+
if (view) {
|
|
155
|
+
return view;
|
|
156
|
+
}
|
|
157
|
+
throw new DefectModelError(service.app, `未找到视图[${path}]`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 根据菜单项所归属应用,获取应用功能
|
|
162
|
+
*
|
|
163
|
+
* @author chitanda
|
|
164
|
+
* @date 2022-12-22 15:12:59
|
|
165
|
+
* @param {AppMenuItemModel} menu
|
|
166
|
+
* @return {*} {(Promise<IPSAppFunc | null>)}
|
|
167
|
+
*/
|
|
168
|
+
async getAppFunc(menu: AppMenuItemModel): Promise<IPSAppFunc | null> {
|
|
169
|
+
const { appId } = menu;
|
|
170
|
+
if (appId === ModelConst.DEFAULT_SANDBOX) {
|
|
171
|
+
return menu.appFunc;
|
|
172
|
+
}
|
|
173
|
+
const service = await this.getAppModelService(appId);
|
|
174
|
+
return service.app.findPSAppFunc(menu.source.M.getPSAppFunc);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* 获取指定应用模型服务
|
|
179
|
+
*
|
|
180
|
+
* @author chitanda
|
|
181
|
+
* @date 2022-12-20 21:12:58
|
|
182
|
+
* @param {IContext} [context]
|
|
183
|
+
* @return {*}
|
|
184
|
+
*/
|
|
185
|
+
async getModelService(context?: IContext) {
|
|
186
|
+
return this.util.getModelService(context?.srfsandbox);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IPSApplication,
|
|
3
|
+
ModelConst,
|
|
4
|
+
ModelObject,
|
|
5
|
+
ModelService,
|
|
6
|
+
} from '@ibiz-template/model';
|
|
7
|
+
import { Application } from './application';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 运行时总集
|
|
11
|
+
*
|
|
12
|
+
* @author chitanda
|
|
13
|
+
* @date 2022-12-21 14:12:00
|
|
14
|
+
* @export
|
|
15
|
+
* @class RuntimeHub
|
|
16
|
+
*/
|
|
17
|
+
export class RuntimeHub {
|
|
18
|
+
/**
|
|
19
|
+
* 应用总集
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2022-12-21 14:12:45
|
|
23
|
+
* @protected
|
|
24
|
+
* @type {Map<string, Application>}
|
|
25
|
+
*/
|
|
26
|
+
protected appMap: Map<string, Application> = new Map();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 创建应用对象
|
|
30
|
+
*
|
|
31
|
+
* @author chitanda
|
|
32
|
+
* @date 2022-12-21 14:12:33
|
|
33
|
+
* @param {string} key 应用标识
|
|
34
|
+
* @param {ModelService} service 应用所对应的模型服务
|
|
35
|
+
* @return {*} {Promise<Application>}
|
|
36
|
+
*/
|
|
37
|
+
async createApp(key: string, service: ModelService): Promise<Application> {
|
|
38
|
+
const app = new Application(service);
|
|
39
|
+
this.appMap.set(key, app);
|
|
40
|
+
await app.init();
|
|
41
|
+
return app;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getApp(key?: string): Application;
|
|
45
|
+
|
|
46
|
+
getApp(appModel?: IPSApplication): Application;
|
|
47
|
+
|
|
48
|
+
getApp(model?: ModelObject): Application;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 根据标识获取应用对象
|
|
52
|
+
*
|
|
53
|
+
* @author chitanda
|
|
54
|
+
* @date 2022-12-21 20:12:53
|
|
55
|
+
* @param {(string | IPSApplication)} [app]
|
|
56
|
+
* @return {*} {Application}
|
|
57
|
+
*/
|
|
58
|
+
getApp(app?: string | IPSApplication | ModelObject): Application {
|
|
59
|
+
let key: string | null = null;
|
|
60
|
+
if (app) {
|
|
61
|
+
if (app instanceof Object) {
|
|
62
|
+
if (app instanceof ModelObject) {
|
|
63
|
+
key = app.modelService.app.appId;
|
|
64
|
+
} else {
|
|
65
|
+
key = (app as IPSApplication).appId;
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
key = app;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (!key) {
|
|
72
|
+
key = ModelConst.DEFAULT_SANDBOX;
|
|
73
|
+
}
|
|
74
|
+
return this.appMap.get(key)!;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -2,8 +2,8 @@ import { MenuPermissionMode, RuntimeError } from '@ibiz-template/core';
|
|
|
2
2
|
import {
|
|
3
3
|
AppEntityModel,
|
|
4
4
|
AppMenuItemModel,
|
|
5
|
-
getModelService,
|
|
6
5
|
IPSDEUIAction,
|
|
6
|
+
ModelService,
|
|
7
7
|
} from '@ibiz-template/model';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
* @class AuthorityService
|
|
16
16
|
*/
|
|
17
17
|
export class AuthorityService {
|
|
18
|
+
protected isInit: boolean = false;
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* 统一资源集合
|
|
20
22
|
*
|
|
@@ -55,6 +57,8 @@ export class AuthorityService {
|
|
|
55
57
|
*/
|
|
56
58
|
private opPrivs: string[] = [];
|
|
57
59
|
|
|
60
|
+
constructor(protected modelService: ModelService) {}
|
|
61
|
+
|
|
58
62
|
/**
|
|
59
63
|
* 权限服务初始化
|
|
60
64
|
*
|
|
@@ -94,7 +98,7 @@ export class AuthorityService {
|
|
|
94
98
|
* @returns {*} {Promise<void>}
|
|
95
99
|
*/
|
|
96
100
|
async calcOPPrivs(resCodes: string[]): Promise<void> {
|
|
97
|
-
const appModel =
|
|
101
|
+
const appModel = this.modelService.app;
|
|
98
102
|
// 先置空
|
|
99
103
|
this.opPrivs = [];
|
|
100
104
|
if (appModel.getAllPSDEOPPrivs()?.length) {
|
|
@@ -108,6 +112,9 @@ export class AuthorityService {
|
|
|
108
112
|
}
|
|
109
113
|
});
|
|
110
114
|
}
|
|
115
|
+
// throw new Error(
|
|
116
|
+
// '多应用模式下,需要补充每个应用自己的计算。整体结构需要改到app下去',
|
|
117
|
+
// );
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
/**
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
UnsupportedModelError,
|
|
8
8
|
} from '@ibiz-template/model';
|
|
9
9
|
import { isNilOrEmpty } from 'qx-util';
|
|
10
|
+
import { Application } from '../../application';
|
|
10
11
|
import { Entity } from '../entity/entity';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -18,6 +19,8 @@ import { Entity } from '../entity/entity';
|
|
|
18
19
|
* @class MethodDto
|
|
19
20
|
*/
|
|
20
21
|
export class MethodDto {
|
|
22
|
+
protected app?: Application;
|
|
23
|
+
|
|
21
24
|
protected fields: IPSAppDEMethodDTOField[];
|
|
22
25
|
|
|
23
26
|
protected dtoMap: Map<string, MethodDto> = new Map();
|
|
@@ -43,7 +46,12 @@ export class MethodDto {
|
|
|
43
46
|
* @param {IPSAppDEMethodDTO} dto
|
|
44
47
|
*/
|
|
45
48
|
constructor(protected dto?: IPSAppDEMethodDTO) {
|
|
46
|
-
|
|
49
|
+
if (dto) {
|
|
50
|
+
this.app = ibiz.hub.getApp(dto.getPSModelService().app);
|
|
51
|
+
this.fields = dto.getPSAppDEMethodDTOFields() || [];
|
|
52
|
+
} else {
|
|
53
|
+
this.fields = [];
|
|
54
|
+
}
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
/**
|
|
@@ -73,7 +81,7 @@ export class MethodDto {
|
|
|
73
81
|
case 'DTOS': {
|
|
74
82
|
const dto = await this.getFieldDto(field);
|
|
75
83
|
const refEntity = field.getRefPSAppDataEntity()!;
|
|
76
|
-
const service = await
|
|
84
|
+
const service = await this.app!.es.getService(
|
|
77
85
|
refEntity.codeName,
|
|
78
86
|
context,
|
|
79
87
|
);
|
|
@@ -107,7 +115,7 @@ export class MethodDto {
|
|
|
107
115
|
* @return {*} {Promise<IData>}
|
|
108
116
|
*/
|
|
109
117
|
async set(context: IContext, data: IData): Promise<Entity> {
|
|
110
|
-
const service = await
|
|
118
|
+
const service = await this.app!.es.getService(this.entity.codeName);
|
|
111
119
|
const all = await this.fields
|
|
112
120
|
.filter(field => field.type === 'DTOS')
|
|
113
121
|
.map(async field => {
|
package/src/service/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './utils';
|
|
|
3
3
|
export * from './service';
|
|
4
4
|
export * from './constant';
|
|
5
5
|
export * from './vo/control.vo';
|
|
6
|
+
export * from './vo/tree-node-data';
|
|
6
7
|
|
|
7
8
|
export { AuthService } from './auth/auth.service';
|
|
8
9
|
export { AuthorityService } from './authority/authority.service';
|