@ibiz-template/runtime 0.5.1-dev.0 → 0.5.1-next.0
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 +93 -55
- package/dist/index.system.min.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/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/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/package.json +3 -3
- 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/interface/controller/state/control/i-gantt.state.ts +6 -6
- 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/dist/index.esm.js
CHANGED
|
@@ -9722,21 +9722,24 @@ var calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
|
9722
9722
|
var GanttStaticNodeData = class extends TreeStaticNodeData {
|
|
9723
9723
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9724
9724
|
super(nodeModel, parentNodeData, opts);
|
|
9725
|
-
this.
|
|
9726
|
-
this.
|
|
9725
|
+
this._sndataIteValue = calcDataItemValue(model.sndataItemName, nodeModel);
|
|
9726
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9727
9727
|
model.beginDataItemName,
|
|
9728
9728
|
nodeModel
|
|
9729
9729
|
);
|
|
9730
|
-
this.
|
|
9731
|
-
|
|
9730
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9731
|
+
model.endDataItemName,
|
|
9732
|
+
nodeModel
|
|
9733
|
+
);
|
|
9734
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9732
9735
|
model.prevDataItemName,
|
|
9733
9736
|
nodeModel
|
|
9734
9737
|
);
|
|
9735
|
-
this.
|
|
9738
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9736
9739
|
model.finishDataItemName,
|
|
9737
9740
|
nodeModel
|
|
9738
9741
|
);
|
|
9739
|
-
this.
|
|
9742
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9740
9743
|
model.totalDataItemName,
|
|
9741
9744
|
nodeModel
|
|
9742
9745
|
);
|
|
@@ -9748,32 +9751,32 @@ var GanttDataSetNodeData = class extends TreeDataSetNodeData {
|
|
|
9748
9751
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9749
9752
|
super(nodeModel, parentNodeData, opts);
|
|
9750
9753
|
const { data } = opts;
|
|
9751
|
-
this.
|
|
9754
|
+
this._sndataIteValue = calcDataItemValue(
|
|
9752
9755
|
model.sndataItemName,
|
|
9753
9756
|
nodeModel,
|
|
9754
9757
|
data
|
|
9755
9758
|
);
|
|
9756
|
-
this.
|
|
9759
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9757
9760
|
model.beginDataItemName,
|
|
9758
9761
|
nodeModel,
|
|
9759
9762
|
data
|
|
9760
9763
|
);
|
|
9761
|
-
this.
|
|
9764
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9762
9765
|
model.endDataItemName,
|
|
9763
9766
|
nodeModel,
|
|
9764
9767
|
data
|
|
9765
9768
|
);
|
|
9766
|
-
this.
|
|
9769
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9767
9770
|
model.prevDataItemName,
|
|
9768
9771
|
nodeModel,
|
|
9769
9772
|
data
|
|
9770
9773
|
);
|
|
9771
|
-
this.
|
|
9774
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9772
9775
|
model.finishDataItemName,
|
|
9773
9776
|
nodeModel,
|
|
9774
9777
|
data
|
|
9775
9778
|
);
|
|
9776
|
-
this.
|
|
9779
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9777
9780
|
model.totalDataItemName,
|
|
9778
9781
|
nodeModel,
|
|
9779
9782
|
data
|
|
@@ -9786,32 +9789,32 @@ var GanttCodeListNodeData = class extends TreeCodeListNodeData {
|
|
|
9786
9789
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
9787
9790
|
super(nodeModel, parentNodeData, opts);
|
|
9788
9791
|
const { data } = opts;
|
|
9789
|
-
this.
|
|
9792
|
+
this._sndataIteValue = calcDataItemValue(
|
|
9790
9793
|
model.sndataItemName,
|
|
9791
9794
|
nodeModel,
|
|
9792
9795
|
data
|
|
9793
9796
|
);
|
|
9794
|
-
this.
|
|
9797
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
9795
9798
|
model.beginDataItemName,
|
|
9796
9799
|
nodeModel,
|
|
9797
9800
|
data
|
|
9798
9801
|
);
|
|
9799
|
-
this.
|
|
9802
|
+
this._endDataItemValue = calcDataItemValue(
|
|
9800
9803
|
model.endDataItemName,
|
|
9801
9804
|
nodeModel,
|
|
9802
9805
|
data
|
|
9803
9806
|
);
|
|
9804
|
-
this.
|
|
9807
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
9805
9808
|
model.prevDataItemName,
|
|
9806
9809
|
nodeModel,
|
|
9807
9810
|
data
|
|
9808
9811
|
);
|
|
9809
|
-
this.
|
|
9812
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
9810
9813
|
model.finishDataItemName,
|
|
9811
9814
|
nodeModel,
|
|
9812
9815
|
data
|
|
9813
9816
|
);
|
|
9814
|
-
this.
|
|
9817
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
9815
9818
|
model.totalDataItemName,
|
|
9816
9819
|
nodeModel,
|
|
9817
9820
|
data
|
|
@@ -24931,7 +24934,7 @@ import {
|
|
|
24931
24934
|
mergeInLeft as mergeInLeft3,
|
|
24932
24935
|
recursiveIterate as recursiveIterate9
|
|
24933
24936
|
} from "@ibiz-template/core";
|
|
24934
|
-
import { isNil as isNil23 } from "ramda";
|
|
24937
|
+
import { clone as clone24, isNil as isNil23 } from "ramda";
|
|
24935
24938
|
|
|
24936
24939
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
24937
24940
|
import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
|
|
@@ -25229,7 +25232,21 @@ function initDefaultEditor() {
|
|
|
25229
25232
|
});
|
|
25230
25233
|
}
|
|
25231
25234
|
initDefaultEditor();
|
|
25232
|
-
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) {
|
|
25233
25250
|
var _a;
|
|
25234
25251
|
if (!json.properties) {
|
|
25235
25252
|
return [];
|
|
@@ -25259,11 +25276,16 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25259
25276
|
addFields.push({
|
|
25260
25277
|
key,
|
|
25261
25278
|
description: properties[key].description,
|
|
25262
|
-
type
|
|
25279
|
+
type,
|
|
25280
|
+
enumSource: properties[key].enumSource
|
|
25263
25281
|
});
|
|
25264
25282
|
});
|
|
25265
25283
|
const codeNameToId = {};
|
|
25266
|
-
|
|
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) => {
|
|
25267
25289
|
codeNameToId[field.codeName.toLowerCase()] = field.id;
|
|
25268
25290
|
});
|
|
25269
25291
|
const addSearchBarFilters = [];
|
|
@@ -25274,18 +25296,18 @@ function calcFilterModelBySchema(json, c) {
|
|
|
25274
25296
|
return;
|
|
25275
25297
|
}
|
|
25276
25298
|
ops.forEach((op) => {
|
|
25277
|
-
|
|
25278
|
-
|
|
25279
|
-
appId,
|
|
25280
|
-
appDEFieldId: codeNameToId[item.key],
|
|
25281
|
-
id: item.key,
|
|
25282
|
-
caption: item.description,
|
|
25283
|
-
defsearchMode: {
|
|
25299
|
+
if (item)
|
|
25300
|
+
addSearchBarFilters.push({
|
|
25284
25301
|
appId,
|
|
25285
|
-
|
|
25286
|
-
|
|
25287
|
-
|
|
25288
|
-
|
|
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
|
+
});
|
|
25289
25311
|
});
|
|
25290
25312
|
});
|
|
25291
25313
|
return addSearchBarFilters;
|
|
@@ -25324,12 +25346,29 @@ var SearchBarController = class extends ControlController {
|
|
|
25324
25346
|
*/
|
|
25325
25347
|
this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
|
|
25326
25348
|
/**
|
|
25327
|
-
*
|
|
25349
|
+
* 是否启用根据实体的JSON Schema生成过滤项
|
|
25328
25350
|
* @author lxm
|
|
25329
|
-
* @date
|
|
25330
|
-
* @type {boolean}
|
|
25351
|
+
* @date 2024-01-05 10:10:37
|
|
25331
25352
|
*/
|
|
25332
|
-
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 || [];
|
|
25333
25372
|
}
|
|
25334
25373
|
/**
|
|
25335
25374
|
* 表格控制器
|
|
@@ -25346,19 +25385,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25346
25385
|
this.state.selectedGroupItem = null;
|
|
25347
25386
|
this.state.searchBarGroups = [];
|
|
25348
25387
|
this.state.selectedSearchGroupItem = null;
|
|
25349
|
-
this.initFilterState();
|
|
25350
|
-
}
|
|
25351
|
-
/**
|
|
25352
|
-
* 初始化Filter相关的属性
|
|
25353
|
-
* @author lxm
|
|
25354
|
-
* @date 2023-12-29 04:18:02
|
|
25355
|
-
* @protected
|
|
25356
|
-
*/
|
|
25357
|
-
initFilterState() {
|
|
25358
25388
|
this.resetFilter();
|
|
25359
25389
|
this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.enableFilter);
|
|
25360
25390
|
}
|
|
25361
25391
|
async onCreated() {
|
|
25392
|
+
await this.initByEntitySchema();
|
|
25362
25393
|
await super.onCreated();
|
|
25363
25394
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
25364
25395
|
this.model.appDataEntityId,
|
|
@@ -25372,7 +25403,6 @@ var SearchBarController = class extends ControlController {
|
|
|
25372
25403
|
this.service = new SearchBarService(this.model, this.view.model.codeName);
|
|
25373
25404
|
await this.service.init(this.context);
|
|
25374
25405
|
}
|
|
25375
|
-
await this.initByEntitySchema();
|
|
25376
25406
|
await this.initSearchBarFilters();
|
|
25377
25407
|
await this.initSearBarGroups();
|
|
25378
25408
|
}
|
|
@@ -25384,12 +25414,17 @@ var SearchBarController = class extends ControlController {
|
|
|
25384
25414
|
*/
|
|
25385
25415
|
async initByEntitySchema() {
|
|
25386
25416
|
var _a;
|
|
25387
|
-
this.
|
|
25388
|
-
|
|
25417
|
+
if (!this.addSchemaFilters) {
|
|
25418
|
+
return;
|
|
25419
|
+
}
|
|
25420
|
+
const json = await getEntitySchema(
|
|
25421
|
+
this.model.appDataEntityId,
|
|
25422
|
+
this.context
|
|
25423
|
+
);
|
|
25389
25424
|
if (!json) {
|
|
25390
25425
|
return;
|
|
25391
25426
|
}
|
|
25392
|
-
const addSearchBarFilters = calcFilterModelBySchema(json, this);
|
|
25427
|
+
const addSearchBarFilters = await calcFilterModelBySchema(json, this);
|
|
25393
25428
|
const mergeFilters = [];
|
|
25394
25429
|
(_a = this.model.searchBarFilters) == null ? void 0 : _a.forEach((filter) => {
|
|
25395
25430
|
const findindex = addSearchBarFilters.findIndex(
|
|
@@ -25402,8 +25437,11 @@ var SearchBarController = class extends ControlController {
|
|
|
25402
25437
|
mergeFilters.push(filter);
|
|
25403
25438
|
}
|
|
25404
25439
|
});
|
|
25405
|
-
addSearchBarFilters.
|
|
25406
|
-
|
|
25440
|
+
if (addSearchBarFilters.length > 0) {
|
|
25441
|
+
this.model = clone24(this.model);
|
|
25442
|
+
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
25443
|
+
this.model.enableFilter = true;
|
|
25444
|
+
}
|
|
25407
25445
|
}
|
|
25408
25446
|
/**
|
|
25409
25447
|
* 计算快速搜索的占位
|
|
@@ -25517,7 +25555,7 @@ var SearchBarController = class extends ControlController {
|
|
|
25517
25555
|
* @return {*} {IData}
|
|
25518
25556
|
*/
|
|
25519
25557
|
calcFilters() {
|
|
25520
|
-
if (!this.
|
|
25558
|
+
if (!this.enableFilter) {
|
|
25521
25559
|
return;
|
|
25522
25560
|
}
|
|
25523
25561
|
let hasFilter = false;
|
|
@@ -30216,7 +30254,7 @@ var ViewEngineBase = class {
|
|
|
30216
30254
|
|
|
30217
30255
|
// src/engine/md-view.engine.ts
|
|
30218
30256
|
import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
|
|
30219
|
-
import { clone as
|
|
30257
|
+
import { clone as clone25 } from "ramda";
|
|
30220
30258
|
var MDViewEngine = class extends ViewEngineBase {
|
|
30221
30259
|
/**
|
|
30222
30260
|
* 多数据部件名称
|
|
@@ -30424,7 +30462,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30424
30462
|
if (!openAppViewLogic) {
|
|
30425
30463
|
throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
30426
30464
|
}
|
|
30427
|
-
const params =
|
|
30465
|
+
const params = clone25(this.view.params);
|
|
30428
30466
|
if (copyMode) {
|
|
30429
30467
|
params.srfcopymode = copyMode;
|
|
30430
30468
|
}
|