@ibiz-template/runtime 0.5.0 → 0.5.1-beta.2
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 +258 -199
- package/dist/index.system.min.js +1 -1
- package/out/constant/view-type.d.ts +5 -1
- package/out/constant/view-type.d.ts.map +1 -1
- package/out/constant/view-type.js +4 -0
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +1 -2
- 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 +6 -7
- package/out/controller/control/gantt/gantt.controller.js +2 -2
- package/out/controller/control/gantt/gantt.service.js +2 -2
- package/out/controller/control/search-bar/entity-schema.d.ts +1 -1
- package/out/controller/control/search-bar/entity-schema.d.ts.map +1 -1
- package/out/controller/control/search-bar/entity-schema.js +29 -13
- package/out/controller/control/search-bar/search-bar.controller.d.ts +8 -9
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +36 -21
- package/out/controller/control/tree/tree.controller.d.ts +8 -3
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +63 -63
- package/out/controller/control/tree/tree.service.js +8 -8
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +2 -2
- package/out/interface/controller/event/view/i-sub-app-ref-view.event.d.ts +12 -0
- package/out/interface/controller/event/view/i-sub-app-ref-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-sub-app-ref-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts +8 -8
- package/out/interface/controller/state/control/i-gantt.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/controller/state/view/i-sub-app-ref-view.state.d.ts +11 -0
- package/out/interface/controller/state/view/i-sub-app-ref-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-sub-app-ref-view.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/service/dto/method.dto.d.ts +12 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +15 -3
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +8 -8
- 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-code-list-node-data.js +6 -6
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +8 -8
- 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 +6 -6
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts +8 -8
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-static-node-data.js +6 -6
- 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 +10 -10
- 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 +27 -27
- 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 +8 -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 +11 -11
- package/package.json +5 -5
- package/src/constant/view-type.ts +5 -0
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +6 -7
- package/src/controller/control/gantt/gantt.controller.ts +2 -2
- package/src/controller/control/gantt/gantt.service.ts +2 -2
- package/src/controller/control/search-bar/entity-schema.ts +43 -20
- package/src/controller/control/search-bar/search-bar.controller.ts +32 -21
- package/src/controller/control/tree/tree.controller.ts +70 -65
- package/src/controller/control/tree/tree.service.ts +8 -8
- package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +7 -3
- package/src/interface/controller/event/view/i-sub-app-ref-view.event.ts +12 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/control/i-gantt.state.ts +8 -8
- package/src/interface/controller/state/control/i-tree.state.ts +27 -25
- package/src/interface/controller/state/view/i-sub-app-ref-view.state.ts +10 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/service/dto/method.dto.ts +14 -2
- package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +14 -14
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +14 -14
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +17 -14
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +13 -13
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +35 -35
- package/src/service/vo/tree-node-data/tree-node-data.ts +19 -22
- package/src/service/vo/tree-node-data/tree-static-node-data.ts +16 -15
|
@@ -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
|
-
Object.defineProperty(this, '
|
|
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,37 +35,37 @@ 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
|
-
const
|
|
49
|
+
const dataItemKeyMap = new Map();
|
|
50
|
+
dataItemKeyMap.set('srfkey', 'srfkey');
|
|
51
|
+
dataItemKeyMap.set('srfmajortext', 'srfmajortext');
|
|
52
52
|
const dataItemDefaults = {};
|
|
53
53
|
(_a = model.detreeNodeDataItems) === null || _a === void 0 ? void 0 : _a.forEach(dataItem => {
|
|
54
54
|
const uiKey = dataItem.id.toLowerCase();
|
|
55
55
|
// 后台实体属性
|
|
56
56
|
const deFieldKey = dataItem.appDEFieldId.toLowerCase();
|
|
57
|
-
|
|
57
|
+
dataItemKeyMap.set(uiKey, deFieldKey);
|
|
58
58
|
if (dataItem.defaultValue) {
|
|
59
59
|
dataItemDefaults[uiKey] = dataItem.defaultValue;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
return new Proxy(this, {
|
|
63
63
|
set(target, p, value) {
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(target.
|
|
65
|
-
target.
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
|
|
65
|
+
target._deData[p] = value;
|
|
66
66
|
}
|
|
67
|
-
else if (
|
|
68
|
-
target.
|
|
67
|
+
else if (dataItemKeyMap.has(p)) {
|
|
68
|
+
target._deData[dataItemKeyMap.get(p)] = value;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
target[p] = value;
|
|
@@ -76,11 +76,11 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
76
76
|
if (target[p] !== undefined) {
|
|
77
77
|
return target[p];
|
|
78
78
|
}
|
|
79
|
-
if (
|
|
80
|
-
return target.
|
|
79
|
+
if (dataItemKeyMap.has(p)) {
|
|
80
|
+
return target._deData[dataItemKeyMap.get(p)] || dataItemDefaults[p];
|
|
81
81
|
}
|
|
82
|
-
if (target.
|
|
83
|
-
return target.
|
|
82
|
+
if (target._deData[p] !== undefined) {
|
|
83
|
+
return target._deData[p];
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
ownKeys(target) {
|
|
@@ -88,8 +88,8 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
88
88
|
const allKeys = [
|
|
89
89
|
...new Set([
|
|
90
90
|
...Object.keys(target),
|
|
91
|
-
...
|
|
92
|
-
...Object.keys(target.
|
|
91
|
+
...dataItemKeyMap.keys(),
|
|
92
|
+
...Object.keys(target._deData),
|
|
93
93
|
]),
|
|
94
94
|
];
|
|
95
95
|
updateKeyDefine(target, allKeys);
|
|
@@ -100,11 +100,11 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
100
100
|
calcIcon(model) {
|
|
101
101
|
const icon = super.calcIcon(model) || {};
|
|
102
102
|
const { iconAppDEFieldId, detreeNodeDataItems } = model;
|
|
103
|
-
if (iconAppDEFieldId && this.
|
|
104
|
-
icon.imagePath = this.
|
|
103
|
+
if (iconAppDEFieldId && this._deData[iconAppDEFieldId]) {
|
|
104
|
+
icon.imagePath = this._deData[iconAppDEFieldId];
|
|
105
105
|
}
|
|
106
106
|
if (icon) {
|
|
107
|
-
this.
|
|
107
|
+
this._icon = icon;
|
|
108
108
|
}
|
|
109
109
|
const iconDataItem = detreeNodeDataItems === null || detreeNodeDataItems === void 0 ? void 0 : detreeNodeDataItems.find(item => item.id === 'icon');
|
|
110
110
|
if (iconDataItem) {
|
|
@@ -122,7 +122,7 @@ export class TreeDataSetNodeData extends TreeNodeData {
|
|
|
122
122
|
*/
|
|
123
123
|
calcDataItemScript(dataItem) {
|
|
124
124
|
if (dataItem.customCode && dataItem.scriptCode) {
|
|
125
|
-
return ScriptFactory.execScriptFn({ data: this.
|
|
125
|
+
return ScriptFactory.execScriptFn({ data: this._deData }, dataItem.scriptCode, {
|
|
126
126
|
isAsync: false,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -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;gBAGjB,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"}
|
|
@@ -9,22 +9,22 @@ import { createUUID } from 'qx-util';
|
|
|
9
9
|
export class TreeNodeData {
|
|
10
10
|
constructor(model, parentNodeData, opts) {
|
|
11
11
|
this._uuid = createUUID();
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
12
|
+
this._leaf = false;
|
|
13
|
+
this._leaf = opts.leaf === true;
|
|
14
|
+
this._parent = parentNodeData;
|
|
15
15
|
this._nodeType = model.treeNodeType;
|
|
16
16
|
// 所有节点都要继承父的上下文,如果父存在则复制父的资源上下文,否则返回空对象。
|
|
17
|
-
if (this.
|
|
18
|
-
this.
|
|
17
|
+
if (this._parent) {
|
|
18
|
+
this._context = Object.assign({}, this._parent._context);
|
|
19
19
|
}
|
|
20
20
|
// 附加导航上下文和视图参数
|
|
21
21
|
if (opts.navContext) {
|
|
22
|
-
this.
|
|
22
|
+
this._context = Object.assign(this._context || {}, opts.navContext);
|
|
23
23
|
}
|
|
24
24
|
if (opts.navParams) {
|
|
25
|
-
this.
|
|
25
|
+
this._params = Object.assign({}, opts.navParams);
|
|
26
26
|
}
|
|
27
|
-
this.
|
|
27
|
+
this._nodeId = model.id;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* 计算节点图标
|
|
@@ -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;CAuCrD"}
|
|
@@ -15,30 +15,30 @@ export class TreeStaticNodeData extends TreeNodeData {
|
|
|
15
15
|
const nodeValue = model.nodeValue === 'root' ? undefined : model.nodeValue;
|
|
16
16
|
// id小写
|
|
17
17
|
const selfId = `${model.id}`.toLowerCase();
|
|
18
|
-
Object.defineProperty(this, '
|
|
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.2",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.5.
|
|
33
|
-
"@ibiz/model-core": "^0.1.
|
|
32
|
+
"@ibiz-template/core": "^0.5.1-beta.2",
|
|
33
|
+
"@ibiz/model-core": "^0.1.1",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.11",
|
|
36
36
|
"@types/systemjs": "^6.13.5",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
50
|
-
"@ibiz/model-core": "^0.1.
|
|
50
|
+
"@ibiz/model-core": "^0.1.1",
|
|
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": "322c526eb9b9e20e44714164911542d0851ebfa1"
|
|
63
63
|
}
|
|
@@ -53,7 +53,7 @@ export class TreeExpBarController
|
|
|
53
53
|
* @date 2023-07-10 03:07:11
|
|
54
54
|
* @memberof TreeExpBarController
|
|
55
55
|
*/
|
|
56
|
-
navKeyName = '
|
|
56
|
+
navKeyName = '_id' as const;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* 有导航视图的节点模型标识集合
|
|
@@ -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
|
);
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { IEditor, ISearchBarFilter } from '@ibiz/model-core';
|
|
1
|
+
import { IDropDownList, IEditor, ISearchBarFilter } from '@ibiz/model-core';
|
|
2
2
|
import { ValueOP } from '../../../constant';
|
|
3
3
|
import { SearchBarController } from './search-bar.controller';
|
|
4
4
|
import { ExcludeOPs } from './search-bar-filter.controller';
|
|
5
5
|
|
|
6
|
+
type ISchemaField = {
|
|
7
|
+
type: string;
|
|
8
|
+
key: string;
|
|
9
|
+
description: string;
|
|
10
|
+
enumSource?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
6
13
|
const appId = '';
|
|
7
14
|
|
|
8
15
|
/** 数据类型映射操作符号 */
|
|
@@ -91,6 +98,21 @@ function initDefaultEditor(): void {
|
|
|
91
98
|
|
|
92
99
|
initDefaultEditor();
|
|
93
100
|
|
|
101
|
+
function getEditor(field: ISchemaField, op: string): IEditor {
|
|
102
|
+
if (field.enumSource) {
|
|
103
|
+
return {
|
|
104
|
+
appId,
|
|
105
|
+
editorType: 'DROPDOWNLIST',
|
|
106
|
+
singleSelect: true,
|
|
107
|
+
valueType: 'SIMPLE',
|
|
108
|
+
appCodeListId: field.enumSource,
|
|
109
|
+
id: `${field.key}_${op}`,
|
|
110
|
+
} as IDropDownList;
|
|
111
|
+
}
|
|
112
|
+
const editorModel = EditorsMap[`${field.type}_${op}`];
|
|
113
|
+
return editorModel;
|
|
114
|
+
}
|
|
115
|
+
|
|
94
116
|
/**
|
|
95
117
|
* 根据json模型计算出过滤项模型
|
|
96
118
|
* @author lxm
|
|
@@ -100,10 +122,10 @@ initDefaultEditor();
|
|
|
100
122
|
* @param {SearchBarController} c
|
|
101
123
|
* @return {*} {ISearchBarFilter[]}
|
|
102
124
|
*/
|
|
103
|
-
export function calcFilterModelBySchema(
|
|
125
|
+
export async function calcFilterModelBySchema(
|
|
104
126
|
json: IData,
|
|
105
127
|
c: SearchBarController,
|
|
106
|
-
): ISearchBarFilter[] {
|
|
128
|
+
): Promise<ISearchBarFilter[]> {
|
|
107
129
|
if (!json.properties) {
|
|
108
130
|
return [];
|
|
109
131
|
}
|
|
@@ -112,11 +134,7 @@ export function calcFilterModelBySchema(
|
|
|
112
134
|
return [];
|
|
113
135
|
}
|
|
114
136
|
|
|
115
|
-
const addFields:
|
|
116
|
-
key: string;
|
|
117
|
-
description: string;
|
|
118
|
-
type: string;
|
|
119
|
-
}[] = [];
|
|
137
|
+
const addFields: ISchemaField[] = [];
|
|
120
138
|
|
|
121
139
|
Object.keys(properties).forEach((key: string) => {
|
|
122
140
|
let type: string;
|
|
@@ -141,12 +159,17 @@ export function calcFilterModelBySchema(
|
|
|
141
159
|
key,
|
|
142
160
|
description: properties[key].description,
|
|
143
161
|
type,
|
|
162
|
+
enumSource: properties[key].enumSource,
|
|
144
163
|
});
|
|
145
164
|
});
|
|
146
165
|
|
|
147
166
|
// 属性codeName对应的属性id
|
|
148
167
|
const codeNameToId: { [p: string]: string } = {};
|
|
149
|
-
|
|
168
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
169
|
+
c.model.appDataEntityId!,
|
|
170
|
+
c.model.appId,
|
|
171
|
+
);
|
|
172
|
+
dataEntity.appDEFields?.forEach(field => {
|
|
150
173
|
codeNameToId[field.codeName!.toLowerCase()] = field.id!;
|
|
151
174
|
});
|
|
152
175
|
|
|
@@ -159,18 +182,18 @@ export function calcFilterModelBySchema(
|
|
|
159
182
|
return;
|
|
160
183
|
}
|
|
161
184
|
ops.forEach(op => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
appId,
|
|
165
|
-
appDEFieldId: codeNameToId[item.key],
|
|
166
|
-
id: item.key,
|
|
167
|
-
caption: item.description,
|
|
168
|
-
defsearchMode: {
|
|
185
|
+
if (item)
|
|
186
|
+
addSearchBarFilters.push({
|
|
169
187
|
appId,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
appDEFieldId: codeNameToId[item.key],
|
|
189
|
+
id: item.key,
|
|
190
|
+
caption: item.description,
|
|
191
|
+
defsearchMode: {
|
|
192
|
+
appId,
|
|
193
|
+
valueOP: op,
|
|
194
|
+
},
|
|
195
|
+
editor: getEditor(item, op),
|
|
196
|
+
});
|
|
174
197
|
});
|
|
175
198
|
});
|
|
176
199
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recursiveIterate,
|
|
5
5
|
} from '@ibiz-template/core';
|
|
6
6
|
import { IAppDataEntity, ISearchBar, ISearchBarFilter } from '@ibiz/model-core';
|
|
7
|
-
import { isNil } from 'ramda';
|
|
7
|
+
import { clone, isNil } from 'ramda';
|
|
8
8
|
import {
|
|
9
9
|
ISearchBarState,
|
|
10
10
|
ISearchBarEvent,
|
|
@@ -79,7 +79,9 @@ export class SearchBarController
|
|
|
79
79
|
* @date 2023-12-29 04:15:34
|
|
80
80
|
* @type {boolean}
|
|
81
81
|
*/
|
|
82
|
-
enableFilter: boolean
|
|
82
|
+
get enableFilter(): boolean {
|
|
83
|
+
return this.model.enableFilter === true;
|
|
84
|
+
}
|
|
83
85
|
|
|
84
86
|
/**
|
|
85
87
|
* 最终使用的searchBarFilters
|
|
@@ -87,7 +89,16 @@ export class SearchBarController
|
|
|
87
89
|
* @date 2023-12-29 06:55:13
|
|
88
90
|
* @type {ISearchBarFilter[]}
|
|
89
91
|
*/
|
|
90
|
-
searchBarFilters
|
|
92
|
+
get searchBarFilters(): ISearchBarFilter[] {
|
|
93
|
+
return this.model.searchBarFilters || [];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 是否启用根据实体的JSON Schema生成过滤项
|
|
98
|
+
* @author lxm
|
|
99
|
+
* @date 2024-01-05 10:10:37
|
|
100
|
+
*/
|
|
101
|
+
addSchemaFilters = false;
|
|
91
102
|
|
|
92
103
|
/**
|
|
93
104
|
* 表格控制器
|
|
@@ -113,16 +124,6 @@ export class SearchBarController
|
|
|
113
124
|
this.state.selectedGroupItem = null;
|
|
114
125
|
this.state.searchBarGroups = [];
|
|
115
126
|
this.state.selectedSearchGroupItem = null;
|
|
116
|
-
this.initFilterState();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 初始化Filter相关的属性
|
|
121
|
-
* @author lxm
|
|
122
|
-
* @date 2023-12-29 04:18:02
|
|
123
|
-
* @protected
|
|
124
|
-
*/
|
|
125
|
-
protected initFilterState(): void {
|
|
126
127
|
this.resetFilter();
|
|
127
128
|
this.state.visible = !!(
|
|
128
129
|
this.model.enableQuickSearch ||
|
|
@@ -132,6 +133,8 @@ export class SearchBarController
|
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
protected async onCreated(): Promise<void> {
|
|
136
|
+
await this.initByEntitySchema();
|
|
137
|
+
|
|
135
138
|
await super.onCreated();
|
|
136
139
|
|
|
137
140
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
@@ -149,7 +152,6 @@ export class SearchBarController
|
|
|
149
152
|
await this.service.init(this.context);
|
|
150
153
|
}
|
|
151
154
|
|
|
152
|
-
await this.initByEntitySchema();
|
|
153
155
|
await this.initSearchBarFilters();
|
|
154
156
|
await this.initSearBarGroups();
|
|
155
157
|
}
|
|
@@ -161,12 +163,17 @@ export class SearchBarController
|
|
|
161
163
|
* @return {*} {Promise<void>}
|
|
162
164
|
*/
|
|
163
165
|
async initByEntitySchema(): Promise<void> {
|
|
164
|
-
this.
|
|
165
|
-
|
|
166
|
+
if (!this.addSchemaFilters) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const json = await getEntitySchema(
|
|
170
|
+
this.model.appDataEntityId!,
|
|
171
|
+
this.context,
|
|
172
|
+
);
|
|
166
173
|
if (!json) {
|
|
167
174
|
return;
|
|
168
175
|
}
|
|
169
|
-
const addSearchBarFilters = calcFilterModelBySchema(json, this);
|
|
176
|
+
const addSearchBarFilters = await calcFilterModelBySchema(json, this);
|
|
170
177
|
|
|
171
178
|
const mergeFilters: ISearchBarFilter[] = [];
|
|
172
179
|
this.model.searchBarFilters?.forEach(filter => {
|
|
@@ -182,9 +189,13 @@ export class SearchBarController
|
|
|
182
189
|
}
|
|
183
190
|
});
|
|
184
191
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
192
|
+
// 如果有根据json计算出的过滤项,则要重置相关state参数
|
|
193
|
+
if (addSearchBarFilters.length > 0) {
|
|
194
|
+
// 修改模型之前拷贝一份,避免污染原始数据
|
|
195
|
+
(this as IData).model = clone(this.model);
|
|
196
|
+
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
197
|
+
this.model.enableFilter = true;
|
|
198
|
+
}
|
|
188
199
|
}
|
|
189
200
|
|
|
190
201
|
/**
|
|
@@ -311,7 +322,7 @@ export class SearchBarController
|
|
|
311
322
|
* @return {*} {IData}
|
|
312
323
|
*/
|
|
313
324
|
calcFilters(): IData[] | undefined {
|
|
314
|
-
if (!this.
|
|
325
|
+
if (!this.enableFilter) {
|
|
315
326
|
return;
|
|
316
327
|
}
|
|
317
328
|
let hasFilter = false; // 是否有过滤项
|