@ibiz-template/runtime 0.6.5 → 0.6.7
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 +67 -28
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/report-panel/report-panel.service.d.ts.map +1 -1
- package/out/controller/control/report-panel/report-panel.service.js +1 -2
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +2 -1
- package/out/controller/utils/data-file-util/data-file-util.js +2 -2
- package/out/model/utils/util.d.ts +12 -1
- package/out/model/utils/util.d.ts.map +1 -1
- package/out/model/utils/util.js +37 -0
- package/out/service/service/entity/de.service.js +3 -3
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +17 -12
- package/out/service/service/entity/method/method.d.ts +8 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +10 -3
- package/out/service/service/file/file.service.js +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +6 -6
- package/package.json +2 -3
package/dist/index.esm.js
CHANGED
|
@@ -804,6 +804,33 @@ function getControlPanel(control) {
|
|
|
804
804
|
}
|
|
805
805
|
return layoutPanel;
|
|
806
806
|
}
|
|
807
|
+
function findAppDEMethod(appDataEntity, id) {
|
|
808
|
+
const models = appDataEntity.appDEMethods;
|
|
809
|
+
if (models && id) {
|
|
810
|
+
const model = findModelChild(models, id);
|
|
811
|
+
if (model) {
|
|
812
|
+
return model;
|
|
813
|
+
}
|
|
814
|
+
const model2 = models.find((item) => {
|
|
815
|
+
switch (item.methodType) {
|
|
816
|
+
case "DEACTION": {
|
|
817
|
+
const { actionTag } = item;
|
|
818
|
+
return (actionTag == null ? void 0 : actionTag.toLowerCase()) === id.toLowerCase();
|
|
819
|
+
}
|
|
820
|
+
case "FETCH": {
|
|
821
|
+
const { dataSetTag } = item;
|
|
822
|
+
return "fetch".concat(dataSetTag == null ? void 0 : dataSetTag.toLowerCase()) === id.toLowerCase();
|
|
823
|
+
}
|
|
824
|
+
default:
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
if (model2) {
|
|
829
|
+
return model2;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return null;
|
|
833
|
+
}
|
|
807
834
|
|
|
808
835
|
// src/model/layout/layout.ts
|
|
809
836
|
import { isArray as isArray2, isObject, isString } from "lodash-es";
|
|
@@ -7966,7 +7993,7 @@ var FileService = class {
|
|
|
7966
7993
|
*/
|
|
7967
7994
|
exportData(dataExport, fetchAction, context, params) {
|
|
7968
7995
|
const resPath = calcResPath(context, this.model);
|
|
7969
|
-
const exportUrl = "".concat(resPath, "/").concat(this.model.
|
|
7996
|
+
const exportUrl = "".concat(resPath, "/").concat(this.model.deapicodeName2, "/exportdata/").concat(fetchAction.toLowerCase(), "/?srfexporttag=").concat(dataExport.codeName);
|
|
7970
7997
|
return ibiz.net.request(exportUrl, {
|
|
7971
7998
|
method: "post",
|
|
7972
7999
|
data: params,
|
|
@@ -8496,7 +8523,7 @@ var DEService = class {
|
|
|
8496
8523
|
if (this.methodMap.has(cacheId)) {
|
|
8497
8524
|
return this.methodMap.get(cacheId);
|
|
8498
8525
|
}
|
|
8499
|
-
const model =
|
|
8526
|
+
const model = findAppDEMethod(this.model, id);
|
|
8500
8527
|
if (!model) {
|
|
8501
8528
|
throw new RuntimeModelError10(this.model, "\u672A\u627E\u5230\u670D\u52A1\u65B9\u6CD5: ".concat(id));
|
|
8502
8529
|
}
|
|
@@ -8649,7 +8676,7 @@ var DEService = class {
|
|
|
8649
8676
|
*/
|
|
8650
8677
|
calcSsePath(context, isHistories = false) {
|
|
8651
8678
|
const srfkey = context[this.model.codeName.toLowerCase()];
|
|
8652
|
-
const curPath = "/".concat(this.model.
|
|
8679
|
+
const curPath = "/".concat(this.model.deapicodeName2, "/ssechatcompletion").concat(isHistories ? "/histories" : "").concat(srfkey ? "/".concat(srfkey) : "");
|
|
8653
8680
|
const resPath = calcResPath(context, this.model);
|
|
8654
8681
|
return resPath + curPath;
|
|
8655
8682
|
}
|
|
@@ -9701,7 +9728,7 @@ var Method = class {
|
|
|
9701
9728
|
async request(path2, context, data, params, header) {
|
|
9702
9729
|
const { actionType, requestMethod } = this.method;
|
|
9703
9730
|
if (actionType === "REMOTE") {
|
|
9704
|
-
const methodName = this.method.
|
|
9731
|
+
const methodName = this.method.requestPath;
|
|
9705
9732
|
let res = null;
|
|
9706
9733
|
switch (requestMethod) {
|
|
9707
9734
|
case "POST":
|
|
@@ -9747,8 +9774,15 @@ var Method = class {
|
|
|
9747
9774
|
}
|
|
9748
9775
|
throw new RuntimeModelError11(this.method, "\u672A\u652F\u6301\u7684\u884C\u4E3A\u7C7B\u578B[".concat(actionType, "]"));
|
|
9749
9776
|
}
|
|
9777
|
+
/**
|
|
9778
|
+
* 合并请求路径
|
|
9779
|
+
* @author lionlau
|
|
9780
|
+
* @param path
|
|
9781
|
+
* @param methodName 方法名,以 / 开始
|
|
9782
|
+
* @returns
|
|
9783
|
+
*/
|
|
9750
9784
|
mergeRequestPath(path2, methodName) {
|
|
9751
|
-
return "".concat(path2
|
|
9785
|
+
return methodName ? "".concat(path2).concat(methodName) : "".concat(path2);
|
|
9752
9786
|
}
|
|
9753
9787
|
/**
|
|
9754
9788
|
* 根据上下文计算当前请求路径
|
|
@@ -9760,7 +9794,7 @@ var Method = class {
|
|
|
9760
9794
|
* @return {*} {string} 拼接结果说明: /祖父实体/祖父实体主键/爷爷实体/爷爷实体主键/父实体/父实体主键/当前实体
|
|
9761
9795
|
*/
|
|
9762
9796
|
calcPath(context) {
|
|
9763
|
-
const curPath = "/".concat(this.entity.
|
|
9797
|
+
const curPath = "/".concat(this.entity.deapicodeName2);
|
|
9764
9798
|
const resPath = calcResPath(context, this.entity);
|
|
9765
9799
|
return resPath + curPath;
|
|
9766
9800
|
}
|
|
@@ -11011,35 +11045,36 @@ var DEActionMethod = class extends Method {
|
|
|
11011
11045
|
if (data && !this.isLocalMode) {
|
|
11012
11046
|
data = await this.inputHandle(context, data);
|
|
11013
11047
|
}
|
|
11014
|
-
|
|
11015
|
-
|
|
11048
|
+
const methodTag = this.method.actionTag ? this.method.actionTag.toUpperCase() : this.method.codeName.toUpperCase();
|
|
11049
|
+
switch (methodTag) {
|
|
11050
|
+
case "CREATE":
|
|
11016
11051
|
result = await this.create(context, data, params || {}, header);
|
|
11017
11052
|
break;
|
|
11018
|
-
case "
|
|
11053
|
+
case "GET":
|
|
11019
11054
|
result = await this.get(context, params, header);
|
|
11020
11055
|
break;
|
|
11021
|
-
case "
|
|
11056
|
+
case "GETDRAFT":
|
|
11022
11057
|
result = await this.getDraft(context, params, header);
|
|
11023
11058
|
break;
|
|
11024
|
-
case "
|
|
11059
|
+
case "REMOVE":
|
|
11025
11060
|
result = await this.remove(context, params);
|
|
11026
11061
|
break;
|
|
11027
|
-
case "
|
|
11062
|
+
case "UPDATE":
|
|
11028
11063
|
result = await this.update(context, data, params, header);
|
|
11029
11064
|
break;
|
|
11030
|
-
case "
|
|
11065
|
+
case "CREATETEMP":
|
|
11031
11066
|
result = await this.createTemp(context, data);
|
|
11032
11067
|
break;
|
|
11033
|
-
case "
|
|
11068
|
+
case "GETTEMP":
|
|
11034
11069
|
result = await this.getTemp(context, data);
|
|
11035
11070
|
break;
|
|
11036
|
-
case "
|
|
11071
|
+
case "GETDRAFTTEMP":
|
|
11037
11072
|
result = await this.getDraftTemp(context, params);
|
|
11038
11073
|
break;
|
|
11039
|
-
case "
|
|
11074
|
+
case "REMOVETEMP":
|
|
11040
11075
|
result = await this.removeTemp(context, data);
|
|
11041
11076
|
break;
|
|
11042
|
-
case "
|
|
11077
|
+
case "UPDATETEMP":
|
|
11043
11078
|
result = await this.updateTemp(context, data);
|
|
11044
11079
|
break;
|
|
11045
11080
|
default: {
|
|
@@ -11173,7 +11208,11 @@ var DEActionMethod = class extends Method {
|
|
|
11173
11208
|
return this.getDraftTemp(context, params);
|
|
11174
11209
|
}
|
|
11175
11210
|
const path2 = this.calcPath(context);
|
|
11176
|
-
const res = await this.app.net.get(
|
|
11211
|
+
const res = await this.app.net.get(
|
|
11212
|
+
this.mergeRequestPath(path2, this.method.requestPath),
|
|
11213
|
+
params,
|
|
11214
|
+
header
|
|
11215
|
+
);
|
|
11177
11216
|
res.data = await this.result.handle(context, res.data);
|
|
11178
11217
|
return res;
|
|
11179
11218
|
}
|
|
@@ -14383,7 +14422,7 @@ function listenAsyncAction(id) {
|
|
|
14383
14422
|
async function asyncImportData(file, appDataEntity, dataImport, context) {
|
|
14384
14423
|
const data = new FormData();
|
|
14385
14424
|
data.append("file", file);
|
|
14386
|
-
let url = "/".concat(appDataEntity.
|
|
14425
|
+
let url = "/".concat(appDataEntity.deapicodeName2, "/").concat(asyncImportUrl);
|
|
14387
14426
|
if (dataImport == null ? void 0 : dataImport.codeName) {
|
|
14388
14427
|
url += "?srfimporttag=".concat(dataImport.codeName);
|
|
14389
14428
|
}
|
|
@@ -14405,7 +14444,7 @@ async function asyncImportData(file, appDataEntity, dataImport, context) {
|
|
|
14405
14444
|
async function importData(file, appDataEntity, dataImport, context) {
|
|
14406
14445
|
const data = new FormData();
|
|
14407
14446
|
data.append("file", file);
|
|
14408
|
-
let url = "/".concat(appDataEntity.
|
|
14447
|
+
let url = "/".concat(appDataEntity.deapicodeName2, "/").concat(importUrl);
|
|
14409
14448
|
if (dataImport == null ? void 0 : dataImport.codeName) {
|
|
14410
14449
|
url += "?srfimporttag=".concat(dataImport.codeName);
|
|
14411
14450
|
}
|
|
@@ -20192,7 +20231,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20192
20231
|
* @return {*}
|
|
20193
20232
|
*/
|
|
20194
20233
|
async executePrint(action, args) {
|
|
20195
|
-
var _a, _b
|
|
20234
|
+
var _a, _b;
|
|
20196
20235
|
const { resultContext, resultParams } = await this.handleParams(
|
|
20197
20236
|
action,
|
|
20198
20237
|
args.context,
|
|
@@ -20209,7 +20248,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20209
20248
|
if (appDEPrint) {
|
|
20210
20249
|
let requestUrl = "";
|
|
20211
20250
|
if (resultContext && resultContext[appDataEntity.codeName.toLowerCase()]) {
|
|
20212
|
-
requestUrl += "/".concat(
|
|
20251
|
+
requestUrl += "/".concat(appDataEntity.deapicodeName2, "/printdata/").concat(resultContext[appDataEntity.codeName.toLowerCase()]);
|
|
20213
20252
|
} else {
|
|
20214
20253
|
throw new RuntimeError48("\u6CA1\u6709\u627E\u5230\u6570\u636E\u4E3B\u952E");
|
|
20215
20254
|
}
|
|
@@ -20224,7 +20263,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20224
20263
|
if (res.ok) {
|
|
20225
20264
|
if (resultParams && resultParams.srfcontenttype) {
|
|
20226
20265
|
const disposition = res.headers["content-disposition"];
|
|
20227
|
-
const filename = (
|
|
20266
|
+
const filename = (_b = disposition.split(";").find((str) => str.indexOf("filename=") !== -1)) == null ? void 0 : _b.slice(9);
|
|
20228
20267
|
const href = URL.createObjectURL(res.data);
|
|
20229
20268
|
const a = document.createElement("a");
|
|
20230
20269
|
a.href = href;
|
|
@@ -20302,7 +20341,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20302
20341
|
* @return {*}
|
|
20303
20342
|
*/
|
|
20304
20343
|
async executeDataExport(action, args) {
|
|
20305
|
-
var _a
|
|
20344
|
+
var _a;
|
|
20306
20345
|
const { resultParams } = await this.handleParams(
|
|
20307
20346
|
action,
|
|
20308
20347
|
args.context,
|
|
@@ -20317,7 +20356,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
20317
20356
|
return dataExport.id === action.appDEDataExportId;
|
|
20318
20357
|
});
|
|
20319
20358
|
if (appDEDataExport) {
|
|
20320
|
-
const url = "/".concat(
|
|
20359
|
+
const url = "/".concat(appDataEntity.deapicodeName2, "/exportdata/fetchdefault?srfexporttag=").concat(appDEDataExport.codeName);
|
|
20321
20360
|
const params = {
|
|
20322
20361
|
page: 0,
|
|
20323
20362
|
size: appDEDataExport.maxRowCount ? appDEDataExport.maxRowCount : 1e3,
|
|
@@ -20479,7 +20518,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20479
20518
|
for (let i = 0; i < item.controlLogics.length; i++) {
|
|
20480
20519
|
const controlLogic = item.controlLogics[i];
|
|
20481
20520
|
const itemState = this.state.buttonsState[item.id];
|
|
20482
|
-
if (controlLogic.itemName === item.id && controlLogic.triggerType === "ITEMVISIBLE") {
|
|
20521
|
+
if (controlLogic.itemName === item.id && controlLogic.triggerType === "ITEMVISIBLE" && itemState) {
|
|
20483
20522
|
itemState.visible = false;
|
|
20484
20523
|
break;
|
|
20485
20524
|
}
|
|
@@ -33527,12 +33566,11 @@ var ReportPanelService = class extends ControlService {
|
|
|
33527
33566
|
* @returns {*} {Promise<IHttpResponse>}
|
|
33528
33567
|
*/
|
|
33529
33568
|
async fetch(context, params = {}) {
|
|
33530
|
-
var _a;
|
|
33531
33569
|
this.dataEntity = await ibiz.hub.getAppDataEntity(
|
|
33532
33570
|
this.model.appDataEntityId,
|
|
33533
33571
|
this.model.appId
|
|
33534
33572
|
);
|
|
33535
|
-
const url = "".concat(
|
|
33573
|
+
const url = "".concat(this.dataEntity.deapicodeName2, "/report?srfreporttag=").concat(this.model.codeName);
|
|
33536
33574
|
let res = await ibiz.net.request(url, {
|
|
33537
33575
|
method: "post",
|
|
33538
33576
|
data: params
|
|
@@ -37473,6 +37511,7 @@ export {
|
|
|
37473
37511
|
fieldValueToBoolean,
|
|
37474
37512
|
filterFieldLogics,
|
|
37475
37513
|
filterValueRules,
|
|
37514
|
+
findAppDEMethod,
|
|
37476
37515
|
findChildFormDetails,
|
|
37477
37516
|
findDELogic,
|
|
37478
37517
|
findEditItem,
|