@ibiz-template/runtime 0.5.0-beta.5 → 0.5.1-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 +238 -151
- package/dist/index.system.min.js +1 -1
- package/out/app-hub.d.ts +1 -0
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +5 -0
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +0 -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 +5 -6
- package/out/controller/control/gantt/gantt.controller.js +2 -2
- package/out/controller/control/gantt/gantt.service.js +2 -2
- package/out/controller/control/grid/grid/grid.controller.d.ts +3 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +8 -5
- package/out/controller/control/tree/tree.controller.d.ts +7 -2
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +59 -59
- package/out/controller/control/tree/tree.service.js +8 -8
- package/out/controller/control/tree-grid/tree-grid.controller.d.ts +35 -2
- package/out/controller/control/tree-grid/tree-grid.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid/tree-grid.controller.js +60 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +6 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree-grid.controller.d.ts +11 -1
- package/out/interface/controller/controller/control/i-tree-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +2 -2
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree-grid.state.d.ts +5 -0
- package/out/interface/controller/state/control/i-tree-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +26 -25
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/interface/service/service/i-auth.service.d.ts +23 -0
- package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
- package/out/interface/service/service/index.d.ts +1 -1
- package/out/interface/service/service/index.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.d.ts +3 -1
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +26 -3
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +4 -3
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +2 -2
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +2 -2
- 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-static-node-data.d.ts +2 -2
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts +3 -3
- 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 +9 -9
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts +4 -4
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +19 -21
- package/out/service/vo/tree-node-data/tree-node-data.d.ts +12 -13
- package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.js +10 -8
- package/out/service/vo/tree-node-data/tree-static-node-data.d.ts +4 -4
- package/out/service/vo/tree-node-data/tree-static-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-static-node-data.js +10 -10
- package/package.json +3 -3
- package/src/app-hub.ts +6 -0
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +5 -6
- package/src/controller/control/gantt/gantt.controller.ts +2 -2
- package/src/controller/control/gantt/gantt.service.ts +2 -2
- package/src/controller/control/grid/grid/grid.controller.ts +17 -8
- package/src/controller/control/tree/tree.controller.ts +61 -61
- package/src/controller/control/tree/tree.service.ts +8 -8
- package/src/controller/control/tree-grid/tree-grid.controller.ts +79 -4
- package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +7 -0
- package/src/interface/controller/controller/control/i-grid.controller.ts +5 -2
- package/src/interface/controller/controller/control/i-tree-grid.controller.ts +16 -1
- package/src/interface/controller/state/control/i-gantt.state.ts +2 -2
- package/src/interface/controller/state/control/i-tree-grid.state.ts +7 -1
- package/src/interface/controller/state/control/i-tree.state.ts +27 -25
- package/src/interface/service/service/i-auth.service.ts +26 -0
- package/src/interface/service/service/index.ts +1 -1
- package/src/service/service/auth/v7-auth.service.ts +31 -2
- package/src/service/service/entity/method/de-action.ts +4 -3
- package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +2 -2
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +2 -2
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +2 -2
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +12 -12
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +26 -29
- package/src/service/vo/tree-node-data/tree-node-data.ts +20 -20
- package/src/service/vo/tree-node-data/tree-static-node-data.ts +14 -14
|
@@ -10,9 +10,9 @@ import { TreeNodeData } from './tree-node-data';
|
|
|
10
10
|
* @implements {ITreeNodeData}
|
|
11
11
|
*/
|
|
12
12
|
export declare class TreeCodeListNodeData extends TreeNodeData implements ITreeNodeData {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
_text: string;
|
|
14
|
+
_id: string;
|
|
15
|
+
_value: string;
|
|
16
16
|
constructor(model: IDETreeDataSetNode, parentNodeData: ITreeNodeData | undefined, opts: {
|
|
17
17
|
data: CodeListItem;
|
|
18
18
|
leaf: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-code-list-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-code-list-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,oBACX,SAAQ,YACR,YAAW,aAAa;IAExB,
|
|
1
|
+
{"version":3,"file":"tree-code-list-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-code-list-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,oBACX,SAAQ,YACR,YAAW,aAAa;IAExB,KAAK,EAAE,MAAM,CAAC;IAEd,GAAG,EAAG,MAAM,CAAC;IAEb,MAAM,EAAE,MAAM,CAAC;gBAGb,KAAK,EAAE,kBAAkB,EACzB,cAAc,EAAE,aAAa,GAAG,SAAS,EACzC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,OAAO,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;CA8BJ"}
|
|
@@ -12,13 +12,13 @@ export class TreeCodeListNodeData extends TreeNodeData {
|
|
|
12
12
|
constructor(model, parentNodeData, opts) {
|
|
13
13
|
super(model, parentNodeData, opts);
|
|
14
14
|
const { data } = opts;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
15
|
+
this._text = data.text;
|
|
16
|
+
this._value = data.value;
|
|
17
17
|
// id小写
|
|
18
|
-
const selfId = `${model.id}@${this.
|
|
18
|
+
const selfId = `${model.id}@${this._value}`.toLowerCase();
|
|
19
19
|
Object.defineProperty(this, 'id', {
|
|
20
20
|
get() {
|
|
21
|
-
return this.
|
|
21
|
+
return this._parent ? `${this._parent.id}:${selfId}` : selfId;
|
|
22
22
|
},
|
|
23
23
|
enumerable: true,
|
|
24
24
|
configurable: true,
|
|
@@ -26,12 +26,12 @@ export class TreeCodeListNodeData extends TreeNodeData {
|
|
|
26
26
|
// 实体节点额外添加上自己的实体上下文
|
|
27
27
|
if (model.appDataEntityId) {
|
|
28
28
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
29
|
-
this.
|
|
30
|
-
[deName]: this.
|
|
29
|
+
this._context = Object.assign(this._context || {}, {
|
|
30
|
+
[deName]: this._value,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
this.srfkey = this.
|
|
34
|
-
this.srfmajortext = this.
|
|
35
|
-
this.
|
|
33
|
+
this.srfkey = this._value;
|
|
34
|
+
this.srfmajortext = this._text;
|
|
35
|
+
this._icon = this.calcIcon(model);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -10,10 +10,10 @@ import { TreeNodeData } from './tree-node-data';
|
|
|
10
10
|
* @implements {ITreeNodeData}
|
|
11
11
|
*/
|
|
12
12
|
export declare class TreeDataSetNodeData extends TreeNodeData implements ITreeNodeData {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
_text: string;
|
|
14
|
+
_id: string;
|
|
15
|
+
_value: string;
|
|
16
|
+
_deData: IData;
|
|
17
17
|
constructor(model: IDETreeDataSetNode, parentNodeData: ITreeNodeData | undefined, opts: {
|
|
18
18
|
data: IData;
|
|
19
19
|
leaf: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-data-set-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-data-set-node-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,aAAa;IAC5E,
|
|
1
|
+
{"version":3,"file":"tree-data-set-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-data-set-node-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,aAAa;IAC5E,KAAK,EAAE,MAAM,CAAC;IAEd,GAAG,EAAG,MAAM,CAAC;IAEb,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,KAAK,CAAC;gBAGb,KAAK,EAAE,kBAAkB,EACzB,cAAc,EAAE,aAAa,GAAG,SAAS,EACzC,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,OAAO,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;IA0FH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,GAAG,SAAS;IAiBhE;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,CAC1B,QAAQ,EAAE,mBAAmB,GAC5B,MAAM,GAAG,SAAS;IAYrB;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,GAAG,SAAS;CAStE"}
|
|
@@ -16,18 +16,18 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
16
16
|
var _a;
|
|
17
17
|
super(model, parentNodeData, opts);
|
|
18
18
|
const { data } = opts;
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
19
|
+
this._deData = data;
|
|
20
|
+
this._text = model.textAppDEFieldId
|
|
21
21
|
? data[model.textAppDEFieldId]
|
|
22
22
|
: data.srfmajortext;
|
|
23
|
-
this.
|
|
23
|
+
this._value = model.idAppDEFieldId
|
|
24
24
|
? data[model.idAppDEFieldId]
|
|
25
25
|
: data.srfkey;
|
|
26
26
|
// id小写
|
|
27
27
|
const selfId = `${model.id}@${data.srfkey}`.toLowerCase();
|
|
28
28
|
Object.defineProperty(this, 'id', {
|
|
29
29
|
get() {
|
|
30
|
-
return this.
|
|
30
|
+
return this._parent ? `${this._parent.id}:${selfId}` : selfId;
|
|
31
31
|
},
|
|
32
32
|
enumerable: true,
|
|
33
33
|
configurable: true,
|
|
@@ -35,17 +35,15 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
35
35
|
// 实体节点额外添加上自己的实体上下文
|
|
36
36
|
if (model.appDataEntityId) {
|
|
37
37
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
38
|
-
this.
|
|
38
|
+
this._context = Object.assign(this._context || {}, {
|
|
39
39
|
[deName]: data.srfkey,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.icon = this.calcIcon(model);
|
|
45
|
-
this.textHtml = this.calcTextHtml(model);
|
|
42
|
+
this._icon = this.calcIcon(model);
|
|
43
|
+
this._textHtml = this.calcTextHtml(model);
|
|
46
44
|
// 识别叶子节点标识属性,根据后台数据赋值leaf
|
|
47
45
|
if (model.leafFlagAppDEFieldId) {
|
|
48
|
-
this.
|
|
46
|
+
this._leaf = fieldValueToBoolean(data[model.leafFlagAppDEFieldId]);
|
|
49
47
|
}
|
|
50
48
|
/** 数据项映射 */
|
|
51
49
|
const dataItemkeyMap = new Map();
|
|
@@ -61,11 +59,11 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
61
59
|
});
|
|
62
60
|
return new Proxy(this, {
|
|
63
61
|
set(target, p, value) {
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(target.
|
|
65
|
-
target.
|
|
62
|
+
if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
|
|
63
|
+
target._deData[p] = value;
|
|
66
64
|
}
|
|
67
65
|
else if (dataItemkeyMap.has(p)) {
|
|
68
|
-
target.
|
|
66
|
+
target._deData[dataItemkeyMap.get(p)] = value;
|
|
69
67
|
}
|
|
70
68
|
else {
|
|
71
69
|
target[p] = value;
|
|
@@ -77,10 +75,10 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
77
75
|
return target[p];
|
|
78
76
|
}
|
|
79
77
|
if (dataItemkeyMap.has(p)) {
|
|
80
|
-
return target.
|
|
78
|
+
return target._deData[dataItemkeyMap.get(p)] || dataItemDefaults[p];
|
|
81
79
|
}
|
|
82
|
-
if (target.
|
|
83
|
-
return target.
|
|
80
|
+
if (target._deData[p] !== undefined) {
|
|
81
|
+
return target._deData[p];
|
|
84
82
|
}
|
|
85
83
|
},
|
|
86
84
|
ownKeys(target) {
|
|
@@ -89,7 +87,7 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
89
87
|
...new Set([
|
|
90
88
|
...Object.keys(target),
|
|
91
89
|
...dataItemkeyMap.keys(),
|
|
92
|
-
...Object.keys(target.
|
|
90
|
+
...Object.keys(target._deData),
|
|
93
91
|
]),
|
|
94
92
|
];
|
|
95
93
|
updateKeyDefine(target, allKeys);
|
|
@@ -100,11 +98,11 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
100
98
|
calcIcon(model) {
|
|
101
99
|
const icon = super.calcIcon(model) || {};
|
|
102
100
|
const { iconAppDEFieldId, detreeNodeDataItems } = model;
|
|
103
|
-
if (iconAppDEFieldId && this.
|
|
104
|
-
icon.imagePath = this.
|
|
101
|
+
if (iconAppDEFieldId && this._deData[iconAppDEFieldId]) {
|
|
102
|
+
icon.imagePath = this._deData[iconAppDEFieldId];
|
|
105
103
|
}
|
|
106
104
|
if (icon) {
|
|
107
|
-
this.
|
|
105
|
+
this._icon = icon;
|
|
108
106
|
}
|
|
109
107
|
const iconDataItem = detreeNodeDataItems === null || detreeNodeDataItems === void 0 ? void 0 : detreeNodeDataItems.find(item => item.id === 'icon');
|
|
110
108
|
if (iconDataItem) {
|
|
@@ -122,7 +120,7 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
122
120
|
*/
|
|
123
121
|
calcDataItemScript(dataItem) {
|
|
124
122
|
if (dataItem.customCode && dataItem.scriptCode) {
|
|
125
|
-
return ScriptFactory.execScriptFn({ data: this.
|
|
123
|
+
return ScriptFactory.execScriptFn({ data: this._deData }, dataItem.scriptCode, {
|
|
126
124
|
isAsync: false,
|
|
127
125
|
});
|
|
128
126
|
}
|
|
@@ -10,21 +10,20 @@ import { IIcon, ITreeNodeData } from '../../../interface';
|
|
|
10
10
|
export declare abstract class TreeNodeData implements ITreeNodeData {
|
|
11
11
|
_uuid: string;
|
|
12
12
|
_nodeType: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
_id: string;
|
|
14
|
+
_value?: string | undefined;
|
|
15
|
+
_text: string;
|
|
16
|
+
_children?: ITreeNodeData[] | undefined;
|
|
17
|
+
_deData?: IData | undefined;
|
|
18
18
|
srfkey?: string | undefined;
|
|
19
19
|
srfmajortext?: string | undefined;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[key: string | symbol]: any;
|
|
20
|
+
_nodeId: string;
|
|
21
|
+
_leaf: boolean;
|
|
22
|
+
_context?: IParams;
|
|
23
|
+
_params?: IParams;
|
|
24
|
+
_parent?: ITreeNodeData;
|
|
25
|
+
_icon?: IIcon;
|
|
26
|
+
_textHtml?: string;
|
|
28
27
|
constructor(model: IDETreeNode, parentNodeData: ITreeNodeData | undefined, opts: {
|
|
29
28
|
leaf: boolean;
|
|
30
29
|
navContext?: IParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;GAMG;AACH,8BAAsB,YAAa,YAAW,aAAa;IACzD,KAAK,EAAE,MAAM,CAAgB;IAE7B,SAAS,EAAE,MAAM,CAAC;IAElB,
|
|
1
|
+
{"version":3,"file":"tree-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;GAMG;AACH,8BAAsB,YAAa,YAAW,aAAa;IACzD,KAAK,EAAE,MAAM,CAAgB;IAE7B,SAAS,EAAE,MAAM,CAAC;IAElB,GAAG,EAAG,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,KAAK,EAAG,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAExC,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,OAAO,CAAS;IAEvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;gBAMjB,KAAK,EAAE,WAAW,EAClB,cAAc,EAAE,aAAa,GAAG,SAAS,EACzC,IAAI,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;IAuBpE;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,GAAG,SAAS;CAa1D"}
|
|
@@ -7,24 +7,26 @@ import { createUUID } from 'qx-util';
|
|
|
7
7
|
* @class TreeNodeData
|
|
8
8
|
*/
|
|
9
9
|
export class TreeNodeData {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
// [key: string | symbol]: any;
|
|
10
12
|
constructor(model, parentNodeData, opts) {
|
|
11
13
|
this._uuid = createUUID();
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
14
|
+
this._leaf = false;
|
|
15
|
+
this._leaf = opts.leaf === true;
|
|
16
|
+
this._parent = parentNodeData;
|
|
15
17
|
this._nodeType = model.treeNodeType;
|
|
16
18
|
// 所有节点都要继承父的上下文,如果父存在则复制父的资源上下文,否则返回空对象。
|
|
17
|
-
if (this.
|
|
18
|
-
this.
|
|
19
|
+
if (this._parent) {
|
|
20
|
+
this._context = Object.assign({}, this._parent._context);
|
|
19
21
|
}
|
|
20
22
|
// 附加导航上下文和视图参数
|
|
21
23
|
if (opts.navContext) {
|
|
22
|
-
this.
|
|
24
|
+
this._context = Object.assign(this._context || {}, opts.navContext);
|
|
23
25
|
}
|
|
24
26
|
if (opts.navParams) {
|
|
25
|
-
this.
|
|
27
|
+
this._params = Object.assign({}, opts.navParams);
|
|
26
28
|
}
|
|
27
|
-
this.
|
|
29
|
+
this._nodeId = model.id;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* 计算节点图标
|
|
@@ -10,10 +10,10 @@ import { TreeNodeData } from './tree-node-data';
|
|
|
10
10
|
* @implements {ITreeNodeData}
|
|
11
11
|
*/
|
|
12
12
|
export declare class TreeStaticNodeData extends TreeNodeData implements ITreeNodeData {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
_text: string;
|
|
14
|
+
_id: string;
|
|
15
|
+
_value?: string;
|
|
16
|
+
_deData?: IData;
|
|
17
17
|
constructor(model: IDETreeStaticNode, parentNodeData: ITreeNodeData | undefined, opts: {
|
|
18
18
|
parentValueLevel?: number;
|
|
19
19
|
leaf: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-static-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-static-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,aAAa;IAC3E,
|
|
1
|
+
{"version":3,"file":"tree-static-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/tree-node-data/tree-static-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,aAAa;IAC3E,KAAK,EAAE,MAAM,CAAC;IAEd,GAAG,EAAG,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,KAAK,CAAC;gBAGd,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,aAAa,GAAG,SAAS,EACzC,IAAI,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE;CAsCrD"}
|
|
@@ -17,28 +17,28 @@ export class TreeStaticNodeData extends TreeNodeData {
|
|
|
17
17
|
const selfId = `${model.id}`.toLowerCase();
|
|
18
18
|
Object.defineProperty(this, 'id', {
|
|
19
19
|
get() {
|
|
20
|
-
return this.
|
|
20
|
+
return this._parent ? `${this._parent.id}:${selfId}` : selfId;
|
|
21
21
|
},
|
|
22
22
|
enumerable: true,
|
|
23
23
|
configurable: true,
|
|
24
24
|
});
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
25
|
+
this._text = model.text;
|
|
26
|
+
this._value = nodeValue;
|
|
27
27
|
// 静态节点数据去对应级别的父节点数据
|
|
28
28
|
if (parentNodeData && opts.parentValueLevel) {
|
|
29
29
|
// 根据父值级别查找父数据
|
|
30
30
|
let parent = parentNodeData;
|
|
31
31
|
for (let index = 1; index < opts.parentValueLevel; index++) {
|
|
32
|
-
parent = parent === null || parent === void 0 ? void 0 : parent.
|
|
32
|
+
parent = parent === null || parent === void 0 ? void 0 : parent._parent;
|
|
33
33
|
}
|
|
34
|
-
if (parent === null || parent === void 0 ? void 0 : parent.
|
|
35
|
-
this.
|
|
34
|
+
if (parent === null || parent === void 0 ? void 0 : parent._deData) {
|
|
35
|
+
this._deData = parent._deData;
|
|
36
36
|
}
|
|
37
37
|
// 静态节点值不存在时,取父数据的值
|
|
38
|
-
this.
|
|
38
|
+
this._value = nodeValue || (parent === null || parent === void 0 ? void 0 : parent._value);
|
|
39
39
|
}
|
|
40
|
-
this.srfkey = ((_a = this.
|
|
41
|
-
this.srfmajortext = ((_b = this.
|
|
42
|
-
this.
|
|
40
|
+
this.srfkey = ((_a = this._deData) === null || _a === void 0 ? void 0 : _a.srfkey) || this._value;
|
|
41
|
+
this.srfmajortext = ((_b = this._deData) === null || _b === void 0 ? void 0 : _b.srfmajortext) || this._text;
|
|
42
|
+
this._icon = this.calcIcon(model);
|
|
43
43
|
}
|
|
44
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1-beta.1",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.5.0
|
|
32
|
+
"@ibiz-template/core": "^0.5.0",
|
|
33
33
|
"@ibiz/model-core": "^0.1.0",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.11",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b5eea7549eab1b5e4c302af72a095c7470313c8b"
|
|
63
63
|
}
|
package/src/app-hub.ts
CHANGED
|
@@ -88,7 +88,6 @@ export class TreeExpBarController
|
|
|
88
88
|
*
|
|
89
89
|
* @author zk
|
|
90
90
|
* @date 2023-05-29 03:05:36
|
|
91
|
-
* @param {IData} data
|
|
92
91
|
* @memberof ExpBarControlController
|
|
93
92
|
*/
|
|
94
93
|
xDataActive(event: ITreeEvent['onActive']['event']): void {
|
|
@@ -111,11 +110,11 @@ export class TreeExpBarController
|
|
|
111
110
|
context: IContext,
|
|
112
111
|
params: IParams,
|
|
113
112
|
): INavViewMsg {
|
|
114
|
-
const nodeId = node.
|
|
115
|
-
const deData = node.
|
|
116
|
-
const nodeModel = this.getNodeModel(node.
|
|
113
|
+
const nodeId = node._id;
|
|
114
|
+
const deData = node._deData || node;
|
|
115
|
+
const nodeModel = this.getNodeModel(node._nodeId);
|
|
117
116
|
if (!nodeModel) {
|
|
118
|
-
throw new RuntimeError(`找不到${node.
|
|
117
|
+
throw new RuntimeError(`找不到${node._nodeId}的节点模型`);
|
|
119
118
|
}
|
|
120
119
|
const result = this.prepareParams(nodeModel, deData, context, params);
|
|
121
120
|
result.context.currentSrfNav = nodeId;
|
|
@@ -142,7 +141,7 @@ export class TreeExpBarController
|
|
|
142
141
|
return true;
|
|
143
142
|
}
|
|
144
143
|
// 需要导航视图的时候,返回第一个配置了导航视图的节点数据
|
|
145
|
-
return this.navNodeModelIds.includes(node.
|
|
144
|
+
return this.navNodeModelIds.includes(node._nodeId);
|
|
146
145
|
});
|
|
147
146
|
if (!data) {
|
|
148
147
|
return;
|
|
@@ -109,7 +109,7 @@ export class GanttController
|
|
|
109
109
|
data: IData,
|
|
110
110
|
isTransformData: boolean = false,
|
|
111
111
|
): Promise<void> {
|
|
112
|
-
const key = nodeData.srfkey ? 'srfkey' : '
|
|
112
|
+
const key = nodeData.srfkey ? 'srfkey' : '_id';
|
|
113
113
|
const currentNode = this.state.items.find(
|
|
114
114
|
item => item[key] === nodeData[key],
|
|
115
115
|
);
|
|
@@ -117,7 +117,7 @@ export class GanttController
|
|
|
117
117
|
ibiz.log.error('找不到对应的动态实体树节点数据', nodeData);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
const nodeModel = this.getNodeModel(currentNode.
|
|
120
|
+
const nodeModel = this.getNodeModel(currentNode._nodeId);
|
|
121
121
|
if (nodeModel) {
|
|
122
122
|
const newData = isTransformData
|
|
123
123
|
? this.transformNodeDataItem(nodeModel, data)
|
|
@@ -78,7 +78,7 @@ export class GanttService extends TreeService {
|
|
|
78
78
|
} else {
|
|
79
79
|
// 有父节点的计算节点关系查询对应节点数据并合并
|
|
80
80
|
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
81
|
-
parentId: parentNodeData.
|
|
81
|
+
parentId: parentNodeData._nodeId,
|
|
82
82
|
hasQuery,
|
|
83
83
|
});
|
|
84
84
|
|
|
@@ -185,7 +185,7 @@ export class GanttService extends TreeService {
|
|
|
185
185
|
childNode,
|
|
186
186
|
opts,
|
|
187
187
|
);
|
|
188
|
-
childNode.
|
|
188
|
+
childNode._children = subChildrenNodes;
|
|
189
189
|
}
|
|
190
190
|
}),
|
|
191
191
|
);
|
|
@@ -41,6 +41,7 @@ import { ControlVO, Srfuf } from '../../../../service';
|
|
|
41
41
|
import { MDControlController } from '../../../common';
|
|
42
42
|
import { GridNotifyState } from '../../../constant';
|
|
43
43
|
import {
|
|
44
|
+
ControllerEvent,
|
|
44
45
|
exportData,
|
|
45
46
|
getDefaultValue,
|
|
46
47
|
getEntitySchema,
|
|
@@ -58,9 +59,13 @@ import { calcColumnModelBySchema } from './entity-schema';
|
|
|
58
59
|
* @class GridController
|
|
59
60
|
* @extends {MDControlController<GridModel>}
|
|
60
61
|
*/
|
|
61
|
-
export class GridController
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
export class GridController<
|
|
63
|
+
T extends IDEGrid = IDEGrid,
|
|
64
|
+
S extends IGridState = IGridState,
|
|
65
|
+
E extends IGridEvent = IGridEvent,
|
|
66
|
+
>
|
|
67
|
+
extends MDControlController<T, S, E>
|
|
68
|
+
implements IGridController<T, S, E>
|
|
64
69
|
{
|
|
65
70
|
/**
|
|
66
71
|
* 表格部件服务
|
|
@@ -71,6 +76,10 @@ export class GridController
|
|
|
71
76
|
*/
|
|
72
77
|
declare service: GridService;
|
|
73
78
|
|
|
79
|
+
protected get _evt(): ControllerEvent<IGridEvent> {
|
|
80
|
+
return this.evt;
|
|
81
|
+
}
|
|
82
|
+
|
|
74
83
|
/**
|
|
75
84
|
* 是否有配置宽度自适应列
|
|
76
85
|
*
|
|
@@ -606,7 +615,7 @@ export class GridController
|
|
|
606
615
|
? await this.service.create(tempContext, data)
|
|
607
616
|
: await this.service.update(tempContext, data);
|
|
608
617
|
} catch (error) {
|
|
609
|
-
await this.
|
|
618
|
+
await this._evt.emit('onSaveError', undefined);
|
|
610
619
|
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}ERROR`, {
|
|
611
620
|
error: error as Error,
|
|
612
621
|
data: rowState.data,
|
|
@@ -620,7 +629,7 @@ export class GridController
|
|
|
620
629
|
rowState.modified = false;
|
|
621
630
|
|
|
622
631
|
this.gridStateNotify(rowState, GridNotifyState.SAVE);
|
|
623
|
-
await this.
|
|
632
|
+
await this._evt.emit('onSaveSuccess', undefined);
|
|
624
633
|
}
|
|
625
634
|
|
|
626
635
|
async saveAll(): Promise<void> {
|
|
@@ -773,7 +782,7 @@ export class GridController
|
|
|
773
782
|
|
|
774
783
|
try {
|
|
775
784
|
await this.dataChangeNotify(row, [name]);
|
|
776
|
-
await this.
|
|
785
|
+
await this._evt.emit('onGridDataChange', {
|
|
777
786
|
data: this.state.rows.map(_row => {
|
|
778
787
|
return _row.data;
|
|
779
788
|
}),
|
|
@@ -866,7 +875,7 @@ export class GridController
|
|
|
866
875
|
} else if (row.data.srfuf === Srfuf.CREATE) {
|
|
867
876
|
// 新建的行取消时删除这一行的数据
|
|
868
877
|
row.showRowEdit = false;
|
|
869
|
-
this.
|
|
878
|
+
this._evt.emit('onRowEditChange', { row });
|
|
870
879
|
return this.remove({ data: [row.data], silent: true });
|
|
871
880
|
} else if (row.cacheData) {
|
|
872
881
|
// 取消的时候,还原编辑前的数据
|
|
@@ -897,7 +906,7 @@ export class GridController
|
|
|
897
906
|
row.editColStates[column.fieldName].editable = toState;
|
|
898
907
|
});
|
|
899
908
|
|
|
900
|
-
this.
|
|
909
|
+
this._evt.emit('onRowEditChange', { row });
|
|
901
910
|
}
|
|
902
911
|
|
|
903
912
|
/**
|