@ibiz-template/runtime 0.4.13 → 0.4.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 +453 -45
- package/dist/index.system.min.js +2 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts +13 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.js +24 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.d.ts +13 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.js +26 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts +0 -8
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js +0 -10
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts +8 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.js +10 -0
- package/out/controller/control/gantt/gantt.controller.d.ts +34 -1
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +74 -0
- package/out/controller/control/gantt/gantt.service.d.ts +13 -0
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +14 -0
- package/out/controller/control/kanban/kanban.controller.d.ts +104 -2
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +220 -0
- package/out/controller/control/tree/tree.controller.d.ts +15 -2
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +32 -2
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts +27 -0
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +23 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +29 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/provider/i-grid-column.provider.d.ts +2 -3
- package/out/interface/provider/i-grid-column.provider.d.ts.map +1 -1
- package/out/model/index.d.ts +1 -0
- package/out/model/index.d.ts.map +1 -1
- package/out/model/index.js +1 -0
- package/out/model/toolbar/toolbar.d.ts +12 -0
- package/out/model/toolbar/toolbar.d.ts.map +1 -0
- package/out/model/toolbar/toolbar.js +22 -0
- package/out/service/dto/method.dto.js +1 -1
- package/package.json +4 -4
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.ts +27 -3
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.ts +26 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts +0 -11
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.ts +11 -0
- package/src/controller/control/gantt/gantt.controller.ts +91 -0
- package/src/controller/control/gantt/gantt.service.ts +26 -1
- package/src/controller/control/kanban/kanban.controller.ts +258 -1
- package/src/controller/control/tree/tree.controller.ts +46 -3
- package/src/interface/controller/controller/control/i-kanban.controller.ts +31 -1
- package/src/interface/controller/controller/control/i-tree.controller.ts +1 -1
- package/src/interface/controller/state/control/i-gantt.state.ts +26 -0
- package/src/interface/controller/state/control/i-kanban.state.ts +33 -0
- package/src/interface/provider/i-grid-column.provider.ts +7 -3
- package/src/model/index.ts +1 -0
- package/src/model/toolbar/toolbar.ts +35 -0
- package/src/service/dto/method.dto.ts +1 -1
|
@@ -32,6 +32,13 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
32
32
|
*/
|
|
33
33
|
declare state: FormMDCtrlFormState;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* 忽略下一次自身对应表单项数据变更
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2023-12-19 11:47:21
|
|
39
|
+
*/
|
|
40
|
+
ignoreNextSelfChange = false;
|
|
41
|
+
|
|
35
42
|
protected createState(): FormMDCtrlFormState {
|
|
36
43
|
return new FormMDCtrlFormState(this.parent?.state);
|
|
37
44
|
}
|
|
@@ -133,7 +140,7 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
133
140
|
*/
|
|
134
141
|
async formStateNotify(state: FormNotifyState): Promise<void> {
|
|
135
142
|
await super.formStateNotify(state);
|
|
136
|
-
await this.
|
|
143
|
+
await this.refresh();
|
|
137
144
|
}
|
|
138
145
|
|
|
139
146
|
/**
|
|
@@ -156,10 +163,10 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
156
163
|
item.context[this.deName] = formData.srfkey;
|
|
157
164
|
}
|
|
158
165
|
}
|
|
159
|
-
this.
|
|
166
|
+
this.notifyFormDataChange();
|
|
160
167
|
});
|
|
161
168
|
controller.evt.on('onRemoveSuccess', () => {
|
|
162
|
-
this.
|
|
169
|
+
this.notifyFormDataChange();
|
|
163
170
|
});
|
|
164
171
|
}
|
|
165
172
|
|
|
@@ -210,6 +217,11 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
210
217
|
}
|
|
211
218
|
|
|
212
219
|
async dataChangeNotify(names: string[]): Promise<void> {
|
|
220
|
+
if (names.includes(this.model.id!) && this.ignoreNextSelfChange) {
|
|
221
|
+
this.ignoreNextSelfChange = false;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
213
225
|
await super.dataChangeNotify(names);
|
|
214
226
|
|
|
215
227
|
// 表单项更新的时候修改数据的时候需要刷新
|
|
@@ -217,4 +229,16 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
217
229
|
this.refresh();
|
|
218
230
|
}
|
|
219
231
|
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 通知表单多数据部件对应的表单项数据变更
|
|
235
|
+
* @author lxm
|
|
236
|
+
* @date 2023-12-19 11:46:13
|
|
237
|
+
* @protected
|
|
238
|
+
*/
|
|
239
|
+
protected notifyFormDataChange(): void {
|
|
240
|
+
this.updateFormItem();
|
|
241
|
+
this.ignoreNextSelfChange = true;
|
|
242
|
+
this.form.dataChangeNotify([this.name]);
|
|
243
|
+
}
|
|
220
244
|
}
|
|
@@ -40,6 +40,13 @@ export class FormMDCtrlMDController extends FormMDCtrlController {
|
|
|
40
40
|
*/
|
|
41
41
|
mdController!: IMDControlController;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* 忽略下一次自身对应表单项数据变更
|
|
45
|
+
* @author lxm
|
|
46
|
+
* @date 2023-12-19 11:47:21
|
|
47
|
+
*/
|
|
48
|
+
ignoreNextSelfChange = false;
|
|
49
|
+
|
|
43
50
|
/**
|
|
44
51
|
* 表单项名称
|
|
45
52
|
*
|
|
@@ -83,10 +90,10 @@ export class FormMDCtrlMDController extends FormMDCtrlController {
|
|
|
83
90
|
|
|
84
91
|
// 多数据部件保存,删除之后触发表单项更新
|
|
85
92
|
controller.evt.on('onSaveSuccess', () => {
|
|
86
|
-
this.
|
|
93
|
+
this.notifyFormDataChange();
|
|
87
94
|
});
|
|
88
95
|
controller.evt.on('onRemoveSuccess', () => {
|
|
89
|
-
this.
|
|
96
|
+
this.notifyFormDataChange();
|
|
90
97
|
});
|
|
91
98
|
}
|
|
92
99
|
|
|
@@ -141,6 +148,11 @@ export class FormMDCtrlMDController extends FormMDCtrlController {
|
|
|
141
148
|
}
|
|
142
149
|
|
|
143
150
|
async dataChangeNotify(names: string[]): Promise<void> {
|
|
151
|
+
if (names.includes(this.model.id!) && this.ignoreNextSelfChange) {
|
|
152
|
+
this.ignoreNextSelfChange = false;
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
144
156
|
await super.dataChangeNotify(names);
|
|
145
157
|
|
|
146
158
|
// 表单项更新的时候修改数据的时候需要刷新
|
|
@@ -148,4 +160,16 @@ export class FormMDCtrlMDController extends FormMDCtrlController {
|
|
|
148
160
|
this.refresh();
|
|
149
161
|
}
|
|
150
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 通知表单多数据部件对应的表单项数据变更
|
|
166
|
+
* @author lxm
|
|
167
|
+
* @date 2023-12-19 11:46:13
|
|
168
|
+
* @protected
|
|
169
|
+
*/
|
|
170
|
+
protected notifyFormDataChange(): void {
|
|
171
|
+
this.updateFormItem();
|
|
172
|
+
this.ignoreNextSelfChange = true;
|
|
173
|
+
this.form.dataChangeNotify([this.name]);
|
|
174
|
+
}
|
|
151
175
|
}
|
package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
CHANGED
|
@@ -14,17 +14,6 @@ import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
|
14
14
|
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
15
15
|
*/
|
|
16
16
|
export class FormMDCtrlRepeaterController extends FormMDCtrlController {
|
|
17
|
-
/**
|
|
18
|
-
* 名称
|
|
19
|
-
* @author lxm
|
|
20
|
-
* @date 2023-11-22 03:31:02
|
|
21
|
-
* @readonly
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
get name(): string {
|
|
25
|
-
return this.model.id!;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
17
|
/**
|
|
29
18
|
* 多数据重复器对应的表单里的值
|
|
30
19
|
*
|
|
@@ -12,6 +12,17 @@ import { FormDetailController } from '../form-detail';
|
|
|
12
12
|
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
13
13
|
*/
|
|
14
14
|
export class FormMDCtrlController extends FormDetailController<IDEFormMDCtrl> {
|
|
15
|
+
/**
|
|
16
|
+
* 名称
|
|
17
|
+
* @author lxm
|
|
18
|
+
* @date 2023-11-22 03:31:02
|
|
19
|
+
* @readonly
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
get name(): string {
|
|
23
|
+
return this.model.id!;
|
|
24
|
+
}
|
|
25
|
+
|
|
15
26
|
/**
|
|
16
27
|
* 上下文
|
|
17
28
|
*
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
|
+
/* eslint-disable no-prototype-builtins */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
4
|
import { recursiveIterate } from '@ibiz-template/core';
|
|
3
5
|
import { IDEGantt, IDETreeColumn, IDETreeNode } from '@ibiz/model-core';
|
|
4
6
|
import {
|
|
@@ -6,6 +8,7 @@ import {
|
|
|
6
8
|
IGanttEvent,
|
|
7
9
|
IGanttNodeData,
|
|
8
10
|
IGanttState,
|
|
11
|
+
IGanttStyle,
|
|
9
12
|
IGridColumnProvider,
|
|
10
13
|
MDCtrlLoadParams,
|
|
11
14
|
} from '../../../interface';
|
|
@@ -99,8 +102,18 @@ export class GanttController
|
|
|
99
102
|
this.state.query = '';
|
|
100
103
|
this.state.columnStates = [];
|
|
101
104
|
this.state.rootNodes = [];
|
|
105
|
+
this.state.ganttStyle = {};
|
|
102
106
|
}
|
|
103
107
|
|
|
108
|
+
/**
|
|
109
|
+
* 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
|
|
110
|
+
* 临时重写 防止错误刷新整个甘特图
|
|
111
|
+
* @protected
|
|
112
|
+
* @param {IData} msg
|
|
113
|
+
* @memberof GanttController
|
|
114
|
+
*/
|
|
115
|
+
protected onDataChange(msg: IData): void {}
|
|
116
|
+
|
|
104
117
|
protected async onCreated(): Promise<void> {
|
|
105
118
|
await super.onCreated();
|
|
106
119
|
await this.initGridColumns();
|
|
@@ -244,6 +257,16 @@ export class GanttController
|
|
|
244
257
|
});
|
|
245
258
|
}
|
|
246
259
|
|
|
260
|
+
/**
|
|
261
|
+
* 设置甘特图样式
|
|
262
|
+
*
|
|
263
|
+
* @param {IGanttStyle} style
|
|
264
|
+
* @memberof GanttController
|
|
265
|
+
*/
|
|
266
|
+
setGanttStyle(style: IGanttStyle): void {
|
|
267
|
+
this.state.ganttStyle = style;
|
|
268
|
+
}
|
|
269
|
+
|
|
247
270
|
/**
|
|
248
271
|
* 加载
|
|
249
272
|
*
|
|
@@ -490,6 +513,74 @@ export class GanttController
|
|
|
490
513
|
};
|
|
491
514
|
}
|
|
492
515
|
|
|
516
|
+
/**
|
|
517
|
+
* 转化节点数据项
|
|
518
|
+
* vo -> do
|
|
519
|
+
* @param {IDETreeNode} nodeModel 节点模型
|
|
520
|
+
* @param {IData} data 数据
|
|
521
|
+
* @memberof GanttController
|
|
522
|
+
*/
|
|
523
|
+
transformNodeDataItem(nodeModel: IDETreeNode, data: IData): IData {
|
|
524
|
+
const dataItem: IData = {};
|
|
525
|
+
nodeModel.detreeNodeDataItems?.forEach(item => {
|
|
526
|
+
if (
|
|
527
|
+
item.id &&
|
|
528
|
+
item.appDEFieldId &&
|
|
529
|
+
data.hasOwnProperty(item.id.toLowerCase())
|
|
530
|
+
) {
|
|
531
|
+
Object.assign(dataItem, {
|
|
532
|
+
[item.appDEFieldId.toLowerCase()]: data[item.id.toLowerCase()],
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
return dataItem;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* 更新节点数据
|
|
541
|
+
*
|
|
542
|
+
* @param {(IGanttNodeData | IData)} nodeData 节点数据
|
|
543
|
+
* @param {IData} data 更新数据
|
|
544
|
+
* @param {boolean} [isTransformData=false] 是否转化数据项
|
|
545
|
+
* @return {*}
|
|
546
|
+
* @memberof GanttController
|
|
547
|
+
*/
|
|
548
|
+
async updateNodeData(
|
|
549
|
+
nodeData: IGanttNodeData | IData,
|
|
550
|
+
data: IData,
|
|
551
|
+
isTransformData: boolean = false,
|
|
552
|
+
): Promise<void> {
|
|
553
|
+
const key = nodeData.srfkey ? 'srfkey' : 'id';
|
|
554
|
+
const currentNode = this.state.items.find(
|
|
555
|
+
item => item[key] === nodeData[key],
|
|
556
|
+
);
|
|
557
|
+
if (!currentNode || !currentNode.srfkey) {
|
|
558
|
+
ibiz.log.error('找不到对应的动态实体树节点数据', nodeData);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const nodeModel = this.getNodeModel(currentNode.nodeId);
|
|
562
|
+
if (nodeModel) {
|
|
563
|
+
const newData = isTransformData
|
|
564
|
+
? this.transformNodeDataItem(nodeModel, data)
|
|
565
|
+
: data;
|
|
566
|
+
if (Object.keys(newData).length > 0) {
|
|
567
|
+
const [, entityCodename] = nodeModel.appDataEntityId!.split('.');
|
|
568
|
+
const tempContext = Object.assign(this.context.clone(), {
|
|
569
|
+
[entityCodename]: currentNode.srfkey,
|
|
570
|
+
});
|
|
571
|
+
const response = await this.service.execDeService(
|
|
572
|
+
nodeModel.appDataEntityId!,
|
|
573
|
+
'update',
|
|
574
|
+
tempContext,
|
|
575
|
+
newData,
|
|
576
|
+
);
|
|
577
|
+
if (response.status === 200) {
|
|
578
|
+
this.refreshNodeChildren(nodeData, true);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
493
584
|
/**
|
|
494
585
|
* 刷新指定树节点的子节点数据
|
|
495
586
|
*
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
IDETreeNode,
|
|
5
5
|
IDETreeNodeRS,
|
|
6
6
|
} from '@ibiz/model-core';
|
|
7
|
-
import { ModelError } from '@ibiz-template/core';
|
|
7
|
+
import { IHttpResponse, ModelError } from '@ibiz-template/core';
|
|
8
8
|
import { IGanttNodeData } from '../../../interface';
|
|
9
9
|
import { getChildNodeRSs, getRootNode, getTreeNode } from '../../../model';
|
|
10
10
|
import { handleAllSettled } from '../../../utils';
|
|
@@ -25,6 +25,31 @@ import {
|
|
|
25
25
|
* @extends {TreeService}
|
|
26
26
|
*/
|
|
27
27
|
export class GanttService extends TreeService {
|
|
28
|
+
/**
|
|
29
|
+
* 执行实体服务
|
|
30
|
+
*
|
|
31
|
+
* @protected
|
|
32
|
+
* @param {string} appDataEntityId 实体标识
|
|
33
|
+
* @param {string} actionName 行为标识
|
|
34
|
+
* @param {IContext} context 上下文
|
|
35
|
+
* @param {IParams} params 参数
|
|
36
|
+
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
37
|
+
* @memberof GanttService
|
|
38
|
+
*/
|
|
39
|
+
execDeService(
|
|
40
|
+
appDataEntityId: string,
|
|
41
|
+
actionName: string,
|
|
42
|
+
context: IContext,
|
|
43
|
+
params: IParams,
|
|
44
|
+
): Promise<IHttpResponse<IData>> {
|
|
45
|
+
return this.app.deService.exec(
|
|
46
|
+
appDataEntityId,
|
|
47
|
+
actionName,
|
|
48
|
+
context,
|
|
49
|
+
params,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
28
53
|
/**
|
|
29
54
|
* 获取子节点数据
|
|
30
55
|
*
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { RuntimeError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
-
import { IDEKanban } from '@ibiz/model-core';
|
|
2
|
+
import { IDEKanban, IUIActionGroupDetail } from '@ibiz/model-core';
|
|
3
3
|
import { isNil } from 'ramda';
|
|
4
4
|
import {
|
|
5
|
+
IController,
|
|
5
6
|
IDragChangeInfo,
|
|
6
7
|
IKanbanController,
|
|
7
8
|
IKanbanEvent,
|
|
8
9
|
IKanbanGroupState,
|
|
9
10
|
IKanbanState,
|
|
11
|
+
IToolbarController,
|
|
10
12
|
MDCtrlLoadParams,
|
|
11
13
|
} from '../../../interface';
|
|
12
14
|
import { calcDeCodeNameById } from '../../../model';
|
|
13
15
|
import { ControlVO } from '../../../service';
|
|
14
16
|
import { DataViewControlController } from '../data-view';
|
|
15
17
|
import { KanbanService } from './kanban.service';
|
|
18
|
+
import { UIActionUtil } from '../../../ui-action';
|
|
16
19
|
|
|
17
20
|
export class KanbanController
|
|
18
21
|
extends DataViewControlController<IDEKanban, IKanbanState, IKanbanEvent>
|
|
@@ -57,6 +60,8 @@ export class KanbanController
|
|
|
57
60
|
super.initState();
|
|
58
61
|
this.state.size = this.model.pagingSize || 1000;
|
|
59
62
|
this.state.updating = false;
|
|
63
|
+
this.state.batching = false;
|
|
64
|
+
this.state.selectGroupKey = '';
|
|
60
65
|
// 支持调整顺序和分组时
|
|
61
66
|
this.state.draggable = this.enableEditOrder || this.enableEditGroup;
|
|
62
67
|
}
|
|
@@ -70,6 +75,7 @@ export class KanbanController
|
|
|
70
75
|
*/
|
|
71
76
|
protected async onCreated(): Promise<void> {
|
|
72
77
|
await super.onCreated();
|
|
78
|
+
this.setToolbarHooks();
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
/**
|
|
@@ -116,6 +122,90 @@ export class KanbanController
|
|
|
116
122
|
return super.afterLoad(args, items);
|
|
117
123
|
}
|
|
118
124
|
|
|
125
|
+
/**
|
|
126
|
+
* 当展开批操作工具栏时需进行行点击拦截
|
|
127
|
+
*
|
|
128
|
+
* @param {IData} data
|
|
129
|
+
* @return {*} {Promise<void>}
|
|
130
|
+
* @memberof KanbanController
|
|
131
|
+
*/
|
|
132
|
+
async onRowClick(data: IData): Promise<void> {
|
|
133
|
+
const { groupAppDEFieldId } = this.model;
|
|
134
|
+
if (this.state.batching && groupAppDEFieldId) {
|
|
135
|
+
const groupVal = data[groupAppDEFieldId];
|
|
136
|
+
if (groupVal !== this.state.selectGroupKey) {
|
|
137
|
+
// 激活事件
|
|
138
|
+
if (this.state.mdctrlActiveMode === 1) {
|
|
139
|
+
await this.setActive(data);
|
|
140
|
+
}
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
super.onRowClick(data);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 点击新建时设置选中分组
|
|
149
|
+
*
|
|
150
|
+
* @param {MouseEvent} event
|
|
151
|
+
* @param {(string | number)} group
|
|
152
|
+
* @memberof KanbanController
|
|
153
|
+
*/
|
|
154
|
+
onClickNew(event: MouseEvent, group: string | number): void {
|
|
155
|
+
this.setSelectGroup(group);
|
|
156
|
+
super.onClickNew(event, group);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 分组工具栏需设置选中分组
|
|
161
|
+
*
|
|
162
|
+
* @param {IUIActionGroupDetail} detail
|
|
163
|
+
* @param {MouseEvent} event
|
|
164
|
+
* @param {IKanbanGroupState} group
|
|
165
|
+
* @return {*} {Promise<void>}
|
|
166
|
+
* @memberof KanbanController
|
|
167
|
+
*/
|
|
168
|
+
async onGroupToolbarClick(
|
|
169
|
+
detail: IUIActionGroupDetail,
|
|
170
|
+
event: MouseEvent,
|
|
171
|
+
group: IKanbanGroupState,
|
|
172
|
+
): Promise<void> {
|
|
173
|
+
this.setSelectGroup(group.key);
|
|
174
|
+
super.onGroupToolbarClick(detail, event, group);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* 分组行为项点击,需携带分组标识
|
|
179
|
+
*
|
|
180
|
+
* @param {IUIActionGroupDetail} detail
|
|
181
|
+
* @param {IData} item
|
|
182
|
+
* @param {MouseEvent} event
|
|
183
|
+
* @param {IKanbanGroupState} group
|
|
184
|
+
* @return {*} {Promise<void>}
|
|
185
|
+
* @memberof KanbanController
|
|
186
|
+
*/
|
|
187
|
+
async onGroupActionClick(
|
|
188
|
+
detail: IUIActionGroupDetail,
|
|
189
|
+
item: IData,
|
|
190
|
+
event: MouseEvent,
|
|
191
|
+
group: IKanbanGroupState,
|
|
192
|
+
): Promise<void> {
|
|
193
|
+
this.setSelectGroup(group.key);
|
|
194
|
+
const params = { ...this.params, srfgroup: group };
|
|
195
|
+
const actionId = detail.uiactionId;
|
|
196
|
+
await UIActionUtil.execAndResolved(
|
|
197
|
+
actionId!,
|
|
198
|
+
{
|
|
199
|
+
context: this.context,
|
|
200
|
+
params,
|
|
201
|
+
data: [item],
|
|
202
|
+
view: this.view,
|
|
203
|
+
event,
|
|
204
|
+
},
|
|
205
|
+
detail.appId,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
119
209
|
handleDataGroup(): Promise<void> {
|
|
120
210
|
if (!this.model.enableGroup || this.model.groupMode === 'NONE') {
|
|
121
211
|
throw new RuntimeError('看板部件必须开启分组');
|
|
@@ -351,4 +441,171 @@ export class KanbanController
|
|
|
351
441
|
await this.afterLoad({}, this.state.items);
|
|
352
442
|
}
|
|
353
443
|
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* 获取是否全屏
|
|
447
|
+
*
|
|
448
|
+
* @return {*} {boolean}
|
|
449
|
+
* @memberof KanbanController
|
|
450
|
+
*/
|
|
451
|
+
getFullscreen(): boolean {
|
|
452
|
+
const value =
|
|
453
|
+
(document as IData).isFullScreen ||
|
|
454
|
+
(document as IData).mozIsFullScreen ||
|
|
455
|
+
(document as IData).webkitIsFullScreen;
|
|
456
|
+
return value;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* 触发全屏
|
|
461
|
+
*
|
|
462
|
+
* @param {IData} container
|
|
463
|
+
* @memberof KanbanController
|
|
464
|
+
*/
|
|
465
|
+
onFullScreen(container: IData): boolean {
|
|
466
|
+
const isFull = this.getFullscreen();
|
|
467
|
+
if (!isFull) {
|
|
468
|
+
if (container) {
|
|
469
|
+
if (container.webkitRequestFullscreen) {
|
|
470
|
+
container.webkitRequestFullscreen();
|
|
471
|
+
} else if (container.mozRequestFullScreen) {
|
|
472
|
+
container.mozRequestFullScreen();
|
|
473
|
+
} else if (container.msRequestFullscreen) {
|
|
474
|
+
container.msRequestFullscreen();
|
|
475
|
+
} else if (container.requestFullscreen) {
|
|
476
|
+
container.requestFullscreen();
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
} else if ((document as IData).documentElement.requestFullScreen) {
|
|
480
|
+
(document as IData).exitFullScreen();
|
|
481
|
+
} else if ((document as IData).documentElement.webkitRequestFullScreen) {
|
|
482
|
+
(document as IData).webkitCancelFullScreen();
|
|
483
|
+
} else if ((document as IData).documentElement.mozRequestFullScreen) {
|
|
484
|
+
(document as IData).mozCancelFullScreen();
|
|
485
|
+
}
|
|
486
|
+
return !isFull;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* 设置选中分组标识
|
|
491
|
+
*
|
|
492
|
+
* @param {(string | number)} key
|
|
493
|
+
* @memberof KanbanController
|
|
494
|
+
*/
|
|
495
|
+
setSelectGroup(key: string | number): void {
|
|
496
|
+
if (!this.state.batching) {
|
|
497
|
+
this.state.selectGroupKey = key;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* 设置分组控制器
|
|
503
|
+
*
|
|
504
|
+
* @param {string} groupKey
|
|
505
|
+
* @param {('quickToolbarController' | 'batchToolbarController')} name
|
|
506
|
+
* @param {IToolbarController} c
|
|
507
|
+
* @memberof KanbanController
|
|
508
|
+
*/
|
|
509
|
+
setGroupController(
|
|
510
|
+
groupKey: string | number,
|
|
511
|
+
name: 'quickToolbarController' | 'batchToolbarController',
|
|
512
|
+
c: IToolbarController,
|
|
513
|
+
): void {
|
|
514
|
+
const group = this.state.groups.find(x => x.key === groupKey);
|
|
515
|
+
if (group) {
|
|
516
|
+
group[name] = c;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* 设置工具栏hook
|
|
522
|
+
*
|
|
523
|
+
* @memberof KanbanController
|
|
524
|
+
*/
|
|
525
|
+
setToolbarHooks(): void {
|
|
526
|
+
this.listenNewController((name: string, c: IController) => {
|
|
527
|
+
if (
|
|
528
|
+
name.startsWith(`${this.model.name}_quicktoolbar`) ||
|
|
529
|
+
name.startsWith(`${this.model.name}_groupquicktoolbar`)
|
|
530
|
+
) {
|
|
531
|
+
this.setQuickToolbarClickHook(name, c as IToolbarController);
|
|
532
|
+
}
|
|
533
|
+
if (name.startsWith(`${this.model.name}_batchtoolbar`)) {
|
|
534
|
+
this.setBatchToolbarClickHook(name, c as IToolbarController);
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* 设置快捷工具栏点击事件hook
|
|
541
|
+
*
|
|
542
|
+
* @param {string} name
|
|
543
|
+
* @param {IToolbarController} c
|
|
544
|
+
* @memberof KanbanController
|
|
545
|
+
*/
|
|
546
|
+
setQuickToolbarClickHook(name: string, c: IToolbarController): void {
|
|
547
|
+
const key = name.split('quicktoolbar_')[1];
|
|
548
|
+
this.setGroupController(
|
|
549
|
+
key,
|
|
550
|
+
'quickToolbarController',
|
|
551
|
+
c as IToolbarController,
|
|
552
|
+
);
|
|
553
|
+
(c as IToolbarController).evt.on('onClick', (event): void => {
|
|
554
|
+
const groupKey = event.targetName.split('quicktoolbar_')[1];
|
|
555
|
+
this.setSelectGroup(groupKey);
|
|
556
|
+
Object.assign(event.params, { srfgroup: groupKey });
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* 设置批工具栏点击事件hook
|
|
562
|
+
*
|
|
563
|
+
* @param {string} name
|
|
564
|
+
* @param {IToolbarController} c
|
|
565
|
+
* @memberof KanbanController
|
|
566
|
+
*/
|
|
567
|
+
setBatchToolbarClickHook(name: string, c: IToolbarController): void {
|
|
568
|
+
const key = name.split('batchtoolbar_')[1];
|
|
569
|
+
this.setGroupController(
|
|
570
|
+
key,
|
|
571
|
+
'batchToolbarController',
|
|
572
|
+
c as IToolbarController,
|
|
573
|
+
);
|
|
574
|
+
(c as IToolbarController).evt.on('onClick', (event): void => {
|
|
575
|
+
const groupKey = event.targetName.split('batchtoolbar_')[1];
|
|
576
|
+
this.setSelectGroup(groupKey);
|
|
577
|
+
Object.assign(event.params, { srfgroup: groupKey });
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* 打开批操作工具栏
|
|
583
|
+
*
|
|
584
|
+
* @param {string} groupKey
|
|
585
|
+
* @memberof KanbanController
|
|
586
|
+
*/
|
|
587
|
+
openBatch(groupKey: string): void {
|
|
588
|
+
this.state.selectGroupKey = groupKey;
|
|
589
|
+
this.state.batching = true;
|
|
590
|
+
this.state.selectedData = [];
|
|
591
|
+
// 清空分组选中数据
|
|
592
|
+
this.state.groups.forEach(group => {
|
|
593
|
+
group.selectedData = [];
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* 关闭批操作工具栏
|
|
599
|
+
*
|
|
600
|
+
* @memberof KanbanController
|
|
601
|
+
*/
|
|
602
|
+
closeBatch(): void {
|
|
603
|
+
this.state.selectGroupKey = '';
|
|
604
|
+
this.state.batching = false;
|
|
605
|
+
this.state.selectedData = [];
|
|
606
|
+
// 清空分组选中数据
|
|
607
|
+
this.state.groups.forEach(group => {
|
|
608
|
+
group.selectedData = [];
|
|
609
|
+
});
|
|
610
|
+
}
|
|
354
611
|
}
|
|
@@ -4,7 +4,12 @@ import {
|
|
|
4
4
|
RuntimeModelError,
|
|
5
5
|
recursiveIterate,
|
|
6
6
|
} from '@ibiz-template/core';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
IDETBUIActionItem,
|
|
9
|
+
IDETree,
|
|
10
|
+
IDETreeDataSetNode,
|
|
11
|
+
IDETreeNode,
|
|
12
|
+
} from '@ibiz/model-core';
|
|
8
13
|
import {
|
|
9
14
|
ITreeState,
|
|
10
15
|
ITreeEvent,
|
|
@@ -16,7 +21,11 @@ import { UIActionUtil } from '../../../ui-action';
|
|
|
16
21
|
import { MDControlController } from '../../common';
|
|
17
22
|
import { ContextMenuController } from '../context-menu';
|
|
18
23
|
import { TreeService } from './tree.service';
|
|
19
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
calcDeCodeNameById,
|
|
26
|
+
getChildNodeRSs,
|
|
27
|
+
getUIActionItemsByActionLevel,
|
|
28
|
+
} from '../../../model';
|
|
20
29
|
|
|
21
30
|
export type DropNodeRS = {
|
|
22
31
|
minorEntityId: string;
|
|
@@ -62,6 +71,13 @@ export class TreeController
|
|
|
62
71
|
*/
|
|
63
72
|
dropNodeRss = new Map<string, DropNodeRS[]>();
|
|
64
73
|
|
|
74
|
+
/**
|
|
75
|
+
* 节点对应的上下文菜单里第一个行为级别为常用操作的项
|
|
76
|
+
* @author lxm
|
|
77
|
+
* @date 2023-12-19 03:14:03
|
|
78
|
+
*/
|
|
79
|
+
nodeClickTBUIActionItem = new Map<string, IDETBUIActionItem>();
|
|
80
|
+
|
|
65
81
|
protected initState(): void {
|
|
66
82
|
super.initState();
|
|
67
83
|
// 根节点初始化
|
|
@@ -106,6 +122,7 @@ export class TreeController
|
|
|
106
122
|
}
|
|
107
123
|
|
|
108
124
|
this.initDropNodeRss();
|
|
125
|
+
this.initNodeClickTBUIActionItem();
|
|
109
126
|
|
|
110
127
|
this.service = new TreeService(this.model);
|
|
111
128
|
await this.service.init(this.context);
|
|
@@ -163,6 +180,23 @@ export class TreeController
|
|
|
163
180
|
});
|
|
164
181
|
}
|
|
165
182
|
|
|
183
|
+
/**
|
|
184
|
+
* 初始化节点点击后触发的第一个常用操作的上下文菜单项
|
|
185
|
+
* @author lxm
|
|
186
|
+
* @date 2023-12-19 03:18:43
|
|
187
|
+
* @protected
|
|
188
|
+
*/
|
|
189
|
+
protected initNodeClickTBUIActionItem(): void {
|
|
190
|
+
this.model.detreeNodes?.forEach(node => {
|
|
191
|
+
if (node.decontextMenu?.detoolbarItems?.length) {
|
|
192
|
+
const items = getUIActionItemsByActionLevel(node.decontextMenu, 200);
|
|
193
|
+
if (items.length > 0) {
|
|
194
|
+
this.nodeClickTBUIActionItem.set(node.id!, items[0]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
166
200
|
/**
|
|
167
201
|
* 树部件加载,从根节点开始重新加载
|
|
168
202
|
*
|
|
@@ -254,7 +288,16 @@ export class TreeController
|
|
|
254
288
|
* @returns {*} {Promise<void>}
|
|
255
289
|
* @memberof TreeController
|
|
256
290
|
*/
|
|
257
|
-
async onTreeNodeClick(
|
|
291
|
+
async onTreeNodeClick(
|
|
292
|
+
nodeData: ITreeNodeData,
|
|
293
|
+
event: MouseEvent,
|
|
294
|
+
): Promise<void> {
|
|
295
|
+
// 节点有配置常用操作的上下文菜单时,触发界面行为,后续逻辑都不走
|
|
296
|
+
if (this.nodeClickTBUIActionItem.has(nodeData.nodeId)) {
|
|
297
|
+
const item = this.nodeClickTBUIActionItem.get(nodeData.nodeId)!;
|
|
298
|
+
return this.doUIAction(item.uiactionId!, nodeData, event, item.appId);
|
|
299
|
+
}
|
|
300
|
+
|
|
258
301
|
// 导航的时候,没有导航视图的时候,节点后续点击逻辑都不走,也不选中
|
|
259
302
|
if (this.state.navigational) {
|
|
260
303
|
const nodeModel = this.getNodeModel(nodeData.nodeId);
|