@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
package/dist/index.esm.js
CHANGED
|
@@ -2419,6 +2419,7 @@ var ViewType = /* @__PURE__ */ ((ViewType2) => {
|
|
|
2419
2419
|
ViewType2["DE_WF_PROXY_START_VIEW"] = "DEWFPROXYSTARTVIEW";
|
|
2420
2420
|
ViewType2["DE_WF_START_VIEW"] = "DEWFSTARTVIEW";
|
|
2421
2421
|
ViewType2["DE_WIZARD_VIEW"] = "DEWIZARDVIEW";
|
|
2422
|
+
ViewType2["DE_SUB_APP_REF_VIEW"] = "DESUBAPPREFVIEW";
|
|
2422
2423
|
return ViewType2;
|
|
2423
2424
|
})(ViewType || {});
|
|
2424
2425
|
|
|
@@ -7048,11 +7049,22 @@ import { RuntimeModelError as RuntimeModelError9 } from "@ibiz-template/core";
|
|
|
7048
7049
|
// src/service/dto/method.dto.ts
|
|
7049
7050
|
import { ModelError as ModelError7 } from "@ibiz-template/core";
|
|
7050
7051
|
var MethodDto = class _MethodDto {
|
|
7051
|
-
|
|
7052
|
+
/**
|
|
7053
|
+
* Creates an instance of MethodDto.
|
|
7054
|
+
* @author lxm
|
|
7055
|
+
* @date 2024-01-04 05:39:07
|
|
7056
|
+
* @param {IAppDEService} service
|
|
7057
|
+
* @param {IAppDataEntity} entity
|
|
7058
|
+
* @param {boolean} [isLocalMode]
|
|
7059
|
+
* @param {IAppDEMethodDTO} [dto]
|
|
7060
|
+
* @param {boolean} [inSelfLoop] 是否在自关系循环中
|
|
7061
|
+
*/
|
|
7062
|
+
constructor(service, entity, isLocalMode, dto, inSelfLoop) {
|
|
7052
7063
|
this.service = service;
|
|
7053
7064
|
this.entity = entity;
|
|
7054
7065
|
this.isLocalMode = isLocalMode;
|
|
7055
7066
|
this.dto = dto;
|
|
7067
|
+
this.inSelfLoop = inSelfLoop;
|
|
7056
7068
|
this.dtoMap = /* @__PURE__ */ new Map();
|
|
7057
7069
|
/**
|
|
7058
7070
|
* 当前 DTO 是否已经计算过关系相关逻辑
|
|
@@ -7185,7 +7197,7 @@ var MethodDto = class _MethodDto {
|
|
|
7185
7197
|
* @return {*} {Promise<IDataEntity[]>}
|
|
7186
7198
|
*/
|
|
7187
7199
|
async sets(context, data) {
|
|
7188
|
-
if (this.isLocalMode) {
|
|
7200
|
+
if (this.isLocalMode && !this.inSelfLoop) {
|
|
7189
7201
|
this.service.local.clear();
|
|
7190
7202
|
}
|
|
7191
7203
|
await this.calcRs(context);
|
|
@@ -7287,9 +7299,10 @@ var MethodDto = class _MethodDto {
|
|
|
7287
7299
|
entity.appDEMethodDTOs || [],
|
|
7288
7300
|
field.refAppDEMethodDTOId
|
|
7289
7301
|
);
|
|
7302
|
+
const inSelfLoop = this.entity.codeName === entity.codeName;
|
|
7290
7303
|
const service = await this.app.deService.getService(context, entity.id);
|
|
7291
7304
|
service.isLocalMode = true;
|
|
7292
|
-
const dto = new _MethodDto(service, entity, true, methodDto);
|
|
7305
|
+
const dto = new _MethodDto(service, entity, true, methodDto, inSelfLoop);
|
|
7293
7306
|
this.dtoMap.set(field.codeName, dto);
|
|
7294
7307
|
return dto;
|
|
7295
7308
|
}
|
|
@@ -9135,20 +9148,20 @@ import { createUUID as createUUID5 } from "qx-util";
|
|
|
9135
9148
|
var TreeNodeData = class {
|
|
9136
9149
|
constructor(model, parentNodeData, opts) {
|
|
9137
9150
|
this._uuid = createUUID5();
|
|
9138
|
-
this.
|
|
9139
|
-
this.
|
|
9140
|
-
this.
|
|
9151
|
+
this._leaf = false;
|
|
9152
|
+
this._leaf = opts.leaf === true;
|
|
9153
|
+
this._parent = parentNodeData;
|
|
9141
9154
|
this._nodeType = model.treeNodeType;
|
|
9142
|
-
if (this.
|
|
9143
|
-
this.
|
|
9155
|
+
if (this._parent) {
|
|
9156
|
+
this._context = { ...this._parent._context };
|
|
9144
9157
|
}
|
|
9145
9158
|
if (opts.navContext) {
|
|
9146
|
-
this.
|
|
9159
|
+
this._context = Object.assign(this._context || {}, opts.navContext);
|
|
9147
9160
|
}
|
|
9148
9161
|
if (opts.navParams) {
|
|
9149
|
-
this.
|
|
9162
|
+
this._params = { ...opts.navParams };
|
|
9150
9163
|
}
|
|
9151
|
-
this.
|
|
9164
|
+
this._nodeId = model.id;
|
|
9152
9165
|
}
|
|
9153
9166
|
/**
|
|
9154
9167
|
* 计算节点图标
|
|
@@ -9178,25 +9191,25 @@ var TreeCodeListNodeData = class extends TreeNodeData {
|
|
|
9178
9191
|
constructor(model, parentNodeData, opts) {
|
|
9179
9192
|
super(model, parentNodeData, opts);
|
|
9180
9193
|
const { data } = opts;
|
|
9181
|
-
this.
|
|
9182
|
-
this.
|
|
9183
|
-
const selfId = "".concat(model.id, "@").concat(this.
|
|
9184
|
-
Object.defineProperty(this, "
|
|
9194
|
+
this._text = data.text;
|
|
9195
|
+
this._value = data.value;
|
|
9196
|
+
const selfId = "".concat(model.id, "@").concat(this._value).toLowerCase();
|
|
9197
|
+
Object.defineProperty(this, "_id", {
|
|
9185
9198
|
get() {
|
|
9186
|
-
return this.
|
|
9199
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9187
9200
|
},
|
|
9188
9201
|
enumerable: true,
|
|
9189
9202
|
configurable: true
|
|
9190
9203
|
});
|
|
9191
9204
|
if (model.appDataEntityId) {
|
|
9192
9205
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
9193
|
-
this.
|
|
9194
|
-
[deName]: this.
|
|
9206
|
+
this._context = Object.assign(this._context || {}, {
|
|
9207
|
+
[deName]: this._value
|
|
9195
9208
|
});
|
|
9196
9209
|
}
|
|
9197
|
-
this.srfkey = this.
|
|
9198
|
-
this.srfmajortext = this.
|
|
9199
|
-
this.
|
|
9210
|
+
this.srfkey = this._value;
|
|
9211
|
+
this.srfmajortext = this._text;
|
|
9212
|
+
this._icon = this.calcIcon(model);
|
|
9200
9213
|
}
|
|
9201
9214
|
};
|
|
9202
9215
|
|
|
@@ -9207,46 +9220,46 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9207
9220
|
var _a;
|
|
9208
9221
|
super(model, parentNodeData, opts);
|
|
9209
9222
|
const { data } = opts;
|
|
9210
|
-
this.
|
|
9211
|
-
this.
|
|
9212
|
-
this.
|
|
9223
|
+
this._deData = data;
|
|
9224
|
+
this._text = model.textAppDEFieldId ? data[model.textAppDEFieldId] : data.srfmajortext;
|
|
9225
|
+
this._value = model.idAppDEFieldId ? data[model.idAppDEFieldId] : data.srfkey;
|
|
9213
9226
|
const selfId = "".concat(model.id, "@").concat(data.srfkey).toLowerCase();
|
|
9214
|
-
Object.defineProperty(this, "
|
|
9227
|
+
Object.defineProperty(this, "_id", {
|
|
9215
9228
|
get() {
|
|
9216
|
-
return this.
|
|
9229
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9217
9230
|
},
|
|
9218
9231
|
enumerable: true,
|
|
9219
9232
|
configurable: true
|
|
9220
9233
|
});
|
|
9221
9234
|
if (model.appDataEntityId) {
|
|
9222
9235
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
9223
|
-
this.
|
|
9236
|
+
this._context = Object.assign(this._context || {}, {
|
|
9224
9237
|
[deName]: data.srfkey
|
|
9225
9238
|
});
|
|
9226
9239
|
}
|
|
9227
|
-
this.
|
|
9228
|
-
this.
|
|
9229
|
-
this.icon = this.calcIcon(model);
|
|
9230
|
-
this.textHtml = this.calcTextHtml(model);
|
|
9240
|
+
this._icon = this.calcIcon(model);
|
|
9241
|
+
this._textHtml = this.calcTextHtml(model);
|
|
9231
9242
|
if (model.leafFlagAppDEFieldId) {
|
|
9232
|
-
this.
|
|
9243
|
+
this._leaf = fieldValueToBoolean(data[model.leafFlagAppDEFieldId]);
|
|
9233
9244
|
}
|
|
9234
|
-
const
|
|
9245
|
+
const dataItemKeyMap = /* @__PURE__ */ new Map();
|
|
9246
|
+
dataItemKeyMap.set("srfkey", "srfkey");
|
|
9247
|
+
dataItemKeyMap.set("srfmajortext", "srfmajortext");
|
|
9235
9248
|
const dataItemDefaults = {};
|
|
9236
9249
|
(_a = model.detreeNodeDataItems) == null ? void 0 : _a.forEach((dataItem) => {
|
|
9237
9250
|
const uiKey = dataItem.id.toLowerCase();
|
|
9238
9251
|
const deFieldKey = dataItem.appDEFieldId.toLowerCase();
|
|
9239
|
-
|
|
9252
|
+
dataItemKeyMap.set(uiKey, deFieldKey);
|
|
9240
9253
|
if (dataItem.defaultValue) {
|
|
9241
9254
|
dataItemDefaults[uiKey] = dataItem.defaultValue;
|
|
9242
9255
|
}
|
|
9243
9256
|
});
|
|
9244
9257
|
return new Proxy(this, {
|
|
9245
9258
|
set(target, p, value) {
|
|
9246
|
-
if (Object.prototype.hasOwnProperty.call(target.
|
|
9247
|
-
target.
|
|
9248
|
-
} else if (
|
|
9249
|
-
target.
|
|
9259
|
+
if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
|
|
9260
|
+
target._deData[p] = value;
|
|
9261
|
+
} else if (dataItemKeyMap.has(p)) {
|
|
9262
|
+
target._deData[dataItemKeyMap.get(p)] = value;
|
|
9250
9263
|
} else {
|
|
9251
9264
|
target[p] = value;
|
|
9252
9265
|
}
|
|
@@ -9256,19 +9269,19 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9256
9269
|
if (target[p] !== void 0) {
|
|
9257
9270
|
return target[p];
|
|
9258
9271
|
}
|
|
9259
|
-
if (
|
|
9260
|
-
return target.
|
|
9272
|
+
if (dataItemKeyMap.has(p)) {
|
|
9273
|
+
return target._deData[dataItemKeyMap.get(p)] || dataItemDefaults[p];
|
|
9261
9274
|
}
|
|
9262
|
-
if (target.
|
|
9263
|
-
return target.
|
|
9275
|
+
if (target._deData[p] !== void 0) {
|
|
9276
|
+
return target._deData[p];
|
|
9264
9277
|
}
|
|
9265
9278
|
},
|
|
9266
9279
|
ownKeys(target) {
|
|
9267
9280
|
const allKeys = [
|
|
9268
9281
|
.../* @__PURE__ */ new Set([
|
|
9269
9282
|
...Object.keys(target),
|
|
9270
|
-
...
|
|
9271
|
-
...Object.keys(target.
|
|
9283
|
+
...dataItemKeyMap.keys(),
|
|
9284
|
+
...Object.keys(target._deData)
|
|
9272
9285
|
])
|
|
9273
9286
|
];
|
|
9274
9287
|
updateKeyDefine(target, allKeys);
|
|
@@ -9279,11 +9292,11 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9279
9292
|
calcIcon(model) {
|
|
9280
9293
|
const icon = super.calcIcon(model) || {};
|
|
9281
9294
|
const { iconAppDEFieldId, detreeNodeDataItems } = model;
|
|
9282
|
-
if (iconAppDEFieldId && this.
|
|
9283
|
-
icon.imagePath = this.
|
|
9295
|
+
if (iconAppDEFieldId && this._deData[iconAppDEFieldId]) {
|
|
9296
|
+
icon.imagePath = this._deData[iconAppDEFieldId];
|
|
9284
9297
|
}
|
|
9285
9298
|
if (icon) {
|
|
9286
|
-
this.
|
|
9299
|
+
this._icon = icon;
|
|
9287
9300
|
}
|
|
9288
9301
|
const iconDataItem = detreeNodeDataItems == null ? void 0 : detreeNodeDataItems.find((item) => item.id === "icon");
|
|
9289
9302
|
if (iconDataItem) {
|
|
@@ -9302,7 +9315,7 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9302
9315
|
calcDataItemScript(dataItem) {
|
|
9303
9316
|
if (dataItem.customCode && dataItem.scriptCode) {
|
|
9304
9317
|
return ScriptFactory.execScriptFn(
|
|
9305
|
-
{ data: this.
|
|
9318
|
+
{ data: this._deData },
|
|
9306
9319
|
dataItem.scriptCode,
|
|
9307
9320
|
{
|
|
9308
9321
|
isAsync: false
|
|
@@ -9336,28 +9349,28 @@ var TreeStaticNodeData = class extends TreeNodeData {
|
|
|
9336
9349
|
super(model, parentNodeData, opts);
|
|
9337
9350
|
const nodeValue = model.nodeValue === "root" ? void 0 : model.nodeValue;
|
|
9338
9351
|
const selfId = "".concat(model.id).toLowerCase();
|
|
9339
|
-
Object.defineProperty(this, "
|
|
9352
|
+
Object.defineProperty(this, "_id", {
|
|
9340
9353
|
get() {
|
|
9341
|
-
return this.
|
|
9354
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9342
9355
|
},
|
|
9343
9356
|
enumerable: true,
|
|
9344
9357
|
configurable: true
|
|
9345
9358
|
});
|
|
9346
|
-
this.
|
|
9347
|
-
this.
|
|
9359
|
+
this._text = model.text;
|
|
9360
|
+
this._value = nodeValue;
|
|
9348
9361
|
if (parentNodeData && opts.parentValueLevel) {
|
|
9349
9362
|
let parent = parentNodeData;
|
|
9350
9363
|
for (let index = 1; index < opts.parentValueLevel; index++) {
|
|
9351
|
-
parent = parent == null ? void 0 : parent.
|
|
9364
|
+
parent = parent == null ? void 0 : parent._parent;
|
|
9352
9365
|
}
|
|
9353
|
-
if (parent == null ? void 0 : parent.
|
|
9354
|
-
this.
|
|
9366
|
+
if (parent == null ? void 0 : parent._deData) {
|
|
9367
|
+
this._deData = parent._deData;
|
|
9355
9368
|
}
|
|
9356
|
-
this.
|
|
9369
|
+
this._value = nodeValue || (parent == null ? void 0 : parent._value);
|
|
9357
9370
|
}
|
|
9358
|
-
this.srfkey = ((_a = this.
|
|
9359
|
-
this.srfmajortext = ((_b = this.
|
|
9360
|
-
this.
|
|
9371
|
+
this.srfkey = ((_a = this._deData) == null ? void 0 : _a.srfkey) || this._value;
|
|
9372
|
+
this.srfmajortext = ((_b = this._deData) == null ? void 0 : _b.srfmajortext) || this._text;
|
|
9373
|
+
this._icon = this.calcIcon(model);
|
|
9361
9374
|
}
|
|
9362
9375
|
};
|
|
9363
9376
|
|
|
@@ -9709,21 +9722,24 @@ var calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
|
9709
9722
|
var GanttStaticNodeData = class extends TreeStaticNodeData {
|
|
9710
9723
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9711
9724
|
super(nodeModel, parentNodeData, opts);
|
|
9712
|
-
this.
|
|
9713
|
-
this.
|
|
9725
|
+
this._sndataIteValue = calcDataItemValue(model.sndataItemName, nodeModel);
|
|
9726
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9714
9727
|
model.beginDataItemName,
|
|
9715
9728
|
nodeModel
|
|
9716
9729
|
);
|
|
9717
|
-
this.
|
|
9718
|
-
|
|
9730
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9731
|
+
model.endDataItemName,
|
|
9732
|
+
nodeModel
|
|
9733
|
+
);
|
|
9734
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9719
9735
|
model.prevDataItemName,
|
|
9720
9736
|
nodeModel
|
|
9721
9737
|
);
|
|
9722
|
-
this.
|
|
9738
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9723
9739
|
model.finishDataItemName,
|
|
9724
9740
|
nodeModel
|
|
9725
9741
|
);
|
|
9726
|
-
this.
|
|
9742
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9727
9743
|
model.totalDataItemName,
|
|
9728
9744
|
nodeModel
|
|
9729
9745
|
);
|
|
@@ -9735,32 +9751,32 @@ var GanttDataSetNodeData = class extends TreeDataSetNodeData {
|
|
|
9735
9751
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9736
9752
|
super(nodeModel, parentNodeData, opts);
|
|
9737
9753
|
const { data } = opts;
|
|
9738
|
-
this.
|
|
9754
|
+
this._sndataIteValue = calcDataItemValue(
|
|
9739
9755
|
model.sndataItemName,
|
|
9740
9756
|
nodeModel,
|
|
9741
9757
|
data
|
|
9742
9758
|
);
|
|
9743
|
-
this.
|
|
9759
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9744
9760
|
model.beginDataItemName,
|
|
9745
9761
|
nodeModel,
|
|
9746
9762
|
data
|
|
9747
9763
|
);
|
|
9748
|
-
this.
|
|
9764
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9749
9765
|
model.endDataItemName,
|
|
9750
9766
|
nodeModel,
|
|
9751
9767
|
data
|
|
9752
9768
|
);
|
|
9753
|
-
this.
|
|
9769
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9754
9770
|
model.prevDataItemName,
|
|
9755
9771
|
nodeModel,
|
|
9756
9772
|
data
|
|
9757
9773
|
);
|
|
9758
|
-
this.
|
|
9774
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9759
9775
|
model.finishDataItemName,
|
|
9760
9776
|
nodeModel,
|
|
9761
9777
|
data
|
|
9762
9778
|
);
|
|
9763
|
-
this.
|
|
9779
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9764
9780
|
model.totalDataItemName,
|
|
9765
9781
|
nodeModel,
|
|
9766
9782
|
data
|
|
@@ -9773,32 +9789,32 @@ var GanttCodeListNodeData = class extends TreeCodeListNodeData {
|
|
|
9773
9789
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9774
9790
|
super(nodeModel, parentNodeData, opts);
|
|
9775
9791
|
const { data } = opts;
|
|
9776
|
-
this.
|
|
9792
|
+
this._sndataIteValue = calcDataItemValue(
|
|
9777
9793
|
model.sndataItemName,
|
|
9778
9794
|
nodeModel,
|
|
9779
9795
|
data
|
|
9780
9796
|
);
|
|
9781
|
-
this.
|
|
9797
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9782
9798
|
model.beginDataItemName,
|
|
9783
9799
|
nodeModel,
|
|
9784
9800
|
data
|
|
9785
9801
|
);
|
|
9786
|
-
this.
|
|
9802
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9787
9803
|
model.endDataItemName,
|
|
9788
9804
|
nodeModel,
|
|
9789
9805
|
data
|
|
9790
9806
|
);
|
|
9791
|
-
this.
|
|
9807
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9792
9808
|
model.prevDataItemName,
|
|
9793
9809
|
nodeModel,
|
|
9794
9810
|
data
|
|
9795
9811
|
);
|
|
9796
|
-
this.
|
|
9812
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9797
9813
|
model.finishDataItemName,
|
|
9798
9814
|
nodeModel,
|
|
9799
9815
|
data
|
|
9800
9816
|
);
|
|
9801
|
-
this.
|
|
9817
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9802
9818
|
model.totalDataItemName,
|
|
9803
9819
|
nodeModel,
|
|
9804
9820
|
data
|
|
@@ -18691,7 +18707,7 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18691
18707
|
* @date 2023-07-10 03:07:11
|
|
18692
18708
|
* @memberof TreeExpBarController
|
|
18693
18709
|
*/
|
|
18694
|
-
this.navKeyName = "
|
|
18710
|
+
this.navKeyName = "_id";
|
|
18695
18711
|
/**
|
|
18696
18712
|
* 有导航视图的节点模型标识集合
|
|
18697
18713
|
* @author lxm
|
|
@@ -18734,7 +18750,6 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18734
18750
|
*
|
|
18735
18751
|
* @author zk
|
|
18736
18752
|
* @date 2023-05-29 03:05:36
|
|
18737
|
-
* @param {IData} data
|
|
18738
18753
|
* @memberof ExpBarControlController
|
|
18739
18754
|
*/
|
|
18740
18755
|
xDataActive(event) {
|
|
@@ -18751,11 +18766,11 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18751
18766
|
* @memberof TabExpPanelController
|
|
18752
18767
|
*/
|
|
18753
18768
|
getNavViewMsg(node, context, params) {
|
|
18754
|
-
const nodeId = node.
|
|
18755
|
-
const deData = node.
|
|
18756
|
-
const nodeModel = this.getNodeModel(node.
|
|
18769
|
+
const nodeId = node._id;
|
|
18770
|
+
const deData = node._deData || node;
|
|
18771
|
+
const nodeModel = this.getNodeModel(node._nodeId);
|
|
18757
18772
|
if (!nodeModel) {
|
|
18758
|
-
throw new RuntimeError49("\u627E\u4E0D\u5230".concat(node.
|
|
18773
|
+
throw new RuntimeError49("\u627E\u4E0D\u5230".concat(node._nodeId, "\u7684\u8282\u70B9\u6A21\u578B"));
|
|
18759
18774
|
}
|
|
18760
18775
|
const result = this.prepareParams(nodeModel, deData, context, params);
|
|
18761
18776
|
result.context.currentSrfNav = nodeId;
|
|
@@ -18775,7 +18790,7 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
18775
18790
|
if (this.state.noNeedNavView) {
|
|
18776
18791
|
return true;
|
|
18777
18792
|
}
|
|
18778
|
-
return this.navNodeModelIds.includes(node.
|
|
18793
|
+
return this.navNodeModelIds.includes(node._nodeId);
|
|
18779
18794
|
});
|
|
18780
18795
|
if (!data) {
|
|
18781
18796
|
return;
|
|
@@ -24919,7 +24934,7 @@ import {
|
|
|
24919
24934
|
mergeInLeft as mergeInLeft3,
|
|
24920
24935
|
recursiveIterate as recursiveIterate9
|
|
24921
24936
|
} from "@ibiz-template/core";
|
|
24922
|
-
import { isNil as isNil23 } from "ramda";
|
|
24937
|
+
import { clone as clone24, isNil as isNil23 } from "ramda";
|
|
24923
24938
|
|
|
24924
24939
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
24925
24940
|
import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
|
|
@@ -25217,7 +25232,21 @@ function initDefaultEditor() {
|
|
|
25217
25232
|
});
|
|
25218
25233
|
}
|
|
25219
25234
|
initDefaultEditor();
|
|
25220
|
-
function
|
|
25235
|
+
function getEditor(field, op) {
|
|
25236
|
+
if (field.enumSource) {
|
|
25237
|
+
return {
|
|
25238
|
+
appId,
|
|
25239
|
+
editorType: "DROPDOWNLIST",
|
|
25240
|
+
singleSelect: true,
|
|
25241
|
+
valueType: "SIMPLE",
|
|
25242
|
+
appCodeListId: field.enumSource,
|
|
25243
|
+
id: "".concat(field.key, "_").concat(op)
|
|
25244
|
+
};
|
|
25245
|
+
}
|
|
25246
|
+
const editorModel = EditorsMap["".concat(field.type, "_").concat(op)];
|
|
25247
|
+
return editorModel;
|
|
25248
|
+
}
|
|
25249
|
+
async function calcFilterModelBySchema(json, c) {
|
|
25221
25250
|
var _a;
|
|
25222
25251
|
if (!json.properties) {
|
|
25223
25252
|
return [];
|
|
@@ -25247,11 +25276,16 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25247
25276
|
addFields.push({
|
|
25248
25277
|
key,
|
|
25249
25278
|
description: properties[key].description,
|
|
25250
|
-
type
|
|
25279
|
+
type,
|
|
25280
|
+
enumSource: properties[key].enumSource
|
|
25251
25281
|
});
|
|
25252
25282
|
});
|
|
25253
25283
|
const codeNameToId = {};
|
|
25254
|
-
|
|
25284
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
25285
|
+
c.model.appDataEntityId,
|
|
25286
|
+
c.model.appId
|
|
25287
|
+
);
|
|
25288
|
+
(_a = dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
25255
25289
|
codeNameToId[field.codeName.toLowerCase()] = field.id;
|
|
25256
25290
|
});
|
|
25257
25291
|
const addSearchBarFilters = [];
|
|
@@ -25262,18 +25296,18 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25262
25296
|
return;
|
|
25263
25297
|
}
|
|
25264
25298
|
ops.forEach((op) => {
|
|
25265
|
-
|
|
25266
|
-
|
|
25267
|
-
appId,
|
|
25268
|
-
appDEFieldId: codeNameToId[item.key],
|
|
25269
|
-
id: item.key,
|
|
25270
|
-
caption: item.description,
|
|
25271
|
-
defsearchMode: {
|
|
25299
|
+
if (item)
|
|
25300
|
+
addSearchBarFilters.push({
|
|
25272
25301
|
appId,
|
|
25273
|
-
|
|
25274
|
-
|
|
25275
|
-
|
|
25276
|
-
|
|
25302
|
+
appDEFieldId: codeNameToId[item.key],
|
|
25303
|
+
id: item.key,
|
|
25304
|
+
caption: item.description,
|
|
25305
|
+
defsearchMode: {
|
|
25306
|
+
appId,
|
|
25307
|
+
valueOP: op
|
|
25308
|
+
},
|
|
25309
|
+
editor: getEditor(item, op)
|
|
25310
|
+
});
|
|
25277
25311
|
});
|
|
25278
25312
|
});
|
|
25279
25313
|
return addSearchBarFilters;
|
|
@@ -25312,12 +25346,29 @@ var SearchBarController = class extends ControlController {
|
|
|
25312
25346
|
*/
|
|
25313
25347
|
this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
|
|
25314
25348
|
/**
|
|
25315
|
-
*
|
|
25349
|
+
* 是否启用根据实体的JSON Schema生成过滤项
|
|
25316
25350
|
* @author lxm
|
|
25317
|
-
* @date
|
|
25318
|
-
* @type {boolean}
|
|
25351
|
+
* @date 2024-01-05 10:10:37
|
|
25319
25352
|
*/
|
|
25320
|
-
this.
|
|
25353
|
+
this.addSchemaFilters = false;
|
|
25354
|
+
}
|
|
25355
|
+
/**
|
|
25356
|
+
* 启用自定义过滤项
|
|
25357
|
+
* @author lxm
|
|
25358
|
+
* @date 2023-12-29 04:15:34
|
|
25359
|
+
* @type {boolean}
|
|
25360
|
+
*/
|
|
25361
|
+
get enableFilter() {
|
|
25362
|
+
return this.model.enableFilter === true;
|
|
25363
|
+
}
|
|
25364
|
+
/**
|
|
25365
|
+
* 最终使用的searchBarFilters
|
|
25366
|
+
* @author lxm
|
|
25367
|
+
* @date 2023-12-29 06:55:13
|
|
25368
|
+
* @type {ISearchBarFilter[]}
|
|
25369
|
+
*/
|
|
25370
|
+
get searchBarFilters() {
|
|
25371
|
+
return this.model.searchBarFilters || [];
|
|
25321
25372
|
}
|
|
25322
25373
|
/**
|
|
25323
25374
|
* 表格控制器
|
|
@@ -25334,19 +25385,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25334
25385
|
this.state.selectedGroupItem = null;
|
|
25335
25386
|
this.state.searchBarGroups = [];
|
|
25336
25387
|
this.state.selectedSearchGroupItem = null;
|
|
25337
|
-
this.initFilterState();
|
|
25338
|
-
}
|
|
25339
|
-
/**
|
|
25340
|
-
* 初始化Filter相关的属性
|
|
25341
|
-
* @author lxm
|
|
25342
|
-
* @date 2023-12-29 04:18:02
|
|
25343
|
-
* @protected
|
|
25344
|
-
*/
|
|
25345
|
-
initFilterState() {
|
|
25346
25388
|
this.resetFilter();
|
|
25347
25389
|
this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.enableFilter);
|
|
25348
25390
|
}
|
|
25349
25391
|
async onCreated() {
|
|
25392
|
+
await this.initByEntitySchema();
|
|
25350
25393
|
await super.onCreated();
|
|
25351
25394
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
25352
25395
|
this.model.appDataEntityId,
|
|
@@ -25360,7 +25403,6 @@ var SearchBarController = class extends ControlController {
|
|
|
25360
25403
|
this.service = new SearchBarService(this.model, this.view.model.codeName);
|
|
25361
25404
|
await this.service.init(this.context);
|
|
25362
25405
|
}
|
|
25363
|
-
await this.initByEntitySchema();
|
|
25364
25406
|
await this.initSearchBarFilters();
|
|
25365
25407
|
await this.initSearBarGroups();
|
|
25366
25408
|
}
|
|
@@ -25372,12 +25414,17 @@ var SearchBarController = class extends ControlController {
|
|
|
25372
25414
|
*/
|
|
25373
25415
|
async initByEntitySchema() {
|
|
25374
25416
|
var _a;
|
|
25375
|
-
this.
|
|
25376
|
-
|
|
25417
|
+
if (!this.addSchemaFilters) {
|
|
25418
|
+
return;
|
|
25419
|
+
}
|
|
25420
|
+
const json = await getEntitySchema(
|
|
25421
|
+
this.model.appDataEntityId,
|
|
25422
|
+
this.context
|
|
25423
|
+
);
|
|
25377
25424
|
if (!json) {
|
|
25378
25425
|
return;
|
|
25379
25426
|
}
|
|
25380
|
-
const addSearchBarFilters = calcFilterModelBySchema(json, this);
|
|
25427
|
+
const addSearchBarFilters = await calcFilterModelBySchema(json, this);
|
|
25381
25428
|
const mergeFilters = [];
|
|
25382
25429
|
(_a = this.model.searchBarFilters) == null ? void 0 : _a.forEach((filter) => {
|
|
25383
25430
|
const findindex = addSearchBarFilters.findIndex(
|
|
@@ -25390,8 +25437,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25390
25437
|
mergeFilters.push(filter);
|
|
25391
25438
|
}
|
|
25392
25439
|
});
|
|
25393
|
-
addSearchBarFilters.
|
|
25394
|
-
|
|
25440
|
+
if (addSearchBarFilters.length > 0) {
|
|
25441
|
+
this.model = clone24(this.model);
|
|
25442
|
+
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
25443
|
+
this.model.enableFilter = true;
|
|
25444
|
+
}
|
|
25395
25445
|
}
|
|
25396
25446
|
/**
|
|
25397
25447
|
* 计算快速搜索的占位
|
|
@@ -25505,7 +25555,7 @@ var SearchBarController = class extends ControlController {
|
|
|
25505
25555
|
* @return {*} {IData}
|
|
25506
25556
|
*/
|
|
25507
25557
|
calcFilters() {
|
|
25508
|
-
if (!this.
|
|
25558
|
+
if (!this.enableFilter) {
|
|
25509
25559
|
return;
|
|
25510
25560
|
}
|
|
25511
25561
|
let hasFilter = false;
|
|
@@ -26000,7 +26050,7 @@ var TreeService = class extends MDControlService {
|
|
|
26000
26050
|
);
|
|
26001
26051
|
} else {
|
|
26002
26052
|
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
26003
|
-
parentId: parentNodeData == null ? void 0 : parentNodeData.
|
|
26053
|
+
parentId: parentNodeData == null ? void 0 : parentNodeData._nodeId,
|
|
26004
26054
|
hasQuery
|
|
26005
26055
|
});
|
|
26006
26056
|
if (childNodeRSs.length === 0) {
|
|
@@ -26086,13 +26136,13 @@ var TreeService = class extends MDControlService {
|
|
|
26086
26136
|
result.map(async (childNode, index) => {
|
|
26087
26137
|
var _a;
|
|
26088
26138
|
if (expanded && // 全展开合只展开首节点expanded都为true
|
|
26089
|
-
(!expandFirstOnly || expandFirstOnly && index === 0) || ((_a = opts.defaultExpandedKeys) == null ? void 0 : _a.length) && opts.defaultExpandedKeys.includes(childNode.
|
|
26139
|
+
(!expandFirstOnly || expandFirstOnly && index === 0) || ((_a = opts.defaultExpandedKeys) == null ? void 0 : _a.length) && opts.defaultExpandedKeys.includes(childNode._id) || // 外部回显给的默认展开节点集合有的展开
|
|
26090
26140
|
isExpandedRoot) {
|
|
26091
26141
|
const subChildrenNodes = await this.fetchChildNodes(
|
|
26092
26142
|
childNode,
|
|
26093
26143
|
opts
|
|
26094
26144
|
);
|
|
26095
|
-
childNode.
|
|
26145
|
+
childNode._children = subChildrenNodes;
|
|
26096
26146
|
}
|
|
26097
26147
|
})
|
|
26098
26148
|
);
|
|
@@ -26136,25 +26186,25 @@ var TreeService = class extends MDControlService {
|
|
|
26136
26186
|
const params = { ...opts.params };
|
|
26137
26187
|
const context = {
|
|
26138
26188
|
...opts.context,
|
|
26139
|
-
...(parentNodeData == null ? void 0 : parentNodeData.
|
|
26189
|
+
...(parentNodeData == null ? void 0 : parentNodeData._context) || {}
|
|
26140
26190
|
};
|
|
26141
26191
|
let data = {};
|
|
26142
26192
|
let parentData;
|
|
26143
26193
|
if (parentNodeData) {
|
|
26144
26194
|
parentData = parentNodeData;
|
|
26145
26195
|
for (let index = 1; index < parentValueLevel; index++) {
|
|
26146
|
-
parentData = parentData == null ? void 0 : parentData.
|
|
26196
|
+
parentData = parentData == null ? void 0 : parentData._parent;
|
|
26147
26197
|
}
|
|
26148
26198
|
}
|
|
26149
26199
|
let derValue;
|
|
26150
26200
|
let deName;
|
|
26151
26201
|
if (parentData) {
|
|
26152
|
-
data = parentData.
|
|
26153
|
-
const parentNodeModel = getTreeNode(this.model, parentData.
|
|
26202
|
+
data = parentData._deData || {};
|
|
26203
|
+
const parentNodeModel = getTreeNode(this.model, parentData._nodeId);
|
|
26154
26204
|
if (parentNodeModel.appDataEntityId) {
|
|
26155
26205
|
deName = calcDeCodeNameById(parentNodeModel.appDataEntityId);
|
|
26156
26206
|
}
|
|
26157
|
-
derValue = parentData.
|
|
26207
|
+
derValue = parentData._value;
|
|
26158
26208
|
}
|
|
26159
26209
|
const { resultContext, resultParams } = calcNavParams(
|
|
26160
26210
|
{
|
|
@@ -26476,7 +26526,7 @@ var TreeController = class extends MDControlController {
|
|
|
26476
26526
|
this.state.isLoading = false;
|
|
26477
26527
|
}
|
|
26478
26528
|
if (parentNode) {
|
|
26479
|
-
parentNode.
|
|
26529
|
+
parentNode._children = nodes;
|
|
26480
26530
|
} else {
|
|
26481
26531
|
this.state.rootNodes = nodes;
|
|
26482
26532
|
}
|
|
@@ -26493,10 +26543,11 @@ var TreeController = class extends MDControlController {
|
|
|
26493
26543
|
async afterLoadNodes(nodes) {
|
|
26494
26544
|
this.state.items = [];
|
|
26495
26545
|
recursiveIterate10(
|
|
26496
|
-
{
|
|
26546
|
+
{ _children: this.state.rootNodes },
|
|
26497
26547
|
(node) => {
|
|
26498
26548
|
this.state.items.push(node);
|
|
26499
|
-
}
|
|
26549
|
+
},
|
|
26550
|
+
{ childrenFields: ["_children"] }
|
|
26500
26551
|
);
|
|
26501
26552
|
this.state.expandedKeys = this.calcExpandedKeys(nodes);
|
|
26502
26553
|
}
|
|
@@ -26509,7 +26560,7 @@ var TreeController = class extends MDControlController {
|
|
|
26509
26560
|
*/
|
|
26510
26561
|
async onTreeNodeClick(nodeData, event) {
|
|
26511
26562
|
var _a;
|
|
26512
|
-
const clickActionItem = (_a = this.contextMenuInfos[nodeData.
|
|
26563
|
+
const clickActionItem = (_a = this.contextMenuInfos[nodeData._nodeId]) == null ? void 0 : _a.clickTBUIActionItem;
|
|
26513
26564
|
if (clickActionItem) {
|
|
26514
26565
|
return this.doUIAction(
|
|
26515
26566
|
clickActionItem.uiactionId,
|
|
@@ -26519,14 +26570,14 @@ var TreeController = class extends MDControlController {
|
|
|
26519
26570
|
);
|
|
26520
26571
|
}
|
|
26521
26572
|
if (this.state.navigational) {
|
|
26522
|
-
const nodeModel = this.getNodeModel(nodeData.
|
|
26573
|
+
const nodeModel = this.getNodeModel(nodeData._nodeId);
|
|
26523
26574
|
if (!(nodeModel == null ? void 0 : nodeModel.navAppViewId)) {
|
|
26524
26575
|
return;
|
|
26525
26576
|
}
|
|
26526
26577
|
}
|
|
26527
26578
|
if (this.state.singleSelect) {
|
|
26528
26579
|
const { selectedData } = this.state;
|
|
26529
|
-
const filterArr = selectedData.filter((item) => item.
|
|
26580
|
+
const filterArr = selectedData.filter((item) => item._id !== nodeData._id);
|
|
26530
26581
|
if (filterArr.length === selectedData.length) {
|
|
26531
26582
|
this.setSelection(
|
|
26532
26583
|
this.state.singleSelect ? [nodeData] : selectedData.concat([nodeData])
|
|
@@ -26547,11 +26598,11 @@ var TreeController = class extends MDControlController {
|
|
|
26547
26598
|
* @param {boolean} isExpand true为展开,false为折叠
|
|
26548
26599
|
*/
|
|
26549
26600
|
onExpandChange(nodeData, isExpand) {
|
|
26550
|
-
const hasKey = this.state.expandedKeys.includes(nodeData.
|
|
26601
|
+
const hasKey = this.state.expandedKeys.includes(nodeData._id);
|
|
26551
26602
|
if (isExpand && !hasKey) {
|
|
26552
|
-
this.state.expandedKeys.push(nodeData.
|
|
26603
|
+
this.state.expandedKeys.push(nodeData._id);
|
|
26553
26604
|
} else if (!isExpand && hasKey) {
|
|
26554
|
-
const index = this.state.expandedKeys.indexOf(nodeData.
|
|
26605
|
+
const index = this.state.expandedKeys.indexOf(nodeData._id);
|
|
26555
26606
|
if (index !== -1) {
|
|
26556
26607
|
this.state.expandedKeys.splice(index, 1);
|
|
26557
26608
|
}
|
|
@@ -26574,9 +26625,9 @@ var TreeController = class extends MDControlController {
|
|
|
26574
26625
|
return this._evt.emit("onActive", { ...nodeParams, nodeData: item });
|
|
26575
26626
|
}
|
|
26576
26627
|
setSelection(selection) {
|
|
26577
|
-
const selectionIds = selection.map((item) => item.
|
|
26628
|
+
const selectionIds = selection.map((item) => item._id);
|
|
26578
26629
|
const filterArr = this.state.items.filter(
|
|
26579
|
-
(item) => selectionIds.includes(item.
|
|
26630
|
+
(item) => selectionIds.includes(item._id)
|
|
26580
26631
|
);
|
|
26581
26632
|
super.setSelection(filterArr);
|
|
26582
26633
|
}
|
|
@@ -26595,11 +26646,11 @@ var TreeController = class extends MDControlController {
|
|
|
26595
26646
|
* 通过标识获取节点数据
|
|
26596
26647
|
* @author lxm
|
|
26597
26648
|
* @date 2023-12-22 02:21:38
|
|
26598
|
-
* @param {string}
|
|
26649
|
+
* @param {string} key 可以是节点_id也可以是_uuid
|
|
26599
26650
|
* @return {*} {(ITreeNodeData | undefined)}
|
|
26600
26651
|
*/
|
|
26601
26652
|
getNodeData(key) {
|
|
26602
|
-
const find = this.state.items.find((item) => item.
|
|
26653
|
+
const find = this.state.items.find((item) => item._id === key);
|
|
26603
26654
|
if (find) {
|
|
26604
26655
|
return find;
|
|
26605
26656
|
}
|
|
@@ -26654,9 +26705,9 @@ var TreeController = class extends MDControlController {
|
|
|
26654
26705
|
*/
|
|
26655
26706
|
parseTreeNodeData(nodeData) {
|
|
26656
26707
|
return {
|
|
26657
|
-
data: [{ ...nodeData, ...nodeData.
|
|
26658
|
-
context: Object.assign(this.context.clone(), nodeData.
|
|
26659
|
-
params: { ...this.params, ...nodeData.
|
|
26708
|
+
data: [{ ...nodeData, ...nodeData._deData || {} }],
|
|
26709
|
+
context: Object.assign(this.context.clone(), nodeData._context || {}),
|
|
26710
|
+
params: { ...this.params, ...nodeData._params || {} }
|
|
26660
26711
|
};
|
|
26661
26712
|
}
|
|
26662
26713
|
/**
|
|
@@ -26669,12 +26720,16 @@ var TreeController = class extends MDControlController {
|
|
|
26669
26720
|
*/
|
|
26670
26721
|
calcExpandedKeys(nodes) {
|
|
26671
26722
|
let expandedKeys = [...this.state.expandedKeys];
|
|
26672
|
-
recursiveIterate10(
|
|
26673
|
-
|
|
26674
|
-
|
|
26675
|
-
|
|
26676
|
-
|
|
26677
|
-
|
|
26723
|
+
recursiveIterate10(
|
|
26724
|
+
{ _children: nodes },
|
|
26725
|
+
(node) => {
|
|
26726
|
+
var _a;
|
|
26727
|
+
if ((_a = node._children) == null ? void 0 : _a.length) {
|
|
26728
|
+
expandedKeys.push(node._id);
|
|
26729
|
+
}
|
|
26730
|
+
},
|
|
26731
|
+
{ childrenFields: ["_children"] }
|
|
26732
|
+
);
|
|
26678
26733
|
expandedKeys = Array.from(new Set(expandedKeys));
|
|
26679
26734
|
return expandedKeys;
|
|
26680
26735
|
}
|
|
@@ -26687,7 +26742,7 @@ var TreeController = class extends MDControlController {
|
|
|
26687
26742
|
* @return {*} {Promise<void>}
|
|
26688
26743
|
*/
|
|
26689
26744
|
async refreshNodeChildren(nodeData, refreshParent = false) {
|
|
26690
|
-
const key = nodeData.srfkey ? "srfkey" : "
|
|
26745
|
+
const key = nodeData.srfkey ? "srfkey" : "_id";
|
|
26691
26746
|
const currentNode = this.state.items.find(
|
|
26692
26747
|
(item) => item[key] === nodeData[key]
|
|
26693
26748
|
);
|
|
@@ -26696,13 +26751,13 @@ var TreeController = class extends MDControlController {
|
|
|
26696
26751
|
return;
|
|
26697
26752
|
}
|
|
26698
26753
|
if (refreshParent) {
|
|
26699
|
-
const {
|
|
26700
|
-
if (!
|
|
26754
|
+
const { _parent } = currentNode;
|
|
26755
|
+
if (!_parent || !this.model.rootVisible && this.state.rootNodes.includes(_parent)) {
|
|
26701
26756
|
await this.refresh();
|
|
26702
26757
|
return;
|
|
26703
26758
|
}
|
|
26704
26759
|
}
|
|
26705
|
-
const targetNode = refreshParent ? currentNode.
|
|
26760
|
+
const targetNode = refreshParent ? currentNode._parent : currentNode;
|
|
26706
26761
|
const nodes = await this.loadNodes(targetNode);
|
|
26707
26762
|
this._evt.emit("onAfterRefreshParent", {
|
|
26708
26763
|
parentNode: targetNode,
|
|
@@ -26717,7 +26772,7 @@ var TreeController = class extends MDControlController {
|
|
|
26717
26772
|
return;
|
|
26718
26773
|
}
|
|
26719
26774
|
const existNodes = this.state.items.filter(
|
|
26720
|
-
(item) => noExpandKeys.includes(item.
|
|
26775
|
+
(item) => noExpandKeys.includes(item._id)
|
|
26721
26776
|
);
|
|
26722
26777
|
this.state.expandedKeys.push(...noExpandKeys);
|
|
26723
26778
|
if (existNodes.length === 0) {
|
|
@@ -26737,7 +26792,7 @@ var TreeController = class extends MDControlController {
|
|
|
26737
26792
|
* @return {*} {boolean}
|
|
26738
26793
|
*/
|
|
26739
26794
|
calcAllowDrag(draggingNode) {
|
|
26740
|
-
const nodeModel = this.getNodeModel(draggingNode.
|
|
26795
|
+
const nodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26741
26796
|
return (nodeModel == null ? void 0 : nodeModel.allowDrag) === true;
|
|
26742
26797
|
}
|
|
26743
26798
|
/**
|
|
@@ -26751,22 +26806,22 @@ var TreeController = class extends MDControlController {
|
|
|
26751
26806
|
*/
|
|
26752
26807
|
calcAllowDrop(draggingNode, dropNode, type) {
|
|
26753
26808
|
var _a, _b;
|
|
26754
|
-
const draggingNodeModel = this.getNodeModel(draggingNode.
|
|
26809
|
+
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26755
26810
|
if (type === "inner") {
|
|
26756
26811
|
return !!this.findDropNodeRS(
|
|
26757
|
-
dropNode.
|
|
26812
|
+
dropNode._nodeId,
|
|
26758
26813
|
draggingNodeModel.appDataEntityId
|
|
26759
26814
|
);
|
|
26760
26815
|
}
|
|
26761
|
-
if (((_a = draggingNode.
|
|
26762
|
-
const currentNodeModel = this.getNodeModel(dropNode.
|
|
26816
|
+
if (((_a = draggingNode._parent) == null ? void 0 : _a._id) === ((_b = dropNode._parent) == null ? void 0 : _b._id)) {
|
|
26817
|
+
const currentNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
26763
26818
|
return (currentNodeModel == null ? void 0 : currentNodeModel.allowOrder) === true;
|
|
26764
26819
|
}
|
|
26765
|
-
if (!dropNode.
|
|
26820
|
+
if (!dropNode._parent) {
|
|
26766
26821
|
return false;
|
|
26767
26822
|
}
|
|
26768
26823
|
return !!this.findDropNodeRS(
|
|
26769
|
-
dropNode.
|
|
26824
|
+
dropNode._parent._nodeId,
|
|
26770
26825
|
draggingNodeModel.appDataEntityId
|
|
26771
26826
|
);
|
|
26772
26827
|
}
|
|
@@ -26795,44 +26850,44 @@ var TreeController = class extends MDControlController {
|
|
|
26795
26850
|
*/
|
|
26796
26851
|
async onNodeDrop(draggingNode, dropNode, dropType) {
|
|
26797
26852
|
var _a, _b, _c;
|
|
26798
|
-
if (dropType === "inner" && !dropNode.
|
|
26799
|
-
await this.expandNodeByKey([dropNode.
|
|
26853
|
+
if (dropType === "inner" && !dropNode._leaf && dropNode._children === void 0) {
|
|
26854
|
+
await this.expandNodeByKey([dropNode._id]);
|
|
26800
26855
|
}
|
|
26801
26856
|
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.
|
|
26857
|
+
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
26858
|
+
const dropInNode = dropType === "inner" ? dropNode : dropNode._parent;
|
|
26859
|
+
const isChangedParent = (dropNode == null ? void 0 : dropNode._id) !== ((_a = draggingNode._parent) == null ? void 0 : _a._id);
|
|
26860
|
+
let orderNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
26861
|
+
if (dropType === "inner" || ((_b = dropNode._parent) == null ? void 0 : _b._id) !== ((_c = draggingNode._parent) == null ? void 0 : _c._id)) {
|
|
26807
26862
|
const dropNodeRs = this.findDropNodeRS(
|
|
26808
|
-
dropInNode.
|
|
26863
|
+
dropInNode._nodeId,
|
|
26809
26864
|
draggingNodeModel.appDataEntityId
|
|
26810
26865
|
);
|
|
26811
26866
|
if (dropNodeRs) {
|
|
26812
|
-
draggingNode.
|
|
26867
|
+
draggingNode._deData[dropNodeRs.pickupDEFName] = dropInNode._value;
|
|
26813
26868
|
modifiedNodeDatas.push(draggingNode);
|
|
26814
26869
|
orderNodeModel = this.getNodeModel(dropNodeRs.childDETreeNodeId);
|
|
26815
26870
|
}
|
|
26816
26871
|
}
|
|
26817
|
-
const originArr = draggingNode.
|
|
26872
|
+
const originArr = draggingNode._parent._children;
|
|
26818
26873
|
originArr.splice(originArr.indexOf(draggingNode), 1);
|
|
26819
26874
|
if (dropType === "inner") {
|
|
26820
|
-
if (!dropNode.
|
|
26821
|
-
dropNode.
|
|
26822
|
-
dropNode.
|
|
26823
|
-
this.state.expandedKeys.push(dropNode.
|
|
26875
|
+
if (!dropNode._children) {
|
|
26876
|
+
dropNode._children = [];
|
|
26877
|
+
dropNode._leaf = true;
|
|
26878
|
+
this.state.expandedKeys.push(dropNode._id);
|
|
26824
26879
|
}
|
|
26825
|
-
dropNode.
|
|
26880
|
+
dropNode._children.push(draggingNode);
|
|
26826
26881
|
} else {
|
|
26827
|
-
let insertIndex = dropInNode.
|
|
26882
|
+
let insertIndex = dropInNode._children.indexOf(dropNode);
|
|
26828
26883
|
if (dropType === "next") {
|
|
26829
26884
|
insertIndex += 1;
|
|
26830
26885
|
}
|
|
26831
|
-
dropInNode.
|
|
26886
|
+
dropInNode._children.splice(insertIndex, 0, draggingNode);
|
|
26832
26887
|
}
|
|
26833
26888
|
if (dropType === "inner" || isChangedParent) {
|
|
26834
|
-
draggingNode.
|
|
26835
|
-
draggingNode.
|
|
26889
|
+
draggingNode._parent = dropInNode;
|
|
26890
|
+
draggingNode._nodeId = orderNodeModel.id;
|
|
26836
26891
|
this.state.expandedKeys = this.calcExpandedKeys([dropInNode]);
|
|
26837
26892
|
}
|
|
26838
26893
|
const { sortAppDEFieldId, sortDir, allowOrder } = orderNodeModel;
|
|
@@ -26842,7 +26897,7 @@ var TreeController = class extends MDControlController {
|
|
|
26842
26897
|
}
|
|
26843
26898
|
const sortField = sortAppDEFieldId.toLowerCase();
|
|
26844
26899
|
const isAsc = sortDir === "ASC";
|
|
26845
|
-
const changedArr = [...dropInNode.
|
|
26900
|
+
const changedArr = [...dropInNode._children];
|
|
26846
26901
|
if (!isAsc) {
|
|
26847
26902
|
changedArr.reverse();
|
|
26848
26903
|
}
|
|
@@ -26854,13 +26909,13 @@ var TreeController = class extends MDControlController {
|
|
|
26854
26909
|
};
|
|
26855
26910
|
let lastSort;
|
|
26856
26911
|
changedArr.forEach((item, index) => {
|
|
26857
|
-
const deData = item.
|
|
26912
|
+
const deData = item._deData;
|
|
26858
26913
|
if (lastSort === void 0) {
|
|
26859
26914
|
if (item === draggingNode) {
|
|
26860
26915
|
if (index === 0) {
|
|
26861
26916
|
lastSort = 100;
|
|
26862
26917
|
} else {
|
|
26863
|
-
lastSort = getNextSort(getSort(changedArr[index - 1].
|
|
26918
|
+
lastSort = getNextSort(getSort(changedArr[index - 1]._deData));
|
|
26864
26919
|
}
|
|
26865
26920
|
deData[sortField] = lastSort;
|
|
26866
26921
|
if (modifiedNodeDatas.indexOf(item) === -1) {
|
|
@@ -26891,8 +26946,8 @@ var TreeController = class extends MDControlController {
|
|
|
26891
26946
|
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
26892
26947
|
await Promise.all(
|
|
26893
26948
|
nodeDatas.map(async (node) => {
|
|
26894
|
-
const model = this.getNodeModel(node.
|
|
26895
|
-
const deData = node.
|
|
26949
|
+
const model = this.getNodeModel(node._nodeId);
|
|
26950
|
+
const deData = node._deData;
|
|
26896
26951
|
const deName = calcDeCodeNameById(model.appDataEntityId);
|
|
26897
26952
|
const tempContext = this.context.clone();
|
|
26898
26953
|
tempContext[deName] = deData.srfkey;
|
|
@@ -26903,7 +26958,7 @@ var TreeController = class extends MDControlController {
|
|
|
26903
26958
|
deData
|
|
26904
26959
|
);
|
|
26905
26960
|
if (res.data) {
|
|
26906
|
-
node.
|
|
26961
|
+
node._deData = res.data;
|
|
26907
26962
|
}
|
|
26908
26963
|
})
|
|
26909
26964
|
);
|
|
@@ -26917,15 +26972,15 @@ var TreeController = class extends MDControlController {
|
|
|
26917
26972
|
* @return {*} {Promise<void>}
|
|
26918
26973
|
*/
|
|
26919
26974
|
async modifyNodeText(nodeData, text) {
|
|
26920
|
-
const model = this.getNodeModel(nodeData.
|
|
26975
|
+
const model = this.getNodeModel(nodeData._nodeId);
|
|
26921
26976
|
if (!model.allowEditText) {
|
|
26922
26977
|
throw new RuntimeModelError61(model, "\u6811\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u7F16\u8F91\u6A21\u5F0F\uFF1A\u540D\u79F0");
|
|
26923
26978
|
}
|
|
26924
|
-
if (!nodeData.
|
|
26979
|
+
if (!nodeData._deData) {
|
|
26925
26980
|
throw new RuntimeError57("\u4E0D\u662F\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E");
|
|
26926
26981
|
}
|
|
26927
|
-
nodeData.
|
|
26928
|
-
nodeData.
|
|
26982
|
+
nodeData._text = text;
|
|
26983
|
+
nodeData._deData[model.textAppDEFieldId] = text;
|
|
26929
26984
|
await this.updateDeNodeData([nodeData]);
|
|
26930
26985
|
}
|
|
26931
26986
|
};
|
|
@@ -28301,9 +28356,13 @@ var TreeGridExController = class extends TreeController {
|
|
|
28301
28356
|
}
|
|
28302
28357
|
async afterLoadNodes(nodes) {
|
|
28303
28358
|
await super.afterLoadNodes(nodes);
|
|
28304
|
-
recursiveIterate11(
|
|
28305
|
-
|
|
28306
|
-
|
|
28359
|
+
recursiveIterate11(
|
|
28360
|
+
{ _children: nodes },
|
|
28361
|
+
(node) => {
|
|
28362
|
+
this.state.rows[node._uuid] = new TreeGridExRowState(node, this);
|
|
28363
|
+
},
|
|
28364
|
+
{ childrenFields: ["_children"] }
|
|
28365
|
+
);
|
|
28307
28366
|
}
|
|
28308
28367
|
/**
|
|
28309
28368
|
* 转换各类多语言
|
|
@@ -29309,7 +29368,7 @@ var GanttService = class extends TreeService {
|
|
|
29309
29368
|
);
|
|
29310
29369
|
} else {
|
|
29311
29370
|
const childNodeRSs = getChildNodeRSs(this.model, {
|
|
29312
|
-
parentId: parentNodeData.
|
|
29371
|
+
parentId: parentNodeData._nodeId,
|
|
29313
29372
|
hasQuery
|
|
29314
29373
|
});
|
|
29315
29374
|
if (childNodeRSs.length === 0) {
|
|
@@ -29400,7 +29459,7 @@ var GanttService = class extends TreeService {
|
|
|
29400
29459
|
childNode,
|
|
29401
29460
|
opts
|
|
29402
29461
|
);
|
|
29403
|
-
childNode.
|
|
29462
|
+
childNode._children = subChildrenNodes;
|
|
29404
29463
|
}
|
|
29405
29464
|
})
|
|
29406
29465
|
);
|
|
@@ -29588,7 +29647,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
29588
29647
|
* @memberof GanttController
|
|
29589
29648
|
*/
|
|
29590
29649
|
async updateNodeData(nodeData, data, isTransformData = false) {
|
|
29591
|
-
const key = nodeData.srfkey ? "srfkey" : "
|
|
29650
|
+
const key = nodeData.srfkey ? "srfkey" : "_id";
|
|
29592
29651
|
const currentNode = this.state.items.find(
|
|
29593
29652
|
(item) => item[key] === nodeData[key]
|
|
29594
29653
|
);
|
|
@@ -29596,7 +29655,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
29596
29655
|
ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u52A8\u6001\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E", nodeData);
|
|
29597
29656
|
return;
|
|
29598
29657
|
}
|
|
29599
|
-
const nodeModel = this.getNodeModel(currentNode.
|
|
29658
|
+
const nodeModel = this.getNodeModel(currentNode._nodeId);
|
|
29600
29659
|
if (nodeModel) {
|
|
29601
29660
|
const newData = isTransformData ? this.transformNodeDataItem(nodeModel, data) : data;
|
|
29602
29661
|
if (Object.keys(newData).length > 0) {
|
|
@@ -30195,7 +30254,7 @@ var ViewEngineBase = class {
|
|
|
30195
30254
|
|
|
30196
30255
|
// src/engine/md-view.engine.ts
|
|
30197
30256
|
import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
|
|
30198
|
-
import { clone as
|
|
30257
|
+
import { clone as clone25 } from "ramda";
|
|
30199
30258
|
var MDViewEngine = class extends ViewEngineBase {
|
|
30200
30259
|
/**
|
|
30201
30260
|
* 多数据部件名称
|
|
@@ -30403,7 +30462,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30403
30462
|
if (!openAppViewLogic) {
|
|
30404
30463
|
throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
30405
30464
|
}
|
|
30406
|
-
const params =
|
|
30465
|
+
const params = clone25(this.view.params);
|
|
30407
30466
|
if (copyMode) {
|
|
30408
30467
|
params.srfcopymode = copyMode;
|
|
30409
30468
|
}
|