@ibiz-template/runtime 0.4.17-dev.1 → 0.5.0-beta.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 +269 -255
- package/dist/index.system.min.js +2 -2
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +7 -2
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +2 -6
- package/out/controller/control/kanban/kanban.controller.d.ts +2 -2
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +1 -1
- package/out/controller/control/search-bar/index.d.ts +1 -0
- package/out/controller/control/search-bar/index.d.ts.map +1 -1
- package/out/controller/control/search-bar/index.js +1 -0
- package/out/interface/service/service/i-app-de.service.d.ts +10 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/service/de-service-util.d.ts +3 -2
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +11 -10
- package/out/service/dto/method.dto.d.ts +2 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +3 -4
- package/out/service/service/entity/de.service.d.ts +10 -0
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +22 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +1 -12
- package/package.json +3 -3
- package/src/controller/common/control/md-control.controller.ts +7 -2
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -6
- package/src/controller/control/kanban/kanban.controller.ts +2 -2
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +1 -1
- package/src/controller/control/search-bar/index.ts +1 -0
- package/src/interface/service/service/i-app-de.service.ts +13 -0
- package/src/service/de-service-util.ts +6 -4
- package/src/service/dto/method.dto.ts +4 -5
- package/src/service/service/entity/de.service.ts +26 -1
- package/src/service/service/entity/method/method.ts +1 -13
package/dist/index.esm.js
CHANGED
|
@@ -5602,6 +5602,205 @@ var FileService = class {
|
|
|
5602
5602
|
}
|
|
5603
5603
|
};
|
|
5604
5604
|
|
|
5605
|
+
// src/service/app-data-entity/app-data-entity.ts
|
|
5606
|
+
import { clone as clone5, isNil as isNil7 } from "ramda";
|
|
5607
|
+
import { DataTypes } from "@ibiz-template/core";
|
|
5608
|
+
import { createUUID as createUUID3 } from "qx-util";
|
|
5609
|
+
|
|
5610
|
+
// src/service/constant/srfuf.ts
|
|
5611
|
+
var Srfuf = /* @__PURE__ */ ((Srfuf2) => {
|
|
5612
|
+
Srfuf2[Srfuf2["CREATE"] = 0] = "CREATE";
|
|
5613
|
+
Srfuf2[Srfuf2["UPDATE"] = 1] = "UPDATE";
|
|
5614
|
+
return Srfuf2;
|
|
5615
|
+
})(Srfuf || {});
|
|
5616
|
+
|
|
5617
|
+
// src/service/app-data-entity/app-data-entity.ts
|
|
5618
|
+
var AppDataEntity = class _AppDataEntity {
|
|
5619
|
+
get srfuf() {
|
|
5620
|
+
return this.srfkey === this.tempsrfkey ? 1 /* UPDATE */ : 0 /* CREATE */;
|
|
5621
|
+
}
|
|
5622
|
+
/**
|
|
5623
|
+
* Creates an instance of AppDataEntity.
|
|
5624
|
+
*
|
|
5625
|
+
* @author chitanda
|
|
5626
|
+
* @date 2023-11-16 15:11:08
|
|
5627
|
+
* @param {IAppDataEntity} entity
|
|
5628
|
+
* @param {(IData | AppDataEntity)} [data={}]
|
|
5629
|
+
*/
|
|
5630
|
+
constructor(entity, data = {}) {
|
|
5631
|
+
Object.defineProperty(this, "_entity", {
|
|
5632
|
+
enumerable: false,
|
|
5633
|
+
configurable: true,
|
|
5634
|
+
value: entity
|
|
5635
|
+
});
|
|
5636
|
+
Object.defineProperty(this, "_data", {
|
|
5637
|
+
enumerable: false,
|
|
5638
|
+
configurable: true,
|
|
5639
|
+
value: data instanceof _AppDataEntity ? clone5(data._data) : clone5(data)
|
|
5640
|
+
});
|
|
5641
|
+
Object.defineProperty(this, "srfdeid", {
|
|
5642
|
+
get() {
|
|
5643
|
+
return entity.id;
|
|
5644
|
+
}
|
|
5645
|
+
});
|
|
5646
|
+
Object.defineProperty(this, "srfdecodename", {
|
|
5647
|
+
get() {
|
|
5648
|
+
return entity.codeName;
|
|
5649
|
+
}
|
|
5650
|
+
});
|
|
5651
|
+
const keyAppField = findModelChild(
|
|
5652
|
+
entity.appDEFields || [],
|
|
5653
|
+
entity.keyAppDEFieldId
|
|
5654
|
+
);
|
|
5655
|
+
if (keyAppField) {
|
|
5656
|
+
const key = keyAppField.codeName.toLowerCase();
|
|
5657
|
+
Object.defineProperty(this, "srfkeyfield", {
|
|
5658
|
+
get() {
|
|
5659
|
+
return key;
|
|
5660
|
+
}
|
|
5661
|
+
});
|
|
5662
|
+
Object.defineProperty(this, "srfkey", {
|
|
5663
|
+
set(val) {
|
|
5664
|
+
this._data[key] = val;
|
|
5665
|
+
},
|
|
5666
|
+
get() {
|
|
5667
|
+
return this._data[key];
|
|
5668
|
+
}
|
|
5669
|
+
});
|
|
5670
|
+
} else {
|
|
5671
|
+
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u952E\u5B57\u6BB5"));
|
|
5672
|
+
}
|
|
5673
|
+
const majorAppField = findModelChild(
|
|
5674
|
+
entity.appDEFields || [],
|
|
5675
|
+
entity.majorAppDEFieldId
|
|
5676
|
+
);
|
|
5677
|
+
if (majorAppField) {
|
|
5678
|
+
const major = majorAppField.codeName.toLowerCase();
|
|
5679
|
+
Object.defineProperty(this, "srfmajorfield", {
|
|
5680
|
+
get() {
|
|
5681
|
+
return major;
|
|
5682
|
+
}
|
|
5683
|
+
});
|
|
5684
|
+
Object.defineProperty(this, "srfmajortext", {
|
|
5685
|
+
set(val) {
|
|
5686
|
+
this._data[major] = val;
|
|
5687
|
+
},
|
|
5688
|
+
get() {
|
|
5689
|
+
return this._data[major];
|
|
5690
|
+
}
|
|
5691
|
+
});
|
|
5692
|
+
} else {
|
|
5693
|
+
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u6587\u672C\u5B57\u6BB5"));
|
|
5694
|
+
}
|
|
5695
|
+
Object.defineProperty(this, "tempsrfkey", {
|
|
5696
|
+
enumerable: false,
|
|
5697
|
+
configurable: true,
|
|
5698
|
+
writable: true,
|
|
5699
|
+
value: isNil7(this.srfkey) ? createUUID3() : this.srfkey
|
|
5700
|
+
});
|
|
5701
|
+
this.defineProperties();
|
|
5702
|
+
}
|
|
5703
|
+
/**
|
|
5704
|
+
* 代理实际数据
|
|
5705
|
+
*
|
|
5706
|
+
* @author chitanda
|
|
5707
|
+
* @date 2022-10-11 22:10:55
|
|
5708
|
+
* @protected
|
|
5709
|
+
*/
|
|
5710
|
+
defineProperties() {
|
|
5711
|
+
var _a;
|
|
5712
|
+
const { _data, convertVal } = this;
|
|
5713
|
+
const properties = {};
|
|
5714
|
+
const keys = Object.keys(_data);
|
|
5715
|
+
keys.forEach((key) => {
|
|
5716
|
+
properties[key] = {
|
|
5717
|
+
enumerable: true,
|
|
5718
|
+
set(val) {
|
|
5719
|
+
_data[key] = val;
|
|
5720
|
+
},
|
|
5721
|
+
get() {
|
|
5722
|
+
return _data[key];
|
|
5723
|
+
}
|
|
5724
|
+
};
|
|
5725
|
+
});
|
|
5726
|
+
(_a = this._entity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
5727
|
+
const key = field.codeName.toLowerCase();
|
|
5728
|
+
properties[key] = {
|
|
5729
|
+
enumerable: true,
|
|
5730
|
+
set(val) {
|
|
5731
|
+
_data[key] = convertVal(val, field.stdDataType);
|
|
5732
|
+
},
|
|
5733
|
+
get() {
|
|
5734
|
+
return _data[key];
|
|
5735
|
+
}
|
|
5736
|
+
};
|
|
5737
|
+
_data[key] = convertVal(_data[key], field.stdDataType);
|
|
5738
|
+
});
|
|
5739
|
+
Object.defineProperties(this, properties);
|
|
5740
|
+
}
|
|
5741
|
+
/**
|
|
5742
|
+
* 克隆数据
|
|
5743
|
+
*
|
|
5744
|
+
* @author chitanda
|
|
5745
|
+
* @date 2022-10-11 00:10:15
|
|
5746
|
+
* @return {*} {AppDataEntity}
|
|
5747
|
+
*/
|
|
5748
|
+
clone() {
|
|
5749
|
+
const entity = new _AppDataEntity(this._entity, this._data);
|
|
5750
|
+
entity.srfkey = this.srfkey;
|
|
5751
|
+
return entity;
|
|
5752
|
+
}
|
|
5753
|
+
/**
|
|
5754
|
+
* 合并参数
|
|
5755
|
+
*
|
|
5756
|
+
* @author chitanda
|
|
5757
|
+
* @date 2022-10-19 11:10:25
|
|
5758
|
+
* @param {(IData | AppDataEntity)} data
|
|
5759
|
+
* @return {*} {AppDataEntity}
|
|
5760
|
+
*/
|
|
5761
|
+
assign(data) {
|
|
5762
|
+
let _data = {};
|
|
5763
|
+
if (data instanceof _AppDataEntity) {
|
|
5764
|
+
_data = data._data;
|
|
5765
|
+
} else {
|
|
5766
|
+
_data = data;
|
|
5767
|
+
}
|
|
5768
|
+
Object.keys(_data).forEach((key) => {
|
|
5769
|
+
if (_data[key] === void 0) {
|
|
5770
|
+
delete _data[key];
|
|
5771
|
+
}
|
|
5772
|
+
});
|
|
5773
|
+
Object.assign(this._data, _data);
|
|
5774
|
+
return this;
|
|
5775
|
+
}
|
|
5776
|
+
/**
|
|
5777
|
+
* 根据属性的数据类型转换值
|
|
5778
|
+
* @author lxm
|
|
5779
|
+
* @date 2023-09-25 03:37:28
|
|
5780
|
+
* @protected
|
|
5781
|
+
* @param {unknown} value
|
|
5782
|
+
* @param {(number | undefined)} dataType
|
|
5783
|
+
* @return {*} {unknown}
|
|
5784
|
+
*/
|
|
5785
|
+
convertVal(value, dataType) {
|
|
5786
|
+
if (value == null) {
|
|
5787
|
+
return value;
|
|
5788
|
+
}
|
|
5789
|
+
if (isNil7(dataType)) {
|
|
5790
|
+
return value;
|
|
5791
|
+
}
|
|
5792
|
+
if (DataTypes.isNumber(dataType)) {
|
|
5793
|
+
const numVal = !isNil7(value) && value !== "" ? Number(value) : value;
|
|
5794
|
+
if (Number.isNaN(numVal)) {
|
|
5795
|
+
ibiz.log.debug("".concat(value, "\u4E0D\u80FD\u8F6C\u6362\u6210\u6570\u5B57"));
|
|
5796
|
+
return value;
|
|
5797
|
+
}
|
|
5798
|
+
return numVal;
|
|
5799
|
+
}
|
|
5800
|
+
return value;
|
|
5801
|
+
}
|
|
5802
|
+
};
|
|
5803
|
+
|
|
5605
5804
|
// src/service/service/entity/de.service.ts
|
|
5606
5805
|
var DEService = class {
|
|
5607
5806
|
/**
|
|
@@ -5820,6 +6019,26 @@ var DEService = class {
|
|
|
5820
6019
|
const resPath = calcResPath(context, this.model);
|
|
5821
6020
|
return resPath + curPath;
|
|
5822
6021
|
}
|
|
6022
|
+
newEntity(data) {
|
|
6023
|
+
if (data instanceof AppDataEntity) {
|
|
6024
|
+
return data.clone();
|
|
6025
|
+
}
|
|
6026
|
+
return new AppDataEntity(this.model, data);
|
|
6027
|
+
}
|
|
6028
|
+
/**
|
|
6029
|
+
* 创建数据对象实例
|
|
6030
|
+
*
|
|
6031
|
+
* @author chitanda
|
|
6032
|
+
* @date 2023-12-23 19:12:57
|
|
6033
|
+
* @param {(IData[] | IDataEntity[] | IData | IDataEntity)} data
|
|
6034
|
+
* @return {*} {(IDataEntity | IDataEntity[])}
|
|
6035
|
+
*/
|
|
6036
|
+
createEntity(data) {
|
|
6037
|
+
if (Array.isArray(data)) {
|
|
6038
|
+
return data.map((item) => this.newEntity(item));
|
|
6039
|
+
}
|
|
6040
|
+
return this.newEntity(data);
|
|
6041
|
+
}
|
|
5823
6042
|
/**
|
|
5824
6043
|
* 服务实例销毁
|
|
5825
6044
|
*
|
|
@@ -5833,20 +6052,11 @@ var DEService = class {
|
|
|
5833
6052
|
};
|
|
5834
6053
|
|
|
5835
6054
|
// src/service/service/control/control.service.ts
|
|
5836
|
-
import { clone as
|
|
5837
|
-
|
|
5838
|
-
// src/service/vo/control.vo.ts
|
|
5839
|
-
import { createUUID as createUUID3 } from "qx-util";
|
|
5840
|
-
import { clone as clone5, isNil as isNil7 } from "ramda";
|
|
5841
|
-
|
|
5842
|
-
// src/service/constant/srfuf.ts
|
|
5843
|
-
var Srfuf = /* @__PURE__ */ ((Srfuf2) => {
|
|
5844
|
-
Srfuf2[Srfuf2["CREATE"] = 0] = "CREATE";
|
|
5845
|
-
Srfuf2[Srfuf2["UPDATE"] = 1] = "UPDATE";
|
|
5846
|
-
return Srfuf2;
|
|
5847
|
-
})(Srfuf || {});
|
|
6055
|
+
import { clone as clone7 } from "@ibiz-template/core";
|
|
5848
6056
|
|
|
5849
6057
|
// src/service/vo/control.vo.ts
|
|
6058
|
+
import { createUUID as createUUID4 } from "qx-util";
|
|
6059
|
+
import { clone as clone6, isNil as isNil8 } from "ramda";
|
|
5850
6060
|
var BuildInKeys = [
|
|
5851
6061
|
"srfkey",
|
|
5852
6062
|
"srfmajortext",
|
|
@@ -5935,7 +6145,7 @@ var ControlVO = class _ControlVO {
|
|
|
5935
6145
|
enumerable: false,
|
|
5936
6146
|
configurable: true,
|
|
5937
6147
|
writable: true,
|
|
5938
|
-
value:
|
|
6148
|
+
value: isNil8(this.srfkey) ? createUUID4() : this.srfkey
|
|
5939
6149
|
});
|
|
5940
6150
|
}
|
|
5941
6151
|
Object.defineProperty(this, "srfuf", {
|
|
@@ -6034,7 +6244,7 @@ var ControlVO = class _ControlVO {
|
|
|
6034
6244
|
* @return {*} {ControlVO}
|
|
6035
6245
|
*/
|
|
6036
6246
|
clone() {
|
|
6037
|
-
const cloneOrigin =
|
|
6247
|
+
const cloneOrigin = clone6(this.$origin);
|
|
6038
6248
|
const newVal = new _ControlVO(cloneOrigin, this.$dataUIMap);
|
|
6039
6249
|
Object.keys(this).forEach((key) => {
|
|
6040
6250
|
newVal[key] = this[key];
|
|
@@ -6111,7 +6321,7 @@ var ControlService = class {
|
|
|
6111
6321
|
* @returns {*} {IHttpResponse}
|
|
6112
6322
|
*/
|
|
6113
6323
|
handleResponse(res) {
|
|
6114
|
-
return
|
|
6324
|
+
return clone7(res);
|
|
6115
6325
|
}
|
|
6116
6326
|
/**
|
|
6117
6327
|
* 实体数据转ui数据
|
|
@@ -6570,7 +6780,7 @@ var V7AuthService = class {
|
|
|
6570
6780
|
};
|
|
6571
6781
|
|
|
6572
6782
|
// src/service/service/async-action/async-action.service.ts
|
|
6573
|
-
import { isNil as
|
|
6783
|
+
import { isNil as isNil9 } from "ramda";
|
|
6574
6784
|
var AsyncActionService = class {
|
|
6575
6785
|
/**
|
|
6576
6786
|
* 获取异步操作的集合
|
|
@@ -6581,7 +6791,7 @@ var AsyncActionService = class {
|
|
|
6581
6791
|
*/
|
|
6582
6792
|
async fetch(params = {}) {
|
|
6583
6793
|
const res = await ibiz.net.post("/portal/asyncaction/all", params);
|
|
6584
|
-
if (
|
|
6794
|
+
if (isNil9(res.data)) {
|
|
6585
6795
|
res.data = [];
|
|
6586
6796
|
}
|
|
6587
6797
|
return res;
|
|
@@ -6606,201 +6816,10 @@ import {
|
|
|
6606
6816
|
RuntimeError as RuntimeError20,
|
|
6607
6817
|
RuntimeModelError as RuntimeModelError19
|
|
6608
6818
|
} from "@ibiz-template/core";
|
|
6609
|
-
import { isArray as
|
|
6819
|
+
import { isArray as isArray6, isNil as isNil10 } from "lodash-es";
|
|
6610
6820
|
|
|
6611
6821
|
// src/service/service/entity/method/method.ts
|
|
6612
6822
|
import { RuntimeModelError as RuntimeModelError8 } from "@ibiz-template/core";
|
|
6613
|
-
import { isArray as isArray4 } from "lodash-es";
|
|
6614
|
-
|
|
6615
|
-
// src/service/app-data-entity/app-data-entity.ts
|
|
6616
|
-
import { clone as clone7, isNil as isNil9 } from "ramda";
|
|
6617
|
-
import { DataTypes } from "@ibiz-template/core";
|
|
6618
|
-
import { createUUID as createUUID4 } from "qx-util";
|
|
6619
|
-
var AppDataEntity = class _AppDataEntity {
|
|
6620
|
-
get srfuf() {
|
|
6621
|
-
return this.srfkey === this.tempsrfkey ? 1 /* UPDATE */ : 0 /* CREATE */;
|
|
6622
|
-
}
|
|
6623
|
-
/**
|
|
6624
|
-
* Creates an instance of AppDataEntity.
|
|
6625
|
-
*
|
|
6626
|
-
* @author chitanda
|
|
6627
|
-
* @date 2023-11-16 15:11:08
|
|
6628
|
-
* @param {IAppDataEntity} entity
|
|
6629
|
-
* @param {(IData | AppDataEntity)} [data={}]
|
|
6630
|
-
*/
|
|
6631
|
-
constructor(entity, data = {}) {
|
|
6632
|
-
Object.defineProperty(this, "_entity", {
|
|
6633
|
-
enumerable: false,
|
|
6634
|
-
configurable: true,
|
|
6635
|
-
value: entity
|
|
6636
|
-
});
|
|
6637
|
-
Object.defineProperty(this, "_data", {
|
|
6638
|
-
enumerable: false,
|
|
6639
|
-
configurable: true,
|
|
6640
|
-
value: data instanceof _AppDataEntity ? clone7(data._data) : clone7(data)
|
|
6641
|
-
});
|
|
6642
|
-
Object.defineProperty(this, "srfdeid", {
|
|
6643
|
-
get() {
|
|
6644
|
-
return entity.id;
|
|
6645
|
-
}
|
|
6646
|
-
});
|
|
6647
|
-
Object.defineProperty(this, "srfdecodename", {
|
|
6648
|
-
get() {
|
|
6649
|
-
return entity.codeName;
|
|
6650
|
-
}
|
|
6651
|
-
});
|
|
6652
|
-
const keyAppField = findModelChild(
|
|
6653
|
-
entity.appDEFields || [],
|
|
6654
|
-
entity.keyAppDEFieldId
|
|
6655
|
-
);
|
|
6656
|
-
if (keyAppField) {
|
|
6657
|
-
const key = keyAppField.codeName.toLowerCase();
|
|
6658
|
-
Object.defineProperty(this, "srfkeyfield", {
|
|
6659
|
-
get() {
|
|
6660
|
-
return key;
|
|
6661
|
-
}
|
|
6662
|
-
});
|
|
6663
|
-
Object.defineProperty(this, "srfkey", {
|
|
6664
|
-
set(val) {
|
|
6665
|
-
this._data[key] = val;
|
|
6666
|
-
},
|
|
6667
|
-
get() {
|
|
6668
|
-
return this._data[key];
|
|
6669
|
-
}
|
|
6670
|
-
});
|
|
6671
|
-
} else {
|
|
6672
|
-
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u952E\u5B57\u6BB5"));
|
|
6673
|
-
}
|
|
6674
|
-
const majorAppField = findModelChild(
|
|
6675
|
-
entity.appDEFields || [],
|
|
6676
|
-
entity.majorAppDEFieldId
|
|
6677
|
-
);
|
|
6678
|
-
if (majorAppField) {
|
|
6679
|
-
const major = majorAppField.codeName.toLowerCase();
|
|
6680
|
-
Object.defineProperty(this, "srfmajorfield", {
|
|
6681
|
-
get() {
|
|
6682
|
-
return major;
|
|
6683
|
-
}
|
|
6684
|
-
});
|
|
6685
|
-
Object.defineProperty(this, "srfmajortext", {
|
|
6686
|
-
set(val) {
|
|
6687
|
-
this._data[major] = val;
|
|
6688
|
-
},
|
|
6689
|
-
get() {
|
|
6690
|
-
return this._data[major];
|
|
6691
|
-
}
|
|
6692
|
-
});
|
|
6693
|
-
} else {
|
|
6694
|
-
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u6587\u672C\u5B57\u6BB5"));
|
|
6695
|
-
}
|
|
6696
|
-
Object.defineProperty(this, "tempsrfkey", {
|
|
6697
|
-
enumerable: false,
|
|
6698
|
-
configurable: true,
|
|
6699
|
-
writable: true,
|
|
6700
|
-
value: isNil9(this.srfkey) ? createUUID4() : this.srfkey
|
|
6701
|
-
});
|
|
6702
|
-
this.defineProperties();
|
|
6703
|
-
}
|
|
6704
|
-
/**
|
|
6705
|
-
* 代理实际数据
|
|
6706
|
-
*
|
|
6707
|
-
* @author chitanda
|
|
6708
|
-
* @date 2022-10-11 22:10:55
|
|
6709
|
-
* @protected
|
|
6710
|
-
*/
|
|
6711
|
-
defineProperties() {
|
|
6712
|
-
var _a;
|
|
6713
|
-
const { _data, convertVal } = this;
|
|
6714
|
-
const properties = {};
|
|
6715
|
-
const keys = Object.keys(_data);
|
|
6716
|
-
keys.forEach((key) => {
|
|
6717
|
-
properties[key] = {
|
|
6718
|
-
enumerable: true,
|
|
6719
|
-
set(val) {
|
|
6720
|
-
_data[key] = val;
|
|
6721
|
-
},
|
|
6722
|
-
get() {
|
|
6723
|
-
return _data[key];
|
|
6724
|
-
}
|
|
6725
|
-
};
|
|
6726
|
-
});
|
|
6727
|
-
(_a = this._entity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
6728
|
-
const key = field.codeName.toLowerCase();
|
|
6729
|
-
properties[key] = {
|
|
6730
|
-
enumerable: true,
|
|
6731
|
-
set(val) {
|
|
6732
|
-
_data[key] = convertVal(val, field.stdDataType);
|
|
6733
|
-
},
|
|
6734
|
-
get() {
|
|
6735
|
-
return _data[key];
|
|
6736
|
-
}
|
|
6737
|
-
};
|
|
6738
|
-
_data[key] = convertVal(_data[key], field.stdDataType);
|
|
6739
|
-
});
|
|
6740
|
-
Object.defineProperties(this, properties);
|
|
6741
|
-
}
|
|
6742
|
-
/**
|
|
6743
|
-
* 克隆数据
|
|
6744
|
-
*
|
|
6745
|
-
* @author chitanda
|
|
6746
|
-
* @date 2022-10-11 00:10:15
|
|
6747
|
-
* @return {*} {AppDataEntity}
|
|
6748
|
-
*/
|
|
6749
|
-
clone() {
|
|
6750
|
-
const entity = new _AppDataEntity(this._entity, this._data);
|
|
6751
|
-
entity.srfkey = this.srfkey;
|
|
6752
|
-
return entity;
|
|
6753
|
-
}
|
|
6754
|
-
/**
|
|
6755
|
-
* 合并参数
|
|
6756
|
-
*
|
|
6757
|
-
* @author chitanda
|
|
6758
|
-
* @date 2022-10-19 11:10:25
|
|
6759
|
-
* @param {(IData | AppDataEntity)} data
|
|
6760
|
-
* @return {*} {AppDataEntity}
|
|
6761
|
-
*/
|
|
6762
|
-
assign(data) {
|
|
6763
|
-
let _data = {};
|
|
6764
|
-
if (data instanceof _AppDataEntity) {
|
|
6765
|
-
_data = data._data;
|
|
6766
|
-
} else {
|
|
6767
|
-
_data = data;
|
|
6768
|
-
}
|
|
6769
|
-
Object.keys(_data).forEach((key) => {
|
|
6770
|
-
if (_data[key] === void 0) {
|
|
6771
|
-
delete _data[key];
|
|
6772
|
-
}
|
|
6773
|
-
});
|
|
6774
|
-
Object.assign(this._data, _data);
|
|
6775
|
-
return this;
|
|
6776
|
-
}
|
|
6777
|
-
/**
|
|
6778
|
-
* 根据属性的数据类型转换值
|
|
6779
|
-
* @author lxm
|
|
6780
|
-
* @date 2023-09-25 03:37:28
|
|
6781
|
-
* @protected
|
|
6782
|
-
* @param {unknown} value
|
|
6783
|
-
* @param {(number | undefined)} dataType
|
|
6784
|
-
* @return {*} {unknown}
|
|
6785
|
-
*/
|
|
6786
|
-
convertVal(value, dataType) {
|
|
6787
|
-
if (value == null) {
|
|
6788
|
-
return value;
|
|
6789
|
-
}
|
|
6790
|
-
if (isNil9(dataType)) {
|
|
6791
|
-
return value;
|
|
6792
|
-
}
|
|
6793
|
-
if (DataTypes.isNumber(dataType)) {
|
|
6794
|
-
const numVal = !isNil9(value) && value !== "" ? Number(value) : value;
|
|
6795
|
-
if (Number.isNaN(numVal)) {
|
|
6796
|
-
ibiz.log.debug("".concat(value, "\u4E0D\u80FD\u8F6C\u6362\u6210\u6570\u5B57"));
|
|
6797
|
-
return value;
|
|
6798
|
-
}
|
|
6799
|
-
return numVal;
|
|
6800
|
-
}
|
|
6801
|
-
return value;
|
|
6802
|
-
}
|
|
6803
|
-
};
|
|
6804
6823
|
|
|
6805
6824
|
// src/service/dto/method.dto.ts
|
|
6806
6825
|
import { ModelError as ModelError6 } from "@ibiz-template/core";
|
|
@@ -6921,7 +6940,7 @@ var MethodDto = class _MethodDto {
|
|
|
6921
6940
|
* @date 2022-10-10 23:10:50
|
|
6922
6941
|
* @param {IContext} context
|
|
6923
6942
|
* @param {IData[]} data
|
|
6924
|
-
* @return {*} {Promise<
|
|
6943
|
+
* @return {*} {Promise<IDataEntity[]>}
|
|
6925
6944
|
*/
|
|
6926
6945
|
async sets(context, data) {
|
|
6927
6946
|
if (this.isLocalMode) {
|
|
@@ -6942,10 +6961,10 @@ var MethodDto = class _MethodDto {
|
|
|
6942
6961
|
if (items) {
|
|
6943
6962
|
const pKey = datum[this.entity.keyAppDEFieldId];
|
|
6944
6963
|
items.forEach((item) => {
|
|
6945
|
-
item.srfpkey = pKey;
|
|
6946
6964
|
item[field.refPickupAppDEFieldId] = pKey;
|
|
6947
6965
|
});
|
|
6948
6966
|
await dto.sets(context, items);
|
|
6967
|
+
delete datum[key];
|
|
6949
6968
|
} else {
|
|
6950
6969
|
await dto.sets(context, []);
|
|
6951
6970
|
}
|
|
@@ -6954,7 +6973,7 @@ var MethodDto = class _MethodDto {
|
|
|
6954
6973
|
for (let i = 0; i < all.length; i++) {
|
|
6955
6974
|
await all[i];
|
|
6956
6975
|
}
|
|
6957
|
-
const entityData =
|
|
6976
|
+
const entityData = this.service.createEntity(datum);
|
|
6958
6977
|
if (this.isLocalMode) {
|
|
6959
6978
|
await this.service.local.add(context, entityData);
|
|
6960
6979
|
}
|
|
@@ -7190,29 +7209,20 @@ var Method = class {
|
|
|
7190
7209
|
* @return {*} {(IDataEntity | IDataEntity[])}
|
|
7191
7210
|
*/
|
|
7192
7211
|
createEntity(data) {
|
|
7193
|
-
|
|
7194
|
-
if (single instanceof AppDataEntity) {
|
|
7195
|
-
return single.clone();
|
|
7196
|
-
}
|
|
7197
|
-
return new AppDataEntity(this.entity, single);
|
|
7198
|
-
};
|
|
7199
|
-
if (isArray4(data)) {
|
|
7200
|
-
return data.map((item) => toEntity(item));
|
|
7201
|
-
}
|
|
7202
|
-
return toEntity(data);
|
|
7212
|
+
return this.service.createEntity(data);
|
|
7203
7213
|
}
|
|
7204
7214
|
};
|
|
7205
7215
|
|
|
7206
7216
|
// src/de-logic/index.ts
|
|
7207
7217
|
import { HttpError as HttpError3, HttpResponse as HttpResponse2, RuntimeError as RuntimeError19 } from "@ibiz-template/core";
|
|
7208
|
-
import { isArray as
|
|
7218
|
+
import { isArray as isArray5 } from "lodash-es";
|
|
7209
7219
|
import { clone as clone12 } from "ramda";
|
|
7210
7220
|
|
|
7211
7221
|
// src/de-logic/de-logic.ts
|
|
7212
7222
|
import { ModelError as ModelError12, RuntimeModelError as RuntimeModelError18 } from "@ibiz-template/core";
|
|
7213
7223
|
|
|
7214
7224
|
// src/de-logic/de-logic-context.ts
|
|
7215
|
-
import { isArray as
|
|
7225
|
+
import { isArray as isArray4 } from "lodash-es";
|
|
7216
7226
|
var DELogicContext = class {
|
|
7217
7227
|
/**
|
|
7218
7228
|
* Creates an instance of DELogicContext.
|
|
@@ -7259,7 +7269,7 @@ var DELogicContext = class {
|
|
|
7259
7269
|
* @type {string}
|
|
7260
7270
|
*/
|
|
7261
7271
|
this.defaultParamName = "Default";
|
|
7262
|
-
this.parameters = { context, data:
|
|
7272
|
+
this.parameters = { context, data: isArray4(data) ? data : [data], params };
|
|
7263
7273
|
}
|
|
7264
7274
|
/**
|
|
7265
7275
|
* 上下文
|
|
@@ -8292,7 +8302,7 @@ async function execFieldLogics(entity, type, context, data, params = {}) {
|
|
|
8292
8302
|
if (!data) {
|
|
8293
8303
|
return;
|
|
8294
8304
|
}
|
|
8295
|
-
if (
|
|
8305
|
+
if (isArray5(data)) {
|
|
8296
8306
|
await Promise.all(
|
|
8297
8307
|
data.map(
|
|
8298
8308
|
(item) => execSingleFieldLogics(entity, type, context, item, params)
|
|
@@ -8314,7 +8324,7 @@ var DEActionMethod = class extends Method {
|
|
|
8314
8324
|
* @return {*} {(Promise<IData | IData[]>)}
|
|
8315
8325
|
*/
|
|
8316
8326
|
async inputHandle(context, data) {
|
|
8317
|
-
if (
|
|
8327
|
+
if (isArray6(data)) {
|
|
8318
8328
|
return data;
|
|
8319
8329
|
}
|
|
8320
8330
|
return this.input.handle(context, data);
|
|
@@ -8373,7 +8383,7 @@ var DEActionMethod = class extends Method {
|
|
|
8373
8383
|
if (this.method.needResourceKey) {
|
|
8374
8384
|
let srfkey = context[this.entity.codeName.toLowerCase()];
|
|
8375
8385
|
if (isNil10(srfkey)) {
|
|
8376
|
-
srfkey =
|
|
8386
|
+
srfkey = isArray6(data) ? null : data == null ? void 0 : data[this.entity.keyAppDEFieldId];
|
|
8377
8387
|
}
|
|
8378
8388
|
path2 = "".concat(path2, "/").concat(srfkey);
|
|
8379
8389
|
}
|
|
@@ -8512,7 +8522,7 @@ var DEActionMethod = class extends Method {
|
|
|
8512
8522
|
try {
|
|
8513
8523
|
const addData = this.createEntity(entity);
|
|
8514
8524
|
let resultData;
|
|
8515
|
-
if (
|
|
8525
|
+
if (isArray6(addData)) {
|
|
8516
8526
|
resultData = await Promise.all(
|
|
8517
8527
|
addData.map((item) => this.service.local.add(context, item))
|
|
8518
8528
|
);
|
|
@@ -8583,7 +8593,7 @@ var DEActionMethod = class extends Method {
|
|
|
8583
8593
|
try {
|
|
8584
8594
|
const updateData = this.createEntity(entity);
|
|
8585
8595
|
let resultData;
|
|
8586
|
-
if (
|
|
8596
|
+
if (isArray6(updateData)) {
|
|
8587
8597
|
resultData = await Promise.all(
|
|
8588
8598
|
updateData.map((item) => this.service.local.update(context, item))
|
|
8589
8599
|
);
|
|
@@ -8649,12 +8659,12 @@ import {
|
|
|
8649
8659
|
ModelError as ModelError13,
|
|
8650
8660
|
RuntimeModelError as RuntimeModelError20
|
|
8651
8661
|
} from "@ibiz-template/core";
|
|
8652
|
-
import { isArray as
|
|
8662
|
+
import { isArray as isArray7 } from "lodash-es";
|
|
8653
8663
|
import { clone as clone13, isEmpty as isEmpty7, isNil as isNil11 } from "ramda";
|
|
8654
8664
|
import { ascSort as ascSort2, descSort } from "qx-util";
|
|
8655
8665
|
var FetchMethod = class extends Method {
|
|
8656
8666
|
async exec(context, params, params2) {
|
|
8657
|
-
const searchParams = params && !
|
|
8667
|
+
const searchParams = params && !isArray7(params) ? params : params2 || {};
|
|
8658
8668
|
if (this.isLocalMode) {
|
|
8659
8669
|
const items2 = await this.searchLocal(
|
|
8660
8670
|
null,
|
|
@@ -9581,7 +9591,7 @@ var MqttService = class {
|
|
|
9581
9591
|
|
|
9582
9592
|
// src/service/de-service-util.ts
|
|
9583
9593
|
import { RuntimeError as RuntimeError21 } from "@ibiz-template/core";
|
|
9584
|
-
var
|
|
9594
|
+
var _DEServiceUtil = class _DEServiceUtil {
|
|
9585
9595
|
/**
|
|
9586
9596
|
* Creates an instance of DEServiceUtil.
|
|
9587
9597
|
*
|
|
@@ -9600,13 +9610,6 @@ var DEServiceUtil = class {
|
|
|
9600
9610
|
* @type {Map<string, Map<string, IAppDEService>>} Map<域标识, Map<实体标识, 实体服务>>
|
|
9601
9611
|
*/
|
|
9602
9612
|
this.cache = /* @__PURE__ */ new Map();
|
|
9603
|
-
/**
|
|
9604
|
-
* 实体服务构造方法缓存
|
|
9605
|
-
* @author lxm
|
|
9606
|
-
* @date 2023-05-15 08:37:13
|
|
9607
|
-
* @protected
|
|
9608
|
-
*/
|
|
9609
|
-
this.constructorCache = /* @__PURE__ */ new Map();
|
|
9610
9613
|
}
|
|
9611
9614
|
/**
|
|
9612
9615
|
* 注册服务工厂方法
|
|
@@ -9616,8 +9619,8 @@ var DEServiceUtil = class {
|
|
|
9616
9619
|
* @param {string} id 实体标识
|
|
9617
9620
|
* @param {DEServiceConstructor} constructor
|
|
9618
9621
|
*/
|
|
9619
|
-
register(id, constructor) {
|
|
9620
|
-
this.constructorCache.set(id, constructor);
|
|
9622
|
+
static register(id, constructor) {
|
|
9623
|
+
this.constructorCache.set(id.toUpperCase(), constructor);
|
|
9621
9624
|
}
|
|
9622
9625
|
/**
|
|
9623
9626
|
* 根据实体标识获取实体服务
|
|
@@ -9642,7 +9645,7 @@ var DEServiceUtil = class {
|
|
|
9642
9645
|
if (!entityModel) {
|
|
9643
9646
|
throw new RuntimeError21("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
9644
9647
|
}
|
|
9645
|
-
const constructor =
|
|
9648
|
+
const constructor = _DEServiceUtil.constructorCache.get(id.toUpperCase());
|
|
9646
9649
|
let service;
|
|
9647
9650
|
if (constructor) {
|
|
9648
9651
|
service = await constructor(sandboxId, entityModel);
|
|
@@ -9706,6 +9709,15 @@ var DEServiceUtil = class {
|
|
|
9706
9709
|
return service.exec(methodName, context, params, params2);
|
|
9707
9710
|
}
|
|
9708
9711
|
};
|
|
9712
|
+
/**
|
|
9713
|
+
* 实体服务构造方法缓存
|
|
9714
|
+
*
|
|
9715
|
+
* @author lxm
|
|
9716
|
+
* @date 2023-05-15 08:37:13
|
|
9717
|
+
* @protected
|
|
9718
|
+
*/
|
|
9719
|
+
_DEServiceUtil.constructorCache = /* @__PURE__ */ new Map();
|
|
9720
|
+
var DEServiceUtil = _DEServiceUtil;
|
|
9709
9721
|
|
|
9710
9722
|
// src/command/app/open-app-view/open-app-view.ts
|
|
9711
9723
|
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
@@ -12687,7 +12699,10 @@ var MDControlController = class extends ControlController {
|
|
|
12687
12699
|
if (this.state.isSimple) {
|
|
12688
12700
|
return [];
|
|
12689
12701
|
}
|
|
12690
|
-
|
|
12702
|
+
const silent = args.silent === true;
|
|
12703
|
+
if (!silent) {
|
|
12704
|
+
await this.startLoading();
|
|
12705
|
+
}
|
|
12691
12706
|
try {
|
|
12692
12707
|
const isInitialLoad = args.isInitialLoad === true;
|
|
12693
12708
|
const isLoadMore = args.isLoadMore === true;
|
|
@@ -12719,7 +12734,9 @@ var MDControlController = class extends ControlController {
|
|
|
12719
12734
|
});
|
|
12720
12735
|
throw error;
|
|
12721
12736
|
} finally {
|
|
12722
|
-
|
|
12737
|
+
if (!silent) {
|
|
12738
|
+
await this.endLoading();
|
|
12739
|
+
}
|
|
12723
12740
|
}
|
|
12724
12741
|
this.state.items.forEach((item, index) => {
|
|
12725
12742
|
item.srfserialnum = index + 1;
|
|
@@ -14563,7 +14580,7 @@ import { recursiveIterate as recursiveIterate2, RuntimeError as RuntimeError46 }
|
|
|
14563
14580
|
|
|
14564
14581
|
// src/ui-action/provider/backend-ui-action-provider.ts
|
|
14565
14582
|
import { RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
|
|
14566
|
-
import { isArray as
|
|
14583
|
+
import { isArray as isArray8 } from "qx-util";
|
|
14567
14584
|
|
|
14568
14585
|
// src/ui-action/provider/ui-action-provider-base.ts
|
|
14569
14586
|
import { RuntimeModelError as RuntimeModelError46 } from "@ibiz-template/core";
|
|
@@ -16290,7 +16307,7 @@ var BackendUIActionProvider = class extends UIActionProviderBase {
|
|
|
16290
16307
|
}
|
|
16291
16308
|
}
|
|
16292
16309
|
Object.assign(actionResult, {
|
|
16293
|
-
data:
|
|
16310
|
+
data: isArray8(res.data) ? res.data : [res.data],
|
|
16294
16311
|
nextContext: resultContext,
|
|
16295
16312
|
nextParams: tempParams
|
|
16296
16313
|
});
|
|
@@ -19369,15 +19386,11 @@ var FormDetailController = class {
|
|
|
19369
19386
|
calcDynaClass(data) {
|
|
19370
19387
|
if (this.model.dynaClass) {
|
|
19371
19388
|
const dynaClass = calcDynaClass(this.model.dynaClass, data);
|
|
19372
|
-
|
|
19373
|
-
this.state.class.containerDyna = dynaClass;
|
|
19374
|
-
}
|
|
19389
|
+
this.state.class.containerDyna = dynaClass;
|
|
19375
19390
|
}
|
|
19376
19391
|
if (this.model.labelDynaClass) {
|
|
19377
19392
|
const dynaClass = calcDynaClass(this.model.labelDynaClass, data);
|
|
19378
|
-
|
|
19379
|
-
this.state.class.labelDyna = dynaClass;
|
|
19380
|
-
}
|
|
19393
|
+
this.state.class.labelDyna = dynaClass;
|
|
19381
19394
|
}
|
|
19382
19395
|
}
|
|
19383
19396
|
/**
|
|
@@ -26486,7 +26499,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
26486
26499
|
*/
|
|
26487
26500
|
async loadMore() {
|
|
26488
26501
|
if (this.state.total > this.state.items.length && !this.state.isLoading) {
|
|
26489
|
-
await this.load({ isLoadMore: true });
|
|
26502
|
+
await this.load({ isLoadMore: true, silent: true });
|
|
26490
26503
|
}
|
|
26491
26504
|
}
|
|
26492
26505
|
/**
|
|
@@ -27203,7 +27216,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27203
27216
|
/**
|
|
27204
27217
|
* 打开批操作工具栏
|
|
27205
27218
|
*
|
|
27206
|
-
* @param {string} groupKey
|
|
27219
|
+
* @param {string | number} groupKey
|
|
27207
27220
|
* @memberof KanbanController
|
|
27208
27221
|
*/
|
|
27209
27222
|
openBatch(groupKey) {
|
|
@@ -31452,6 +31465,7 @@ export {
|
|
|
31452
31465
|
ScriptFactory,
|
|
31453
31466
|
ScriptFunction,
|
|
31454
31467
|
SearchBarController,
|
|
31468
|
+
SearchBarFilterController,
|
|
31455
31469
|
SearchFilter,
|
|
31456
31470
|
SearchFormController,
|
|
31457
31471
|
SearchFormService,
|