@ibiz-template/runtime 0.4.17-dev.1 → 0.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +629 -816
- package/dist/index.system.min.js +2 -2
- package/out/controller/common/control/md-control.controller.d.ts +21 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +38 -2
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +2 -6
- package/out/controller/control/gantt/gantt.controller.d.ts +6 -189
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +6 -412
- package/out/controller/control/gantt/gantt.service.d.ts +2 -2
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +5 -5
- package/out/controller/control/kanban/kanban.controller.d.ts +2 -2
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +1 -1
- package/out/controller/control/list/list.controller.d.ts +1 -30
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +0 -41
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +1 -1
- package/out/controller/control/search-bar/index.d.ts +1 -0
- package/out/controller/control/search-bar/index.d.ts.map +1 -1
- package/out/controller/control/search-bar/index.js +1 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +48 -4
- package/out/controller/control/search-bar/search-bar.service.d.ts +24 -0
- package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.service.js +62 -16
- package/out/interface/controller/event/control/i-gantt.event.d.ts +2 -44
- package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +2 -41
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +8 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/service/i-parent-config/i-parent-config.d.ts +67 -0
- package/out/interface/service/i-parent-config/i-parent-config.d.ts.map +1 -0
- package/out/interface/service/i-parent-config/i-parent-config.js +1 -0
- package/out/interface/service/index.d.ts +1 -0
- package/out/interface/service/index.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +10 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/service/de-service-util.d.ts +3 -2
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +11 -10
- package/out/service/dto/method.dto.d.ts +22 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +65 -4
- package/out/service/service/entity/de.service.d.ts +10 -0
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +22 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +1 -12
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +0 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +1 -2
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +0 -7
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +0 -18
- package/out/ui-action/provider/ui-action-provider-base.d.ts +10 -0
- package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
- package/out/ui-action/provider/ui-action-provider-base.js +20 -9
- package/out/utils/index.d.ts +1 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +25 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +72 -31
- package/out/utils/ui-domain/ui-domain.d.ts +28 -0
- package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
- package/out/utils/ui-domain/ui-domain.js +40 -0
- package/package.json +6 -6
- package/src/controller/common/control/md-control.controller.ts +50 -2
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -6
- package/src/controller/control/gantt/gantt.controller.ts +7 -492
- package/src/controller/control/gantt/gantt.service.ts +5 -5
- package/src/controller/control/kanban/kanban.controller.ts +2 -2
- package/src/controller/control/list/list.controller.ts +0 -54
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +1 -1
- package/src/controller/control/search-bar/index.ts +1 -0
- package/src/controller/control/search-bar/search-bar.controller.ts +63 -10
- package/src/controller/control/search-bar/search-bar.service.ts +70 -16
- package/src/interface/controller/event/control/i-gantt.event.ts +2 -38
- package/src/interface/controller/state/control/i-gantt.state.ts +2 -47
- package/src/interface/controller/state/control/i-search-bar.state.ts +9 -1
- package/src/interface/service/i-parent-config/i-parent-config.ts +66 -0
- package/src/interface/service/index.ts +1 -0
- package/src/interface/service/service/i-app-de.service.ts +13 -0
- package/src/service/de-service-util.ts +6 -4
- package/src/service/dto/method.dto.ts +77 -5
- package/src/service/service/entity/de.service.ts +26 -1
- package/src/service/service/entity/method/method.ts +1 -13
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +1 -4
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +0 -21
- package/src/ui-action/provider/ui-action-provider-base.ts +34 -15
- package/src/utils/index.ts +1 -0
- package/src/utils/open-redirect-view/open-redirect-view.ts +93 -38
- package/src/utils/ui-domain/ui-domain.ts +44 -0
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
/* eslint-disable no-prototype-builtins */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
|
-
import {
|
|
5
|
-
import { IDEGantt, IDETreeColumn, IDETreeNode } from '@ibiz/model-core';
|
|
4
|
+
import { IDEGantt, IDETreeNode } from '@ibiz/model-core';
|
|
6
5
|
import {
|
|
7
6
|
IGanttController,
|
|
8
7
|
IGanttEvent,
|
|
9
8
|
IGanttNodeData,
|
|
10
9
|
IGanttState,
|
|
11
10
|
IGanttStyle,
|
|
12
|
-
IGridColumnProvider,
|
|
13
|
-
MDCtrlLoadParams,
|
|
14
11
|
} from '../../../interface';
|
|
15
|
-
import { MDControlController } from '../../common';
|
|
16
12
|
import { GanttService } from './gantt.service';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
GridColumnController,
|
|
20
|
-
GridFieldColumnController,
|
|
21
|
-
GridUAColumnController,
|
|
22
|
-
} from '../grid';
|
|
23
|
-
import { getGridColumnProvider } from '../../../register';
|
|
24
|
-
import { UIActionUtil } from '../../../ui-action';
|
|
13
|
+
import { TreeGridExController } from '../tree-grid-ex';
|
|
25
14
|
|
|
26
15
|
/**
|
|
27
16
|
* 甘特图控制器
|
|
@@ -34,61 +23,11 @@ import { UIActionUtil } from '../../../ui-action';
|
|
|
34
23
|
* @implements {IGanttController}
|
|
35
24
|
*/
|
|
36
25
|
export class GanttController
|
|
37
|
-
extends
|
|
26
|
+
extends TreeGridExController<IDEGantt, IGanttState, IGanttEvent>
|
|
38
27
|
implements IGanttController
|
|
39
28
|
{
|
|
40
29
|
declare service: GanttService;
|
|
41
30
|
|
|
42
|
-
/**
|
|
43
|
-
* 表格列适配器
|
|
44
|
-
*
|
|
45
|
-
* @type {{ [key: string]: IGridColumnProvider }}
|
|
46
|
-
* @memberof GanttController
|
|
47
|
-
*/
|
|
48
|
-
providers: { [key: string]: IGridColumnProvider } = {};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 所有表格列控制器集合
|
|
52
|
-
*
|
|
53
|
-
* @type {{ [key: string]: GridColumnController }}
|
|
54
|
-
* @memberof GanttController
|
|
55
|
-
*/
|
|
56
|
-
columns: { [key: string]: GridColumnController } = {};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 所有表格属性列的控制器
|
|
60
|
-
*
|
|
61
|
-
* @type {{ [key: string]: GridFieldColumnController }}
|
|
62
|
-
* @memberof GanttController
|
|
63
|
-
*/
|
|
64
|
-
fieldColumns: { [key: string]: GridFieldColumnController } = {};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 所有表格操作列的控制器
|
|
68
|
-
*
|
|
69
|
-
* @type {{ [key: string]: GridUAColumnController }}
|
|
70
|
-
* @memberof GanttController
|
|
71
|
-
*/
|
|
72
|
-
uaColumns: { [key: string]: GridUAColumnController } = {};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 上下文菜单控制器
|
|
76
|
-
*
|
|
77
|
-
* @author tony001
|
|
78
|
-
* @date 2023-12-11 16:12:57
|
|
79
|
-
* @type {{ [p: string]: ContextMenuController }}
|
|
80
|
-
*/
|
|
81
|
-
contextMenus: { [p: string]: ContextMenuController } = {};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 是否启用快速搜索
|
|
85
|
-
*
|
|
86
|
-
* @author tony001
|
|
87
|
-
* @date 2023-12-11 16:12:13
|
|
88
|
-
* @type {boolean}
|
|
89
|
-
*/
|
|
90
|
-
enableQuickSearch: boolean = false;
|
|
91
|
-
|
|
92
31
|
/**
|
|
93
32
|
* 初始化状态
|
|
94
33
|
*
|
|
@@ -98,9 +37,6 @@ export class GanttController
|
|
|
98
37
|
*/
|
|
99
38
|
protected initState(): void {
|
|
100
39
|
super.initState();
|
|
101
|
-
this.state.size = 0;
|
|
102
|
-
this.state.query = '';
|
|
103
|
-
this.state.columnStates = [];
|
|
104
40
|
this.state.rootNodes = [];
|
|
105
41
|
this.state.ganttStyle = {};
|
|
106
42
|
}
|
|
@@ -114,148 +50,16 @@ export class GanttController
|
|
|
114
50
|
*/
|
|
115
51
|
protected onDataChange(msg: IData): void {}
|
|
116
52
|
|
|
117
|
-
protected async onCreated(): Promise<void> {
|
|
118
|
-
await super.onCreated();
|
|
119
|
-
await this.initGridColumns();
|
|
120
|
-
this.initColumnStates();
|
|
121
|
-
|
|
122
|
-
// 快速搜索
|
|
123
|
-
if (this.model.detreeNodes?.[0].enableQuickSearch) {
|
|
124
|
-
this.enableQuickSearch = true;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// 计算快速搜索占位符
|
|
128
|
-
if (this.dataEntity) {
|
|
129
|
-
const searchFields = this.dataEntity.appDEFields?.filter(field => {
|
|
130
|
-
return field.enableQuickSearch;
|
|
131
|
-
});
|
|
132
|
-
const placeHolders: string[] = [];
|
|
133
|
-
searchFields?.forEach(searchField => {
|
|
134
|
-
if (searchField?.lnlanguageRes && searchField.lnlanguageRes.lanResTag) {
|
|
135
|
-
placeHolders.push(
|
|
136
|
-
ibiz.i18n.t(
|
|
137
|
-
searchField.lnlanguageRes.lanResTag,
|
|
138
|
-
searchField.logicName,
|
|
139
|
-
),
|
|
140
|
-
);
|
|
141
|
-
} else if (searchField?.logicName) {
|
|
142
|
-
placeHolders.push(searchField.logicName);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
if (placeHolders.length > 0) {
|
|
146
|
-
this.state.placeHolder = placeHolders.join('、');
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
this.service = new GanttService(this.model);
|
|
151
|
-
await this.service.init(this.context);
|
|
152
|
-
|
|
153
|
-
// 初始化上下文菜单控制器
|
|
154
|
-
this.model.detreeNodes!.forEach(node => {
|
|
155
|
-
if (node.decontextMenu?.detoolbarItems?.length) {
|
|
156
|
-
this.contextMenus[node.decontextMenu.id!] = new ContextMenuController(
|
|
157
|
-
node.decontextMenu,
|
|
158
|
-
this.context,
|
|
159
|
-
this.params,
|
|
160
|
-
this.ctx,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
// 上下文菜单控制器初始化
|
|
166
|
-
await Promise.all(
|
|
167
|
-
Object.values(this.contextMenus).map(menu => menu.created()),
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* 初始化表格列
|
|
173
|
-
*
|
|
174
|
-
* @protected
|
|
175
|
-
* @return {*} {Promise<void>}
|
|
176
|
-
* @memberof GanttController
|
|
177
|
-
*/
|
|
178
|
-
protected async initGridColumns(): Promise<void> {
|
|
179
|
-
if (this.model.detreeColumns) {
|
|
180
|
-
await Promise.all(
|
|
181
|
-
this.model.detreeColumns.map(async column =>
|
|
182
|
-
this.initColumnsController(column),
|
|
183
|
-
),
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
53
|
/**
|
|
189
|
-
*
|
|
54
|
+
* 初始化对应类型的部件服务
|
|
190
55
|
*
|
|
191
56
|
* @protected
|
|
192
|
-
* @param {IDETreeColumn} column
|
|
193
57
|
* @return {*} {Promise<void>}
|
|
194
58
|
* @memberof GanttController
|
|
195
59
|
*/
|
|
196
|
-
protected async
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (!provider) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
this.providers[column.codeName!] = provider;
|
|
203
|
-
|
|
204
|
-
// 初始化表格列控制器
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
|
-
const controller = await provider.createController(column, this as any);
|
|
207
|
-
this.columns[column.codeName!] = controller as GridColumnController;
|
|
208
|
-
// 分类存放控制器
|
|
209
|
-
if (column.columnType === 'DEFGRIDCOLUMN') {
|
|
210
|
-
this.fieldColumns[column.codeName!] =
|
|
211
|
-
controller as GridFieldColumnController;
|
|
212
|
-
} else if (column.columnType === 'UAGRIDCOLUMN') {
|
|
213
|
-
this.uaColumns[column.codeName!] = controller as GridUAColumnController;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 初始化表格列状态
|
|
219
|
-
*
|
|
220
|
-
* @protected
|
|
221
|
-
* @memberof GanttController
|
|
222
|
-
*/
|
|
223
|
-
protected initColumnStates(): void {
|
|
224
|
-
recursiveIterate(
|
|
225
|
-
this.model,
|
|
226
|
-
(column: IDETreeColumn) => {
|
|
227
|
-
if (column.columnType !== 'GROUPGRIDCOLUMN') {
|
|
228
|
-
this.state.columnStates.push({
|
|
229
|
-
key: column.codeName!,
|
|
230
|
-
caption: column.caption!,
|
|
231
|
-
hidden: !!column.hideDefault,
|
|
232
|
-
uaColumn: column.columnType === 'UAGRIDCOLUMN',
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{ childrenFields: ['detreeColumns'] },
|
|
237
|
-
);
|
|
238
|
-
this.calcColumnFixed();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* 计算列的固定状态
|
|
243
|
-
*
|
|
244
|
-
* @protected
|
|
245
|
-
* @memberof GanttController
|
|
246
|
-
*/
|
|
247
|
-
protected calcColumnFixed(): void {
|
|
248
|
-
const showColumns = this.state.columnStates.filter(
|
|
249
|
-
column => !column.hidden,
|
|
250
|
-
);
|
|
251
|
-
const allNum = showColumns.length;
|
|
252
|
-
showColumns.forEach((column, index) => {
|
|
253
|
-
if (column.uaColumn) {
|
|
254
|
-
column.fixed = index + 1 <= Math.floor(allNum / 2) ? 'left' : 'right';
|
|
255
|
-
} else {
|
|
256
|
-
column.fixed = 'right';
|
|
257
|
-
}
|
|
258
|
-
});
|
|
60
|
+
protected async initService(): Promise<void> {
|
|
61
|
+
this.service = new GanttService(this.model);
|
|
62
|
+
await this.service.init(this.context);
|
|
259
63
|
}
|
|
260
64
|
|
|
261
65
|
/**
|
|
@@ -268,252 +72,6 @@ export class GanttController
|
|
|
268
72
|
this.state.ganttStyle = style;
|
|
269
73
|
}
|
|
270
74
|
|
|
271
|
-
/**
|
|
272
|
-
* 加载
|
|
273
|
-
*
|
|
274
|
-
* @author tony001
|
|
275
|
-
* @date 2023-12-12 11:12:08
|
|
276
|
-
* @param {MDCtrlLoadParams} [args={}]
|
|
277
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
278
|
-
*/
|
|
279
|
-
async load(args: MDCtrlLoadParams = {}): Promise<IGanttNodeData[]> {
|
|
280
|
-
const isInitialLoad = args.isInitialLoad === true;
|
|
281
|
-
if (isInitialLoad) {
|
|
282
|
-
await this.startLoading();
|
|
283
|
-
}
|
|
284
|
-
let nodes;
|
|
285
|
-
try {
|
|
286
|
-
nodes = await this.loadNodes();
|
|
287
|
-
} finally {
|
|
288
|
-
if (isInitialLoad) {
|
|
289
|
-
await this.endLoading();
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
await this.afterLoad(args, nodes);
|
|
293
|
-
this.state.isLoaded = true;
|
|
294
|
-
await this.evt.emit('onLoadSuccess', {
|
|
295
|
-
isInitialLoad,
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
return nodes;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* 获取节点模型
|
|
303
|
-
*
|
|
304
|
-
* @param {string} id
|
|
305
|
-
* @return {*} {(IDETreeNode | undefined)}
|
|
306
|
-
* @memberof GanttController
|
|
307
|
-
*/
|
|
308
|
-
getNodeModel(id: string): IDETreeNode | undefined {
|
|
309
|
-
return this.model.detreeNodes?.find(item => item.id === id);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* 获取查询参数
|
|
314
|
-
*
|
|
315
|
-
* @author tony001
|
|
316
|
-
* @date 2023-12-12 11:12:22
|
|
317
|
-
* @param {IParams} [extraParams]
|
|
318
|
-
* @return {*} {Promise<IParams>}
|
|
319
|
-
*/
|
|
320
|
-
async getFetchParams(extraParams?: IParams): Promise<IParams> {
|
|
321
|
-
const params = await super.getFetchParams(extraParams);
|
|
322
|
-
if (this.state.query) {
|
|
323
|
-
params.query = this.state.query;
|
|
324
|
-
}
|
|
325
|
-
return params;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* 加载节点
|
|
330
|
-
*
|
|
331
|
-
* @author tony001
|
|
332
|
-
* @date 2023-12-12 11:12:33
|
|
333
|
-
* @param {IGanttNodeData} [parentNode]
|
|
334
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
335
|
-
*/
|
|
336
|
-
async loadNodes(parentNode?: IGanttNodeData): Promise<IGanttNodeData[]> {
|
|
337
|
-
const params = await this.getFetchParams();
|
|
338
|
-
const hasQuery = !!params.query;
|
|
339
|
-
|
|
340
|
-
this.state.isLoading = true;
|
|
341
|
-
|
|
342
|
-
let nodes: IGanttNodeData[] | undefined;
|
|
343
|
-
try {
|
|
344
|
-
// 请求服务获取子节点数据
|
|
345
|
-
nodes =
|
|
346
|
-
(await this.service.fetchGanttChildNodes(parentNode, {
|
|
347
|
-
context: this.context.clone(),
|
|
348
|
-
params,
|
|
349
|
-
hasQuery,
|
|
350
|
-
defaultExpandedKeys: [],
|
|
351
|
-
})) || [];
|
|
352
|
-
} finally {
|
|
353
|
-
this.state.isLoading = false;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// 有父节点绑定到父节点数据上,无父节点替换rootNodes
|
|
357
|
-
if (parentNode) {
|
|
358
|
-
parentNode.children = nodes;
|
|
359
|
-
} else {
|
|
360
|
-
this.state.rootNodes = nodes;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// 更新items
|
|
364
|
-
this.state.items = [];
|
|
365
|
-
recursiveIterate(
|
|
366
|
-
{ children: this.state.rootNodes },
|
|
367
|
-
(node: IGanttNodeData) => {
|
|
368
|
-
this.state.items.push(node);
|
|
369
|
-
},
|
|
370
|
-
);
|
|
371
|
-
return nodes;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* 甘特节点点击事件
|
|
376
|
-
*
|
|
377
|
-
* @param {IGanttNodeData} nodeData
|
|
378
|
-
* @return {*} {Promise<void>}
|
|
379
|
-
* @memberof GanttController
|
|
380
|
-
*/
|
|
381
|
-
async onGanttNodeClick(nodeData: IGanttNodeData): Promise<void> {
|
|
382
|
-
// 单选时,单击才会触发选中逻辑
|
|
383
|
-
if (this.state.singleSelect) {
|
|
384
|
-
// 选中相关处理
|
|
385
|
-
const { selectedData } = this.state;
|
|
386
|
-
// 选中里没有则添加,有则删除
|
|
387
|
-
const filterArr = selectedData.filter(item => item.id !== nodeData.id);
|
|
388
|
-
if (filterArr.length === selectedData.length) {
|
|
389
|
-
this.setSelection(
|
|
390
|
-
this.state.singleSelect
|
|
391
|
-
? [nodeData]
|
|
392
|
-
: selectedData.concat([nodeData]),
|
|
393
|
-
);
|
|
394
|
-
} else {
|
|
395
|
-
this.setSelection(filterArr);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// 激活事件
|
|
400
|
-
if (this.state.mdctrlActiveMode === 1) {
|
|
401
|
-
await this.setActive(nodeData);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* 甘特节点双击事件
|
|
407
|
-
*
|
|
408
|
-
* @param {IGanttNodeData} nodeData
|
|
409
|
-
* @return {*} {Promise<void>}
|
|
410
|
-
* @memberof GanttController
|
|
411
|
-
*/
|
|
412
|
-
async onDbGanttNodeClick(nodeData: IGanttNodeData): Promise<void> {
|
|
413
|
-
if (this.state.mdctrlActiveMode === 2) {
|
|
414
|
-
await this.setActive(nodeData);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* 设置激活
|
|
420
|
-
*
|
|
421
|
-
* @param {IGanttNodeData} item
|
|
422
|
-
* @return {*} {Promise<void>}
|
|
423
|
-
* @memberof GanttController
|
|
424
|
-
*/
|
|
425
|
-
setActive(item: IGanttNodeData): Promise<void> {
|
|
426
|
-
const nodeParams = this.parseGanttNodeData(item);
|
|
427
|
-
return this.evt.emit('onActive', { ...nodeParams, nodeData: item });
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* 设置选中
|
|
432
|
-
*
|
|
433
|
-
* @param {IData[]} selection
|
|
434
|
-
* @memberof GanttController
|
|
435
|
-
*/
|
|
436
|
-
setSelection(selection: IData[]): void {
|
|
437
|
-
// 通过id过滤出原始的树节点数据,避免外部使用的时候传入的选中数据有问题。
|
|
438
|
-
const selectionIds = selection.map(item => item.id);
|
|
439
|
-
const filterArr = this.state.items.filter(item =>
|
|
440
|
-
selectionIds.includes(item.id),
|
|
441
|
-
);
|
|
442
|
-
super.setSelection(filterArr);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* 执行界面行为
|
|
447
|
-
*
|
|
448
|
-
* @param {string} uiActionId
|
|
449
|
-
* @param {IGanttNodeData} nodeData
|
|
450
|
-
* @param {MouseEvent} event
|
|
451
|
-
* @param {string} appId
|
|
452
|
-
* @return {*} {Promise<void>}
|
|
453
|
-
* @memberof GanttController
|
|
454
|
-
*/
|
|
455
|
-
async doUIAction(
|
|
456
|
-
uiActionId: string,
|
|
457
|
-
nodeData: IGanttNodeData,
|
|
458
|
-
event: MouseEvent,
|
|
459
|
-
appId: string,
|
|
460
|
-
): Promise<void> {
|
|
461
|
-
const eventArgs = this.getEventArgs();
|
|
462
|
-
const nodeParams = this.parseGanttNodeData(nodeData);
|
|
463
|
-
const result = await UIActionUtil.exec(
|
|
464
|
-
uiActionId!,
|
|
465
|
-
{
|
|
466
|
-
...eventArgs,
|
|
467
|
-
...nodeParams,
|
|
468
|
-
event,
|
|
469
|
-
},
|
|
470
|
-
appId,
|
|
471
|
-
);
|
|
472
|
-
if (result.closeView) {
|
|
473
|
-
this.view.closeView();
|
|
474
|
-
} else if (result.refresh) {
|
|
475
|
-
switch (result.refreshMode) {
|
|
476
|
-
// 刷新当前节点的子
|
|
477
|
-
case 1:
|
|
478
|
-
this.refreshNodeChildren(nodeData);
|
|
479
|
-
break;
|
|
480
|
-
// 刷新当前节点的父节点的子
|
|
481
|
-
case 2:
|
|
482
|
-
this.refreshNodeChildren(nodeData, true);
|
|
483
|
-
break;
|
|
484
|
-
// 刷新所有节点数据
|
|
485
|
-
case 3:
|
|
486
|
-
this.refresh();
|
|
487
|
-
break;
|
|
488
|
-
default:
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* 解析甘特节点获取通用数据,和完整的上下文和视图参数。
|
|
495
|
-
*
|
|
496
|
-
* @protected
|
|
497
|
-
* @param {IGanttNodeData} nodeData
|
|
498
|
-
* @return {*} {{
|
|
499
|
-
* data: IData[];
|
|
500
|
-
* context: IContext;
|
|
501
|
-
* params: IParams;
|
|
502
|
-
* }}
|
|
503
|
-
* @memberof GanttController
|
|
504
|
-
*/
|
|
505
|
-
protected parseGanttNodeData(nodeData: IGanttNodeData): {
|
|
506
|
-
data: IData[];
|
|
507
|
-
context: IContext;
|
|
508
|
-
params: IParams;
|
|
509
|
-
} {
|
|
510
|
-
return {
|
|
511
|
-
data: [{ ...nodeData, ...(nodeData.deData || {}) }],
|
|
512
|
-
context: Object.assign(this.context.clone(), nodeData.context || {}),
|
|
513
|
-
params: { ...this.params, ...(nodeData.params || {}) },
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
|
|
517
75
|
/**
|
|
518
76
|
* 转化节点数据项
|
|
519
77
|
* vo -> do
|
|
@@ -581,47 +139,4 @@ export class GanttController
|
|
|
581
139
|
}
|
|
582
140
|
}
|
|
583
141
|
}
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* 刷新指定树节点的子节点数据
|
|
587
|
-
*
|
|
588
|
-
* @param {(IGanttNodeData | IData)} nodeData 指定树节点数据,可以是节点数据,也可以是对应的实体数据
|
|
589
|
-
* @param {boolean} [refreshParent=false] 是否是刷新给定节点数据的父节点的子节点数据
|
|
590
|
-
* @return {*} {Promise<void>}
|
|
591
|
-
* @memberof GanttController
|
|
592
|
-
*/
|
|
593
|
-
async refreshNodeChildren(
|
|
594
|
-
nodeData: IGanttNodeData | IData,
|
|
595
|
-
refreshParent = false,
|
|
596
|
-
): Promise<void> {
|
|
597
|
-
const key = nodeData.srfkey ? 'srfkey' : 'id';
|
|
598
|
-
const currentNode = this.state.items.find(
|
|
599
|
-
item => item[key] === nodeData[key],
|
|
600
|
-
);
|
|
601
|
-
if (!currentNode) {
|
|
602
|
-
ibiz.log.error('找不到对应的树节点数据', nodeData);
|
|
603
|
-
return;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// 刷新父,但是没父,刷新根
|
|
607
|
-
if (refreshParent) {
|
|
608
|
-
const { parent } = currentNode;
|
|
609
|
-
// 没有父,或者父是不显示的根节点,那么刷新所有
|
|
610
|
-
if (
|
|
611
|
-
!parent ||
|
|
612
|
-
(!this.model.rootVisible && this.state.rootNodes.includes(parent))
|
|
613
|
-
) {
|
|
614
|
-
this.refresh();
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
const targetNode = refreshParent ? currentNode.parent! : currentNode;
|
|
620
|
-
|
|
621
|
-
const nodes = await this.loadNodes(targetNode);
|
|
622
|
-
this.evt.emit('onAfterRefreshParent', {
|
|
623
|
-
parentNode: targetNode,
|
|
624
|
-
children: nodes,
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
142
|
}
|
|
@@ -59,7 +59,7 @@ export class GanttService extends TreeService {
|
|
|
59
59
|
* @param {TreeFetchOpts} opts
|
|
60
60
|
* @return {*} {(Promise<IGanttNodeData[] | undefined>)}
|
|
61
61
|
*/
|
|
62
|
-
async
|
|
62
|
+
async fetchChildNodes(
|
|
63
63
|
parentNodeData: IGanttNodeData | undefined,
|
|
64
64
|
opts: TreeFetchOpts,
|
|
65
65
|
): Promise<IGanttNodeData[] | undefined> {
|
|
@@ -69,7 +69,7 @@ export class GanttService extends TreeService {
|
|
|
69
69
|
if (!parentNodeData) {
|
|
70
70
|
// 没有父节点的加载根节点数据
|
|
71
71
|
const rootNode = getRootNode(this.model);
|
|
72
|
-
childrenNodes = await this.
|
|
72
|
+
childrenNodes = await this.fetchNodeDatasByType(
|
|
73
73
|
rootNode,
|
|
74
74
|
undefined,
|
|
75
75
|
undefined,
|
|
@@ -91,7 +91,7 @@ export class GanttService extends TreeService {
|
|
|
91
91
|
this.model,
|
|
92
92
|
childNodeRS.childDETreeNodeId!,
|
|
93
93
|
);
|
|
94
|
-
return this.
|
|
94
|
+
return this.fetchNodeDatasByType(
|
|
95
95
|
childNode,
|
|
96
96
|
childNodeRS,
|
|
97
97
|
parentNodeData,
|
|
@@ -120,7 +120,7 @@ export class GanttService extends TreeService {
|
|
|
120
120
|
* @param {TreeFetchOpts} opts
|
|
121
121
|
* @return {*} {Promise<IGanttNodeData[]>}
|
|
122
122
|
*/
|
|
123
|
-
protected async
|
|
123
|
+
protected async fetchNodeDatasByType(
|
|
124
124
|
nodeModel: IDETreeNode,
|
|
125
125
|
nodeRS: IDETreeNodeRS | undefined,
|
|
126
126
|
parentNodeData: IGanttNodeData | undefined,
|
|
@@ -181,7 +181,7 @@ export class GanttService extends TreeService {
|
|
|
181
181
|
(!expandFirstOnly || (expandFirstOnly && index === 0))) ||
|
|
182
182
|
isExpandedRoot
|
|
183
183
|
) {
|
|
184
|
-
const subChildrenNodes = await this.
|
|
184
|
+
const subChildrenNodes = await this.fetchChildNodes(
|
|
185
185
|
childNode,
|
|
186
186
|
opts,
|
|
187
187
|
);
|
|
@@ -581,10 +581,10 @@ export class KanbanController
|
|
|
581
581
|
/**
|
|
582
582
|
* 打开批操作工具栏
|
|
583
583
|
*
|
|
584
|
-
* @param {string} groupKey
|
|
584
|
+
* @param {string | number} groupKey
|
|
585
585
|
* @memberof KanbanController
|
|
586
586
|
*/
|
|
587
|
-
openBatch(groupKey: string): void {
|
|
587
|
+
openBatch(groupKey: string | number): void {
|
|
588
588
|
this.state.selectGroupKey = groupKey;
|
|
589
589
|
this.state.batching = true;
|
|
590
590
|
this.state.selectedData = [];
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
IListState,
|
|
4
4
|
IListEvent,
|
|
5
5
|
IListController,
|
|
6
|
-
IToolbarController,
|
|
7
6
|
MDCtrlLoadParams,
|
|
8
7
|
IMDControlGroupState,
|
|
9
8
|
CodeListItem,
|
|
@@ -52,59 +51,6 @@ export class ListController
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
/**
|
|
56
|
-
* 工具栏
|
|
57
|
-
*
|
|
58
|
-
* @author zk
|
|
59
|
-
* @date 2023-08-02 06:08:34
|
|
60
|
-
* @readonly
|
|
61
|
-
* @type {(IToolbarController | undefined)}
|
|
62
|
-
* @memberof ListController
|
|
63
|
-
*/
|
|
64
|
-
protected get batchToolbarController(): IToolbarController | undefined {
|
|
65
|
-
const controller = this.view.getController(
|
|
66
|
-
`${this.model.name!}_batchtoolbar`,
|
|
67
|
-
);
|
|
68
|
-
return controller as IToolbarController;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 工具栏
|
|
73
|
-
*
|
|
74
|
-
* @author zk
|
|
75
|
-
* @date 2023-08-02 06:08:34
|
|
76
|
-
* @readonly
|
|
77
|
-
* @type {(IToolbarController | undefined)}
|
|
78
|
-
* @memberof ListController
|
|
79
|
-
*/
|
|
80
|
-
protected get quickToolbarController(): IToolbarController | undefined {
|
|
81
|
-
const controller = this.view.getController(
|
|
82
|
-
`${this.model.name!}_quicktoolbar`,
|
|
83
|
-
);
|
|
84
|
-
return controller as IToolbarController;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 根据数据计算工具栏权限和状态
|
|
89
|
-
*
|
|
90
|
-
* @author zk
|
|
91
|
-
* @date 2023-08-02 06:08:11
|
|
92
|
-
* @param {IData[]} selection
|
|
93
|
-
* @memberof ListController
|
|
94
|
-
*/
|
|
95
|
-
setSelection(selection: IData[]): void {
|
|
96
|
-
super.setSelection(selection);
|
|
97
|
-
const data = selection?.[0];
|
|
98
|
-
this.batchToolbarController?.calcButtonState(
|
|
99
|
-
data,
|
|
100
|
-
this.model.appDataEntityId,
|
|
101
|
-
);
|
|
102
|
-
this.quickToolbarController?.calcButtonState(
|
|
103
|
-
data,
|
|
104
|
-
this.model.appDataEntityId,
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
54
|
/**
|
|
109
55
|
* 加载更多
|
|
110
56
|
* @author lxm
|
|
@@ -84,7 +84,7 @@ export class MDCtrlController
|
|
|
84
84
|
async loadMore(): Promise<void> {
|
|
85
85
|
// 修复加载更多时,数据未加载成功 但是还是会继续加载的问题
|
|
86
86
|
if (this.state.total > this.state.items.length && !this.state.isLoading) {
|
|
87
|
-
await this.load({ isLoadMore: true });
|
|
87
|
+
await this.load({ isLoadMore: true, silent: true });
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|