@ibiz-template/vue3-util 0.7.34 → 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/badge/badge.d.ts +1 -1
- package/es/common/code-list/code-list.d.ts +10 -1
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +23 -5
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +1 -1
- package/es/common/control-shell/control-shell.d.ts +1 -1
- package/es/common/icon/icon.d.ts +1 -1
- package/es/common/router-view/router-view.d.ts +3 -4
- package/es/common/router-view/router-view.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.d.ts +11 -8
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +61 -32
- package/es/control/panel/panel/index.d.ts +1 -1
- package/es/control/panel/panel/panel.d.ts +1 -1
- package/es/control/panel/view-layout-panel/index.d.ts +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +2 -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/grid-container/grid-container.d.ts +1 -1
- package/es/panel-component/grid-container/index.d.ts +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/index.d.ts +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts +9 -0
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.mjs +32 -7
- package/es/panel-component/multi-data-container/multi-data-container.d.ts +2 -2
- package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
- 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/index.d.ts +1 -1
- 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/panel-component/nav-pos/nav-pos.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +1 -1
- package/es/panel-component/panel-container/index.d.ts +1 -1
- package/es/panel-component/panel-container/panel-container.d.ts +1 -1
- package/es/panel-component/panel-container-group/index.d.ts +1 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +1 -1
- package/es/panel-component/panel-container-image/index.d.ts +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +1 -1
- package/es/panel-component/panel-container-tabs/index.d.ts +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +1 -1
- package/es/panel-component/panel-field/index.d.ts +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +1 -1
- package/es/panel-component/panel-item-render/index.d.ts +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.d.ts +1 -1
- package/es/panel-component/panel-rawitem/index.d.ts +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.mjs +2 -2
- package/es/panel-component/panel-tab-page/index.d.ts +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +1 -1
- package/es/panel-component/scroll-container/index.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +1 -1
- package/es/panel-component/single-data-container/index.d.ts +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts +9 -0
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.mjs +31 -6
- package/es/panel-component/single-data-container/single-data-container.d.ts +2 -2
- package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/index.d.ts +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +1 -1
- package/es/use/click-outside/click-outside.d.ts.map +1 -1
- package/es/util/install.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/app-redirect-view/app-redirect-view.d.ts +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts.map +1 -1
- package/es/view/common/index.d.ts +3 -3
- package/es/view/common/view.d.ts +3 -3
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +7 -6
- package/es/view/de-redirect-view/de-redirect-view.d.ts +1 -1
- package/es/view/de-redirect-view/index.d.ts +1 -1
- 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/es/view/portal-view/index.d.ts +1 -1
- package/es/view/portal-view/portal-view.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts.map +1 -1
- package/lib/common/code-list/code-list.cjs +21 -3
- package/lib/common/view-shell/view-shell.cjs +59 -30
- 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/multi-data-container.controller.cjs +31 -6
- 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.cjs +1 -1
- package/lib/panel-component/nav-pos/nav-pos.controller.cjs +5 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +2 -2
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +30 -5
- 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 +5 -5
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
|
+
var multiDataContainerRaw_state = require('./multi-data-container-raw.state.cjs');
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
class MultiDataContainerRawController extends runtime.PanelItemController {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.isDataContainer = true;
|
|
12
|
+
/**
|
|
13
|
+
* @description 面板子项的控制器
|
|
14
|
+
* @type {{ [key: string]: IPanelItemController }}
|
|
15
|
+
* @memberof MultiDataContainerRawController
|
|
16
|
+
*/
|
|
17
|
+
this.panelItems = {};
|
|
18
|
+
/**
|
|
19
|
+
* 所有面板成员的适配器
|
|
20
|
+
*
|
|
21
|
+
* @type {{ [key: string]: IPanelItemProvider }}
|
|
22
|
+
* @memberof MultiDataContainerRawController
|
|
23
|
+
*/
|
|
24
|
+
this.providers = {};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 多项数据容器,根据数据模式
|
|
28
|
+
*
|
|
29
|
+
* @readonly
|
|
30
|
+
* @type {IData}
|
|
31
|
+
* @memberof MultiDataContainerRawController
|
|
32
|
+
*/
|
|
33
|
+
get data() {
|
|
34
|
+
return this.state.items;
|
|
35
|
+
}
|
|
36
|
+
createState() {
|
|
37
|
+
var _a;
|
|
38
|
+
return new multiDataContainerRaw_state.MultiDataContainerRawState((_a = this.parent) == null ? void 0 : _a.state);
|
|
39
|
+
}
|
|
40
|
+
async onInit() {
|
|
41
|
+
await super.onInit();
|
|
42
|
+
await this.initPanelItemControllers();
|
|
43
|
+
this.initContainerData();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 初始化面板子项控制器
|
|
47
|
+
*
|
|
48
|
+
* @protected
|
|
49
|
+
* @param {(IPanelItem[] | undefined)} [panelItems=this.model.panelItems]
|
|
50
|
+
* @param {IPanelController} [panel=this.panel]
|
|
51
|
+
* @param {(IPanelItemContainerController | undefined)} [parent=this]
|
|
52
|
+
* @return {*} {Promise<void>}
|
|
53
|
+
* @memberof MultiDataContainerRawController
|
|
54
|
+
*/
|
|
55
|
+
async initPanelItemControllers(panelItems = this.model.panelItems, panel = this.panel, parent = this) {
|
|
56
|
+
if (!panelItems) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
await Promise.all(
|
|
60
|
+
panelItems.map(async (panelItem) => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const panelItemProvider = await runtime.getPanelItemProvider(
|
|
63
|
+
panelItem,
|
|
64
|
+
panel.model,
|
|
65
|
+
panel.view.model
|
|
66
|
+
);
|
|
67
|
+
if (!panelItemProvider) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.providers[panelItem.id] = panelItemProvider;
|
|
71
|
+
const panelItemController = await panelItemProvider.createController(
|
|
72
|
+
panelItem,
|
|
73
|
+
panel,
|
|
74
|
+
parent
|
|
75
|
+
);
|
|
76
|
+
this.panelItems[panelItem.id] = panelItemController;
|
|
77
|
+
if (((_a = panelItem.panelItems) == null ? void 0 : _a.length) && !runtime.isDataContainer(panelItem)) {
|
|
78
|
+
await this.initPanelItemControllers(
|
|
79
|
+
panelItem.panelItems,
|
|
80
|
+
panel,
|
|
81
|
+
panelItemController
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if ((_b = panelItem.panelTabPages) == null ? void 0 : _b.length) {
|
|
85
|
+
await this.initPanelItemControllers(
|
|
86
|
+
panelItem.panelTabPages,
|
|
87
|
+
panel,
|
|
88
|
+
panelItemController
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 计算导航参数
|
|
96
|
+
*
|
|
97
|
+
* @protected
|
|
98
|
+
* @return {*} {IData}
|
|
99
|
+
* @memberof MultiDataContainerRawController
|
|
100
|
+
*/
|
|
101
|
+
computeNavParams() {
|
|
102
|
+
const { navigateContexts, navigateParams } = this.model;
|
|
103
|
+
const context = this.panel.context.clone();
|
|
104
|
+
Object.assign(
|
|
105
|
+
context,
|
|
106
|
+
runtime.convertNavData(navigateContexts, this.panel.params, this.panel.context)
|
|
107
|
+
);
|
|
108
|
+
const params = runtime.convertNavData(
|
|
109
|
+
navigateParams,
|
|
110
|
+
this.panel.params,
|
|
111
|
+
this.panel.context
|
|
112
|
+
);
|
|
113
|
+
Object.assign(params, this.panel.params);
|
|
114
|
+
return { context, params };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 根据来源类型初始化容器数据
|
|
118
|
+
*
|
|
119
|
+
* @protected
|
|
120
|
+
* @memberof MultiDataContainerRawController
|
|
121
|
+
*/
|
|
122
|
+
initContainerData() {
|
|
123
|
+
const { dataSourceType, dataName, scriptCode } = this.model;
|
|
124
|
+
switch (dataSourceType) {
|
|
125
|
+
case "DEACTION":
|
|
126
|
+
case "DEDATASET":
|
|
127
|
+
this.setDataByDeMethod();
|
|
128
|
+
break;
|
|
129
|
+
case "APPGLOBALPARAM":
|
|
130
|
+
this.setDataByAppGlobalParam();
|
|
131
|
+
break;
|
|
132
|
+
case "DELOGIC":
|
|
133
|
+
this.setDataByDeLogic();
|
|
134
|
+
break;
|
|
135
|
+
case "TOPVIEWSESSIONPARAM": {
|
|
136
|
+
if (!dataName) {
|
|
137
|
+
throw new core.RuntimeModelError(
|
|
138
|
+
this.model,
|
|
139
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
this.bindViewData(this.panel.getTopView(), dataName);
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case "VIEWSESSIONPARAM": {
|
|
146
|
+
if (!dataName) {
|
|
147
|
+
throw new core.RuntimeModelError(
|
|
148
|
+
this.model,
|
|
149
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
this.bindViewData(this.panel.view, dataName);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
case "ACTIVEDATAPARAM": {
|
|
156
|
+
if (!dataName) {
|
|
157
|
+
throw new core.RuntimeModelError(
|
|
158
|
+
this.model,
|
|
159
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguardDataObject")
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
this.setData(this.dataParent.data[dataName]);
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case "CUSTOM": {
|
|
166
|
+
if (!scriptCode) {
|
|
167
|
+
throw new core.RuntimeModelError(
|
|
168
|
+
this.model,
|
|
169
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredScript")
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
const computeData = runtime.ScriptFactory.execScriptFn(
|
|
173
|
+
{
|
|
174
|
+
...this.panel.getEventArgs(),
|
|
175
|
+
data: this.dataParent.data
|
|
176
|
+
},
|
|
177
|
+
scriptCode,
|
|
178
|
+
{
|
|
179
|
+
isAsync: false,
|
|
180
|
+
singleRowReturn: true
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
this.setData(computeData);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
default:
|
|
187
|
+
throw new core.ModelError(
|
|
188
|
+
this.model,
|
|
189
|
+
ibiz.i18n.t("vue3Util.panelComponent.noSupportedDataSourceType", {
|
|
190
|
+
dataSourceType
|
|
191
|
+
})
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 面板状态变更通知
|
|
197
|
+
*
|
|
198
|
+
* @param {PanelNotifyState} state
|
|
199
|
+
* @memberof MultiDataContainerRawController
|
|
200
|
+
*/
|
|
201
|
+
childrenStateNotify(state) {
|
|
202
|
+
Object.values(this.panelItems).forEach((panelItem) => {
|
|
203
|
+
panelItem.panelStateNotify(state);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 设置数据集合
|
|
208
|
+
*
|
|
209
|
+
* @param {IData[]} items
|
|
210
|
+
* @return {*} {Promise<void>}
|
|
211
|
+
* @memberof MultiDataContainerRawController
|
|
212
|
+
*/
|
|
213
|
+
async setData(items) {
|
|
214
|
+
var _a, _b;
|
|
215
|
+
(_b = (_a = this.data).destroy) == null ? void 0 : _b.call(_a);
|
|
216
|
+
this.state.items = items;
|
|
217
|
+
this.childrenStateNotify(runtime.PanelNotifyState.LOAD);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* 通过实体设置视图逻辑
|
|
221
|
+
*
|
|
222
|
+
* @protected
|
|
223
|
+
* @return {*} {Promise<void>}
|
|
224
|
+
* @memberof MultiDataContainerRawController
|
|
225
|
+
*/
|
|
226
|
+
async setDataByDeLogic() {
|
|
227
|
+
const { appDataEntityId, appDELogicId } = this.model;
|
|
228
|
+
if (!appDELogicId) {
|
|
229
|
+
throw new core.RuntimeModelError(
|
|
230
|
+
this.model,
|
|
231
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntityLogic")
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
if (!appDataEntityId) {
|
|
235
|
+
throw new core.RuntimeModelError(
|
|
236
|
+
this.model,
|
|
237
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntity")
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
const { context, params } = this.computeNavParams();
|
|
241
|
+
const data = await runtime.execDELogicById(
|
|
242
|
+
appDELogicId,
|
|
243
|
+
appDataEntityId,
|
|
244
|
+
context,
|
|
245
|
+
this.panel.data,
|
|
246
|
+
params
|
|
247
|
+
);
|
|
248
|
+
if (!data) {
|
|
249
|
+
throw new core.RuntimeError(
|
|
250
|
+
ibiz.i18n.t("vue3Util.panelComponent.noReturnValue", { appDELogicId })
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
this.setData(data);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 设置全局变量为当前容器数据
|
|
257
|
+
*
|
|
258
|
+
* @protected
|
|
259
|
+
* @memberof MultiDataContainerRawController
|
|
260
|
+
*/
|
|
261
|
+
setDataByAppGlobalParam() {
|
|
262
|
+
const { dataName } = this.model;
|
|
263
|
+
const originData = dataName ? ibiz.appData[dataName] : ibiz.appData;
|
|
264
|
+
if (originData) {
|
|
265
|
+
this.setData(originData);
|
|
266
|
+
} else {
|
|
267
|
+
ibiz.log.error(
|
|
268
|
+
ibiz.i18n.t("vue3Util.panelComponent.noAttribute", { dataName })
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* 请求实体行为并把返回值设置为当前容器的数据
|
|
274
|
+
*
|
|
275
|
+
* @protected
|
|
276
|
+
* @return {*} {Promise<void>}
|
|
277
|
+
* @memberof MultiDataContainerRawController
|
|
278
|
+
*/
|
|
279
|
+
async setDataByDeMethod() {
|
|
280
|
+
const { appDEMethodId, appDataEntityId } = this.model;
|
|
281
|
+
if (!appDEMethodId) {
|
|
282
|
+
throw new core.RuntimeModelError(
|
|
283
|
+
this.model,
|
|
284
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguerdEntityBehanior")
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
if (!appDataEntityId) {
|
|
288
|
+
throw new core.RuntimeModelError(
|
|
289
|
+
this.model,
|
|
290
|
+
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntity")
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
const app = ibiz.hub.getApp(this.panel.context.srfappid);
|
|
294
|
+
const { context, params } = this.computeNavParams();
|
|
295
|
+
const res = await app.deService.exec(
|
|
296
|
+
appDataEntityId,
|
|
297
|
+
appDEMethodId,
|
|
298
|
+
context,
|
|
299
|
+
void 0,
|
|
300
|
+
params
|
|
301
|
+
);
|
|
302
|
+
if (res.ok && res.data) {
|
|
303
|
+
this.setData(res.data);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* 绑定指定视图会话的变量
|
|
308
|
+
*
|
|
309
|
+
* @protected
|
|
310
|
+
* @param {IViewController} view 绑定视图控制器
|
|
311
|
+
* @param {string} dataName 变量名称
|
|
312
|
+
* @return {*} {void}
|
|
313
|
+
* @memberof MultiDataContainerRawController
|
|
314
|
+
*/
|
|
315
|
+
bindViewData(view, dataName) {
|
|
316
|
+
if (!Object.prototype.hasOwnProperty.call(view.state, dataName)) {
|
|
317
|
+
ibiz.log.error(
|
|
318
|
+
ibiz.i18n.t("vue3Util.panelComponent.sessionView", { dataName })
|
|
319
|
+
);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const updateData = () => {
|
|
323
|
+
const originData = view.state[dataName];
|
|
324
|
+
if (originData) {
|
|
325
|
+
this.setData(originData);
|
|
326
|
+
} else {
|
|
327
|
+
ibiz.log.error(
|
|
328
|
+
ibiz.i18n.t("vue3Util.panelComponent.viewStateAttribute", {
|
|
329
|
+
dataName
|
|
330
|
+
})
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
updateData();
|
|
335
|
+
view.evt.on("onDataChange", () => {
|
|
336
|
+
updateData();
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
setDataValue(_name, _value) {
|
|
340
|
+
throw new Error(ibiz.i18n.t("vue3Util.panelComponent.noImplementMethod"));
|
|
341
|
+
}
|
|
342
|
+
destroy() {
|
|
343
|
+
var _a, _b;
|
|
344
|
+
super.destroy();
|
|
345
|
+
(_b = (_a = this.data).destroy) == null ? void 0 : _b.call(_a);
|
|
346
|
+
Object.values(this.panelItems).forEach((item) => {
|
|
347
|
+
var _a2;
|
|
348
|
+
(_a2 = item.destroy) == null ? void 0 : _a2.call(item);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
exports.MultiDataContainerRawController = MultiDataContainerRawController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-multi-data-container-raw{width:100%;height:100%}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var multiDataContainerRaw_controller = require('./multi-data-container-raw.controller.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
class MultiDataContainerRawProvider {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.component = "IBizMultiDataContainerRaw";
|
|
9
|
+
}
|
|
10
|
+
async createController(panelItem, panel, parent) {
|
|
11
|
+
const c = new multiDataContainerRaw_controller.MultiDataContainerRawController(panelItem, panel, parent);
|
|
12
|
+
await c.init();
|
|
13
|
+
return c;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.MultiDataContainerRawProvider = MultiDataContainerRawProvider;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('@ibiz-template/runtime');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
class MultiDataContainerRawState extends runtime.PanelItemState {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
/**
|
|
10
|
+
* 多项数据容器数据
|
|
11
|
+
* @author zzq
|
|
12
|
+
* @date 2024-09-09 16:04:27
|
|
13
|
+
* @type {(IData | IData[])}
|
|
14
|
+
*/
|
|
15
|
+
this.items = [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.MultiDataContainerRawState = MultiDataContainerRawState;
|
|
@@ -94,7 +94,7 @@ const NavPos = /* @__PURE__ */ vue.defineComponent({
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
} else {
|
|
97
|
-
const view = currentKey ? vue.h(vue.resolveComponent("IBizViewShell"), {
|
|
97
|
+
const view = currentKey && navViewMsgs[currentKey] ? vue.h(vue.resolveComponent("IBizViewShell"), {
|
|
98
98
|
context: navViewMsgs[currentKey].context,
|
|
99
99
|
params: navViewMsgs[currentKey].params,
|
|
100
100
|
key: !this.c.ignoreEmbedKey ? currentKey : void 0,
|
|
@@ -212,6 +212,11 @@ class NavPosController extends runtime.PanelItemController {
|
|
|
212
212
|
* @memberof NavPosController
|
|
213
213
|
*/
|
|
214
214
|
onViewCreated(event) {
|
|
215
|
+
this.panel.evt.emit("onPresetPanelItemEvent", {
|
|
216
|
+
panelItemName: this.model.id,
|
|
217
|
+
panelItemEventName: "onViewCreated",
|
|
218
|
+
presetParams: event
|
|
219
|
+
});
|
|
215
220
|
ibiz.log.debug(this.constructor.name, "onViewCreated", event);
|
|
216
221
|
}
|
|
217
222
|
toBlankRoute() {
|
|
@@ -79,8 +79,8 @@ const PanelRawItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
79
|
return vue.createVNode("div", {
|
|
80
80
|
"class": this.classArr,
|
|
81
81
|
"style": this.tempStyle,
|
|
82
|
-
"onClick": () => {
|
|
83
|
-
this.controller.onClick();
|
|
82
|
+
"onClick": (event) => {
|
|
83
|
+
this.controller.onClick(event);
|
|
84
84
|
}
|
|
85
85
|
}, [vue.createVNode(vue.resolveComponent("iBizRawItem"), {
|
|
86
86
|
"rawItem": this.modelData,
|
|
@@ -91,6 +91,29 @@ class SingleDataContainerController extends runtime.PanelItemController {
|
|
|
91
91
|
})
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* 计算导航参数
|
|
96
|
+
*
|
|
97
|
+
* @author tony001
|
|
98
|
+
* @date 2024-07-30 18:07:52
|
|
99
|
+
* @protected
|
|
100
|
+
* @return {*} {IData}
|
|
101
|
+
*/
|
|
102
|
+
computeNavParams() {
|
|
103
|
+
const { navigateContexts, navigateParams } = this.model;
|
|
104
|
+
const context = this.panel.context.clone();
|
|
105
|
+
Object.assign(
|
|
106
|
+
context,
|
|
107
|
+
runtime.convertNavData(navigateContexts, this.panel.params, this.panel.context)
|
|
108
|
+
);
|
|
109
|
+
const params = runtime.convertNavData(
|
|
110
|
+
navigateParams,
|
|
111
|
+
this.panel.params,
|
|
112
|
+
this.panel.context
|
|
113
|
+
);
|
|
114
|
+
Object.assign(params, this.panel.params);
|
|
115
|
+
return { context, params };
|
|
116
|
+
}
|
|
94
117
|
/**
|
|
95
118
|
* 根据来源类型初始化容器数据
|
|
96
119
|
* @author lxm
|
|
@@ -235,12 +258,13 @@ class SingleDataContainerController extends runtime.PanelItemController {
|
|
|
235
258
|
ibiz.i18n.t("vue3Util.panelComponent.noConfiguredEntity")
|
|
236
259
|
);
|
|
237
260
|
}
|
|
261
|
+
const { context, params } = this.computeNavParams();
|
|
238
262
|
const data = await runtime.execDELogicById(
|
|
239
263
|
appDELogicId,
|
|
240
264
|
appDataEntityId,
|
|
241
|
-
|
|
265
|
+
context,
|
|
242
266
|
this.panel.data,
|
|
243
|
-
|
|
267
|
+
params
|
|
244
268
|
);
|
|
245
269
|
if (!data) {
|
|
246
270
|
throw new core.RuntimeError(
|
|
@@ -288,12 +312,13 @@ class SingleDataContainerController extends runtime.PanelItemController {
|
|
|
288
312
|
);
|
|
289
313
|
}
|
|
290
314
|
const app = ibiz.hub.getApp(this.panel.context.srfappid);
|
|
315
|
+
const { context, params } = this.computeNavParams();
|
|
291
316
|
const res = await app.deService.exec(
|
|
292
317
|
appDataEntityId,
|
|
293
318
|
appDEMethodId,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
319
|
+
context,
|
|
320
|
+
void 0,
|
|
321
|
+
params
|
|
297
322
|
);
|
|
298
323
|
if (res.ok && res.data) {
|
|
299
324
|
this.setData(res.data);
|
|
@@ -7,9 +7,16 @@ var zIndex = require('./z-index.cjs');
|
|
|
7
7
|
"use strict";
|
|
8
8
|
const useUIStore = pinia.defineStore("uiStore", () => {
|
|
9
9
|
const zIndex$1 = zIndex.useZIndexStore();
|
|
10
|
+
const getTheme = () => {
|
|
11
|
+
const themeTag = ibiz.util.theme.getTheme();
|
|
12
|
+
return themeTag.includes("dark") ? "dark" : "light";
|
|
13
|
+
};
|
|
10
14
|
const UIStore = vue.reactive({
|
|
11
15
|
zIndex: zIndex$1.zIndex,
|
|
12
|
-
theme:
|
|
16
|
+
theme: getTheme()
|
|
17
|
+
});
|
|
18
|
+
ibiz.util.theme.evt.on("onChange", () => {
|
|
19
|
+
UIStore.theme = getTheme();
|
|
13
20
|
});
|
|
14
21
|
return { UIStore, zIndex: zIndex$1 };
|
|
15
22
|
});
|
package/lib/view/common/view.cjs
CHANGED
|
@@ -83,18 +83,19 @@ const View = /* @__PURE__ */ vue.defineComponent({
|
|
|
83
83
|
});
|
|
84
84
|
return result;
|
|
85
85
|
};
|
|
86
|
-
const getCtrlProps = (ctrl) => {
|
|
86
|
+
const getCtrlProps = (ctrl, slotProps = {}) => {
|
|
87
87
|
const slotKey = ctrl.name || ctrl.id;
|
|
88
88
|
return {
|
|
89
89
|
context: c.context,
|
|
90
90
|
params: c.params,
|
|
91
91
|
modelData: ctrl,
|
|
92
|
-
...c.slotProps[slotKey] || {}
|
|
92
|
+
...c.slotProps[slotKey] || {},
|
|
93
|
+
...slotProps
|
|
93
94
|
};
|
|
94
95
|
};
|
|
95
|
-
const renderControl = (ctrl) => {
|
|
96
|
+
const renderControl = (ctrl, slotProps = {}) => {
|
|
96
97
|
const slotKey = ctrl.name || ctrl.id;
|
|
97
|
-
const ctrlProps = getCtrlProps(ctrl);
|
|
98
|
+
const ctrlProps = getCtrlProps(ctrl, slotProps);
|
|
98
99
|
if (slots[slotKey]) {
|
|
99
100
|
return vue.renderSlot(slots, slotKey, ctrlProps);
|
|
100
101
|
}
|
|
@@ -135,8 +136,8 @@ const View = /* @__PURE__ */ vue.defineComponent({
|
|
|
135
136
|
if ((_a = this.controls) == null ? void 0 : _a.length) {
|
|
136
137
|
this.controls.forEach((ctrl) => {
|
|
137
138
|
const slotKey = ctrl.name || ctrl.id;
|
|
138
|
-
slots[slotKey] = () => {
|
|
139
|
-
return this.renderControl(ctrl);
|
|
139
|
+
slots[slotKey] = (slotProps) => {
|
|
140
|
+
return this.renderControl(ctrl, slotProps);
|
|
140
141
|
};
|
|
141
142
|
});
|
|
142
143
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
|
+
require('../../use/index.cjs');
|
|
6
|
+
require('./html-view.css');
|
|
7
|
+
var namespace = require('../../use/namespace/namespace.cjs');
|
|
8
|
+
var useViewController = require('../../use/view/use-view-controller/use-view-controller.cjs');
|
|
9
|
+
|
|
10
|
+
"use strict";
|
|
11
|
+
const HtmlView = /* @__PURE__ */ vue.defineComponent({
|
|
12
|
+
name: "IBizHtmlView",
|
|
13
|
+
props: {
|
|
14
|
+
context: Object,
|
|
15
|
+
params: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => ({})
|
|
18
|
+
},
|
|
19
|
+
modelData: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
modal: {
|
|
24
|
+
type: Object
|
|
25
|
+
},
|
|
26
|
+
state: {
|
|
27
|
+
type: Object
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup() {
|
|
31
|
+
var _a;
|
|
32
|
+
const ns = namespace.useNamespace("view");
|
|
33
|
+
const c = useViewController.useViewController((...args) => new runtime.ViewController(...args));
|
|
34
|
+
const controls = ((_a = c.model.viewLayoutPanel) == null ? void 0 : _a.controls) || c.model.controls;
|
|
35
|
+
const {
|
|
36
|
+
viewType,
|
|
37
|
+
sysCss,
|
|
38
|
+
codeName
|
|
39
|
+
} = c.model;
|
|
40
|
+
const typeClass = viewType.toLowerCase();
|
|
41
|
+
const sysCssName = sysCss == null ? void 0 : sysCss.cssName;
|
|
42
|
+
const viewClassNames = [ns.b(), ns.b(typeClass), ns.m(codeName), sysCssName];
|
|
43
|
+
const isLoading = vue.ref(false);
|
|
44
|
+
const url = vue.computed(() => {
|
|
45
|
+
if (c.model) {
|
|
46
|
+
const {
|
|
47
|
+
htmlUrl
|
|
48
|
+
} = c.model;
|
|
49
|
+
if (htmlUrl) {
|
|
50
|
+
return htmlUrl;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return "";
|
|
54
|
+
});
|
|
55
|
+
vue.onBeforeMount(() => {
|
|
56
|
+
if (url.value) {
|
|
57
|
+
isLoading.value = true;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const onLoad = () => {
|
|
61
|
+
isLoading.value = false;
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
c,
|
|
65
|
+
ns,
|
|
66
|
+
controls,
|
|
67
|
+
viewClassNames,
|
|
68
|
+
url,
|
|
69
|
+
isLoading,
|
|
70
|
+
onLoad
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
render() {
|
|
74
|
+
if (this.url) {
|
|
75
|
+
return vue.withDirectives(vue.createVNode("div", {
|
|
76
|
+
"class": this.viewClassNames
|
|
77
|
+
}, [vue.createVNode("iframe", {
|
|
78
|
+
"src": this.url,
|
|
79
|
+
"onLoad": () => this.onLoad()
|
|
80
|
+
}, null)]), [[vue.resolveDirective("loading"), this.isLoading]]);
|
|
81
|
+
}
|
|
82
|
+
let Content = null;
|
|
83
|
+
const provider = runtime.getErrorViewProvider("404");
|
|
84
|
+
if (provider) {
|
|
85
|
+
if (typeof provider.component === "string") {
|
|
86
|
+
Content = vue.h(vue.resolveComponent(provider.component));
|
|
87
|
+
}
|
|
88
|
+
Content = vue.h(provider.component);
|
|
89
|
+
}
|
|
90
|
+
return vue.createVNode("div", {
|
|
91
|
+
"class": this.viewClassNames
|
|
92
|
+
}, [Content]);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
exports.HtmlView = HtmlView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-view-dehtmlview>iframe{width:100%;height:100%;border:0}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('@ibiz-template/runtime');
|
|
4
|
+
require('../../util/index.cjs');
|
|
5
|
+
var htmlView_provider = require('./html-view.provider.cjs');
|
|
6
|
+
var htmlView = require('./html-view.cjs');
|
|
7
|
+
var install = require('../../util/install.cjs');
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizHtmlView = install.withInstall(htmlView.HtmlView, function(v) {
|
|
11
|
+
v.component(htmlView.HtmlView.name, htmlView.HtmlView);
|
|
12
|
+
runtime.registerViewProvider(runtime.ViewType.DE_HTML_VIEW, () => new htmlView_provider.HtmlViewProvider());
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
exports.IBizHtmlView = IBizHtmlView;
|
package/lib/view/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var index = require('./common/index.cjs');
|
|
|
5
5
|
var todoRedirect = require('./todo-redirect/todo-redirect.cjs');
|
|
6
6
|
var index$1 = require('./portal-view/index.cjs');
|
|
7
7
|
var index$2 = require('./de-redirect-view/index.cjs');
|
|
8
|
+
var index$3 = require('./html-view/index.cjs');
|
|
8
9
|
|
|
9
10
|
"use strict";
|
|
10
11
|
|
|
@@ -13,3 +14,4 @@ exports.IBizView = index.IBizView;
|
|
|
13
14
|
exports.TodoRedirect = todoRedirect.TodoRedirect;
|
|
14
15
|
exports.IBizPortalView = index$1.IBizPortalView;
|
|
15
16
|
exports.IBizDeRedirectView = index$2.IBizDeRedirectView;
|
|
17
|
+
exports.IBizHtmlView = index$3.IBizHtmlView;
|