@ibiz-template/runtime 0.2.12 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +280 -120
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.js +1 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +6 -0
- package/out/controller/control/calendar/calendar.controller.js +5 -5
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +2 -2
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.d.ts +1 -1
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/calendar-exp-bar.controller.js +2 -2
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts +3 -3
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +22 -11
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +13 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.js +29 -12
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +14 -6
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +0 -4
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +3 -3
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts +3 -8
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts.map +1 -1
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.js +28 -39
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +11 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +27 -14
- package/out/controller/control/tree/tree.controller.d.ts +1 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +25 -0
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts +8 -0
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.js +58 -15
- package/out/controller/utils/index.d.ts +1 -0
- package/out/controller/utils/index.d.ts.map +1 -1
- package/out/controller/utils/index.js +1 -0
- package/out/controller/utils/route/route.d.ts +10 -0
- package/out/controller/utils/route/route.d.ts.map +1 -0
- package/out/controller/utils/route/route.js +11 -0
- package/out/controller/utils/view-msg/view-msg-controller.d.ts.map +1 -1
- package/out/controller/utils/view-msg/view-msg-controller.js +10 -1
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts +7 -0
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts.map +1 -1
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts +9 -0
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts.map +1 -1
- package/out/interface/controller/common/view-message/i-view-message.d.ts +9 -0
- package/out/interface/controller/common/view-message/i-view-message.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-md-control.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/i-md-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-medit-view-panel.controller.d.ts +6 -0
- package/out/interface/controller/controller/control/i-medit-view-panel.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-medit-view-panel.state.d.ts +5 -0
- package/out/interface/controller/state/control/i-medit-view-panel.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-action-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-action-executor.js +4 -0
- package/out/service/service/entity/util/util.d.ts +1 -0
- package/out/service/service/entity/util/util.d.ts.map +1 -1
- package/out/service/service/entity/util/util.js +1 -0
- package/out/service/service/work-flow/work-flow.service.d.ts +11 -0
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.js +15 -2
- package/out/service/vo/control.vo.d.ts.map +1 -1
- package/out/service/vo/control.vo.js +11 -0
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts +0 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.js +0 -1
- package/out/ui-action/provider/backend-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/backend-ui-action-provider.js +3 -1
- package/package.json +7 -8
- package/src/controller/common/control/md-control.controller.ts +1 -1
- package/src/controller/common/view/view.controller.ts +6 -0
- package/src/controller/control/calendar/calendar.controller.ts +5 -5
- package/src/controller/control/chart/generator/base-series-generator.ts +5 -2
- package/src/controller/control/exp-bar/calendar-exp-bar.controller.ts +2 -2
- package/src/controller/control/exp-bar/exp-bar.controller.ts +23 -14
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +30 -11
- package/src/controller/control/form/edit-form/edit-form.controller.ts +16 -7
- package/src/controller/control/grid/grid/grid.controller.ts +0 -3
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +3 -3
- package/src/controller/control/medit-view-panel/medit-view-panel.controller.ts +30 -46
- package/src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts +31 -11
- package/src/controller/control/tree/tree.controller.ts +36 -0
- package/src/controller/control/wizard-panel/wizard-panel.controller.ts +67 -18
- package/src/controller/utils/index.ts +1 -0
- package/src/controller/utils/route/route.ts +11 -0
- package/src/controller/utils/view-msg/view-msg-controller.ts +11 -1
- package/src/interface/common/i-data-ability-params/i-data-ability-params.ts +8 -0
- package/src/interface/controller/common/i-nav-view-msg/i-nav-view-msg.ts +10 -0
- package/src/interface/controller/common/view-message/i-view-message.ts +10 -0
- package/src/interface/controller/controller/control/i-exp-bar-control.controller.ts +1 -1
- package/src/interface/controller/controller/control/i-md-control.controller.ts +8 -0
- package/src/interface/controller/controller/control/i-medit-view-panel.controller.ts +8 -1
- package/src/interface/controller/controller/control/i-tree.controller.ts +9 -0
- package/src/interface/controller/state/control/i-medit-view-panel.state.ts +6 -0
- package/src/interface/controller/state/control/i-tree.state.ts +8 -0
- package/src/logic-scheduler/executor/app-ui-action-executor.ts +8 -1
- package/src/service/service/entity/util/util.ts +1 -0
- package/src/service/service/work-flow/work-flow.service.ts +20 -2
- package/src/service/vo/control.vo.ts +12 -0
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +0 -3
- package/src/ui-action/provider/backend-ui-action-provider.ts +5 -1
package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { DataTypes, ModelError } from '@ibiz-template/core';
|
|
2
|
+
import { DataTypes, ModelError, plus } from '@ibiz-template/core';
|
|
3
3
|
import { IAppCodeList, IDEGridFieldColumn } from '@ibiz/model-core';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { debounce } from 'lodash-es';
|
|
@@ -236,13 +236,13 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
236
236
|
case 'SUM':
|
|
237
237
|
aggValue = items
|
|
238
238
|
.map(item => item[fieldName] as number)
|
|
239
|
-
.reduce((a, b) => a
|
|
239
|
+
.reduce((a, b) => plus(a, b), 0);
|
|
240
240
|
break;
|
|
241
241
|
case 'AVG':
|
|
242
242
|
aggValue =
|
|
243
243
|
items
|
|
244
244
|
.map(item => item[fieldName] as number)
|
|
245
|
-
.reduce((a, b) => a
|
|
245
|
+
.reduce((a, b) => plus(a, b), 0) / items.length;
|
|
246
246
|
break;
|
|
247
247
|
case 'MAX':
|
|
248
248
|
aggValue = Math.max(...items.map(item => item[fieldName] as number));
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
IPanelUiItem,
|
|
11
11
|
DataChangeEvent,
|
|
12
12
|
} from '../../../interface';
|
|
13
|
-
import {
|
|
14
|
-
import { ControlVO, Srfuf } from '../../../service';
|
|
13
|
+
import { ControlVO } from '../../../service';
|
|
15
14
|
import { MDControlController } from '../../common';
|
|
16
15
|
import { MEditViewPanelService } from './medit-view-panel.service';
|
|
17
16
|
|
|
@@ -32,12 +31,6 @@ export class MEditViewPanelController
|
|
|
32
31
|
{
|
|
33
32
|
declare service: MEditViewPanelService;
|
|
34
33
|
|
|
35
|
-
/**
|
|
36
|
-
* 是否显示底部按钮
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
showButton: boolean = true;
|
|
40
|
-
|
|
41
34
|
/**
|
|
42
35
|
* 当前应用视图参数对象
|
|
43
36
|
*
|
|
@@ -56,6 +49,7 @@ export class MEditViewPanelController
|
|
|
56
49
|
this.state.panelUiItems = [];
|
|
57
50
|
this.state.activeTab = '';
|
|
58
51
|
this.state.size = 1000;
|
|
52
|
+
this.state.isNeedScroll = false;
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
/**
|
|
@@ -99,12 +93,17 @@ export class MEditViewPanelController
|
|
|
99
93
|
items: ControlVO[],
|
|
100
94
|
): Promise<ControlVO[]> {
|
|
101
95
|
await super.afterLoad(args, items);
|
|
96
|
+
// 找出临时UI数据
|
|
97
|
+
const tempPanelUiItems = this.state.panelUiItems.filter(UiItem => {
|
|
98
|
+
return UiItem.id.startsWith('mockId:');
|
|
99
|
+
});
|
|
102
100
|
this.state.panelUiItems = [];
|
|
103
|
-
this.doItems(items);
|
|
101
|
+
this.doItems(items, tempPanelUiItems);
|
|
104
102
|
// 设置默认激活
|
|
105
103
|
if (
|
|
106
104
|
this.model.panelStyle === 'TAB_TOP' &&
|
|
107
|
-
this.state.panelUiItems.length > 0
|
|
105
|
+
this.state.panelUiItems.length > 0 &&
|
|
106
|
+
tempPanelUiItems.length === 0
|
|
108
107
|
) {
|
|
109
108
|
this.state.activeTab = this.state.panelUiItems[0].id;
|
|
110
109
|
}
|
|
@@ -158,11 +157,14 @@ export class MEditViewPanelController
|
|
|
158
157
|
* @author: zhujiamin
|
|
159
158
|
* @Date: 2023-10-16 15:00:02
|
|
160
159
|
*/
|
|
161
|
-
doItems(datas: ControlVO[]): void {
|
|
160
|
+
doItems(datas: ControlVO[], tempPanelUiItems?: IPanelUiItem[]): void {
|
|
162
161
|
datas.forEach((arg: ControlVO) => {
|
|
163
162
|
const item = this.handlePanelItemParams(arg);
|
|
164
163
|
this.state.panelUiItems.push(item);
|
|
165
164
|
});
|
|
165
|
+
if (tempPanelUiItems) {
|
|
166
|
+
this.state.panelUiItems.push(...tempPanelUiItems);
|
|
167
|
+
}
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
/**
|
|
@@ -172,6 +174,7 @@ export class MEditViewPanelController
|
|
|
172
174
|
* @Date: 2023-10-16 15:18:01
|
|
173
175
|
*/
|
|
174
176
|
async handleAdd(): Promise<void> {
|
|
177
|
+
this.state.isNeedScroll = true;
|
|
175
178
|
this.doItems([{ srfuf: 0 } as ControlVO]);
|
|
176
179
|
if (this.model.panelStyle === 'TAB_TOP') {
|
|
177
180
|
// 上分页添加后激活最后一个
|
|
@@ -188,6 +191,7 @@ export class MEditViewPanelController
|
|
|
188
191
|
* @Date: 2023-10-16 15:23:59
|
|
189
192
|
*/
|
|
190
193
|
async handleDelete(item: IPanelUiItem): Promise<void> {
|
|
194
|
+
this.state.isNeedScroll = false;
|
|
191
195
|
// 新建的界面上删除即可
|
|
192
196
|
if (item.data.srfuf === 0) {
|
|
193
197
|
// 删除items中已删除的项
|
|
@@ -196,7 +200,7 @@ export class MEditViewPanelController
|
|
|
196
200
|
});
|
|
197
201
|
this.state.panelUiItems.splice(index, 1);
|
|
198
202
|
} else {
|
|
199
|
-
await this.remove({ data: [item.data] });
|
|
203
|
+
await this.remove({ data: [item.data], notRefresh: true });
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
|
|
@@ -253,53 +257,33 @@ export class MEditViewPanelController
|
|
|
253
257
|
onViewDataChange(args: DataChangeEvent, id: string): void {
|
|
254
258
|
// 新建的保存成功后该部件需要保存来更新数据
|
|
255
259
|
if (args.eventName === 'onSaveSuccess') {
|
|
256
|
-
this.
|
|
260
|
+
this.handleDataChange(args.data[0] as ControlVO, id);
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
|
|
260
264
|
/**
|
|
261
|
-
*
|
|
265
|
+
* 处理数据变化
|
|
262
266
|
*
|
|
263
267
|
* @param {ControlVO} data
|
|
264
268
|
* @returns {*} {Promise<void>}
|
|
265
269
|
*/
|
|
266
|
-
async
|
|
270
|
+
async handleDataChange(data: ControlVO, id: string): Promise<void> {
|
|
267
271
|
const panelUiItemIndex = this.state.panelUiItems.findIndex(
|
|
268
272
|
item => item.id === id,
|
|
269
273
|
);
|
|
270
|
-
if (
|
|
274
|
+
if (panelUiItemIndex < 0) {
|
|
271
275
|
throw new RuntimeError('编辑视图面板部件UI数据不存在');
|
|
272
276
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
} catch (error) {
|
|
284
|
-
await this.evt.emit('onSaveError', undefined);
|
|
285
|
-
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}ERROR`, {
|
|
286
|
-
error: error as Error,
|
|
287
|
-
data: this.state.panelUiItems[panelUiItemIndex].data,
|
|
288
|
-
});
|
|
289
|
-
throw error;
|
|
290
|
-
} finally {
|
|
291
|
-
await this.endLoading();
|
|
277
|
+
const tempUiItem = this.state.panelUiItems[panelUiItemIndex];
|
|
278
|
+
if (tempUiItem.id.startsWith('mockId:')) {
|
|
279
|
+
this.state.panelUiItems[panelUiItemIndex] =
|
|
280
|
+
this.handlePanelItemParams(data);
|
|
281
|
+
} else {
|
|
282
|
+
tempUiItem.srfmajortext = data.srfmajortext!;
|
|
283
|
+
}
|
|
284
|
+
if (this.model.panelStyle === 'TAB_TOP') {
|
|
285
|
+
// 上分页保存后激活保存的这一个
|
|
286
|
+
this.state.activeTab = this.state.panelUiItems[panelUiItemIndex].id;
|
|
292
287
|
}
|
|
293
|
-
// 后续处理
|
|
294
|
-
const index = this.state.items.findIndex(
|
|
295
|
-
item => item.srfkey === data.srfkey,
|
|
296
|
-
);
|
|
297
|
-
this.state.items.splice(index, 1, res.data);
|
|
298
|
-
this.state.panelUiItems.splice(
|
|
299
|
-
panelUiItemIndex,
|
|
300
|
-
1,
|
|
301
|
-
this.handlePanelItemParams(res.data),
|
|
302
|
-
);
|
|
303
|
-
await this.evt.emit('onSaveSuccess', undefined);
|
|
304
288
|
}
|
|
305
289
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { calcDeCodeNameById } from '../../../model';
|
|
10
10
|
import { calcNavParams } from '../../../utils';
|
|
11
11
|
import { ControlController } from '../../common';
|
|
12
|
+
import { hasSubRoute } from '../../utils';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* 分页导航面板
|
|
@@ -57,6 +58,19 @@ export class TabExpPanelController
|
|
|
57
58
|
return ibiz.config.view.expCacheMode.includes(this.model.controlType!);
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
/**
|
|
62
|
+
* 当前路由视图的层级
|
|
63
|
+
*
|
|
64
|
+
* @author zk
|
|
65
|
+
* @date 2023-07-11 10:07:20
|
|
66
|
+
* @readonly
|
|
67
|
+
* @type {(number | undefined)}
|
|
68
|
+
* @memberof ExpBarControlController
|
|
69
|
+
*/
|
|
70
|
+
get routeDepth(): number | undefined {
|
|
71
|
+
return this.view.modal.routeDepth;
|
|
72
|
+
}
|
|
73
|
+
|
|
60
74
|
/**
|
|
61
75
|
* 初始化state的属性
|
|
62
76
|
*
|
|
@@ -141,23 +155,25 @@ export class TabExpPanelController
|
|
|
141
155
|
* @memberof TabExpPanelController
|
|
142
156
|
*/
|
|
143
157
|
initDefaultPage(): void {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this.handleTabChange();
|
|
147
|
-
};
|
|
148
|
-
if (!this.state.defaultTabName) {
|
|
149
|
-
initFirstPage();
|
|
150
|
-
} else {
|
|
158
|
+
// 跳转指定的默认分页
|
|
159
|
+
if (this.state.defaultTabName) {
|
|
151
160
|
const activeTab = this.state.tabPages.find(
|
|
152
161
|
item => item.tabTag === this.state.defaultTabName,
|
|
153
162
|
);
|
|
154
|
-
if (
|
|
155
|
-
initFirstPage();
|
|
156
|
-
} else {
|
|
163
|
+
if (activeTab) {
|
|
157
164
|
this.state.activeName = activeTab.tabTag;
|
|
158
|
-
this.changeToTab(
|
|
165
|
+
this.changeToTab(
|
|
166
|
+
this.activeTabViewPanelModel,
|
|
167
|
+
// 路由模式下并且有子路由
|
|
168
|
+
this.routeDepth !== undefined && hasSubRoute(this.routeDepth),
|
|
169
|
+
);
|
|
170
|
+
return;
|
|
159
171
|
}
|
|
160
172
|
}
|
|
173
|
+
|
|
174
|
+
// 没有默认分页或者匹配不到时,跳转第一个分页
|
|
175
|
+
this.state.activeName = this.state.tabPages[0].tabTag;
|
|
176
|
+
this.handleTabChange();
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
/**
|
|
@@ -169,8 +185,12 @@ export class TabExpPanelController
|
|
|
169
185
|
*/
|
|
170
186
|
protected changeToTab(
|
|
171
187
|
tab: IDETabViewPanel = this.activeTabViewPanelModel!,
|
|
188
|
+
isRoutePushed = false,
|
|
172
189
|
): void {
|
|
173
190
|
const navViewMsg = this.getNavViewMsg(tab);
|
|
191
|
+
if (isRoutePushed === true) {
|
|
192
|
+
navViewMsg.isRoutePushed = true;
|
|
193
|
+
}
|
|
174
194
|
this.evt.emit('onNavViewChange', { navViewMsg });
|
|
175
195
|
}
|
|
176
196
|
|
|
@@ -41,6 +41,7 @@ export class TreeController
|
|
|
41
41
|
// 根节点初始化
|
|
42
42
|
this.state.defaultExpandedKeys = [];
|
|
43
43
|
this.state.expandedKeys = [];
|
|
44
|
+
this.state.navigational = false;
|
|
44
45
|
this.state.size = 0;
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -154,6 +155,14 @@ export class TreeController
|
|
|
154
155
|
* @memberof TreeController
|
|
155
156
|
*/
|
|
156
157
|
async onTreeNodeClick(nodeData: ITreeNodeData): Promise<void> {
|
|
158
|
+
// 导航的时候,没有导航视图的时候,节点后续点击逻辑都不走,也不选中
|
|
159
|
+
if (this.state.navigational) {
|
|
160
|
+
const nodeModel = this.getNodeModel(nodeData.nodeId);
|
|
161
|
+
if (!nodeModel?.navAppViewId) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
157
166
|
// 单选时,单击才会触发选中逻辑
|
|
158
167
|
if (this.state.singleSelect) {
|
|
159
168
|
// 选中相关处理
|
|
@@ -363,4 +372,31 @@ export class TreeController
|
|
|
363
372
|
children: nodes,
|
|
364
373
|
});
|
|
365
374
|
}
|
|
375
|
+
|
|
376
|
+
async expandNodeByKey(expandKeys: string[]): Promise<void> {
|
|
377
|
+
const noExpandKeys = expandKeys.filter(
|
|
378
|
+
key => !this.state.expandedKeys.includes(key),
|
|
379
|
+
);
|
|
380
|
+
if (noExpandKeys.length === 0) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// 找到已存在的要展开的节点
|
|
385
|
+
const existNodes = this.state.items.filter(item =>
|
|
386
|
+
noExpandKeys.includes(item.id),
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
// 补充所有未展开的节点标识,查询过程中会自动加载后续展开
|
|
390
|
+
this.state.expandedKeys.push(...noExpandKeys);
|
|
391
|
+
|
|
392
|
+
if (existNodes.length === 0) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
// 展开加载节点
|
|
396
|
+
await Promise.all(
|
|
397
|
+
existNodes.map(node => {
|
|
398
|
+
return this.loadNodes(node);
|
|
399
|
+
}),
|
|
400
|
+
);
|
|
401
|
+
}
|
|
366
402
|
}
|
|
@@ -207,6 +207,29 @@ export class WizardPanelController
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* 根据tag获取应该激活的向导表单
|
|
212
|
+
* @param {string} tag
|
|
213
|
+
* @return {*}
|
|
214
|
+
* @author: zhujiamin
|
|
215
|
+
* @Date: 2023-11-10 18:35:37
|
|
216
|
+
*/
|
|
217
|
+
getWizardFormByTag(tag: string): IDEWizardForm | undefined {
|
|
218
|
+
if (!this.model.dewizard?.dewizardForms) {
|
|
219
|
+
throw new RuntimeError(`没有配置向导表单集合`);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const wizardForm = this.model.dewizard.dewizardForms.find(
|
|
223
|
+
(form: IDEWizardForm) => {
|
|
224
|
+
return form.formTag === tag;
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
if (!wizardForm) {
|
|
228
|
+
throw new RuntimeError(`找不到标识为${tag}的向导表单`);
|
|
229
|
+
}
|
|
230
|
+
return wizardForm;
|
|
231
|
+
}
|
|
232
|
+
|
|
210
233
|
/**
|
|
211
234
|
* 执行初始化操作,存在初始化实体行为的时候加载数据并把主键放入上下文
|
|
212
235
|
*
|
|
@@ -221,8 +244,22 @@ export class WizardPanelController
|
|
|
221
244
|
if (res.data && res.data.srfkey) {
|
|
222
245
|
this.context[deName] = res.data.srfkey;
|
|
223
246
|
}
|
|
247
|
+
// 初始化时状态向导面板根据状态属性去决定当前激活哪个表单
|
|
248
|
+
if (
|
|
249
|
+
res.data &&
|
|
250
|
+
this.model.stateAppDEFieldId &&
|
|
251
|
+
res.data[this.model.stateAppDEFieldId]
|
|
252
|
+
) {
|
|
253
|
+
const activeForm = this.getWizardFormByTag(
|
|
254
|
+
res.data[this.model.stateAppDEFieldId],
|
|
255
|
+
);
|
|
256
|
+
if (activeForm) {
|
|
257
|
+
this.state.activeFormTag = activeForm.formTag!;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
224
260
|
}
|
|
225
|
-
|
|
261
|
+
// 没有激活的表单标识就选配置的首表单
|
|
262
|
+
if (!this.state.activeFormTag && this.firstForm) {
|
|
226
263
|
this.state.activeFormTag = this.firstForm.formTag!;
|
|
227
264
|
this.tagHistory.push(this.firstForm.formTag!);
|
|
228
265
|
}
|
|
@@ -250,10 +287,20 @@ export class WizardPanelController
|
|
|
250
287
|
*/
|
|
251
288
|
async onPrevClick(): Promise<void> {
|
|
252
289
|
// 先执行表单返回行为
|
|
253
|
-
await this.activeFormController.goBack();
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
290
|
+
const data = await this.activeFormController.goBack();
|
|
291
|
+
let prevTag;
|
|
292
|
+
// 返回上一个表单优先级 stateAppDEFieldId > tagHistory
|
|
293
|
+
if (this.model.stateAppDEFieldId && data[this.model.stateAppDEFieldId]) {
|
|
294
|
+
const wizardForm = this.getWizardFormByTag(
|
|
295
|
+
data[this.model.stateAppDEFieldId],
|
|
296
|
+
);
|
|
297
|
+
if (wizardForm) {
|
|
298
|
+
prevTag = data[this.model.stateAppDEFieldId];
|
|
299
|
+
}
|
|
300
|
+
} else {
|
|
301
|
+
prevTag = this.tagHistory[this.tagHistory.length - 1];
|
|
302
|
+
this.tagHistory.pop();
|
|
303
|
+
}
|
|
257
304
|
if (!prevTag) {
|
|
258
305
|
throw new RuntimeError('没有上一个表单');
|
|
259
306
|
}
|
|
@@ -272,15 +319,21 @@ export class WizardPanelController
|
|
|
272
319
|
const data = await this.activeFormController.save();
|
|
273
320
|
let nextTag;
|
|
274
321
|
if (data.srfnextform) {
|
|
275
|
-
const wizardForm = this.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
322
|
+
const wizardForm = this.getWizardFormByTag(data.srfnextform);
|
|
323
|
+
if (wizardForm) {
|
|
324
|
+
nextTag = data.srfnextform;
|
|
325
|
+
this.tagHistory.push(nextTag);
|
|
326
|
+
}
|
|
327
|
+
} else if (
|
|
328
|
+
this.model.stateAppDEFieldId &&
|
|
329
|
+
data[this.model.stateAppDEFieldId]
|
|
330
|
+
) {
|
|
331
|
+
const wizardForm = this.getWizardFormByTag(
|
|
332
|
+
data[this.model.stateAppDEFieldId],
|
|
279
333
|
);
|
|
280
|
-
if (
|
|
281
|
-
|
|
334
|
+
if (wizardForm) {
|
|
335
|
+
nextTag = data[this.model.stateAppDEFieldId];
|
|
282
336
|
}
|
|
283
|
-
nextTag = data.srfnextform;
|
|
284
337
|
} else {
|
|
285
338
|
// 通过步骤找,找到下一个步骤对应的第一个向导表单
|
|
286
339
|
const { formTag } = this.activeWizardForm!;
|
|
@@ -293,12 +346,8 @@ export class WizardPanelController
|
|
|
293
346
|
if (!nextWizardStep) {
|
|
294
347
|
throw new RuntimeError('找不到下一个向导步骤');
|
|
295
348
|
}
|
|
296
|
-
const nextWizardForm = this.
|
|
297
|
-
|
|
298
|
-
return wizardForm.formTag === nextWizardStep.stepTag;
|
|
299
|
-
},
|
|
300
|
-
);
|
|
301
|
-
if (nextWizardForm) {
|
|
349
|
+
const nextWizardForm = this.getWizardFormByTag(nextWizardStep.stepTag!);
|
|
350
|
+
if (nextWizardForm && nextWizardForm.formTag) {
|
|
302
351
|
nextTag = nextWizardForm.formTag;
|
|
303
352
|
}
|
|
304
353
|
}
|
|
@@ -2,6 +2,7 @@ export * from './counter';
|
|
|
2
2
|
export * from './loading/loading.state';
|
|
3
3
|
export * from './button-state';
|
|
4
4
|
export * from './event';
|
|
5
|
+
export * from './route/route';
|
|
5
6
|
export * from './util/util';
|
|
6
7
|
export * from './value-rule/value-rule';
|
|
7
8
|
export * from './value-ex/value-ex';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 是否有子路由路径
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-11-08 10:12:54
|
|
5
|
+
* @export
|
|
6
|
+
* @param {number} routeDepth
|
|
7
|
+
* @return {*} {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function hasSubRoute(routeDepth: number): boolean {
|
|
10
|
+
return window.location.hash.split('/').length > routeDepth * 2 + 2;
|
|
11
|
+
}
|
|
@@ -146,13 +146,16 @@ export class ViewMsgController {
|
|
|
146
146
|
*/
|
|
147
147
|
protected calcStaticMsg(detail: IAppViewMsgGroupDetail): IViewMessage {
|
|
148
148
|
const { position: position1 } = detail;
|
|
149
|
+
const viewMsg = this.viewMsgMap.get(detail.appViewMsgId!)!;
|
|
149
150
|
const {
|
|
150
151
|
title,
|
|
151
152
|
message,
|
|
152
153
|
removeMode,
|
|
153
154
|
position: position2,
|
|
154
155
|
messageType,
|
|
155
|
-
} =
|
|
156
|
+
} = viewMsg;
|
|
157
|
+
const { userTag, userTag2, userTag3, userTag4 } = viewMsg as IData;
|
|
158
|
+
|
|
156
159
|
// detail里的位置优先
|
|
157
160
|
const position = position1 || position2;
|
|
158
161
|
return {
|
|
@@ -161,6 +164,13 @@ export class ViewMsgController {
|
|
|
161
164
|
position,
|
|
162
165
|
messageType,
|
|
163
166
|
removeMode,
|
|
167
|
+
// 额外参数
|
|
168
|
+
extraParams: {
|
|
169
|
+
userTag,
|
|
170
|
+
userTag2,
|
|
171
|
+
userTag3,
|
|
172
|
+
userTag4,
|
|
173
|
+
},
|
|
164
174
|
};
|
|
165
175
|
}
|
|
166
176
|
|
|
@@ -64,5 +64,5 @@ export interface IExpBarControlController<
|
|
|
64
64
|
* @date 2023-09-14 07:03:39
|
|
65
65
|
* @param {{ srfnav?: string; path: string }} info 当前系统的路由的从一级到最后一级的所有路径。
|
|
66
66
|
*/
|
|
67
|
-
onRouterChange(info: { srfnav: string; path: string }): void
|
|
67
|
+
onRouterChange(info: { srfnav: string; path: string }): Promise<void>;
|
|
68
68
|
}
|
|
@@ -28,6 +28,14 @@ export interface MDCtrlRemoveParams extends IDataAbilityParams {
|
|
|
28
28
|
* @type {boolean}
|
|
29
29
|
*/
|
|
30
30
|
silent?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 是否不需要刷新(默认为否,如果不需要刷新传true)
|
|
34
|
+
* @author lxm
|
|
35
|
+
* @date 2023-08-17 06:04:23
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
*/
|
|
38
|
+
notRefresh?: boolean;
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
/**
|
|
@@ -14,4 +14,11 @@ export interface IMEditViewPanelController<
|
|
|
14
14
|
T extends IDEMultiEditViewPanel = IDEMultiEditViewPanel,
|
|
15
15
|
S extends IMEditViewPanelState = IMEditViewPanelState,
|
|
16
16
|
E extends IMEditViewPanelEvent = IMEditViewPanelEvent,
|
|
17
|
-
> extends IMDControlController<T, S, E> {
|
|
17
|
+
> extends IMDControlController<T, S, E> {
|
|
18
|
+
/**
|
|
19
|
+
* 处理添加
|
|
20
|
+
*
|
|
21
|
+
* @memberof IMEditViewPanelController
|
|
22
|
+
*/
|
|
23
|
+
handleAdd(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -57,4 +57,13 @@ export interface ITreeController
|
|
|
57
57
|
nodeData: ITreeNodeData | IData,
|
|
58
58
|
refreshParent?: boolean,
|
|
59
59
|
): Promise<void>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 展开并加载节点
|
|
63
|
+
* @author lxm
|
|
64
|
+
* @date 2023-11-07 03:00:54
|
|
65
|
+
* @param {string[]} expandedKeys 要展开的节点标识集合
|
|
66
|
+
* @return {*} {Promise<void>}
|
|
67
|
+
*/
|
|
68
|
+
expandNodeByKey(expandedKeys: string[]): Promise<void>;
|
|
60
69
|
}
|
|
@@ -37,6 +37,14 @@ export interface ITreeState extends IMDControlState {
|
|
|
37
37
|
* @type {string[]}
|
|
38
38
|
*/
|
|
39
39
|
expandedKeys: string[];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 是否是导航的(即树导航里的树)
|
|
43
|
+
* @author lxm
|
|
44
|
+
* @date 2023-11-08 03:25:21
|
|
45
|
+
* @type {boolean}
|
|
46
|
+
*/
|
|
47
|
+
navigational: boolean;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
1
2
|
import { IUILogicParams } from '../../interface';
|
|
2
3
|
import { UIActionUtil } from '../../ui-action';
|
|
3
4
|
import { LogicExecutor } from './logic-executor';
|
|
@@ -15,6 +16,12 @@ export class AppDEUIActionExecutor extends LogicExecutor {
|
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
18
|
execute(executeParams: IUILogicParams): any {
|
|
18
|
-
|
|
19
|
+
if (!this.logic.appDEUIActionId) {
|
|
20
|
+
throw new RuntimeModelError(
|
|
21
|
+
this.logic,
|
|
22
|
+
`逻辑中缺少触发应用实体界面行为id`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
UIActionUtil.execAndResolved(this.logic.appDEUIActionId, executeParams);
|
|
19
26
|
}
|
|
20
27
|
}
|