@ibiz-template/vue3-util 0.7.37-alpha.3 → 0.7.38-alpha.12
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.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/code-list/code-list.d.ts +9 -0
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +6 -2
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +12 -4
- package/es/index.mjs +4 -0
- package/es/locale/en/index.mjs +1 -1
- package/es/panel-component/index.d.ts +1 -0
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +3 -0
- package/es/panel-component/multi-data-container-raw/index.d.ts +37 -0
- package/es/panel-component/multi-data-container-raw/index.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/index.mjs +21 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts +118 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs +351 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.css +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +36 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.mjs +82 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.d.ts +16 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.mjs +15 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts +20 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.mjs +17 -0
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.mjs +5 -0
- package/es/use/click-outside/click-outside.d.ts.map +1 -1
- package/es/util/store/ui-store/ui-store.d.ts.map +1 -1
- package/es/util/store/ui-store/ui-store.mjs +8 -1
- package/es/view/common/index.d.ts +2 -2
- package/es/view/common/view.d.ts +2 -2
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +7 -6
- package/es/view/html-view/html-view.css +1 -0
- package/es/view/html-view/html-view.d.ts +48 -0
- package/es/view/html-view/html-view.d.ts.map +1 -0
- package/es/view/html-view/html-view.mjs +94 -0
- package/es/view/html-view/html-view.provider.d.ts +14 -0
- package/es/view/html-view/html-view.provider.d.ts.map +1 -0
- package/es/view/html-view/html-view.provider.mjs +8 -0
- package/es/view/html-view/index.d.ts +44 -0
- package/es/view/html-view/index.d.ts.map +1 -0
- package/es/view/html-view/index.mjs +13 -0
- package/es/view/index.d.ts +1 -0
- package/es/view/index.d.ts.map +1 -1
- package/es/view/index.mjs +1 -0
- package/lib/common/code-list/code-list.cjs +6 -2
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +11 -3
- package/lib/index.cjs +45 -37
- package/lib/locale/en/index.cjs +1 -1
- package/lib/panel-component/index.cjs +22 -16
- package/lib/panel-component/multi-data-container-raw/index.cjs +28 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.cjs +84 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs +353 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.css +1 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.provider.cjs +17 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.state.cjs +19 -0
- package/lib/panel-component/nav-pos/nav-pos.controller.cjs +5 -0
- package/lib/util/store/ui-store/ui-store.cjs +8 -1
- package/lib/view/common/view.cjs +7 -6
- package/lib/view/html-view/html-view.cjs +96 -0
- package/lib/view/html-view/html-view.css +1 -0
- package/lib/view/html-view/html-view.provider.cjs +10 -0
- package/lib/view/html-view/index.cjs +15 -0
- package/lib/view/index.cjs +2 -0
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isVNode, defineComponent, watch, reactive, createVNode, renderSlot, resolveComponent, h, provide } from 'vue';
|
|
2
2
|
import './view-layout-panel.css';
|
|
3
|
-
import { ScriptFactory, ViewLayoutPanelController, isDataContainer } from '@ibiz-template/runtime';
|
|
3
|
+
import { ScriptFactory, ViewLayoutPanelController, isSimpleDataContainer, isDataContainer } from '@ibiz-template/runtime';
|
|
4
4
|
import '../../../use/index.mjs';
|
|
5
5
|
import { useControlController } from '../../../use/control/use-control-controller/use-control-controller.mjs';
|
|
6
6
|
import { useNamespace } from '../../../use/namespace/namespace.mjs';
|
|
@@ -91,9 +91,17 @@ const ViewLayoutPanelControl = /* @__PURE__ */ defineComponent({
|
|
|
91
91
|
const component = resolveComponent(provider.component);
|
|
92
92
|
let children;
|
|
93
93
|
if (panelItem.itemType === "CTRLPOS" && slots[panelItem.id]) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const panelItemC2 = panelItems[panelItem.id];
|
|
95
|
+
if (panelItemC2.parent && isSimpleDataContainer(panelItemC2.parent.model)) {
|
|
96
|
+
children = () => {
|
|
97
|
+
return slots[panelItem.id]({
|
|
98
|
+
isSimple: true,
|
|
99
|
+
data: panelItemC2.data
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
} else {
|
|
103
|
+
children = () => slots[panelItem.id]();
|
|
104
|
+
}
|
|
97
105
|
} else if (panelItem.itemType === "TABPANEL" && ((_a = panelItem.panelTabPages) == null ? void 0 : _a.length)) {
|
|
98
106
|
children = () => {
|
|
99
107
|
return panelItem.panelTabPages.map((child) => {
|
package/es/index.mjs
CHANGED
|
@@ -38,6 +38,9 @@ export { IBizPanelRawItem } from './panel-component/panel-rawitem/index.mjs';
|
|
|
38
38
|
export { MultiDataContainerState } from './panel-component/multi-data-container/multi-data-container.state.mjs';
|
|
39
39
|
export { MultiDataContainerController } from './panel-component/multi-data-container/multi-data-container.controller.mjs';
|
|
40
40
|
export { IBizMultiDataContainer } from './panel-component/multi-data-container/index.mjs';
|
|
41
|
+
export { MultiDataContainerRawState } from './panel-component/multi-data-container-raw/multi-data-container-raw.state.mjs';
|
|
42
|
+
export { MultiDataContainerRawController } from './panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs';
|
|
43
|
+
export { IBizMultiDataContainerRaw } from './panel-component/multi-data-container-raw/index.mjs';
|
|
41
44
|
export { SingleDataContainerState } from './panel-component/single-data-container/single-data-container.state.mjs';
|
|
42
45
|
export { SingleDataContainerController } from './panel-component/single-data-container/single-data-container.controller.mjs';
|
|
43
46
|
export { IBizSingleDataContainer } from './panel-component/single-data-container/index.mjs';
|
|
@@ -60,6 +63,7 @@ export { IBizView } from './view/common/index.mjs';
|
|
|
60
63
|
export { TodoRedirect } from './view/todo-redirect/todo-redirect.mjs';
|
|
61
64
|
export { IBizPortalView } from './view/portal-view/index.mjs';
|
|
62
65
|
export { IBizDeRedirectView } from './view/de-redirect-view/index.mjs';
|
|
66
|
+
export { IBizHtmlView } from './view/html-view/index.mjs';
|
|
63
67
|
export { IBizViewLayoutPanelControl } from './control/panel/view-layout-panel/index.mjs';
|
|
64
68
|
export { IBizPanelControl } from './control/panel/panel/index.mjs';
|
|
65
69
|
export { PluginFactory } from './plugin/plugin-factory/plugin-factory.mjs';
|
package/es/locale/en/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ export * from './nav-pos';
|
|
|
5
5
|
export * from './panel-field';
|
|
6
6
|
export * from './panel-rawitem';
|
|
7
7
|
export * from './multi-data-container';
|
|
8
|
+
export * from './multi-data-container-raw';
|
|
8
9
|
export * from './single-data-container';
|
|
9
10
|
export * from './grid-container';
|
|
10
11
|
export * from './panel-container-image';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/panel-component/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/panel-component/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
@@ -5,6 +5,7 @@ export { IBizNavPos } from './nav-pos/index.mjs';
|
|
|
5
5
|
export { IBizPanelField } from './panel-field/index.mjs';
|
|
6
6
|
export { IBizPanelRawItem } from './panel-rawitem/index.mjs';
|
|
7
7
|
export { IBizMultiDataContainer } from './multi-data-container/index.mjs';
|
|
8
|
+
export { IBizMultiDataContainerRaw } from './multi-data-container-raw/index.mjs';
|
|
8
9
|
export { IBizSingleDataContainer } from './single-data-container/index.mjs';
|
|
9
10
|
export { IBizGridContainer } from './grid-container/index.mjs';
|
|
10
11
|
export { IBizPanelContainerImage } from './panel-container-image/index.mjs';
|
|
@@ -26,6 +27,8 @@ export { PanelFieldController } from './panel-field/panel-field.controller.mjs';
|
|
|
26
27
|
export { PanelRawItemController } from './panel-rawitem/panel-rawitem.controller.mjs';
|
|
27
28
|
export { MultiDataContainerState } from './multi-data-container/multi-data-container.state.mjs';
|
|
28
29
|
export { MultiDataContainerController } from './multi-data-container/multi-data-container.controller.mjs';
|
|
30
|
+
export { MultiDataContainerRawState } from './multi-data-container-raw/multi-data-container-raw.state.mjs';
|
|
31
|
+
export { MultiDataContainerRawController } from './multi-data-container-raw/multi-data-container-raw.controller.mjs';
|
|
29
32
|
export { SingleDataContainerState } from './single-data-container/single-data-container.state.mjs';
|
|
30
33
|
export { SingleDataContainerController } from './single-data-container/single-data-container.controller.mjs';
|
|
31
34
|
export { GridContainerState } from './grid-container/grid-container.state.mjs';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MultiDataContainerRawState } from './multi-data-container-raw.state';
|
|
2
|
+
import { MultiDataContainerRawController } from './multi-data-container-raw.controller';
|
|
3
|
+
export { MultiDataContainerRawState, MultiDataContainerRawController };
|
|
4
|
+
export declare const IBizMultiDataContainerRaw: import("../../util").TypeWithInstall<import("vue").DefineComponent<{
|
|
5
|
+
modelData: {
|
|
6
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelContainer>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
controller: {
|
|
10
|
+
type: typeof MultiDataContainerRawController;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
15
|
+
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
16
|
+
renderPanelItem: (panelItem: import("@ibiz/model-core").IPanelItem, options?: {
|
|
17
|
+
providers: {
|
|
18
|
+
[key: string]: import("@ibiz-template/runtime").IPanelItemProvider;
|
|
19
|
+
};
|
|
20
|
+
panelItems: {
|
|
21
|
+
[key: string]: import("@ibiz-template/runtime").IPanelItemController;
|
|
22
|
+
};
|
|
23
|
+
} | undefined) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}> | null;
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
modelData: {
|
|
28
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelContainer>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
controller: {
|
|
32
|
+
type: typeof MultiDataContainerRawController;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>>, {}, {}>>;
|
|
36
|
+
export default IBizMultiDataContainerRaw;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-component/multi-data-container-raw/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAExF,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,CAAC;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aASrC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { registerPanelItemProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import '../../util/index.mjs';
|
|
3
|
+
import { MultiDataContainerRaw } from './multi-data-container-raw.mjs';
|
|
4
|
+
import { MultiDataContainerRawProvider } from './multi-data-container-raw.provider.mjs';
|
|
5
|
+
export { MultiDataContainerRawState } from './multi-data-container-raw.state.mjs';
|
|
6
|
+
export { MultiDataContainerRawController } from './multi-data-container-raw.controller.mjs';
|
|
7
|
+
import { withInstall } from '../../util/install.mjs';
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizMultiDataContainerRaw = withInstall(
|
|
11
|
+
MultiDataContainerRaw,
|
|
12
|
+
function(v) {
|
|
13
|
+
v.component(MultiDataContainerRaw.name, MultiDataContainerRaw);
|
|
14
|
+
registerPanelItemProvider(
|
|
15
|
+
"CONTAINER_CONTAINER_MULTIDATA_RAW",
|
|
16
|
+
() => new MultiDataContainerRawProvider()
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export { IBizMultiDataContainerRaw, IBizMultiDataContainerRaw as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { IPanelController, IPanelDataContainerController, IPanelItemContainerController, IPanelItemController, IPanelItemProvider, IViewController, PanelItemController, PanelNotifyState } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelContainer, IPanelItem } from '@ibiz/model-core';
|
|
3
|
+
import { MultiDataContainerRawState } from './multi-data-container-raw.state';
|
|
4
|
+
/**
|
|
5
|
+
* 多项数据容器控制器
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class MultiDataContainerRawController
|
|
9
|
+
* @extends {PanelItemController}
|
|
10
|
+
*/
|
|
11
|
+
export declare class MultiDataContainerRawController extends PanelItemController<IPanelContainer> implements IPanelDataContainerController {
|
|
12
|
+
state: MultiDataContainerRawState;
|
|
13
|
+
readonly isDataContainer = true;
|
|
14
|
+
/**
|
|
15
|
+
* @description 面板子项的控制器
|
|
16
|
+
* @type {{ [key: string]: IPanelItemController }}
|
|
17
|
+
* @memberof MultiDataContainerRawController
|
|
18
|
+
*/
|
|
19
|
+
panelItems: {
|
|
20
|
+
[key: string]: IPanelItemController;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 所有面板成员的适配器
|
|
24
|
+
*
|
|
25
|
+
* @type {{ [key: string]: IPanelItemProvider }}
|
|
26
|
+
* @memberof MultiDataContainerRawController
|
|
27
|
+
*/
|
|
28
|
+
providers: {
|
|
29
|
+
[key: string]: IPanelItemProvider;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 多项数据容器,根据数据模式
|
|
33
|
+
*
|
|
34
|
+
* @readonly
|
|
35
|
+
* @type {IData}
|
|
36
|
+
* @memberof MultiDataContainerRawController
|
|
37
|
+
*/
|
|
38
|
+
get data(): IData;
|
|
39
|
+
protected createState(): MultiDataContainerRawState;
|
|
40
|
+
protected onInit(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 初始化面板子项控制器
|
|
43
|
+
*
|
|
44
|
+
* @protected
|
|
45
|
+
* @param {(IPanelItem[] | undefined)} [panelItems=this.model.panelItems]
|
|
46
|
+
* @param {IPanelController} [panel=this.panel]
|
|
47
|
+
* @param {(IPanelItemContainerController | undefined)} [parent=this]
|
|
48
|
+
* @return {*} {Promise<void>}
|
|
49
|
+
* @memberof MultiDataContainerRawController
|
|
50
|
+
*/
|
|
51
|
+
protected initPanelItemControllers(panelItems?: IPanelItem[] | undefined, panel?: IPanelController, parent?: IPanelItemContainerController | undefined): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* 计算导航参数
|
|
54
|
+
*
|
|
55
|
+
* @protected
|
|
56
|
+
* @return {*} {IData}
|
|
57
|
+
* @memberof MultiDataContainerRawController
|
|
58
|
+
*/
|
|
59
|
+
protected computeNavParams(): IData;
|
|
60
|
+
/**
|
|
61
|
+
* 根据来源类型初始化容器数据
|
|
62
|
+
*
|
|
63
|
+
* @protected
|
|
64
|
+
* @memberof MultiDataContainerRawController
|
|
65
|
+
*/
|
|
66
|
+
protected initContainerData(): void;
|
|
67
|
+
/**
|
|
68
|
+
* 面板状态变更通知
|
|
69
|
+
*
|
|
70
|
+
* @param {PanelNotifyState} state
|
|
71
|
+
* @memberof MultiDataContainerRawController
|
|
72
|
+
*/
|
|
73
|
+
childrenStateNotify(state: PanelNotifyState): void;
|
|
74
|
+
/**
|
|
75
|
+
* 设置数据集合
|
|
76
|
+
*
|
|
77
|
+
* @param {IData[]} items
|
|
78
|
+
* @return {*} {Promise<void>}
|
|
79
|
+
* @memberof MultiDataContainerRawController
|
|
80
|
+
*/
|
|
81
|
+
setData(items: IData[]): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* 通过实体设置视图逻辑
|
|
84
|
+
*
|
|
85
|
+
* @protected
|
|
86
|
+
* @return {*} {Promise<void>}
|
|
87
|
+
* @memberof MultiDataContainerRawController
|
|
88
|
+
*/
|
|
89
|
+
protected setDataByDeLogic(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* 设置全局变量为当前容器数据
|
|
92
|
+
*
|
|
93
|
+
* @protected
|
|
94
|
+
* @memberof MultiDataContainerRawController
|
|
95
|
+
*/
|
|
96
|
+
protected setDataByAppGlobalParam(): void;
|
|
97
|
+
/**
|
|
98
|
+
* 请求实体行为并把返回值设置为当前容器的数据
|
|
99
|
+
*
|
|
100
|
+
* @protected
|
|
101
|
+
* @return {*} {Promise<void>}
|
|
102
|
+
* @memberof MultiDataContainerRawController
|
|
103
|
+
*/
|
|
104
|
+
protected setDataByDeMethod(): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* 绑定指定视图会话的变量
|
|
107
|
+
*
|
|
108
|
+
* @protected
|
|
109
|
+
* @param {IViewController} view 绑定视图控制器
|
|
110
|
+
* @param {string} dataName 变量名称
|
|
111
|
+
* @return {*} {void}
|
|
112
|
+
* @memberof MultiDataContainerRawController
|
|
113
|
+
*/
|
|
114
|
+
protected bindViewData(view: IViewController, dataName: string): void;
|
|
115
|
+
setDataValue(_name: string, _value: unknown): Promise<void>;
|
|
116
|
+
destroy(): void;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=multi-data-container-raw.controller.d.ts.map
|
package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-data-container-raw.controller.d.ts","sourceRoot":"","sources":["../../../src/panel-component/multi-data-container-raw/multi-data-container-raw.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAElB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E;;;;;;GAMG;AACH,qBAAa,+BACX,SAAQ,mBAAmB,CAAC,eAAe,CAC3C,YAAW,6BAA6B;IAEhC,KAAK,EAAE,0BAA0B,CAAC;IAE1C,QAAQ,CAAC,eAAe,QAAQ;IAEhC;;;;OAIG;IACH,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAM;IAEzD;;;;;OAKG;IACH,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAA;KAAE,CAAM;IAEtD;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED,SAAS,CAAC,WAAW,IAAI,0BAA0B;cAInC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAMvC;;;;;;;;;OASG;cACa,wBAAwB,CACtC,UAAU,GAAE,UAAU,EAAE,GAAG,SAAiC,EAC5D,KAAK,GAAE,gBAA6B,EACpC,MAAM,GAAE,6BAA6B,GAAG,SAAgB,GACvD,OAAO,CAAC,IAAI,CAAC;IA4ChB;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,KAAK;IAgBnC;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IA0EnC;;;;;OAKG;IACH,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAMlD;;;;;;OAMG;IACG,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C;;;;;;OAMG;cACa,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAgCjD;;;;;OAKG;IACH,SAAS,CAAC,uBAAuB,IAAI,IAAI;IAYzC;;;;;;OAMG;cACa,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BlD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IA2BrE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,OAAO,IAAI,IAAI;CAOhB"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { ModelError, RuntimeModelError, RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { PanelItemController, getPanelItemProvider, isDataContainer, convertNavData, ScriptFactory, PanelNotifyState, execDELogicById } from '@ibiz-template/runtime';
|
|
3
|
+
import { MultiDataContainerRawState } from './multi-data-container-raw.state.mjs';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
class MultiDataContainerRawController extends PanelItemController {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.isDataContainer = true;
|
|
10
|
+
/**
|
|
11
|
+
* @description 面板子项的控制器
|
|
12
|
+
* @type {{ [key: string]: IPanelItemController }}
|
|
13
|
+
* @memberof MultiDataContainerRawController
|
|
14
|
+
*/
|
|
15
|
+
this.panelItems = {};
|
|
16
|
+
/**
|
|
17
|
+
* 所有面板成员的适配器
|
|
18
|
+
*
|
|
19
|
+
* @type {{ [key: string]: IPanelItemProvider }}
|
|
20
|
+
* @memberof MultiDataContainerRawController
|
|
21
|
+
*/
|
|
22
|
+
this.providers = {};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 多项数据容器,根据数据模式
|
|
26
|
+
*
|
|
27
|
+
* @readonly
|
|
28
|
+
* @type {IData}
|
|
29
|
+
* @memberof MultiDataContainerRawController
|
|
30
|
+
*/
|
|
31
|
+
get data() {
|
|
32
|
+
return this.state.items;
|
|
33
|
+
}
|
|
34
|
+
createState() {
|
|
35
|
+
var _a;
|
|
36
|
+
return new MultiDataContainerRawState((_a = this.parent) == null ? void 0 : _a.state);
|
|
37
|
+
}
|
|
38
|
+
async onInit() {
|
|
39
|
+
await super.onInit();
|
|
40
|
+
await this.initPanelItemControllers();
|
|
41
|
+
this.initContainerData();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 初始化面板子项控制器
|
|
45
|
+
*
|
|
46
|
+
* @protected
|
|
47
|
+
* @param {(IPanelItem[] | undefined)} [panelItems=this.model.panelItems]
|
|
48
|
+
* @param {IPanelController} [panel=this.panel]
|
|
49
|
+
* @param {(IPanelItemContainerController | undefined)} [parent=this]
|
|
50
|
+
* @return {*} {Promise<void>}
|
|
51
|
+
* @memberof MultiDataContainerRawController
|
|
52
|
+
*/
|
|
53
|
+
async initPanelItemControllers(panelItems = this.model.panelItems, panel = this.panel, parent = this) {
|
|
54
|
+
if (!panelItems) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await Promise.all(
|
|
58
|
+
panelItems.map(async (panelItem) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
const panelItemProvider = await getPanelItemProvider(
|
|
61
|
+
panelItem,
|
|
62
|
+
panel.model,
|
|
63
|
+
panel.view.model
|
|
64
|
+
);
|
|
65
|
+
if (!panelItemProvider) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this.providers[panelItem.id] = panelItemProvider;
|
|
69
|
+
const panelItemController = await panelItemProvider.createController(
|
|
70
|
+
panelItem,
|
|
71
|
+
panel,
|
|
72
|
+
parent
|
|
73
|
+
);
|
|
74
|
+
this.panelItems[panelItem.id] = panelItemController;
|
|
75
|
+
if (((_a = panelItem.panelItems) == null ? void 0 : _a.length) && !isDataContainer(panelItem)) {
|
|
76
|
+
await this.initPanelItemControllers(
|
|
77
|
+
panelItem.panelItems,
|
|
78
|
+
panel,
|
|
79
|
+
panelItemController
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if ((_b = panelItem.panelTabPages) == null ? void 0 : _b.length) {
|
|
83
|
+
await this.initPanelItemControllers(
|
|
84
|
+
panelItem.panelTabPages,
|
|
85
|
+
panel,
|
|
86
|
+
panelItemController
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 计算导航参数
|
|
94
|
+
*
|
|
95
|
+
* @protected
|
|
96
|
+
* @return {*} {IData}
|
|
97
|
+
* @memberof MultiDataContainerRawController
|
|
98
|
+
*/
|
|
99
|
+
computeNavParams() {
|
|
100
|
+
const { navigateContexts, navigateParams } = this.model;
|
|
101
|
+
const context = this.panel.context.clone();
|
|
102
|
+
Object.assign(
|
|
103
|
+
context,
|
|
104
|
+
convertNavData(navigateContexts, this.panel.params, this.panel.context)
|
|
105
|
+
);
|
|
106
|
+
const params = convertNavData(
|
|
107
|
+
navigateParams,
|
|
108
|
+
this.panel.params,
|
|
109
|
+
this.panel.context
|
|
110
|
+
);
|
|
111
|
+
Object.assign(params, this.panel.params);
|
|
112
|
+
return { context, params };
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 根据来源类型初始化容器数据
|
|
116
|
+
*
|
|
117
|
+
* @protected
|
|
118
|
+
* @memberof MultiDataContainerRawController
|
|
119
|
+
*/
|
|
120
|
+
initContainerData() {
|
|
121
|
+
const { dataSourceType, dataName, scriptCode } = this.model;
|
|
122
|
+
switch (dataSourceType) {
|
|
123
|
+
case "DEACTION":
|
|
124
|
+
case "DEDATASET":
|
|
125
|
+
this.setDataByDeMethod();
|
|
126
|
+
break;
|
|
127
|
+
case "APPGLOBALPARAM":
|
|
128
|
+
this.setDataByAppGlobalParam();
|
|
129
|
+
break;
|
|
130
|
+
case "DELOGIC":
|
|
131
|
+
this.setDataByDeLogic();
|
|
132
|
+
break;
|
|
133
|
+
case "TOPVIEWSESSIONPARAM": {
|
|
134
|
+
if (!dataName) {
|
|
135
|
+
throw new RuntimeModelError(
|
|
136
|
+
this.model,
|
|
137
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
this.bindViewData(this.panel.getTopView(), dataName);
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
case "VIEWSESSIONPARAM": {
|
|
144
|
+
if (!dataName) {
|
|
145
|
+
throw new RuntimeModelError(
|
|
146
|
+
this.model,
|
|
147
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
this.bindViewData(this.panel.view, dataName);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "ACTIVEDATAPARAM": {
|
|
154
|
+
if (!dataName) {
|
|
155
|
+
throw new RuntimeModelError(
|
|
156
|
+
this.model,
|
|
157
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
this.setData(this.dataParent.data[dataName]);
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case "CUSTOM": {
|
|
164
|
+
if (!scriptCode) {
|
|
165
|
+
throw new RuntimeModelError(
|
|
166
|
+
this.model,
|
|
167
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredScript")
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
const computeData = ScriptFactory.execScriptFn(
|
|
171
|
+
{
|
|
172
|
+
...this.panel.getEventArgs(),
|
|
173
|
+
data: this.dataParent.data
|
|
174
|
+
},
|
|
175
|
+
scriptCode,
|
|
176
|
+
{
|
|
177
|
+
isAsync: false,
|
|
178
|
+
singleRowReturn: true
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
this.setData(computeData);
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
default:
|
|
185
|
+
throw new ModelError(
|
|
186
|
+
this.model,
|
|
187
|
+
ibiz.i18n.t("vue3Util.panelComponent.noSupportedDataSourceType", {
|
|
188
|
+
dataSourceType
|
|
189
|
+
})
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 面板状态变更通知
|
|
195
|
+
*
|
|
196
|
+
* @param {PanelNotifyState} state
|
|
197
|
+
* @memberof MultiDataContainerRawController
|
|
198
|
+
*/
|
|
199
|
+
childrenStateNotify(state) {
|
|
200
|
+
Object.values(this.panelItems).forEach((panelItem) => {
|
|
201
|
+
panelItem.panelStateNotify(state);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 设置数据集合
|
|
206
|
+
*
|
|
207
|
+
* @param {IData[]} items
|
|
208
|
+
* @return {*} {Promise<void>}
|
|
209
|
+
* @memberof MultiDataContainerRawController
|
|
210
|
+
*/
|
|
211
|
+
async setData(items) {
|
|
212
|
+
var _a, _b;
|
|
213
|
+
(_b = (_a = this.data).destroy) == null ? void 0 : _b.call(_a);
|
|
214
|
+
this.state.items = items;
|
|
215
|
+
this.childrenStateNotify(PanelNotifyState.LOAD);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 通过实体设置视图逻辑
|
|
219
|
+
*
|
|
220
|
+
* @protected
|
|
221
|
+
* @return {*} {Promise<void>}
|
|
222
|
+
* @memberof MultiDataContainerRawController
|
|
223
|
+
*/
|
|
224
|
+
async setDataByDeLogic() {
|
|
225
|
+
const { appDataEntityId, appDELogicId } = this.model;
|
|
226
|
+
if (!appDELogicId) {
|
|
227
|
+
throw new RuntimeModelError(
|
|
228
|
+
this.model,
|
|
229
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntityLogic")
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (!appDataEntityId) {
|
|
233
|
+
throw new RuntimeModelError(
|
|
234
|
+
this.model,
|
|
235
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntity")
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
const { context, params } = this.computeNavParams();
|
|
239
|
+
const data = await execDELogicById(
|
|
240
|
+
appDELogicId,
|
|
241
|
+
appDataEntityId,
|
|
242
|
+
context,
|
|
243
|
+
this.panel.data,
|
|
244
|
+
params
|
|
245
|
+
);
|
|
246
|
+
if (!data) {
|
|
247
|
+
throw new RuntimeError(
|
|
248
|
+
ibiz.i18n.t("vue3Util.panelComponent.noReturnValue", { appDELogicId })
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
this.setData(data);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* 设置全局变量为当前容器数据
|
|
255
|
+
*
|
|
256
|
+
* @protected
|
|
257
|
+
* @memberof MultiDataContainerRawController
|
|
258
|
+
*/
|
|
259
|
+
setDataByAppGlobalParam() {
|
|
260
|
+
const { dataName } = this.model;
|
|
261
|
+
const originData = dataName ? ibiz.appData[dataName] : ibiz.appData;
|
|
262
|
+
if (originData) {
|
|
263
|
+
this.setData(originData);
|
|
264
|
+
} else {
|
|
265
|
+
ibiz.log.error(
|
|
266
|
+
ibiz.i18n.t("vue3Util.panelComponent.noAttribute", { dataName })
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* 请求实体行为并把返回值设置为当前容器的数据
|
|
272
|
+
*
|
|
273
|
+
* @protected
|
|
274
|
+
* @return {*} {Promise<void>}
|
|
275
|
+
* @memberof MultiDataContainerRawController
|
|
276
|
+
*/
|
|
277
|
+
async setDataByDeMethod() {
|
|
278
|
+
const { appDEMethodId, appDataEntityId } = this.model;
|
|
279
|
+
if (!appDEMethodId) {
|
|
280
|
+
throw new RuntimeModelError(
|
|
281
|
+
this.model,
|
|
282
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguerdEntityBehanior")
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
if (!appDataEntityId) {
|
|
286
|
+
throw new RuntimeModelError(
|
|
287
|
+
this.model,
|
|
288
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntity")
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
const app = ibiz.hub.getApp(this.panel.context.srfappid);
|
|
292
|
+
const { context, params } = this.computeNavParams();
|
|
293
|
+
const res = await app.deService.exec(
|
|
294
|
+
appDataEntityId,
|
|
295
|
+
appDEMethodId,
|
|
296
|
+
context,
|
|
297
|
+
void 0,
|
|
298
|
+
params
|
|
299
|
+
);
|
|
300
|
+
if (res.ok && res.data) {
|
|
301
|
+
this.setData(res.data);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* 绑定指定视图会话的变量
|
|
306
|
+
*
|
|
307
|
+
* @protected
|
|
308
|
+
* @param {IViewController} view 绑定视图控制器
|
|
309
|
+
* @param {string} dataName 变量名称
|
|
310
|
+
* @return {*} {void}
|
|
311
|
+
* @memberof MultiDataContainerRawController
|
|
312
|
+
*/
|
|
313
|
+
bindViewData(view, dataName) {
|
|
314
|
+
if (!Object.prototype.hasOwnProperty.call(view.state, dataName)) {
|
|
315
|
+
ibiz.log.error(
|
|
316
|
+
ibiz.i18n.t("vue3Util.panelComponent.sessionView", { dataName })
|
|
317
|
+
);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const updateData = () => {
|
|
321
|
+
const originData = view.state[dataName];
|
|
322
|
+
if (originData) {
|
|
323
|
+
this.setData(originData);
|
|
324
|
+
} else {
|
|
325
|
+
ibiz.log.error(
|
|
326
|
+
ibiz.i18n.t("vue3Util.panelComponent.viewStateAttribute", {
|
|
327
|
+
dataName
|
|
328
|
+
})
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
updateData();
|
|
333
|
+
view.evt.on("onDataChange", () => {
|
|
334
|
+
updateData();
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
setDataValue(_name, _value) {
|
|
338
|
+
throw new Error(ibiz.i18n.t("vue3Util.panelComponent.noImplementMethod"));
|
|
339
|
+
}
|
|
340
|
+
destroy() {
|
|
341
|
+
var _a, _b;
|
|
342
|
+
super.destroy();
|
|
343
|
+
(_b = (_a = this.data).destroy) == null ? void 0 : _b.call(_a);
|
|
344
|
+
Object.values(this.panelItems).forEach((item) => {
|
|
345
|
+
var _a2;
|
|
346
|
+
(_a2 = item.destroy) == null ? void 0 : _a2.call(item);
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export { MultiDataContainerRawController };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-multi-data-container-raw{width:100%;height:100%}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IPanelItemProvider, IPanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelContainer, IPanelItem } from '@ibiz/model-core';
|
|
3
|
+
import { PropType, VNode } from 'vue';
|
|
4
|
+
import { MultiDataContainerRawController } from './multi-data-container-raw.controller';
|
|
5
|
+
import './multi-data-container-raw.scss';
|
|
6
|
+
export declare const MultiDataContainerRaw: import("vue").DefineComponent<{
|
|
7
|
+
modelData: {
|
|
8
|
+
type: PropType<IPanelContainer>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
controller: {
|
|
12
|
+
type: typeof MultiDataContainerRawController;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
17
|
+
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
18
|
+
renderPanelItem: (panelItem: IPanelItem, options?: {
|
|
19
|
+
providers: {
|
|
20
|
+
[key: string]: IPanelItemProvider;
|
|
21
|
+
};
|
|
22
|
+
panelItems: {
|
|
23
|
+
[key: string]: IPanelItemController;
|
|
24
|
+
};
|
|
25
|
+
}) => VNode | null;
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
modelData: {
|
|
28
|
+
type: PropType<IPanelContainer>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
controller: {
|
|
32
|
+
type: typeof MultiDataContainerRawController;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>>, {}, {}>;
|
|
36
|
+
//# sourceMappingURL=multi-data-container-raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-data-container-raw.d.ts","sourceRoot":"","sources":["../../../src/panel-component/multi-data-container-raw/multi-data-container-raw.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAIL,QAAQ,EAER,KAAK,EAEN,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,iCAAiC,CAAC;AAEzC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iCAgCf,UAAU,YACX;QACR,SAAS,EAAE;YACT,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC;SACnC,CAAC;QACF,UAAU,EAAE;YACV,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC;SACrC,CAAC;KACH,KACE,KAAK,GAAG,IAAI;;;;;;;;;;YA0CrB,CAAC"}
|