@ibiz-template/runtime 0.5.0 → 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 +121 -122
- package/dist/index.system.min.js +1 -1
- 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/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 +58 -58
- package/out/controller/control/tree/tree.service.js +8 -8
- 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.state.d.ts +26 -25
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- 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 +2 -2
- 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/tree/tree.controller.ts +60 -60
- package/src/controller/control/tree/tree.service.ts +8 -8
- package/src/interface/controller/state/control/i-gantt.state.ts +2 -2
- package/src/interface/controller/state/control/i-tree.state.ts +27 -25
- 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
package/dist/index.esm.js
CHANGED
|
@@ -9133,22 +9133,24 @@ function presetDEMethodProvider() {
|
|
|
9133
9133
|
// src/service/vo/tree-node-data/tree-node-data.ts
|
|
9134
9134
|
import { createUUID as createUUID5 } from "qx-util";
|
|
9135
9135
|
var TreeNodeData = class {
|
|
9136
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9137
|
+
// [key: string | symbol]: any;
|
|
9136
9138
|
constructor(model, parentNodeData, opts) {
|
|
9137
9139
|
this._uuid = createUUID5();
|
|
9138
|
-
this.
|
|
9139
|
-
this.
|
|
9140
|
-
this.
|
|
9140
|
+
this._leaf = false;
|
|
9141
|
+
this._leaf = opts.leaf === true;
|
|
9142
|
+
this._parent = parentNodeData;
|
|
9141
9143
|
this._nodeType = model.treeNodeType;
|
|
9142
|
-
if (this.
|
|
9143
|
-
this.
|
|
9144
|
+
if (this._parent) {
|
|
9145
|
+
this._context = { ...this._parent._context };
|
|
9144
9146
|
}
|
|
9145
9147
|
if (opts.navContext) {
|
|
9146
|
-
this.
|
|
9148
|
+
this._context = Object.assign(this._context || {}, opts.navContext);
|
|
9147
9149
|
}
|
|
9148
9150
|
if (opts.navParams) {
|
|
9149
|
-
this.
|
|
9151
|
+
this._params = { ...opts.navParams };
|
|
9150
9152
|
}
|
|
9151
|
-
this.
|
|
9153
|
+
this._nodeId = model.id;
|
|
9152
9154
|
}
|
|
9153
9155
|
/**
|
|
9154
9156
|
* 计算节点图标
|
|
@@ -9178,25 +9180,25 @@ var TreeCodeListNodeData = class extends TreeNodeData {
|
|
|
9178
9180
|
constructor(model, parentNodeData, opts) {
|
|
9179
9181
|
super(model, parentNodeData, opts);
|
|
9180
9182
|
const { data } = opts;
|
|
9181
|
-
this.
|
|
9182
|
-
this.
|
|
9183
|
-
const selfId = "".concat(model.id, "@").concat(this.
|
|
9183
|
+
this._text = data.text;
|
|
9184
|
+
this._value = data.value;
|
|
9185
|
+
const selfId = "".concat(model.id, "@").concat(this._value).toLowerCase();
|
|
9184
9186
|
Object.defineProperty(this, "id", {
|
|
9185
9187
|
get() {
|
|
9186
|
-
return this.
|
|
9188
|
+
return this._parent ? "".concat(this._parent.id, ":").concat(selfId) : selfId;
|
|
9187
9189
|
},
|
|
9188
9190
|
enumerable: true,
|
|
9189
9191
|
configurable: true
|
|
9190
9192
|
});
|
|
9191
9193
|
if (model.appDataEntityId) {
|
|
9192
9194
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
9193
|
-
this.
|
|
9194
|
-
[deName]: this.
|
|
9195
|
+
this._context = Object.assign(this._context || {}, {
|
|
9196
|
+
[deName]: this._value
|
|
9195
9197
|
});
|
|
9196
9198
|
}
|
|
9197
|
-
this.srfkey = this.
|
|
9198
|
-
this.srfmajortext = this.
|
|
9199
|
-
this.
|
|
9199
|
+
this.srfkey = this._value;
|
|
9200
|
+
this.srfmajortext = this._text;
|
|
9201
|
+
this._icon = this.calcIcon(model);
|
|
9200
9202
|
}
|
|
9201
9203
|
};
|
|
9202
9204
|
|
|
@@ -9207,29 +9209,27 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9207
9209
|
var _a;
|
|
9208
9210
|
super(model, parentNodeData, opts);
|
|
9209
9211
|
const { data } = opts;
|
|
9210
|
-
this.
|
|
9211
|
-
this.
|
|
9212
|
-
this.
|
|
9212
|
+
this._deData = data;
|
|
9213
|
+
this._text = model.textAppDEFieldId ? data[model.textAppDEFieldId] : data.srfmajortext;
|
|
9214
|
+
this._value = model.idAppDEFieldId ? data[model.idAppDEFieldId] : data.srfkey;
|
|
9213
9215
|
const selfId = "".concat(model.id, "@").concat(data.srfkey).toLowerCase();
|
|
9214
9216
|
Object.defineProperty(this, "id", {
|
|
9215
9217
|
get() {
|
|
9216
|
-
return this.
|
|
9218
|
+
return this._parent ? "".concat(this._parent.id, ":").concat(selfId) : selfId;
|
|
9217
9219
|
},
|
|
9218
9220
|
enumerable: true,
|
|
9219
9221
|
configurable: true
|
|
9220
9222
|
});
|
|
9221
9223
|
if (model.appDataEntityId) {
|
|
9222
9224
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
9223
|
-
this.
|
|
9225
|
+
this._context = Object.assign(this._context || {}, {
|
|
9224
9226
|
[deName]: data.srfkey
|
|
9225
9227
|
});
|
|
9226
9228
|
}
|
|
9227
|
-
this.
|
|
9228
|
-
this.
|
|
9229
|
-
this.icon = this.calcIcon(model);
|
|
9230
|
-
this.textHtml = this.calcTextHtml(model);
|
|
9229
|
+
this._icon = this.calcIcon(model);
|
|
9230
|
+
this._textHtml = this.calcTextHtml(model);
|
|
9231
9231
|
if (model.leafFlagAppDEFieldId) {
|
|
9232
|
-
this.
|
|
9232
|
+
this._leaf = fieldValueToBoolean(data[model.leafFlagAppDEFieldId]);
|
|
9233
9233
|
}
|
|
9234
9234
|
const dataItemkeyMap = /* @__PURE__ */ new Map();
|
|
9235
9235
|
const dataItemDefaults = {};
|
|
@@ -9243,10 +9243,10 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9243
9243
|
});
|
|
9244
9244
|
return new Proxy(this, {
|
|
9245
9245
|
set(target, p, value) {
|
|
9246
|
-
if (Object.prototype.hasOwnProperty.call(target.
|
|
9247
|
-
target.
|
|
9246
|
+
if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
|
|
9247
|
+
target._deData[p] = value;
|
|
9248
9248
|
} else if (dataItemkeyMap.has(p)) {
|
|
9249
|
-
target.
|
|
9249
|
+
target._deData[dataItemkeyMap.get(p)] = value;
|
|
9250
9250
|
} else {
|
|
9251
9251
|
target[p] = value;
|
|
9252
9252
|
}
|
|
@@ -9257,10 +9257,10 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9257
9257
|
return target[p];
|
|
9258
9258
|
}
|
|
9259
9259
|
if (dataItemkeyMap.has(p)) {
|
|
9260
|
-
return target.
|
|
9260
|
+
return target._deData[dataItemkeyMap.get(p)] || dataItemDefaults[p];
|
|
9261
9261
|
}
|
|
9262
|
-
if (target.
|
|
9263
|
-
return target.
|
|
9262
|
+
if (target._deData[p] !== void 0) {
|
|
9263
|
+
return target._deData[p];
|
|
9264
9264
|
}
|
|
9265
9265
|
},
|
|
9266
9266
|
ownKeys(target) {
|
|
@@ -9268,7 +9268,7 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9268
9268
|
.../* @__PURE__ */ new Set([
|
|
9269
9269
|
...Object.keys(target),
|
|
9270
9270
|
...dataItemkeyMap.keys(),
|
|
9271
|
-
...Object.keys(target.
|
|
9271
|
+
...Object.keys(target._deData)
|
|
9272
9272
|
])
|
|
9273
9273
|
];
|
|
9274
9274
|
updateKeyDefine(target, allKeys);
|
|
@@ -9279,11 +9279,11 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9279
9279
|
calcIcon(model) {
|
|
9280
9280
|
const icon = super.calcIcon(model) || {};
|
|
9281
9281
|
const { iconAppDEFieldId, detreeNodeDataItems } = model;
|
|
9282
|
-
if (iconAppDEFieldId && this.
|
|
9283
|
-
icon.imagePath = this.
|
|
9282
|
+
if (iconAppDEFieldId && this._deData[iconAppDEFieldId]) {
|
|
9283
|
+
icon.imagePath = this._deData[iconAppDEFieldId];
|
|
9284
9284
|
}
|
|
9285
9285
|
if (icon) {
|
|
9286
|
-
this.
|
|
9286
|
+
this._icon = icon;
|
|
9287
9287
|
}
|
|
9288
9288
|
const iconDataItem = detreeNodeDataItems == null ? void 0 : detreeNodeDataItems.find((item) => item.id === "icon");
|
|
9289
9289
|
if (iconDataItem) {
|
|
@@ -9302,7 +9302,7 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9302
9302
|
calcDataItemScript(dataItem) {
|
|
9303
9303
|
if (dataItem.customCode && dataItem.scriptCode) {
|
|
9304
9304
|
return ScriptFactory.execScriptFn(
|
|
9305
|
-
{ data: this.
|
|
9305
|
+
{ data: this._deData },
|
|
9306
9306
|
dataItem.scriptCode,
|
|
9307
9307
|
{
|
|
9308
9308
|
isAsync: false
|
|
@@ -9338,26 +9338,26 @@ var TreeStaticNodeData = class extends TreeNodeData {
|
|
|
9338
9338
|
const selfId = "".concat(model.id).toLowerCase();
|
|
9339
9339
|
Object.defineProperty(this, "id", {
|
|
9340
9340
|
get() {
|
|
9341
|
-
return this.
|
|
9341
|
+
return this._parent ? "".concat(this._parent.id, ":").concat(selfId) : selfId;
|
|
9342
9342
|
},
|
|
9343
9343
|
enumerable: true,
|
|
9344
9344
|
configurable: true
|
|
9345
9345
|
});
|
|
9346
|
-
this.
|
|
9347
|
-
this.
|
|
9346
|
+
this._text = model.text;
|
|
9347
|
+
this._value = nodeValue;
|
|
9348
9348
|
if (parentNodeData && opts.parentValueLevel) {
|
|
9349
9349
|
let parent = parentNodeData;
|
|
9350
9350
|
for (let index = 1; index < opts.parentValueLevel; index++) {
|
|
9351
|
-
parent = parent == null ? void 0 : parent.
|
|
9351
|
+
parent = parent == null ? void 0 : parent._parent;
|
|
9352
9352
|
}
|
|
9353
|
-
if (parent == null ? void 0 : parent.
|
|
9354
|
-
this.
|
|
9353
|
+
if (parent == null ? void 0 : parent._deData) {
|
|
9354
|
+
this._deData = parent._deData;
|
|
9355
9355
|
}
|
|
9356
|
-
this.
|
|
9356
|
+
this._value = nodeValue || (parent == null ? void 0 : parent._value);
|
|
9357
9357
|
}
|
|
9358
|
-
this.srfkey = ((_a = this.
|
|
9359
|
-
this.srfmajortext = ((_b = this.
|
|
9360
|
-
this.
|
|
9358
|
+
this.srfkey = ((_a = this._deData) == null ? void 0 : _a.srfkey) || this._value;
|
|
9359
|
+
this.srfmajortext = ((_b = this._deData) == null ? void 0 : _b.srfmajortext) || this._text;
|
|
9360
|
+
this._icon = this.calcIcon(model);
|
|
9361
9361
|
}
|
|
9362
9362
|
};
|
|
9363
9363
|
|
|
@@ -18734,7 +18734,6 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18734
18734
|
*
|
|
18735
18735
|
* @author zk
|
|
18736
18736
|
* @date 2023-05-29 03:05:36
|
|
18737
|
-
* @param {IData} data
|
|
18738
18737
|
* @memberof ExpBarControlController
|
|
18739
18738
|
*/
|
|
18740
18739
|
xDataActive(event) {
|
|
@@ -18751,11 +18750,11 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18751
18750
|
* @memberof TabExpPanelController
|
|
18752
18751
|
*/
|
|
18753
18752
|
getNavViewMsg(node, context, params) {
|
|
18754
|
-
const nodeId = node.
|
|
18755
|
-
const deData = node.
|
|
18756
|
-
const nodeModel = this.getNodeModel(node.
|
|
18753
|
+
const nodeId = node._id;
|
|
18754
|
+
const deData = node._deData || node;
|
|
18755
|
+
const nodeModel = this.getNodeModel(node._nodeId);
|
|
18757
18756
|
if (!nodeModel) {
|
|
18758
|
-
throw new RuntimeError49("\u627E\u4E0D\u5230".concat(node.
|
|
18757
|
+
throw new RuntimeError49("\u627E\u4E0D\u5230".concat(node._nodeId, "\u7684\u8282\u70B9\u6A21\u578B"));
|
|
18759
18758
|
}
|
|
18760
18759
|
const result = this.prepareParams(nodeModel, deData, context, params);
|
|
18761
18760
|
result.context.currentSrfNav = nodeId;
|
|
@@ -18775,7 +18774,7 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18775
18774
|
if (this.state.noNeedNavView) {
|
|
18776
18775
|
return true;
|
|
18777
18776
|
}
|
|
18778
|
-
return this.navNodeModelIds.includes(node.
|
|
18777
|
+
return this.navNodeModelIds.includes(node._nodeId);
|
|
18779
18778
|
});
|
|
18780
18779
|
if (!data) {
|
|
18781
18780
|
return;
|
|
@@ -26000,7 +25999,7 @@ var TreeService = class extends MDControlService {
|
|
|
26000
25999
|
);
|
|
26001
26000
|
} else {
|
|
26002
26001
|
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
26003
|
-
parentId: parentNodeData == null ? void 0 : parentNodeData.
|
|
26002
|
+
parentId: parentNodeData == null ? void 0 : parentNodeData._nodeId,
|
|
26004
26003
|
hasQuery
|
|
26005
26004
|
});
|
|
26006
26005
|
if (childNodeRSs.length === 0) {
|
|
@@ -26086,13 +26085,13 @@ var TreeService = class extends MDControlService {
|
|
|
26086
26085
|
result.map(async (childNode, index) => {
|
|
26087
26086
|
var _a;
|
|
26088
26087
|
if (expanded && // 全展开合只展开首节点expanded都为true
|
|
26089
|
-
(!expandFirstOnly || expandFirstOnly && index === 0) || ((_a = opts.defaultExpandedKeys) == null ? void 0 : _a.length) && opts.defaultExpandedKeys.includes(childNode.
|
|
26088
|
+
(!expandFirstOnly || expandFirstOnly && index === 0) || ((_a = opts.defaultExpandedKeys) == null ? void 0 : _a.length) && opts.defaultExpandedKeys.includes(childNode._id) || // 外部回显给的默认展开节点集合有的展开
|
|
26090
26089
|
isExpandedRoot) {
|
|
26091
26090
|
const subChildrenNodes = await this.fetchChildNodes(
|
|
26092
26091
|
childNode,
|
|
26093
26092
|
opts
|
|
26094
26093
|
);
|
|
26095
|
-
childNode.
|
|
26094
|
+
childNode._children = subChildrenNodes;
|
|
26096
26095
|
}
|
|
26097
26096
|
})
|
|
26098
26097
|
);
|
|
@@ -26136,25 +26135,25 @@ var TreeService = class extends MDControlService {
|
|
|
26136
26135
|
const params = { ...opts.params };
|
|
26137
26136
|
const context = {
|
|
26138
26137
|
...opts.context,
|
|
26139
|
-
...(parentNodeData == null ? void 0 : parentNodeData.
|
|
26138
|
+
...(parentNodeData == null ? void 0 : parentNodeData._context) || {}
|
|
26140
26139
|
};
|
|
26141
26140
|
let data = {};
|
|
26142
26141
|
let parentData;
|
|
26143
26142
|
if (parentNodeData) {
|
|
26144
26143
|
parentData = parentNodeData;
|
|
26145
26144
|
for (let index = 1; index < parentValueLevel; index++) {
|
|
26146
|
-
parentData = parentData == null ? void 0 : parentData.
|
|
26145
|
+
parentData = parentData == null ? void 0 : parentData._parent;
|
|
26147
26146
|
}
|
|
26148
26147
|
}
|
|
26149
26148
|
let derValue;
|
|
26150
26149
|
let deName;
|
|
26151
26150
|
if (parentData) {
|
|
26152
|
-
data = parentData.
|
|
26153
|
-
const parentNodeModel = getTreeNode(this.model, parentData.
|
|
26151
|
+
data = parentData._deData || {};
|
|
26152
|
+
const parentNodeModel = getTreeNode(this.model, parentData._nodeId);
|
|
26154
26153
|
if (parentNodeModel.appDataEntityId) {
|
|
26155
26154
|
deName = calcDeCodeNameById(parentNodeModel.appDataEntityId);
|
|
26156
26155
|
}
|
|
26157
|
-
derValue = parentData.
|
|
26156
|
+
derValue = parentData._value;
|
|
26158
26157
|
}
|
|
26159
26158
|
const { resultContext, resultParams } = calcNavParams(
|
|
26160
26159
|
{
|
|
@@ -26476,7 +26475,7 @@ var TreeController = class extends MDControlController {
|
|
|
26476
26475
|
this.state.isLoading = false;
|
|
26477
26476
|
}
|
|
26478
26477
|
if (parentNode) {
|
|
26479
|
-
parentNode.
|
|
26478
|
+
parentNode._children = nodes;
|
|
26480
26479
|
} else {
|
|
26481
26480
|
this.state.rootNodes = nodes;
|
|
26482
26481
|
}
|
|
@@ -26509,7 +26508,7 @@ var TreeController = class extends MDControlController {
|
|
|
26509
26508
|
*/
|
|
26510
26509
|
async onTreeNodeClick(nodeData, event) {
|
|
26511
26510
|
var _a;
|
|
26512
|
-
const clickActionItem = (_a = this.contextMenuInfos[nodeData.
|
|
26511
|
+
const clickActionItem = (_a = this.contextMenuInfos[nodeData._nodeId]) == null ? void 0 : _a.clickTBUIActionItem;
|
|
26513
26512
|
if (clickActionItem) {
|
|
26514
26513
|
return this.doUIAction(
|
|
26515
26514
|
clickActionItem.uiactionId,
|
|
@@ -26519,14 +26518,14 @@ var TreeController = class extends MDControlController {
|
|
|
26519
26518
|
);
|
|
26520
26519
|
}
|
|
26521
26520
|
if (this.state.navigational) {
|
|
26522
|
-
const nodeModel = this.getNodeModel(nodeData.
|
|
26521
|
+
const nodeModel = this.getNodeModel(nodeData._nodeId);
|
|
26523
26522
|
if (!(nodeModel == null ? void 0 : nodeModel.navAppViewId)) {
|
|
26524
26523
|
return;
|
|
26525
26524
|
}
|
|
26526
26525
|
}
|
|
26527
26526
|
if (this.state.singleSelect) {
|
|
26528
26527
|
const { selectedData } = this.state;
|
|
26529
|
-
const filterArr = selectedData.filter((item) => item.
|
|
26528
|
+
const filterArr = selectedData.filter((item) => item._id !== nodeData._id);
|
|
26530
26529
|
if (filterArr.length === selectedData.length) {
|
|
26531
26530
|
this.setSelection(
|
|
26532
26531
|
this.state.singleSelect ? [nodeData] : selectedData.concat([nodeData])
|
|
@@ -26547,11 +26546,11 @@ var TreeController = class extends MDControlController {
|
|
|
26547
26546
|
* @param {boolean} isExpand true为展开,false为折叠
|
|
26548
26547
|
*/
|
|
26549
26548
|
onExpandChange(nodeData, isExpand) {
|
|
26550
|
-
const hasKey = this.state.expandedKeys.includes(nodeData.
|
|
26549
|
+
const hasKey = this.state.expandedKeys.includes(nodeData._id);
|
|
26551
26550
|
if (isExpand && !hasKey) {
|
|
26552
|
-
this.state.expandedKeys.push(nodeData.
|
|
26551
|
+
this.state.expandedKeys.push(nodeData._id);
|
|
26553
26552
|
} else if (!isExpand && hasKey) {
|
|
26554
|
-
const index = this.state.expandedKeys.indexOf(nodeData.
|
|
26553
|
+
const index = this.state.expandedKeys.indexOf(nodeData._id);
|
|
26555
26554
|
if (index !== -1) {
|
|
26556
26555
|
this.state.expandedKeys.splice(index, 1);
|
|
26557
26556
|
}
|
|
@@ -26574,9 +26573,9 @@ var TreeController = class extends MDControlController {
|
|
|
26574
26573
|
return this._evt.emit("onActive", { ...nodeParams, nodeData: item });
|
|
26575
26574
|
}
|
|
26576
26575
|
setSelection(selection) {
|
|
26577
|
-
const selectionIds = selection.map((item) => item.
|
|
26576
|
+
const selectionIds = selection.map((item) => item._id);
|
|
26578
26577
|
const filterArr = this.state.items.filter(
|
|
26579
|
-
(item) => selectionIds.includes(item.
|
|
26578
|
+
(item) => selectionIds.includes(item._id)
|
|
26580
26579
|
);
|
|
26581
26580
|
super.setSelection(filterArr);
|
|
26582
26581
|
}
|
|
@@ -26599,7 +26598,7 @@ var TreeController = class extends MDControlController {
|
|
|
26599
26598
|
* @return {*} {(ITreeNodeData | undefined)}
|
|
26600
26599
|
*/
|
|
26601
26600
|
getNodeData(key) {
|
|
26602
|
-
const find = this.state.items.find((item) => item.
|
|
26601
|
+
const find = this.state.items.find((item) => item._id === key);
|
|
26603
26602
|
if (find) {
|
|
26604
26603
|
return find;
|
|
26605
26604
|
}
|
|
@@ -26654,9 +26653,9 @@ var TreeController = class extends MDControlController {
|
|
|
26654
26653
|
*/
|
|
26655
26654
|
parseTreeNodeData(nodeData) {
|
|
26656
26655
|
return {
|
|
26657
|
-
data: [{ ...nodeData, ...nodeData.
|
|
26658
|
-
context: Object.assign(this.context.clone(), nodeData.
|
|
26659
|
-
params: { ...this.params, ...nodeData.
|
|
26656
|
+
data: [{ ...nodeData, ...nodeData._deData || {} }],
|
|
26657
|
+
context: Object.assign(this.context.clone(), nodeData._context || {}),
|
|
26658
|
+
params: { ...this.params, ...nodeData._params || {} }
|
|
26660
26659
|
};
|
|
26661
26660
|
}
|
|
26662
26661
|
/**
|
|
@@ -26671,8 +26670,8 @@ var TreeController = class extends MDControlController {
|
|
|
26671
26670
|
let expandedKeys = [...this.state.expandedKeys];
|
|
26672
26671
|
recursiveIterate10({ children: nodes }, (node) => {
|
|
26673
26672
|
var _a;
|
|
26674
|
-
if ((_a = node.
|
|
26675
|
-
expandedKeys.push(node.
|
|
26673
|
+
if ((_a = node._children) == null ? void 0 : _a.length) {
|
|
26674
|
+
expandedKeys.push(node._id);
|
|
26676
26675
|
}
|
|
26677
26676
|
});
|
|
26678
26677
|
expandedKeys = Array.from(new Set(expandedKeys));
|
|
@@ -26687,7 +26686,7 @@ var TreeController = class extends MDControlController {
|
|
|
26687
26686
|
* @return {*} {Promise<void>}
|
|
26688
26687
|
*/
|
|
26689
26688
|
async refreshNodeChildren(nodeData, refreshParent = false) {
|
|
26690
|
-
const key = nodeData.srfkey ? "srfkey" : "
|
|
26689
|
+
const key = nodeData.srfkey ? "srfkey" : "_id";
|
|
26691
26690
|
const currentNode = this.state.items.find(
|
|
26692
26691
|
(item) => item[key] === nodeData[key]
|
|
26693
26692
|
);
|
|
@@ -26696,13 +26695,13 @@ var TreeController = class extends MDControlController {
|
|
|
26696
26695
|
return;
|
|
26697
26696
|
}
|
|
26698
26697
|
if (refreshParent) {
|
|
26699
|
-
const {
|
|
26700
|
-
if (!
|
|
26698
|
+
const { _parent } = currentNode;
|
|
26699
|
+
if (!_parent || !this.model.rootVisible && this.state.rootNodes.includes(_parent)) {
|
|
26701
26700
|
await this.refresh();
|
|
26702
26701
|
return;
|
|
26703
26702
|
}
|
|
26704
26703
|
}
|
|
26705
|
-
const targetNode = refreshParent ? currentNode.
|
|
26704
|
+
const targetNode = refreshParent ? currentNode._parent : currentNode;
|
|
26706
26705
|
const nodes = await this.loadNodes(targetNode);
|
|
26707
26706
|
this._evt.emit("onAfterRefreshParent", {
|
|
26708
26707
|
parentNode: targetNode,
|
|
@@ -26717,7 +26716,7 @@ var TreeController = class extends MDControlController {
|
|
|
26717
26716
|
return;
|
|
26718
26717
|
}
|
|
26719
26718
|
const existNodes = this.state.items.filter(
|
|
26720
|
-
(item) => noExpandKeys.includes(item.
|
|
26719
|
+
(item) => noExpandKeys.includes(item._id)
|
|
26721
26720
|
);
|
|
26722
26721
|
this.state.expandedKeys.push(...noExpandKeys);
|
|
26723
26722
|
if (existNodes.length === 0) {
|
|
@@ -26737,7 +26736,7 @@ var TreeController = class extends MDControlController {
|
|
|
26737
26736
|
* @return {*} {boolean}
|
|
26738
26737
|
*/
|
|
26739
26738
|
calcAllowDrag(draggingNode) {
|
|
26740
|
-
const nodeModel = this.getNodeModel(draggingNode.
|
|
26739
|
+
const nodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26741
26740
|
return (nodeModel == null ? void 0 : nodeModel.allowDrag) === true;
|
|
26742
26741
|
}
|
|
26743
26742
|
/**
|
|
@@ -26751,22 +26750,22 @@ var TreeController = class extends MDControlController {
|
|
|
26751
26750
|
*/
|
|
26752
26751
|
calcAllowDrop(draggingNode, dropNode, type) {
|
|
26753
26752
|
var _a, _b;
|
|
26754
|
-
const draggingNodeModel = this.getNodeModel(draggingNode.
|
|
26753
|
+
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26755
26754
|
if (type === "inner") {
|
|
26756
26755
|
return !!this.findDropNodeRS(
|
|
26757
|
-
dropNode.
|
|
26756
|
+
dropNode._nodeId,
|
|
26758
26757
|
draggingNodeModel.appDataEntityId
|
|
26759
26758
|
);
|
|
26760
26759
|
}
|
|
26761
|
-
if (((_a = draggingNode.
|
|
26762
|
-
const currentNodeModel = this.getNodeModel(dropNode.
|
|
26760
|
+
if (((_a = draggingNode._parent) == null ? void 0 : _a._id) === ((_b = dropNode._parent) == null ? void 0 : _b._id)) {
|
|
26761
|
+
const currentNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
26763
26762
|
return (currentNodeModel == null ? void 0 : currentNodeModel.allowOrder) === true;
|
|
26764
26763
|
}
|
|
26765
|
-
if (!dropNode.
|
|
26764
|
+
if (!dropNode._parent) {
|
|
26766
26765
|
return false;
|
|
26767
26766
|
}
|
|
26768
26767
|
return !!this.findDropNodeRS(
|
|
26769
|
-
dropNode.
|
|
26768
|
+
dropNode._parent._nodeId,
|
|
26770
26769
|
draggingNodeModel.appDataEntityId
|
|
26771
26770
|
);
|
|
26772
26771
|
}
|
|
@@ -26795,44 +26794,44 @@ var TreeController = class extends MDControlController {
|
|
|
26795
26794
|
*/
|
|
26796
26795
|
async onNodeDrop(draggingNode, dropNode, dropType) {
|
|
26797
26796
|
var _a, _b, _c;
|
|
26798
|
-
if (dropType === "inner" && !dropNode.
|
|
26799
|
-
await this.expandNodeByKey([dropNode.
|
|
26797
|
+
if (dropType === "inner" && !dropNode._leaf && dropNode._children === void 0) {
|
|
26798
|
+
await this.expandNodeByKey([dropNode._id]);
|
|
26800
26799
|
}
|
|
26801
26800
|
const modifiedNodeDatas = [];
|
|
26802
|
-
const draggingNodeModel = this.getNodeModel(draggingNode.
|
|
26803
|
-
const dropInNode = dropType === "inner" ? dropNode : dropNode.
|
|
26804
|
-
const isChangedParent = (dropNode == null ? void 0 : dropNode.
|
|
26805
|
-
let orderNodeModel = this.getNodeModel(dropNode.
|
|
26806
|
-
if (dropType === "inner" || ((_b = dropNode.
|
|
26801
|
+
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26802
|
+
const dropInNode = dropType === "inner" ? dropNode : dropNode._parent;
|
|
26803
|
+
const isChangedParent = (dropNode == null ? void 0 : dropNode._id) !== ((_a = draggingNode._parent) == null ? void 0 : _a._id);
|
|
26804
|
+
let orderNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
26805
|
+
if (dropType === "inner" || ((_b = dropNode._parent) == null ? void 0 : _b._id) !== ((_c = draggingNode._parent) == null ? void 0 : _c._id)) {
|
|
26807
26806
|
const dropNodeRs = this.findDropNodeRS(
|
|
26808
|
-
dropInNode.
|
|
26807
|
+
dropInNode._nodeId,
|
|
26809
26808
|
draggingNodeModel.appDataEntityId
|
|
26810
26809
|
);
|
|
26811
26810
|
if (dropNodeRs) {
|
|
26812
|
-
draggingNode.
|
|
26811
|
+
draggingNode._deData[dropNodeRs.pickupDEFName] = dropInNode._value;
|
|
26813
26812
|
modifiedNodeDatas.push(draggingNode);
|
|
26814
26813
|
orderNodeModel = this.getNodeModel(dropNodeRs.childDETreeNodeId);
|
|
26815
26814
|
}
|
|
26816
26815
|
}
|
|
26817
|
-
const originArr = draggingNode.
|
|
26816
|
+
const originArr = draggingNode._parent._children;
|
|
26818
26817
|
originArr.splice(originArr.indexOf(draggingNode), 1);
|
|
26819
26818
|
if (dropType === "inner") {
|
|
26820
|
-
if (!dropNode.
|
|
26821
|
-
dropNode.
|
|
26822
|
-
dropNode.
|
|
26823
|
-
this.state.expandedKeys.push(dropNode.
|
|
26819
|
+
if (!dropNode._children) {
|
|
26820
|
+
dropNode._children = [];
|
|
26821
|
+
dropNode._leaf = true;
|
|
26822
|
+
this.state.expandedKeys.push(dropNode._id);
|
|
26824
26823
|
}
|
|
26825
|
-
dropNode.
|
|
26824
|
+
dropNode._children.push(draggingNode);
|
|
26826
26825
|
} else {
|
|
26827
|
-
let insertIndex = dropInNode.
|
|
26826
|
+
let insertIndex = dropInNode._children.indexOf(dropNode);
|
|
26828
26827
|
if (dropType === "next") {
|
|
26829
26828
|
insertIndex += 1;
|
|
26830
26829
|
}
|
|
26831
|
-
dropInNode.
|
|
26830
|
+
dropInNode._children.splice(insertIndex, 0, draggingNode);
|
|
26832
26831
|
}
|
|
26833
26832
|
if (dropType === "inner" || isChangedParent) {
|
|
26834
|
-
draggingNode.
|
|
26835
|
-
draggingNode.
|
|
26833
|
+
draggingNode._parent = dropInNode;
|
|
26834
|
+
draggingNode._nodeId = orderNodeModel.id;
|
|
26836
26835
|
this.state.expandedKeys = this.calcExpandedKeys([dropInNode]);
|
|
26837
26836
|
}
|
|
26838
26837
|
const { sortAppDEFieldId, sortDir, allowOrder } = orderNodeModel;
|
|
@@ -26842,7 +26841,7 @@ var TreeController = class extends MDControlController {
|
|
|
26842
26841
|
}
|
|
26843
26842
|
const sortField = sortAppDEFieldId.toLowerCase();
|
|
26844
26843
|
const isAsc = sortDir === "ASC";
|
|
26845
|
-
const changedArr = [...dropInNode.
|
|
26844
|
+
const changedArr = [...dropInNode._children];
|
|
26846
26845
|
if (!isAsc) {
|
|
26847
26846
|
changedArr.reverse();
|
|
26848
26847
|
}
|
|
@@ -26854,13 +26853,13 @@ var TreeController = class extends MDControlController {
|
|
|
26854
26853
|
};
|
|
26855
26854
|
let lastSort;
|
|
26856
26855
|
changedArr.forEach((item, index) => {
|
|
26857
|
-
const deData = item.
|
|
26856
|
+
const deData = item._deData;
|
|
26858
26857
|
if (lastSort === void 0) {
|
|
26859
26858
|
if (item === draggingNode) {
|
|
26860
26859
|
if (index === 0) {
|
|
26861
26860
|
lastSort = 100;
|
|
26862
26861
|
} else {
|
|
26863
|
-
lastSort = getNextSort(getSort(changedArr[index - 1].
|
|
26862
|
+
lastSort = getNextSort(getSort(changedArr[index - 1]._deData));
|
|
26864
26863
|
}
|
|
26865
26864
|
deData[sortField] = lastSort;
|
|
26866
26865
|
if (modifiedNodeDatas.indexOf(item) === -1) {
|
|
@@ -26891,8 +26890,8 @@ var TreeController = class extends MDControlController {
|
|
|
26891
26890
|
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
26892
26891
|
await Promise.all(
|
|
26893
26892
|
nodeDatas.map(async (node) => {
|
|
26894
|
-
const model = this.getNodeModel(node.
|
|
26895
|
-
const deData = node.
|
|
26893
|
+
const model = this.getNodeModel(node._nodeId);
|
|
26894
|
+
const deData = node._deData;
|
|
26896
26895
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
26897
26896
|
const tempContext = this.context.clone();
|
|
26898
26897
|
tempContext[deName] = deData.srfkey;
|
|
@@ -26903,7 +26902,7 @@ var TreeController = class extends MDControlController {
|
|
|
26903
26902
|
deData
|
|
26904
26903
|
);
|
|
26905
26904
|
if (res.data) {
|
|
26906
|
-
node.
|
|
26905
|
+
node._deData = res.data;
|
|
26907
26906
|
}
|
|
26908
26907
|
})
|
|
26909
26908
|
);
|
|
@@ -26917,15 +26916,15 @@ var TreeController = class extends MDControlController {
|
|
|
26917
26916
|
* @return {*} {Promise<void>}
|
|
26918
26917
|
*/
|
|
26919
26918
|
async modifyNodeText(nodeData, text) {
|
|
26920
|
-
const model = this.getNodeModel(nodeData.
|
|
26919
|
+
const model = this.getNodeModel(nodeData._nodeId);
|
|
26921
26920
|
if (!model.allowEditText) {
|
|
26922
26921
|
throw new RuntimeModelError61(model, "\u6811\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u7F16\u8F91\u6A21\u5F0F\uFF1A\u540D\u79F0");
|
|
26923
26922
|
}
|
|
26924
|
-
if (!nodeData.
|
|
26923
|
+
if (!nodeData._deData) {
|
|
26925
26924
|
throw new RuntimeError57("\u4E0D\u662F\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E");
|
|
26926
26925
|
}
|
|
26927
|
-
nodeData.
|
|
26928
|
-
nodeData.
|
|
26926
|
+
nodeData._text = text;
|
|
26927
|
+
nodeData._deData[model.textAppDEFieldId] = text;
|
|
26929
26928
|
await this.updateDeNodeData([nodeData]);
|
|
26930
26929
|
}
|
|
26931
26930
|
};
|
|
@@ -29309,7 +29308,7 @@ var GanttService = class extends TreeService {
|
|
|
29309
29308
|
);
|
|
29310
29309
|
} else {
|
|
29311
29310
|
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
29312
|
-
parentId: parentNodeData.
|
|
29311
|
+
parentId: parentNodeData._nodeId,
|
|
29313
29312
|
hasQuery
|
|
29314
29313
|
});
|
|
29315
29314
|
if (childNodeRSs.length === 0) {
|
|
@@ -29400,7 +29399,7 @@ var GanttService = class extends TreeService {
|
|
|
29400
29399
|
childNode,
|
|
29401
29400
|
opts
|
|
29402
29401
|
);
|
|
29403
|
-
childNode.
|
|
29402
|
+
childNode._children = subChildrenNodes;
|
|
29404
29403
|
}
|
|
29405
29404
|
})
|
|
29406
29405
|
);
|
|
@@ -29588,7 +29587,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
29588
29587
|
* @memberof GanttController
|
|
29589
29588
|
*/
|
|
29590
29589
|
async updateNodeData(nodeData, data, isTransformData = false) {
|
|
29591
|
-
const key = nodeData.srfkey ? "srfkey" : "
|
|
29590
|
+
const key = nodeData.srfkey ? "srfkey" : "_id";
|
|
29592
29591
|
const currentNode = this.state.items.find(
|
|
29593
29592
|
(item) => item[key] === nodeData[key]
|
|
29594
29593
|
);
|
|
@@ -29596,7 +29595,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
29596
29595
|
ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u52A8\u6001\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E", nodeData);
|
|
29597
29596
|
return;
|
|
29598
29597
|
}
|
|
29599
|
-
const nodeModel = this.getNodeModel(currentNode.
|
|
29598
|
+
const nodeModel = this.getNodeModel(currentNode._nodeId);
|
|
29600
29599
|
if (nodeModel) {
|
|
29601
29600
|
const newData = isTransformData ? this.transformNodeDataItem(nodeModel, data) : data;
|
|
29602
29601
|
if (Object.keys(newData).length > 0) {
|