@ibiz-template/runtime 0.5.1-beta.1 → 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 +146 -86
- 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 -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 +1 -1
- 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 +1 -1
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +5 -5
- 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 +6 -6
- package/out/interface/controller/state/control/i-gantt.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 +6 -6
- 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 +6 -6
- 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 +6 -6
- 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.js +2 -2
- 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 +11 -9
- 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 +0 -2
- 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 +2 -2
- package/package.json +5 -5
- package/src/constant/view-type.ts +5 -0
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +1 -1
- 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 +12 -7
- 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 +6 -6
- 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 +12 -12
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +12 -12
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +15 -12
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +2 -2
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +12 -9
- package/src/service/vo/tree-node-data/tree-node-data.ts +0 -3
- package/src/service/vo/tree-node-data/tree-static-node-data.ts +3 -2
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
|
}
|
|
@@ -9133,8 +9146,6 @@ function presetDEMethodProvider() {
|
|
|
9133
9146
|
// src/service/vo/tree-node-data/tree-node-data.ts
|
|
9134
9147
|
import { createUUID as createUUID5 } from "qx-util";
|
|
9135
9148
|
var TreeNodeData = class {
|
|
9136
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9137
|
-
// [key: string | symbol]: any;
|
|
9138
9149
|
constructor(model, parentNodeData, opts) {
|
|
9139
9150
|
this._uuid = createUUID5();
|
|
9140
9151
|
this._leaf = false;
|
|
@@ -9183,9 +9194,9 @@ var TreeCodeListNodeData = class extends TreeNodeData {
|
|
|
9183
9194
|
this._text = data.text;
|
|
9184
9195
|
this._value = data.value;
|
|
9185
9196
|
const selfId = "".concat(model.id, "@").concat(this._value).toLowerCase();
|
|
9186
|
-
Object.defineProperty(this, "
|
|
9197
|
+
Object.defineProperty(this, "_id", {
|
|
9187
9198
|
get() {
|
|
9188
|
-
return this._parent ? "".concat(this._parent.
|
|
9199
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9189
9200
|
},
|
|
9190
9201
|
enumerable: true,
|
|
9191
9202
|
configurable: true
|
|
@@ -9213,9 +9224,9 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9213
9224
|
this._text = model.textAppDEFieldId ? data[model.textAppDEFieldId] : data.srfmajortext;
|
|
9214
9225
|
this._value = model.idAppDEFieldId ? data[model.idAppDEFieldId] : data.srfkey;
|
|
9215
9226
|
const selfId = "".concat(model.id, "@").concat(data.srfkey).toLowerCase();
|
|
9216
|
-
Object.defineProperty(this, "
|
|
9227
|
+
Object.defineProperty(this, "_id", {
|
|
9217
9228
|
get() {
|
|
9218
|
-
return this._parent ? "".concat(this._parent.
|
|
9229
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9219
9230
|
},
|
|
9220
9231
|
enumerable: true,
|
|
9221
9232
|
configurable: true
|
|
@@ -9231,12 +9242,14 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9231
9242
|
if (model.leafFlagAppDEFieldId) {
|
|
9232
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
|
}
|
|
@@ -9245,8 +9258,8 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9245
9258
|
set(target, p, value) {
|
|
9246
9259
|
if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
|
|
9247
9260
|
target._deData[p] = value;
|
|
9248
|
-
} else if (
|
|
9249
|
-
target._deData[
|
|
9261
|
+
} else if (dataItemKeyMap.has(p)) {
|
|
9262
|
+
target._deData[dataItemKeyMap.get(p)] = value;
|
|
9250
9263
|
} else {
|
|
9251
9264
|
target[p] = value;
|
|
9252
9265
|
}
|
|
@@ -9256,8 +9269,8 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9256
9269
|
if (target[p] !== void 0) {
|
|
9257
9270
|
return target[p];
|
|
9258
9271
|
}
|
|
9259
|
-
if (
|
|
9260
|
-
return target._deData[
|
|
9272
|
+
if (dataItemKeyMap.has(p)) {
|
|
9273
|
+
return target._deData[dataItemKeyMap.get(p)] || dataItemDefaults[p];
|
|
9261
9274
|
}
|
|
9262
9275
|
if (target._deData[p] !== void 0) {
|
|
9263
9276
|
return target._deData[p];
|
|
@@ -9267,7 +9280,7 @@ var TreeDataSetNodeData = class extends TreeNodeData {
|
|
|
9267
9280
|
const allKeys = [
|
|
9268
9281
|
.../* @__PURE__ */ new Set([
|
|
9269
9282
|
...Object.keys(target),
|
|
9270
|
-
...
|
|
9283
|
+
...dataItemKeyMap.keys(),
|
|
9271
9284
|
...Object.keys(target._deData)
|
|
9272
9285
|
])
|
|
9273
9286
|
];
|
|
@@ -9336,9 +9349,9 @@ 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._parent ? "".concat(this._parent.
|
|
9354
|
+
return this._parent ? "".concat(this._parent._id, ":").concat(selfId) : selfId;
|
|
9342
9355
|
},
|
|
9343
9356
|
enumerable: true,
|
|
9344
9357
|
configurable: true
|
|
@@ -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
|
|
@@ -24918,7 +24934,7 @@ import {
|
|
|
24918
24934
|
mergeInLeft as mergeInLeft3,
|
|
24919
24935
|
recursiveIterate as recursiveIterate9
|
|
24920
24936
|
} from "@ibiz-template/core";
|
|
24921
|
-
import { isNil as isNil23 } from "ramda";
|
|
24937
|
+
import { clone as clone24, isNil as isNil23 } from "ramda";
|
|
24922
24938
|
|
|
24923
24939
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
24924
24940
|
import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
|
|
@@ -25216,7 +25232,21 @@ function initDefaultEditor() {
|
|
|
25216
25232
|
});
|
|
25217
25233
|
}
|
|
25218
25234
|
initDefaultEditor();
|
|
25219
|
-
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) {
|
|
25220
25250
|
var _a;
|
|
25221
25251
|
if (!json.properties) {
|
|
25222
25252
|
return [];
|
|
@@ -25246,11 +25276,16 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25246
25276
|
addFields.push({
|
|
25247
25277
|
key,
|
|
25248
25278
|
description: properties[key].description,
|
|
25249
|
-
type
|
|
25279
|
+
type,
|
|
25280
|
+
enumSource: properties[key].enumSource
|
|
25250
25281
|
});
|
|
25251
25282
|
});
|
|
25252
25283
|
const codeNameToId = {};
|
|
25253
|
-
|
|
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) => {
|
|
25254
25289
|
codeNameToId[field.codeName.toLowerCase()] = field.id;
|
|
25255
25290
|
});
|
|
25256
25291
|
const addSearchBarFilters = [];
|
|
@@ -25261,18 +25296,18 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25261
25296
|
return;
|
|
25262
25297
|
}
|
|
25263
25298
|
ops.forEach((op) => {
|
|
25264
|
-
|
|
25265
|
-
|
|
25266
|
-
appId,
|
|
25267
|
-
appDEFieldId: codeNameToId[item.key],
|
|
25268
|
-
id: item.key,
|
|
25269
|
-
caption: item.description,
|
|
25270
|
-
defsearchMode: {
|
|
25299
|
+
if (item)
|
|
25300
|
+
addSearchBarFilters.push({
|
|
25271
25301
|
appId,
|
|
25272
|
-
|
|
25273
|
-
|
|
25274
|
-
|
|
25275
|
-
|
|
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
|
+
});
|
|
25276
25311
|
});
|
|
25277
25312
|
});
|
|
25278
25313
|
return addSearchBarFilters;
|
|
@@ -25311,12 +25346,29 @@ var SearchBarController = class extends ControlController {
|
|
|
25311
25346
|
*/
|
|
25312
25347
|
this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
|
|
25313
25348
|
/**
|
|
25314
|
-
*
|
|
25349
|
+
* 是否启用根据实体的JSON Schema生成过滤项
|
|
25315
25350
|
* @author lxm
|
|
25316
|
-
* @date
|
|
25317
|
-
* @type {boolean}
|
|
25351
|
+
* @date 2024-01-05 10:10:37
|
|
25318
25352
|
*/
|
|
25319
|
-
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 || [];
|
|
25320
25372
|
}
|
|
25321
25373
|
/**
|
|
25322
25374
|
* 表格控制器
|
|
@@ -25333,19 +25385,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25333
25385
|
this.state.selectedGroupItem = null;
|
|
25334
25386
|
this.state.searchBarGroups = [];
|
|
25335
25387
|
this.state.selectedSearchGroupItem = null;
|
|
25336
|
-
this.initFilterState();
|
|
25337
|
-
}
|
|
25338
|
-
/**
|
|
25339
|
-
* 初始化Filter相关的属性
|
|
25340
|
-
* @author lxm
|
|
25341
|
-
* @date 2023-12-29 04:18:02
|
|
25342
|
-
* @protected
|
|
25343
|
-
*/
|
|
25344
|
-
initFilterState() {
|
|
25345
25388
|
this.resetFilter();
|
|
25346
25389
|
this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.enableFilter);
|
|
25347
25390
|
}
|
|
25348
25391
|
async onCreated() {
|
|
25392
|
+
await this.initByEntitySchema();
|
|
25349
25393
|
await super.onCreated();
|
|
25350
25394
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
25351
25395
|
this.model.appDataEntityId,
|
|
@@ -25359,7 +25403,6 @@ var SearchBarController = class extends ControlController {
|
|
|
25359
25403
|
this.service = new SearchBarService(this.model, this.view.model.codeName);
|
|
25360
25404
|
await this.service.init(this.context);
|
|
25361
25405
|
}
|
|
25362
|
-
await this.initByEntitySchema();
|
|
25363
25406
|
await this.initSearchBarFilters();
|
|
25364
25407
|
await this.initSearBarGroups();
|
|
25365
25408
|
}
|
|
@@ -25371,12 +25414,17 @@ var SearchBarController = class extends ControlController {
|
|
|
25371
25414
|
*/
|
|
25372
25415
|
async initByEntitySchema() {
|
|
25373
25416
|
var _a;
|
|
25374
|
-
this.
|
|
25375
|
-
|
|
25417
|
+
if (!this.addSchemaFilters) {
|
|
25418
|
+
return;
|
|
25419
|
+
}
|
|
25420
|
+
const json = await getEntitySchema(
|
|
25421
|
+
this.model.appDataEntityId,
|
|
25422
|
+
this.context
|
|
25423
|
+
);
|
|
25376
25424
|
if (!json) {
|
|
25377
25425
|
return;
|
|
25378
25426
|
}
|
|
25379
|
-
const addSearchBarFilters = calcFilterModelBySchema(json, this);
|
|
25427
|
+
const addSearchBarFilters = await calcFilterModelBySchema(json, this);
|
|
25380
25428
|
const mergeFilters = [];
|
|
25381
25429
|
(_a = this.model.searchBarFilters) == null ? void 0 : _a.forEach((filter) => {
|
|
25382
25430
|
const findindex = addSearchBarFilters.findIndex(
|
|
@@ -25389,8 +25437,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25389
25437
|
mergeFilters.push(filter);
|
|
25390
25438
|
}
|
|
25391
25439
|
});
|
|
25392
|
-
addSearchBarFilters.
|
|
25393
|
-
|
|
25440
|
+
if (addSearchBarFilters.length > 0) {
|
|
25441
|
+
this.model = clone24(this.model);
|
|
25442
|
+
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
25443
|
+
this.model.enableFilter = true;
|
|
25444
|
+
}
|
|
25394
25445
|
}
|
|
25395
25446
|
/**
|
|
25396
25447
|
* 计算快速搜索的占位
|
|
@@ -25504,7 +25555,7 @@ var SearchBarController = class extends ControlController {
|
|
|
25504
25555
|
* @return {*} {IData}
|
|
25505
25556
|
*/
|
|
25506
25557
|
calcFilters() {
|
|
25507
|
-
if (!this.
|
|
25558
|
+
if (!this.enableFilter) {
|
|
25508
25559
|
return;
|
|
25509
25560
|
}
|
|
25510
25561
|
let hasFilter = false;
|
|
@@ -26492,10 +26543,11 @@ var TreeController = class extends MDControlController {
|
|
|
26492
26543
|
async afterLoadNodes(nodes) {
|
|
26493
26544
|
this.state.items = [];
|
|
26494
26545
|
recursiveIterate10(
|
|
26495
|
-
{
|
|
26546
|
+
{ _children: this.state.rootNodes },
|
|
26496
26547
|
(node) => {
|
|
26497
26548
|
this.state.items.push(node);
|
|
26498
|
-
}
|
|
26549
|
+
},
|
|
26550
|
+
{ childrenFields: ["_children"] }
|
|
26499
26551
|
);
|
|
26500
26552
|
this.state.expandedKeys = this.calcExpandedKeys(nodes);
|
|
26501
26553
|
}
|
|
@@ -26594,7 +26646,7 @@ var TreeController = class extends MDControlController {
|
|
|
26594
26646
|
* 通过标识获取节点数据
|
|
26595
26647
|
* @author lxm
|
|
26596
26648
|
* @date 2023-12-22 02:21:38
|
|
26597
|
-
* @param {string}
|
|
26649
|
+
* @param {string} key 可以是节点_id也可以是_uuid
|
|
26598
26650
|
* @return {*} {(ITreeNodeData | undefined)}
|
|
26599
26651
|
*/
|
|
26600
26652
|
getNodeData(key) {
|
|
@@ -26668,12 +26720,16 @@ var TreeController = class extends MDControlController {
|
|
|
26668
26720
|
*/
|
|
26669
26721
|
calcExpandedKeys(nodes) {
|
|
26670
26722
|
let expandedKeys = [...this.state.expandedKeys];
|
|
26671
|
-
recursiveIterate10(
|
|
26672
|
-
|
|
26673
|
-
|
|
26674
|
-
|
|
26675
|
-
|
|
26676
|
-
|
|
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
|
+
);
|
|
26677
26733
|
expandedKeys = Array.from(new Set(expandedKeys));
|
|
26678
26734
|
return expandedKeys;
|
|
26679
26735
|
}
|
|
@@ -28300,9 +28356,13 @@ var TreeGridExController = class extends TreeController {
|
|
|
28300
28356
|
}
|
|
28301
28357
|
async afterLoadNodes(nodes) {
|
|
28302
28358
|
await super.afterLoadNodes(nodes);
|
|
28303
|
-
recursiveIterate11(
|
|
28304
|
-
|
|
28305
|
-
|
|
28359
|
+
recursiveIterate11(
|
|
28360
|
+
{ _children: nodes },
|
|
28361
|
+
(node) => {
|
|
28362
|
+
this.state.rows[node._uuid] = new TreeGridExRowState(node, this);
|
|
28363
|
+
},
|
|
28364
|
+
{ childrenFields: ["_children"] }
|
|
28365
|
+
);
|
|
28306
28366
|
}
|
|
28307
28367
|
/**
|
|
28308
28368
|
* 转换各类多语言
|
|
@@ -30194,7 +30254,7 @@ var ViewEngineBase = class {
|
|
|
30194
30254
|
|
|
30195
30255
|
// src/engine/md-view.engine.ts
|
|
30196
30256
|
import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
|
|
30197
|
-
import { clone as
|
|
30257
|
+
import { clone as clone25 } from "ramda";
|
|
30198
30258
|
var MDViewEngine = class extends ViewEngineBase {
|
|
30199
30259
|
/**
|
|
30200
30260
|
* 多数据部件名称
|
|
@@ -30402,7 +30462,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30402
30462
|
if (!openAppViewLogic) {
|
|
30403
30463
|
throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
30404
30464
|
}
|
|
30405
|
-
const params =
|
|
30465
|
+
const params = clone25(this.view.params);
|
|
30406
30466
|
if (copyMode) {
|
|
30407
30467
|
params.srfcopymode = copyMode;
|
|
30408
30468
|
}
|