@ibiz-template/runtime 0.4.14 → 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 +314 -0
- package/dist/index.system.min.js +2 -2
- 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/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/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/package.json +4 -4
- 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/interface/controller/controller/control/i-kanban.controller.ts +31 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-gantt.state.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/i-gantt.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;;;;OAKG;IACH,YAAY,EAAE,YAAY,EAAE,CAAC;IAE7B;;;;;OAKG;IACH,SAAS,EAAE,cAAc,EAAE,CAAC;IAE5B;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"i-gantt.state.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/i-gantt.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;;;;OAKG;IACH,YAAY,EAAE,YAAY,EAAE,CAAC;IAE7B;;;;;OAKG;IACH,SAAS,EAAE,cAAc,EAAE,CAAC;IAE5B;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEnC;;;;;;OAMG;IACH,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;IAErC;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAExC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IToolbarController } from '../../controller';
|
|
1
2
|
import { IDataViewControlState } from './i-data-view-control.state';
|
|
2
3
|
import { IMDControlGroupState } from './i-md-control.state';
|
|
3
4
|
/**
|
|
@@ -22,6 +23,13 @@ export interface IKanbanState extends IDataViewControlState {
|
|
|
22
23
|
* @type {boolean}
|
|
23
24
|
*/
|
|
24
25
|
updating: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 是否正在批操作
|
|
28
|
+
*
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
* @memberof IKanbanState
|
|
31
|
+
*/
|
|
32
|
+
batching: boolean;
|
|
25
33
|
/**
|
|
26
34
|
* 分组数据
|
|
27
35
|
*
|
|
@@ -29,6 +37,13 @@ export interface IKanbanState extends IDataViewControlState {
|
|
|
29
37
|
* @memberof IKanbanState
|
|
30
38
|
*/
|
|
31
39
|
groups: IKanbanGroupState[];
|
|
40
|
+
/**
|
|
41
|
+
* 选中分组标识
|
|
42
|
+
*
|
|
43
|
+
* @type {string | number}
|
|
44
|
+
* @memberof IKanbanState
|
|
45
|
+
*/
|
|
46
|
+
selectGroupKey: string | number;
|
|
32
47
|
}
|
|
33
48
|
/**
|
|
34
49
|
* 看板部件分组数据
|
|
@@ -45,5 +60,19 @@ export interface IKanbanGroupState extends IMDControlGroupState {
|
|
|
45
60
|
* @memberof IKanbanGroupState
|
|
46
61
|
*/
|
|
47
62
|
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* 快速工具栏控制器
|
|
65
|
+
*
|
|
66
|
+
* @type {IToolbarController}
|
|
67
|
+
* @memberof IKanbanGroupState
|
|
68
|
+
*/
|
|
69
|
+
quickToolbarController?: IToolbarController;
|
|
70
|
+
/**
|
|
71
|
+
* 批操作工具栏控制器
|
|
72
|
+
*
|
|
73
|
+
* @type {IToolbarController}
|
|
74
|
+
* @memberof IKanbanGroupState
|
|
75
|
+
*/
|
|
76
|
+
batchToolbarController?: IToolbarController;
|
|
48
77
|
}
|
|
49
78
|
//# sourceMappingURL=i-kanban.state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-kanban.state.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/i-kanban.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACzD;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,MAAM,EAAE,iBAAiB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"i-kanban.state.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/i-kanban.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACzD;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAE5C;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;CAC7C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IDEGridColumn } from '@ibiz/model-core';
|
|
2
|
-
import {
|
|
3
|
-
import { IGridColumnController, IGridController } from '../controller';
|
|
2
|
+
import { IGanttController, IGridColumnController, IGridController, ITreeGridExController } from '../controller';
|
|
4
3
|
/**
|
|
5
4
|
* 表格列适配器的接口
|
|
6
5
|
*
|
|
@@ -27,6 +26,6 @@ export interface IGridColumnProvider {
|
|
|
27
26
|
* @param {GridController} grid 表格控制器
|
|
28
27
|
* @returns {*} {Promise<GridColumnController>}
|
|
29
28
|
*/
|
|
30
|
-
createController(columnModel: IDEGridColumn, grid: IGridController |
|
|
29
|
+
createController(columnModel: IDEGridColumn, grid: IGridController | ITreeGridExController | IGanttController): Promise<IGridColumnController>;
|
|
31
30
|
}
|
|
32
31
|
//# sourceMappingURL=i-grid-column.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-grid-column.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-grid-column.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"i-grid-column.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-grid-column.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IAEH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;;;;;OAQG;IACH,gBAAgB,CACd,WAAW,EAAE,aAAa,EAC1B,IAAI,EAAE,eAAe,GAAG,qBAAqB,GAAG,gBAAgB,GAE/D,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@ibiz-template/core": "^0.4.12",
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
33
|
+
"@ibiz/model-core": "^0.0.28",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.10",
|
|
36
36
|
"@types/systemjs": "^6.13.5",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.4.0",
|
|
50
|
-
"@ibiz/model-core": "^0.0.
|
|
50
|
+
"@ibiz/model-core": "^0.0.28",
|
|
51
51
|
"async-validator": "^4.2.5",
|
|
52
52
|
"dayjs": "^1.11.7",
|
|
53
53
|
"echarts": "^5.4.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6d9696266fe07f6a154cf6959914b640a1e7c4e8"
|
|
63
63
|
}
|
|
@@ -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
|
}
|
|
@@ -11,4 +11,34 @@ import { IDataViewControlController } from './i-data-view-control.controller';
|
|
|
11
11
|
* @extends {IMDControlController<IDEDataView, IDataViewControlState, IDataViewControlEvent>}
|
|
12
12
|
*/
|
|
13
13
|
export interface IKanbanController
|
|
14
|
-
extends IDataViewControlController<IDEKanban, IKanbanState, IKanbanEvent> {
|
|
14
|
+
extends IDataViewControlController<IDEKanban, IKanbanState, IKanbanEvent> {
|
|
15
|
+
/**
|
|
16
|
+
* 是否全屏
|
|
17
|
+
*
|
|
18
|
+
* @return {*} {boolean}
|
|
19
|
+
* @memberof IKanbanController
|
|
20
|
+
*/
|
|
21
|
+
getFullscreen(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 全屏
|
|
24
|
+
*
|
|
25
|
+
* @param {IData} container
|
|
26
|
+
* @memberof IKanbanController
|
|
27
|
+
*/
|
|
28
|
+
onFullScreen(container: IData): boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 打开对应分组批操作工具栏
|
|
32
|
+
*
|
|
33
|
+
* @param {string | number} groupKey
|
|
34
|
+
* @memberof IKanbanController
|
|
35
|
+
*/
|
|
36
|
+
openBatch(groupKey: string | number): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 关闭批操作工具栏
|
|
40
|
+
*
|
|
41
|
+
* @memberof IKanbanController
|
|
42
|
+
*/
|
|
43
|
+
closeBatch(): void;
|
|
44
|
+
}
|
|
@@ -47,6 +47,32 @@ export interface IGanttState extends IMDControlState {
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
*/
|
|
49
49
|
placeHolder: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 甘特图样式
|
|
53
|
+
*
|
|
54
|
+
* @type {IGanttStyle}
|
|
55
|
+
* @memberof IGanttState
|
|
56
|
+
*/
|
|
57
|
+
ganttStyle: IGanttStyle;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface IGanttStyle {
|
|
61
|
+
/**
|
|
62
|
+
* 主题色
|
|
63
|
+
*
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof IGanttStyle
|
|
66
|
+
*/
|
|
67
|
+
primaryColor?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 文本色
|
|
71
|
+
*
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @memberof IGanttStyle
|
|
74
|
+
*/
|
|
75
|
+
textColor?: string;
|
|
50
76
|
}
|
|
51
77
|
|
|
52
78
|
/**
|