@ibiz-template/runtime 0.1.35 → 0.1.36
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 +363 -70
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/constant/index.d.ts +1 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -0
- package/out/constant/value-op.d.ts +82 -0
- package/out/constant/value-op.d.ts.map +1 -0
- package/out/constant/value-op.js +83 -0
- package/out/controller/control/form/search-form/search-form.controller.d.ts +2 -2
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +11 -3
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts +38 -3
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +110 -3
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts +65 -0
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts.map +1 -0
- package/out/controller/control/search-bar/search-bar-filter.controller.js +48 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts +63 -4
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +143 -9
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +2 -23
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts +2 -2
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +75 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +2 -2
- package/package.json +3 -3
- package/src/constant/index.ts +1 -0
- package/src/constant/value-op.ts +82 -0
- package/src/controller/control/form/search-form/search-form.controller.ts +11 -3
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +136 -3
- package/src/controller/control/search-bar/search-bar-filter.controller.ts +112 -0
- package/src/controller/control/search-bar/search-bar.controller.ts +165 -9
- package/src/engine/md-view.engine.ts +2 -27
- package/src/interface/controller/controller/control/i-search-bar.controller.ts +10 -1
- package/src/interface/controller/controller/control/i-search-form.controller.ts +2 -2
- package/src/interface/controller/state/control/i-search-bar.state.ts +86 -0
- package/src/service/service/entity/method/method.ts +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -8389,6 +8389,29 @@ var ViewCallTag = /* @__PURE__ */ ((ViewCallTag2) => {
|
|
|
8389
8389
|
return ViewCallTag2;
|
|
8390
8390
|
})(ViewCallTag || {});
|
|
8391
8391
|
|
|
8392
|
+
// src/constant/value-op.ts
|
|
8393
|
+
var ValueOP = /* @__PURE__ */ ((ValueOP2) => {
|
|
8394
|
+
ValueOP2["EQ"] = "EQ";
|
|
8395
|
+
ValueOP2["NOT_EQ"] = "NOTEQ";
|
|
8396
|
+
ValueOP2["GT"] = "GT";
|
|
8397
|
+
ValueOP2["GT_AND_EQ"] = "GTANDEQ";
|
|
8398
|
+
ValueOP2["LT"] = "LT";
|
|
8399
|
+
ValueOP2["LT_AND_EQ"] = "LTANDEQ";
|
|
8400
|
+
ValueOP2["IS_NULL"] = "ISNULL";
|
|
8401
|
+
ValueOP2["IS_NOT_NULL"] = "ISNOTNULL";
|
|
8402
|
+
ValueOP2["IN"] = "IN";
|
|
8403
|
+
ValueOP2["NOT_IN"] = "NOTIN";
|
|
8404
|
+
ValueOP2["LIKE"] = "LIKE";
|
|
8405
|
+
ValueOP2["LIFT_LIKE"] = "LIFTLIKE";
|
|
8406
|
+
ValueOP2["RIGHT_LIKE"] = "RIGHT_LIKE";
|
|
8407
|
+
ValueOP2["CHILD_OF"] = "CHILDOF";
|
|
8408
|
+
ValueOP2["USER_LIKE"] = "USERLIKE";
|
|
8409
|
+
ValueOP2["BIT_AND"] = "BITAND";
|
|
8410
|
+
ValueOP2["EXISTS"] = "EXISTS";
|
|
8411
|
+
ValueOP2["NOT_EXISTS"] = "NOTEXISTS";
|
|
8412
|
+
return ValueOP2;
|
|
8413
|
+
})(ValueOP || {});
|
|
8414
|
+
|
|
8392
8415
|
// src/constant/studio-event.ts
|
|
8393
8416
|
var StudioViewEvents = class {
|
|
8394
8417
|
};
|
|
@@ -11457,7 +11480,7 @@ var Method = class {
|
|
|
11457
11480
|
case "POST":
|
|
11458
11481
|
res = await this.app.net.post(
|
|
11459
11482
|
this.mergeRequestPath(path2, methodName),
|
|
11460
|
-
notNilEmpty6(data) ? data : params
|
|
11483
|
+
notNilEmpty6(data) ? data : params || {}
|
|
11461
11484
|
);
|
|
11462
11485
|
break;
|
|
11463
11486
|
case "GET":
|
|
@@ -11469,7 +11492,7 @@ var Method = class {
|
|
|
11469
11492
|
case "PUT": {
|
|
11470
11493
|
res = await this.app.net.put(
|
|
11471
11494
|
this.mergeRequestPath(path2, methodName),
|
|
11472
|
-
notNilEmpty6(data) ? data : params
|
|
11495
|
+
notNilEmpty6(data) ? data : params || {}
|
|
11473
11496
|
);
|
|
11474
11497
|
break;
|
|
11475
11498
|
}
|
|
@@ -22340,14 +22363,21 @@ var SearchFormController = class extends FormController {
|
|
|
22340
22363
|
return this.data;
|
|
22341
22364
|
}
|
|
22342
22365
|
/**
|
|
22343
|
-
*
|
|
22366
|
+
* 获取搜索表单的过滤参数
|
|
22344
22367
|
*
|
|
22345
22368
|
* @author lxm
|
|
22346
22369
|
* @date 2022-09-22 17:09:21
|
|
22347
22370
|
* @returns {*} {IParams}
|
|
22348
22371
|
*/
|
|
22349
|
-
|
|
22350
|
-
|
|
22372
|
+
getFilterParams() {
|
|
22373
|
+
const filterParams = {};
|
|
22374
|
+
Object.keys(this.state.data).forEach((key) => {
|
|
22375
|
+
const value = this.state.data[key];
|
|
22376
|
+
if (value !== null && value !== void 0 && value !== "") {
|
|
22377
|
+
filterParams[key] = value;
|
|
22378
|
+
}
|
|
22379
|
+
});
|
|
22380
|
+
return filterParams;
|
|
22351
22381
|
}
|
|
22352
22382
|
/**
|
|
22353
22383
|
* 执行搜索行为
|
|
@@ -27558,45 +27588,116 @@ var PickupViewPanelController = class extends ControlController {
|
|
|
27558
27588
|
}
|
|
27559
27589
|
};
|
|
27560
27590
|
|
|
27591
|
+
// src/controller/control/search-bar/search-bar.controller.ts
|
|
27592
|
+
import { recursiveIterate as recursiveIterate6 } from "@ibiz-template/core";
|
|
27593
|
+
import { isNil as isNil20 } from "ramda";
|
|
27594
|
+
|
|
27595
|
+
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
27596
|
+
import { RuntimeModelError as RuntimeModelError55 } from "@ibiz-template/core";
|
|
27597
|
+
var SearchBarFilterController = class {
|
|
27598
|
+
constructor(model, searchBar) {
|
|
27599
|
+
this.model = model;
|
|
27600
|
+
this.searchBar = searchBar;
|
|
27601
|
+
var _a;
|
|
27602
|
+
let field;
|
|
27603
|
+
if (model.appDEFieldId) {
|
|
27604
|
+
field = findFieldById(searchBar.appDataEntity, model.appDEFieldId);
|
|
27605
|
+
}
|
|
27606
|
+
this.fieldName = field ? field.codeName.toLowerCase() : model.id;
|
|
27607
|
+
this.label = model.caption || (field == null ? void 0 : field.logicName) || model.id;
|
|
27608
|
+
this.valueOP = (_a = model.defsearchMode) == null ? void 0 : _a.valueOP;
|
|
27609
|
+
}
|
|
27610
|
+
get context() {
|
|
27611
|
+
return this.searchBar.context;
|
|
27612
|
+
}
|
|
27613
|
+
get params() {
|
|
27614
|
+
return this.searchBar.params;
|
|
27615
|
+
}
|
|
27616
|
+
/**
|
|
27617
|
+
* 初始化
|
|
27618
|
+
* @author lxm
|
|
27619
|
+
* @date 2023-10-12 05:47:19
|
|
27620
|
+
* @return {*} {Promise<void>}
|
|
27621
|
+
*/
|
|
27622
|
+
async init() {
|
|
27623
|
+
if (!this.model.editor) {
|
|
27624
|
+
throw new RuntimeModelError55(this.model, "\u7F3A\u5C11\u7F16\u8F91\u5668\u6A21\u578B");
|
|
27625
|
+
}
|
|
27626
|
+
this.editorProvider = await getEditorProvider(this.model.editor);
|
|
27627
|
+
if (this.editorProvider) {
|
|
27628
|
+
this.editor = await this.editorProvider.createController(
|
|
27629
|
+
this.model.editor,
|
|
27630
|
+
this
|
|
27631
|
+
);
|
|
27632
|
+
}
|
|
27633
|
+
}
|
|
27634
|
+
};
|
|
27635
|
+
|
|
27561
27636
|
// src/controller/control/search-bar/search-bar.controller.ts
|
|
27562
27637
|
var SearchBarController = class extends ControlController {
|
|
27563
27638
|
constructor() {
|
|
27564
27639
|
super(...arguments);
|
|
27565
27640
|
/**
|
|
27566
|
-
*
|
|
27641
|
+
* 快速搜索占位符
|
|
27567
27642
|
* @return {*}
|
|
27568
27643
|
* @author: zhujiamin
|
|
27569
27644
|
* @Date: 2023-08-11 14:13:10
|
|
27570
27645
|
*/
|
|
27571
27646
|
this.placeHolder = "";
|
|
27647
|
+
/**
|
|
27648
|
+
* 过滤项控制器集合
|
|
27649
|
+
* @author lxm
|
|
27650
|
+
* @date 2023-10-13 03:31:26
|
|
27651
|
+
* @type {SearchBarFilterController[]}
|
|
27652
|
+
*/
|
|
27653
|
+
this.filterControllers = [];
|
|
27572
27654
|
}
|
|
27573
27655
|
initState() {
|
|
27574
27656
|
super.initState();
|
|
27575
27657
|
this.state.query = "";
|
|
27576
27658
|
this.state.selectedGroupItem = null;
|
|
27577
27659
|
this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.model.enableFilter);
|
|
27660
|
+
if (this.model.enableFilter) {
|
|
27661
|
+
this.resetFilter();
|
|
27662
|
+
}
|
|
27578
27663
|
}
|
|
27579
27664
|
async onCreated() {
|
|
27580
|
-
var _a;
|
|
27581
27665
|
await super.onCreated();
|
|
27582
27666
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
27583
27667
|
this.model.appDataEntityId,
|
|
27584
27668
|
this.context.srfappid
|
|
27585
27669
|
);
|
|
27586
27670
|
if (appDataEntity) {
|
|
27587
|
-
|
|
27588
|
-
|
|
27589
|
-
|
|
27671
|
+
this.appDataEntity = appDataEntity;
|
|
27672
|
+
this.calcQuickSearchPlaceholder();
|
|
27673
|
+
}
|
|
27674
|
+
await this.initSearchBarFilters();
|
|
27675
|
+
}
|
|
27676
|
+
/**
|
|
27677
|
+
* 计算快速搜索的占位
|
|
27678
|
+
* @author lxm
|
|
27679
|
+
* @date 2023-10-16 03:49:47
|
|
27680
|
+
* @protected
|
|
27681
|
+
* @return {*} {void}
|
|
27682
|
+
*/
|
|
27683
|
+
calcQuickSearchPlaceholder() {
|
|
27684
|
+
if (!this.appDataEntity) {
|
|
27685
|
+
return;
|
|
27686
|
+
}
|
|
27687
|
+
const searchFields = this.appDataEntity.appDEFields.filter((field) => {
|
|
27688
|
+
return field.enableQuickSearch;
|
|
27689
|
+
});
|
|
27690
|
+
if (searchFields.length) {
|
|
27590
27691
|
const placeHolders = [];
|
|
27591
|
-
searchFields
|
|
27592
|
-
if (
|
|
27692
|
+
searchFields.forEach((searchField) => {
|
|
27693
|
+
if (searchField.lnlanguageRes && searchField.lnlanguageRes.lanResTag) {
|
|
27593
27694
|
placeHolders.push(
|
|
27594
27695
|
ibiz.i18n.t(
|
|
27595
27696
|
searchField.lnlanguageRes.lanResTag,
|
|
27596
27697
|
searchField.logicName
|
|
27597
27698
|
)
|
|
27598
27699
|
);
|
|
27599
|
-
} else if (searchField
|
|
27700
|
+
} else if (searchField.logicName) {
|
|
27600
27701
|
placeHolders.push(searchField.logicName);
|
|
27601
27702
|
}
|
|
27602
27703
|
});
|
|
@@ -27621,9 +27722,114 @@ var SearchBarController = class extends ControlController {
|
|
|
27621
27722
|
* @author: zhujiamin
|
|
27622
27723
|
* @Date: 2023-06-01 18:08:18
|
|
27623
27724
|
*/
|
|
27624
|
-
|
|
27725
|
+
onSearch() {
|
|
27625
27726
|
this.evt.emit("onSearch", void 0);
|
|
27626
27727
|
}
|
|
27728
|
+
/**
|
|
27729
|
+
* 获取搜索栏的过滤参数(包括快速搜索,快速分组和过滤器的参数)
|
|
27730
|
+
* @author lxm
|
|
27731
|
+
* @date 2023-10-16 03:54:07
|
|
27732
|
+
* @return {*} {IParams}
|
|
27733
|
+
*/
|
|
27734
|
+
getFilterParams() {
|
|
27735
|
+
var _a;
|
|
27736
|
+
const params = {};
|
|
27737
|
+
if (this.state.query) {
|
|
27738
|
+
params.query = this.state.query;
|
|
27739
|
+
}
|
|
27740
|
+
if ((_a = this.state.selectedGroupItem) == null ? void 0 : _a.data) {
|
|
27741
|
+
const func = new Function(
|
|
27742
|
+
"return (".concat(this.state.selectedGroupItem.data, ");")
|
|
27743
|
+
);
|
|
27744
|
+
const addParams = func();
|
|
27745
|
+
Object.assign(params, addParams);
|
|
27746
|
+
}
|
|
27747
|
+
const filters = this.calcFilters();
|
|
27748
|
+
if (filters) {
|
|
27749
|
+
params.filters = filters;
|
|
27750
|
+
}
|
|
27751
|
+
return params;
|
|
27752
|
+
}
|
|
27753
|
+
/**
|
|
27754
|
+
* 重置过滤器
|
|
27755
|
+
* @author lxm
|
|
27756
|
+
* @date 2023-10-16 03:52:44
|
|
27757
|
+
*/
|
|
27758
|
+
resetFilter() {
|
|
27759
|
+
this.state.filterNodes = [
|
|
27760
|
+
{
|
|
27761
|
+
leaf: false,
|
|
27762
|
+
logicType: "AND",
|
|
27763
|
+
children: [{ leaf: true, field: null, valueOP: null, value: null }]
|
|
27764
|
+
}
|
|
27765
|
+
];
|
|
27766
|
+
}
|
|
27767
|
+
/**
|
|
27768
|
+
* 初始化过滤项控制器
|
|
27769
|
+
* @author lxm
|
|
27770
|
+
* @date 2023-10-13 03:33:17
|
|
27771
|
+
* @protected
|
|
27772
|
+
* @return {*} {Promise<void>}
|
|
27773
|
+
*/
|
|
27774
|
+
async initSearchBarFilters() {
|
|
27775
|
+
var _a;
|
|
27776
|
+
if ((_a = this.model.searchBarFilters) == null ? void 0 : _a.length) {
|
|
27777
|
+
this.model.searchBarFilters.forEach((item) => {
|
|
27778
|
+
const filterController = new SearchBarFilterController(item, this);
|
|
27779
|
+
this.filterControllers.push(filterController);
|
|
27780
|
+
});
|
|
27781
|
+
await Promise.all(
|
|
27782
|
+
this.filterControllers.map((controller) => controller.init())
|
|
27783
|
+
);
|
|
27784
|
+
}
|
|
27785
|
+
}
|
|
27786
|
+
/**
|
|
27787
|
+
* 计算过滤项参数
|
|
27788
|
+
* @author lxm
|
|
27789
|
+
* @date 2023-10-13 05:53:35
|
|
27790
|
+
* @return {*} {IData}
|
|
27791
|
+
*/
|
|
27792
|
+
calcFilters() {
|
|
27793
|
+
if (!this.model.enableFilter) {
|
|
27794
|
+
return;
|
|
27795
|
+
}
|
|
27796
|
+
let hasFilter = false;
|
|
27797
|
+
let hasError = false;
|
|
27798
|
+
recursiveIterate6(this.state.filterNodes[0], (node) => {
|
|
27799
|
+
if (node.leaf) {
|
|
27800
|
+
if (node.field && node.valueOP && !isNil20(node.value)) {
|
|
27801
|
+
hasFilter = true;
|
|
27802
|
+
} else {
|
|
27803
|
+
hasError = true;
|
|
27804
|
+
}
|
|
27805
|
+
}
|
|
27806
|
+
});
|
|
27807
|
+
if (hasFilter && !hasError) {
|
|
27808
|
+
const filter = this.formatFilters(this.state.filterNodes[0]);
|
|
27809
|
+
return filter;
|
|
27810
|
+
}
|
|
27811
|
+
}
|
|
27812
|
+
/**
|
|
27813
|
+
* 格式化过滤项
|
|
27814
|
+
* @author lxm
|
|
27815
|
+
* @date 2023-10-16 03:45:41
|
|
27816
|
+
* @param {IFilterNode} node
|
|
27817
|
+
* @return {*} {IData}
|
|
27818
|
+
*/
|
|
27819
|
+
formatFilters(node) {
|
|
27820
|
+
if (!node.leaf) {
|
|
27821
|
+
return {
|
|
27822
|
+
["$".concat(node.logicType.toLowerCase())]: node.children.map(
|
|
27823
|
+
(item) => this.formatFilters(item)
|
|
27824
|
+
)
|
|
27825
|
+
};
|
|
27826
|
+
}
|
|
27827
|
+
return {
|
|
27828
|
+
["".concat(node.field)]: {
|
|
27829
|
+
["$".concat(node.valueOP.toLowerCase())]: node.value
|
|
27830
|
+
}
|
|
27831
|
+
};
|
|
27832
|
+
}
|
|
27627
27833
|
};
|
|
27628
27834
|
|
|
27629
27835
|
// src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts
|
|
@@ -27849,7 +28055,7 @@ var TabExpPanelController = class extends ControlController {
|
|
|
27849
28055
|
};
|
|
27850
28056
|
|
|
27851
28057
|
// src/controller/control/tree/tree.controller.ts
|
|
27852
|
-
import { recursiveIterate as
|
|
28058
|
+
import { recursiveIterate as recursiveIterate7 } from "@ibiz-template/core";
|
|
27853
28059
|
|
|
27854
28060
|
// src/controller/control/tree/tree.service.ts
|
|
27855
28061
|
import { ModelError as ModelError27 } from "@ibiz-template/core";
|
|
@@ -28219,7 +28425,7 @@ var TreeController = class extends MDControlController {
|
|
|
28219
28425
|
this.state.rootNodes = nodes;
|
|
28220
28426
|
}
|
|
28221
28427
|
this.state.items = [];
|
|
28222
|
-
|
|
28428
|
+
recursiveIterate7(
|
|
28223
28429
|
{ children: this.state.rootNodes },
|
|
28224
28430
|
(node) => {
|
|
28225
28431
|
this.state.items.push(node);
|
|
@@ -28361,7 +28567,7 @@ var TreeController = class extends MDControlController {
|
|
|
28361
28567
|
*/
|
|
28362
28568
|
calcExpandedKeys(nodes) {
|
|
28363
28569
|
let expandedKeys = [...this.state.expandedKeys];
|
|
28364
|
-
|
|
28570
|
+
recursiveIterate7({ children: nodes }, (node) => {
|
|
28365
28571
|
var _a;
|
|
28366
28572
|
if ((_a = node.children) == null ? void 0 : _a.length) {
|
|
28367
28573
|
expandedKeys.push(node.id);
|
|
@@ -28702,6 +28908,10 @@ var WizardPanelController = class extends ControlController {
|
|
|
28702
28908
|
}
|
|
28703
28909
|
};
|
|
28704
28910
|
|
|
28911
|
+
// src/controller/control/md-ctrl/md-ctrl.controller.ts
|
|
28912
|
+
import { RuntimeModelError as RuntimeModelError56 } from "@ibiz-template/core";
|
|
28913
|
+
import { isNil as isNil21 } from "ramda";
|
|
28914
|
+
|
|
28705
28915
|
// src/controller/control/md-ctrl/md-ctrl.service.ts
|
|
28706
28916
|
var MDCtrlService = class extends MDControlService {
|
|
28707
28917
|
/**
|
|
@@ -28812,7 +29022,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
28812
29022
|
async refresh() {
|
|
28813
29023
|
await this.load({ isInitialLoad: true });
|
|
28814
29024
|
}
|
|
28815
|
-
afterLoad(args, items) {
|
|
29025
|
+
async afterLoad(args, items) {
|
|
28816
29026
|
if (args.isInitialLoad) {
|
|
28817
29027
|
this.state.rows = [];
|
|
28818
29028
|
}
|
|
@@ -28825,6 +29035,8 @@ var MDCtrlController = class extends MDControlController {
|
|
|
28825
29035
|
})
|
|
28826
29036
|
);
|
|
28827
29037
|
}
|
|
29038
|
+
await this.initGroupCodeListItems();
|
|
29039
|
+
await this.handleDataGroup();
|
|
28828
29040
|
return super.afterLoad(args, items);
|
|
28829
29041
|
}
|
|
28830
29042
|
/**
|
|
@@ -28833,7 +29045,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
28833
29045
|
* @author zk
|
|
28834
29046
|
* @date 2023-05-26 02:05:46
|
|
28835
29047
|
* @param {IData[]} items
|
|
28836
|
-
* @memberof
|
|
29048
|
+
* @memberof MDCtrlController
|
|
28837
29049
|
*/
|
|
28838
29050
|
setData(items) {
|
|
28839
29051
|
const rows = items.map((item) => {
|
|
@@ -28848,7 +29060,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
28848
29060
|
* @author zk
|
|
28849
29061
|
* @date 2023-05-26 02:05:35
|
|
28850
29062
|
* @return {*} {IData[]}
|
|
28851
|
-
* @memberof
|
|
29063
|
+
* @memberof MDCtrlController
|
|
28852
29064
|
*/
|
|
28853
29065
|
getAllData() {
|
|
28854
29066
|
return this.state.rows.map((row) => row.data);
|
|
@@ -28911,11 +29123,114 @@ var MDCtrlController = class extends MDControlController {
|
|
|
28911
29123
|
containerState.update(row.data.getOrigin());
|
|
28912
29124
|
row.uaColStates[group.id] = containerState;
|
|
28913
29125
|
}
|
|
29126
|
+
/**
|
|
29127
|
+
* 处理数据分组
|
|
29128
|
+
*
|
|
29129
|
+
* @memberof MDCtrlController
|
|
29130
|
+
*/
|
|
29131
|
+
async handleDataGroup() {
|
|
29132
|
+
const { enableGroup, groupMode, groupAppDEFieldId } = this.model;
|
|
29133
|
+
if (enableGroup && groupMode) {
|
|
29134
|
+
if (!groupAppDEFieldId) {
|
|
29135
|
+
throw new RuntimeModelError56(this.model, "\u5206\u7EC4\u5C5E\u6027\u6CA1\u6709\u914D\u7F6E");
|
|
29136
|
+
}
|
|
29137
|
+
if (groupMode === "AUTO") {
|
|
29138
|
+
this.handleAutoGroup();
|
|
29139
|
+
} else if (groupMode === "CODELIST") {
|
|
29140
|
+
await this.handleCodeListGroup();
|
|
29141
|
+
}
|
|
29142
|
+
}
|
|
29143
|
+
}
|
|
29144
|
+
/**
|
|
29145
|
+
* 处理自动分组
|
|
29146
|
+
*
|
|
29147
|
+
* @memberof MDCtrlController
|
|
29148
|
+
*/
|
|
29149
|
+
handleAutoGroup() {
|
|
29150
|
+
const { groupAppDEFieldId } = this.model;
|
|
29151
|
+
if (groupAppDEFieldId) {
|
|
29152
|
+
const { items } = this.state;
|
|
29153
|
+
const groupMap = /* @__PURE__ */ new Map();
|
|
29154
|
+
items.forEach((item) => {
|
|
29155
|
+
const groupVal = item[groupAppDEFieldId];
|
|
29156
|
+
if (isNil21(groupVal)) {
|
|
29157
|
+
return;
|
|
29158
|
+
}
|
|
29159
|
+
if (!groupMap.has(groupVal)) {
|
|
29160
|
+
groupMap.set(groupVal, []);
|
|
29161
|
+
}
|
|
29162
|
+
groupMap.get(groupVal).push(new MobMDCtrlRowState(item, this));
|
|
29163
|
+
});
|
|
29164
|
+
const groups = [];
|
|
29165
|
+
groupMap.forEach((value, key) => {
|
|
29166
|
+
groups.push({
|
|
29167
|
+
caption: key,
|
|
29168
|
+
key,
|
|
29169
|
+
children: [...value]
|
|
29170
|
+
});
|
|
29171
|
+
});
|
|
29172
|
+
this.state.groups = groups;
|
|
29173
|
+
}
|
|
29174
|
+
}
|
|
29175
|
+
/**
|
|
29176
|
+
* 加载并初始化分组代码表项集合
|
|
29177
|
+
* @author lxm
|
|
29178
|
+
* @date 2023-08-29 05:11:39
|
|
29179
|
+
* @protected
|
|
29180
|
+
* @return {*} {Promise<void>}
|
|
29181
|
+
*/
|
|
29182
|
+
async initGroupCodeListItems() {
|
|
29183
|
+
const { groupCodeListId } = this.model;
|
|
29184
|
+
if (!groupCodeListId) {
|
|
29185
|
+
return;
|
|
29186
|
+
}
|
|
29187
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
29188
|
+
this.groupCodeListItems = await app.codeList.get(
|
|
29189
|
+
groupCodeListId,
|
|
29190
|
+
this.context,
|
|
29191
|
+
this.params
|
|
29192
|
+
);
|
|
29193
|
+
}
|
|
29194
|
+
/**
|
|
29195
|
+
* 处理代码表分组
|
|
29196
|
+
*
|
|
29197
|
+
* @memberof MDCtrlController
|
|
29198
|
+
*/
|
|
29199
|
+
async handleCodeListGroup() {
|
|
29200
|
+
const { groupAppDEFieldId, groupCodeListId } = this.model;
|
|
29201
|
+
if (!groupCodeListId) {
|
|
29202
|
+
throw new RuntimeModelError56(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
|
|
29203
|
+
}
|
|
29204
|
+
const { items } = this.state;
|
|
29205
|
+
const groupMap = /* @__PURE__ */ new Map();
|
|
29206
|
+
this.groupCodeListItems.forEach((item) => {
|
|
29207
|
+
groupMap.set(item.value, []);
|
|
29208
|
+
});
|
|
29209
|
+
items.forEach((item) => {
|
|
29210
|
+
const groupVal = item[groupAppDEFieldId];
|
|
29211
|
+
const groupArr = groupMap.get(groupVal);
|
|
29212
|
+
if (groupArr) {
|
|
29213
|
+
groupArr.push(new MobMDCtrlRowState(item, this));
|
|
29214
|
+
}
|
|
29215
|
+
});
|
|
29216
|
+
const groups = [];
|
|
29217
|
+
groupMap.forEach((arr, key) => {
|
|
29218
|
+
const codeListItem = this.groupCodeListItems.find(
|
|
29219
|
+
(item) => item.value === key
|
|
29220
|
+
);
|
|
29221
|
+
groups.push({
|
|
29222
|
+
caption: codeListItem.text,
|
|
29223
|
+
key: codeListItem.value,
|
|
29224
|
+
children: arr
|
|
29225
|
+
});
|
|
29226
|
+
});
|
|
29227
|
+
this.state.groups = groups;
|
|
29228
|
+
}
|
|
28914
29229
|
};
|
|
28915
29230
|
|
|
28916
29231
|
// src/controller/control/kanban/kanban.controller.ts
|
|
28917
|
-
import { RuntimeError as RuntimeError48, RuntimeModelError as
|
|
28918
|
-
import { isNil as
|
|
29232
|
+
import { RuntimeError as RuntimeError48, RuntimeModelError as RuntimeModelError57 } from "@ibiz-template/core";
|
|
29233
|
+
import { isNil as isNil22 } from "ramda";
|
|
28919
29234
|
|
|
28920
29235
|
// src/controller/control/kanban/kanban.service.ts
|
|
28921
29236
|
var KanbanService = class extends DataViewControlService {
|
|
@@ -28989,15 +29304,15 @@ var KanbanController = class extends DataViewControlController {
|
|
|
28989
29304
|
const sortField = this.model.minorSortAppDEFieldId;
|
|
28990
29305
|
const { minorSortDir } = this.model;
|
|
28991
29306
|
if (!sortField) {
|
|
28992
|
-
throw new
|
|
29307
|
+
throw new RuntimeModelError57(this.model, "\u6392\u5E8F\u5C5E\u6027\u6CA1\u914D\u7F6E");
|
|
28993
29308
|
}
|
|
28994
29309
|
if (!minorSortDir) {
|
|
28995
|
-
throw new
|
|
29310
|
+
throw new RuntimeModelError57(this.model, "\u6392\u5E8F\u65B9\u5411\u6CA1\u914D\u7F6E");
|
|
28996
29311
|
}
|
|
28997
29312
|
const isAsc = minorSortDir === "ASC";
|
|
28998
29313
|
items.forEach((item) => {
|
|
28999
29314
|
const sortValue = item[sortField];
|
|
29000
|
-
if (
|
|
29315
|
+
if (isNil22(sortValue)) {
|
|
29001
29316
|
item[sortField] = 0;
|
|
29002
29317
|
} else {
|
|
29003
29318
|
const toNum = Number(sortValue);
|
|
@@ -29142,7 +29457,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
29142
29457
|
};
|
|
29143
29458
|
|
|
29144
29459
|
// src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
|
|
29145
|
-
import { recursiveIterate as
|
|
29460
|
+
import { recursiveIterate as recursiveIterate8 } from "@ibiz-template/core";
|
|
29146
29461
|
|
|
29147
29462
|
// src/controller/control/tree-grid-ex/tree-grid-ex.service.ts
|
|
29148
29463
|
import { isArray as isArray6 } from "qx-util";
|
|
@@ -29382,7 +29697,7 @@ var TreeGridExController = class extends MDControlController {
|
|
|
29382
29697
|
* @memberof TreeGridExController
|
|
29383
29698
|
*/
|
|
29384
29699
|
initColumnStates() {
|
|
29385
|
-
|
|
29700
|
+
recursiveIterate8(
|
|
29386
29701
|
this.model,
|
|
29387
29702
|
(column) => {
|
|
29388
29703
|
if (column.columnType !== "GROUPGRIDCOLUMN") {
|
|
@@ -29470,7 +29785,7 @@ var TreeGridExController = class extends MDControlController {
|
|
|
29470
29785
|
this.state.rootNodes = nodes;
|
|
29471
29786
|
}
|
|
29472
29787
|
this.state.items = [];
|
|
29473
|
-
|
|
29788
|
+
recursiveIterate8(
|
|
29474
29789
|
{ children: this.state.rootNodes },
|
|
29475
29790
|
(node) => {
|
|
29476
29791
|
this.state.items.push(node);
|
|
@@ -29489,7 +29804,7 @@ var TreeGridExController = class extends MDControlController {
|
|
|
29489
29804
|
*/
|
|
29490
29805
|
calcExpandedKeys(nodes) {
|
|
29491
29806
|
let expandedKeys = [];
|
|
29492
|
-
|
|
29807
|
+
recursiveIterate8({ children: nodes }, (node) => {
|
|
29493
29808
|
var _a;
|
|
29494
29809
|
if ((_a = node.children) == null ? void 0 : _a.length) {
|
|
29495
29810
|
expandedKeys.push(node.id);
|
|
@@ -30085,7 +30400,7 @@ var ViewEngineBase = class {
|
|
|
30085
30400
|
};
|
|
30086
30401
|
|
|
30087
30402
|
// src/engine/md-view.engine.ts
|
|
30088
|
-
import { RuntimeModelError as
|
|
30403
|
+
import { RuntimeModelError as RuntimeModelError58 } from "@ibiz-template/core";
|
|
30089
30404
|
import { clone as clone20 } from "ramda";
|
|
30090
30405
|
var MDViewEngine = class extends ViewEngineBase {
|
|
30091
30406
|
/**
|
|
@@ -30281,7 +30596,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30281
30596
|
(item) => item.id === "newdata"
|
|
30282
30597
|
);
|
|
30283
30598
|
if (!openAppViewLogic) {
|
|
30284
|
-
throw new
|
|
30599
|
+
throw new RuntimeModelError58(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
30285
30600
|
}
|
|
30286
30601
|
const params = clone20(this.view.params);
|
|
30287
30602
|
if (copyMode) {
|
|
@@ -30297,7 +30612,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30297
30612
|
if (result instanceof Object && result.ok) {
|
|
30298
30613
|
this.refresh();
|
|
30299
30614
|
} else if (result === -1) {
|
|
30300
|
-
throw new
|
|
30615
|
+
throw new RuntimeModelError58(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
30301
30616
|
}
|
|
30302
30617
|
}
|
|
30303
30618
|
/**
|
|
@@ -30344,35 +30659,12 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30344
30659
|
* @return {*} {IParams}
|
|
30345
30660
|
*/
|
|
30346
30661
|
getSearchParams() {
|
|
30347
|
-
var _a;
|
|
30348
30662
|
const params = {};
|
|
30349
30663
|
if (this.searchForm) {
|
|
30350
|
-
|
|
30351
|
-
const filteredParams = Object.entries(addParams).reduce(
|
|
30352
|
-
(result, [key, value]) => {
|
|
30353
|
-
if (value !== null && value !== void 0 && value !== "") {
|
|
30354
|
-
result[key] = value;
|
|
30355
|
-
}
|
|
30356
|
-
return result;
|
|
30357
|
-
},
|
|
30358
|
-
{}
|
|
30359
|
-
);
|
|
30360
|
-
Object.assign(params, filteredParams);
|
|
30664
|
+
Object.assign(params, this.searchForm.getFilterParams());
|
|
30361
30665
|
}
|
|
30362
30666
|
if (this.searchBar) {
|
|
30363
|
-
|
|
30364
|
-
const addParams = {
|
|
30365
|
-
query: this.searchBar.state.query
|
|
30366
|
-
};
|
|
30367
|
-
Object.assign(params, addParams);
|
|
30368
|
-
}
|
|
30369
|
-
if ((_a = this.searchBar.state.selectedGroupItem) == null ? void 0 : _a.data) {
|
|
30370
|
-
const func = new Function(
|
|
30371
|
-
"return (".concat(this.searchBar.state.selectedGroupItem.data, ");")
|
|
30372
|
-
);
|
|
30373
|
-
const addParams = func();
|
|
30374
|
-
Object.assign(params, addParams);
|
|
30375
|
-
}
|
|
30667
|
+
Object.assign(params, this.searchBar.getFilterParams());
|
|
30376
30668
|
}
|
|
30377
30669
|
return params;
|
|
30378
30670
|
}
|
|
@@ -30435,7 +30727,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30435
30727
|
|
|
30436
30728
|
// src/utils/error-handler/default-error-handler.ts
|
|
30437
30729
|
import {
|
|
30438
|
-
RuntimeModelError as
|
|
30730
|
+
RuntimeModelError as RuntimeModelError59,
|
|
30439
30731
|
ModelError as ModelError28,
|
|
30440
30732
|
HttpError as HttpError4,
|
|
30441
30733
|
NoticeError as NoticeError2,
|
|
@@ -30443,7 +30735,7 @@ import {
|
|
|
30443
30735
|
} from "@ibiz-template/core";
|
|
30444
30736
|
var DefaultErrorHandler = class {
|
|
30445
30737
|
handle(error) {
|
|
30446
|
-
if (error instanceof
|
|
30738
|
+
if (error instanceof RuntimeModelError59 || error instanceof ModelError28) {
|
|
30447
30739
|
ibiz.message.error(error.message, 10, true);
|
|
30448
30740
|
} else if (error instanceof HttpError4) {
|
|
30449
30741
|
if (error.status === 401) {
|
|
@@ -30697,13 +30989,13 @@ var ScriptExecutor = class extends LogicExecutor {
|
|
|
30697
30989
|
};
|
|
30698
30990
|
|
|
30699
30991
|
// src/logic-scheduler/executor/app-de-ui-logic-executor.ts
|
|
30700
|
-
import { RuntimeModelError as
|
|
30992
|
+
import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
|
|
30701
30993
|
var AppDEUILogicExecutor = class extends LogicExecutor {
|
|
30702
30994
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30703
30995
|
execute(executeParams) {
|
|
30704
30996
|
const { appDEUILogicId, appDataEntityId } = this.logic;
|
|
30705
30997
|
if (!appDEUILogicId) {
|
|
30706
|
-
throw new
|
|
30998
|
+
throw new RuntimeModelError60(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
30707
30999
|
}
|
|
30708
31000
|
execUILogic(appDEUILogicId, appDataEntityId, executeParams);
|
|
30709
31001
|
}
|
|
@@ -31188,7 +31480,7 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
31188
31480
|
import {
|
|
31189
31481
|
ModelError as ModelError31,
|
|
31190
31482
|
RuntimeError as RuntimeError56,
|
|
31191
|
-
RuntimeModelError as
|
|
31483
|
+
RuntimeModelError as RuntimeModelError61
|
|
31192
31484
|
} from "@ibiz-template/core";
|
|
31193
31485
|
import { notNilEmpty as notNilEmpty10 } from "qx-util";
|
|
31194
31486
|
var AppUILogicExecutor = class extends LogicExecutor {
|
|
@@ -31232,7 +31524,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31232
31524
|
} else {
|
|
31233
31525
|
openViewRef = appUILogic.openDataAppView;
|
|
31234
31526
|
if (!openViewRef) {
|
|
31235
|
-
throw new
|
|
31527
|
+
throw new RuntimeModelError61(
|
|
31236
31528
|
appUILogic,
|
|
31237
31529
|
"opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
|
|
31238
31530
|
);
|
|
@@ -31240,7 +31532,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31240
31532
|
}
|
|
31241
31533
|
const openView = openViewRef.refAppViewId;
|
|
31242
31534
|
if (!openView) {
|
|
31243
|
-
throw new
|
|
31535
|
+
throw new RuntimeModelError61(
|
|
31244
31536
|
appUILogic,
|
|
31245
31537
|
"opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
|
|
31246
31538
|
);
|
|
@@ -31267,7 +31559,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31267
31559
|
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
31268
31560
|
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
31269
31561
|
if (!formTypeName) {
|
|
31270
|
-
throw new
|
|
31562
|
+
throw new RuntimeModelError61(
|
|
31271
31563
|
appUILogic,
|
|
31272
31564
|
"".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
|
|
31273
31565
|
);
|
|
@@ -31275,7 +31567,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31275
31567
|
const { data } = parameters;
|
|
31276
31568
|
const formTypeValue = data[0][formTypeName];
|
|
31277
31569
|
if (!formTypeValue) {
|
|
31278
|
-
throw new
|
|
31570
|
+
throw new RuntimeModelError61(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
31279
31571
|
}
|
|
31280
31572
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
31281
31573
|
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
@@ -31317,7 +31609,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31317
31609
|
return viewRef.refMode.toLowerCase() !== parentDeName;
|
|
31318
31610
|
});
|
|
31319
31611
|
if (!newViewRef) {
|
|
31320
|
-
throw new
|
|
31612
|
+
throw new RuntimeModelError61(
|
|
31321
31613
|
appUILogic,
|
|
31322
31614
|
"\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
|
|
31323
31615
|
);
|
|
@@ -31327,7 +31619,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31327
31619
|
} else {
|
|
31328
31620
|
newViewRef = newDataAppView;
|
|
31329
31621
|
if (!newViewRef || !newViewRef.refAppViewId) {
|
|
31330
|
-
throw new
|
|
31622
|
+
throw new RuntimeModelError61(
|
|
31331
31623
|
appUILogic,
|
|
31332
31624
|
"newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
|
|
31333
31625
|
);
|
|
@@ -31384,7 +31676,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31384
31676
|
const { wizardAppView, newDataAppViews } = appUILogic;
|
|
31385
31677
|
const { context, params, ...rest } = parameters;
|
|
31386
31678
|
if (!wizardAppView || !wizardAppView.refAppViewId) {
|
|
31387
|
-
throw new
|
|
31679
|
+
throw new RuntimeModelError61(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
|
|
31388
31680
|
}
|
|
31389
31681
|
const result = await ibiz.commands.execute(
|
|
31390
31682
|
OpenAppViewCommand.TAG,
|
|
@@ -31430,7 +31722,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
31430
31722
|
const minorDERs = selfDe.minorAppDERSs;
|
|
31431
31723
|
const pickParentDeName = newViewRef.refMode.toLowerCase();
|
|
31432
31724
|
if (!minorDERs) {
|
|
31433
|
-
throw new
|
|
31725
|
+
throw new RuntimeModelError61(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
|
|
31434
31726
|
}
|
|
31435
31727
|
let pickParentFieldName;
|
|
31436
31728
|
minorDERs == null ? void 0 : minorDERs.forEach((item) => {
|
|
@@ -31853,6 +32145,7 @@ export {
|
|
|
31853
32145
|
V7AuthService,
|
|
31854
32146
|
VIEW_PROVIDER_PREFIX,
|
|
31855
32147
|
ValueExUtil,
|
|
32148
|
+
ValueOP,
|
|
31856
32149
|
ViewCallTag,
|
|
31857
32150
|
ViewController,
|
|
31858
32151
|
ViewEngineBase,
|