@ibiz-template/runtime 0.1.19 → 0.1.20
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 +217 -29
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/control.controller.d.ts +13 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +58 -0
- package/out/controller/common/control/md-control.controller.d.ts +7 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +27 -2
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +2 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +36 -7
- package/out/controller/control/form/form/form.controller.d.ts +4 -0
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +3 -0
- 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 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +29 -5
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +2 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +1 -0
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +33 -4
- package/out/logic-scheduler/trigger/control-event-trigger.js +1 -1
- package/out/logic-scheduler/trigger/view-event-trigger.js +1 -1
- package/out/model/data-entity/data-entity.d.ts +11 -0
- package/out/model/data-entity/data-entity.d.ts.map +1 -1
- package/out/model/data-entity/data-entity.js +14 -0
- package/out/model/index.d.ts +1 -0
- package/out/model/index.d.ts.map +1 -1
- package/out/model/index.js +1 -0
- package/out/model/panel/data-container.d.ts +11 -0
- package/out/model/panel/data-container.d.ts.map +1 -0
- package/out/model/panel/data-container.js +12 -0
- package/out/model/panel/index.d.ts +2 -0
- package/out/model/panel/index.d.ts.map +1 -0
- package/out/model/panel/index.js +1 -0
- package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
- package/out/service/app-data-entity/app-data-entity.js +3 -1
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +3 -0
- package/out/service/vo/control.vo.js +2 -2
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +0 -1
- package/package.json +3 -3
- package/src/controller/common/control/control.controller.ts +67 -0
- package/src/controller/common/control/md-control.controller.ts +28 -2
- package/src/controller/control/data-view/data-view.controller.ts +2 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +34 -7
- package/src/controller/control/form/form/form.controller.ts +7 -0
- package/src/controller/control/form/search-form/search-form.controller.ts +10 -1
- package/src/controller/control/grid/grid/grid.controller.ts +28 -5
- package/src/controller/control/list/list.controller.ts +2 -1
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +44 -7
- package/src/logic-scheduler/trigger/control-event-trigger.ts +1 -1
- package/src/logic-scheduler/trigger/view-event-trigger.ts +1 -1
- package/src/model/data-entity/data-entity.ts +17 -0
- package/src/model/index.ts +1 -0
- package/src/model/panel/data-container.ts +18 -0
- package/src/model/panel/index.ts +1 -0
- package/src/service/app-data-entity/app-data-entity.ts +3 -1
- package/src/service/service/entity/method/method.ts +3 -0
- package/src/service/vo/control.vo.ts +2 -2
- package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -6991,6 +6991,10 @@ async function getDeACMode(appDEACModeId, entityId, srfappid) {
|
|
|
6991
6991
|
});
|
|
6992
6992
|
return deACMode;
|
|
6993
6993
|
}
|
|
6994
|
+
async function getFormTypeFieldName(entityId) {
|
|
6995
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(entityId);
|
|
6996
|
+
return appDataEntity.formTypeAppDEFieldId;
|
|
6997
|
+
}
|
|
6994
6998
|
function findDELogic(appDELogicId, entity) {
|
|
6995
6999
|
var _a;
|
|
6996
7000
|
return (_a = entity.appDELogics) == null ? void 0 : _a.find((item) => item.id === appDELogicId);
|
|
@@ -7092,6 +7096,13 @@ function getViewEngines(view) {
|
|
|
7092
7096
|
return appViewEngines;
|
|
7093
7097
|
}
|
|
7094
7098
|
|
|
7099
|
+
// src/model/panel/data-container.ts
|
|
7100
|
+
function isDataContainer(panelItem) {
|
|
7101
|
+
return panelItem.itemType === "CONTAINER" && ["CONTAINER_MULTIDATA", "CONTAINER_SINGLEDATA"].includes(
|
|
7102
|
+
panelItem.predefinedType
|
|
7103
|
+
);
|
|
7104
|
+
}
|
|
7105
|
+
|
|
7095
7106
|
// src/utils/open-redirect-view/open-redirect-view.ts
|
|
7096
7107
|
async function openRedirectView(appView, context, params = {}, opts = {}) {
|
|
7097
7108
|
return openDERedirectView(
|
|
@@ -11249,7 +11260,9 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
11249
11260
|
* @return {*} {AppDataEntity}
|
|
11250
11261
|
*/
|
|
11251
11262
|
clone() {
|
|
11252
|
-
|
|
11263
|
+
const entity = new _AppDataEntity(this._entity, this._data);
|
|
11264
|
+
entity.srfkey = this.srfkey;
|
|
11265
|
+
return entity;
|
|
11253
11266
|
}
|
|
11254
11267
|
/**
|
|
11255
11268
|
* 合并参数
|
|
@@ -11599,6 +11612,9 @@ var Method = class {
|
|
|
11599
11612
|
* @return {*} {IDataEntity}
|
|
11600
11613
|
*/
|
|
11601
11614
|
createEntity(data) {
|
|
11615
|
+
if (data instanceof AppDataEntity) {
|
|
11616
|
+
return data.clone();
|
|
11617
|
+
}
|
|
11602
11618
|
return new AppDataEntity(this.entity, data);
|
|
11603
11619
|
}
|
|
11604
11620
|
};
|
|
@@ -13282,7 +13298,7 @@ var ControlVO = class _ControlVO {
|
|
|
13282
13298
|
* @returns {*}
|
|
13283
13299
|
*/
|
|
13284
13300
|
linkProperty(uiKey, dataKey, isOriginField = true) {
|
|
13285
|
-
if (uiKey === "srfuf") {
|
|
13301
|
+
if (uiKey === "srfuf" || uiKey === "srfkey") {
|
|
13286
13302
|
return;
|
|
13287
13303
|
}
|
|
13288
13304
|
if (isOriginField || Object.prototype.hasOwnProperty.call(this.$origin, uiKey)) {
|
|
@@ -15770,6 +15786,8 @@ var CodeListEditorController = class extends EditorController {
|
|
|
15770
15786
|
};
|
|
15771
15787
|
|
|
15772
15788
|
// src/controller/common/control/control.controller.ts
|
|
15789
|
+
import { NoticeError } from "@ibiz-template/core";
|
|
15790
|
+
import { isNil as isNil13 } from "ramda";
|
|
15773
15791
|
var ControlController = class extends BaseController {
|
|
15774
15792
|
/**
|
|
15775
15793
|
* Creates an instance of ControlController.
|
|
@@ -15931,11 +15949,71 @@ var ControlController = class extends BaseController {
|
|
|
15931
15949
|
return this.getEventArgs();
|
|
15932
15950
|
};
|
|
15933
15951
|
}
|
|
15952
|
+
/**
|
|
15953
|
+
* 执行对应部件行为消息提示
|
|
15954
|
+
* @author lxm
|
|
15955
|
+
* @date 2023-09-07 04:51:21
|
|
15956
|
+
* @param {string} tag
|
|
15957
|
+
* @param {({ default?: string; data?: IData | IData[]; error?: Error })} [opts]
|
|
15958
|
+
* @return {*} {void}
|
|
15959
|
+
*/
|
|
15960
|
+
actionNotification(tag, opts) {
|
|
15961
|
+
var _a;
|
|
15962
|
+
const { ctrlMsg } = this.model;
|
|
15963
|
+
const msgItem = (_a = ctrlMsg == null ? void 0 : ctrlMsg.ctrlMsgItems) == null ? void 0 : _a.find((item) => item.name === tag);
|
|
15964
|
+
let message;
|
|
15965
|
+
let duration;
|
|
15966
|
+
if (msgItem && msgItem.content) {
|
|
15967
|
+
duration = isNil13(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
|
|
15968
|
+
const scriptParams = { ...this.getEventArgs() };
|
|
15969
|
+
if (opts == null ? void 0 : opts.data) {
|
|
15970
|
+
scriptParams.data = opts.data;
|
|
15971
|
+
}
|
|
15972
|
+
message = ScriptFactory.execScriptFn(
|
|
15973
|
+
scriptParams,
|
|
15974
|
+
"`".concat(msgItem.content, "`"),
|
|
15975
|
+
{
|
|
15976
|
+
isAsync: false,
|
|
15977
|
+
singleRowReturn: true
|
|
15978
|
+
}
|
|
15979
|
+
);
|
|
15980
|
+
} else {
|
|
15981
|
+
const resTag = "CONTROL.".concat(this.model.controlType, ".").concat(tag).toUpperCase();
|
|
15982
|
+
message = ibiz.i18n.t(resTag, "");
|
|
15983
|
+
if (message === resTag) {
|
|
15984
|
+
message = "";
|
|
15985
|
+
}
|
|
15986
|
+
}
|
|
15987
|
+
if (!message && (opts == null ? void 0 : opts.default)) {
|
|
15988
|
+
message = opts.default;
|
|
15989
|
+
}
|
|
15990
|
+
if (!message && (opts == null ? void 0 : opts.error)) {
|
|
15991
|
+
message = message || opts.error.message;
|
|
15992
|
+
}
|
|
15993
|
+
if (!message) {
|
|
15994
|
+
return;
|
|
15995
|
+
}
|
|
15996
|
+
if (opts == null ? void 0 : opts.error) {
|
|
15997
|
+
throw new NoticeError(message, duration);
|
|
15998
|
+
} else {
|
|
15999
|
+
ibiz.message.success(message, duration, duration === 0);
|
|
16000
|
+
}
|
|
16001
|
+
}
|
|
15934
16002
|
};
|
|
15935
16003
|
|
|
15936
16004
|
// src/controller/common/control/md-control.controller.ts
|
|
15937
16005
|
import { isElementSame, RuntimeError as RuntimeError23 } from "@ibiz-template/core";
|
|
15938
16006
|
var MDControlController = class extends ControlController {
|
|
16007
|
+
constructor() {
|
|
16008
|
+
super(...arguments);
|
|
16009
|
+
/**
|
|
16010
|
+
* 实体属性映射,key是id,value是name
|
|
16011
|
+
* @author lxm
|
|
16012
|
+
* @date 2023-09-07 03:16:56
|
|
16013
|
+
* @protected
|
|
16014
|
+
*/
|
|
16015
|
+
this.fieldIdNameMap = /* @__PURE__ */ new Map();
|
|
16016
|
+
}
|
|
15939
16017
|
get _evt() {
|
|
15940
16018
|
return this.evt;
|
|
15941
16019
|
}
|
|
@@ -15955,7 +16033,14 @@ var MDControlController = class extends ControlController {
|
|
|
15955
16033
|
this.state.groups = [];
|
|
15956
16034
|
}
|
|
15957
16035
|
async onCreated() {
|
|
16036
|
+
var _a;
|
|
15958
16037
|
await super.onCreated();
|
|
16038
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
16039
|
+
this.model.appDataEntityId
|
|
16040
|
+
);
|
|
16041
|
+
(_a = dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
16042
|
+
this.fieldIdNameMap.set(field.id, field.name);
|
|
16043
|
+
});
|
|
15959
16044
|
this.setSort();
|
|
15960
16045
|
}
|
|
15961
16046
|
/**
|
|
@@ -16034,10 +16119,14 @@ var MDControlController = class extends ControlController {
|
|
|
16034
16119
|
});
|
|
16035
16120
|
} catch (error) {
|
|
16036
16121
|
await this._evt.emit("onLoadError", void 0);
|
|
16122
|
+
this.actionNotification("FETCHERROR", {
|
|
16123
|
+
error
|
|
16124
|
+
});
|
|
16037
16125
|
throw error;
|
|
16038
16126
|
} finally {
|
|
16039
16127
|
await this.endLoading();
|
|
16040
16128
|
}
|
|
16129
|
+
this.actionNotification("FETCHSUCCESS");
|
|
16041
16130
|
return this.state.items;
|
|
16042
16131
|
}
|
|
16043
16132
|
/**
|
|
@@ -16098,8 +16187,9 @@ var MDControlController = class extends ControlController {
|
|
|
16098
16187
|
})
|
|
16099
16188
|
);
|
|
16100
16189
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
16101
|
-
|
|
16102
|
-
|
|
16190
|
+
this.actionNotification("REMOVESUCCESS", {
|
|
16191
|
+
data,
|
|
16192
|
+
default: "\u6570\u636E[".concat(data.map((item) => item.srfmajortext).join("\u3001"), "]\u5220\u9664\u6210\u529F!")
|
|
16103
16193
|
});
|
|
16104
16194
|
}
|
|
16105
16195
|
if (needRefresh) {
|
|
@@ -16107,6 +16197,10 @@ var MDControlController = class extends ControlController {
|
|
|
16107
16197
|
}
|
|
16108
16198
|
} catch (error) {
|
|
16109
16199
|
await this._evt.emit("onRemoveError", void 0);
|
|
16200
|
+
this.actionNotification("REMOVEERROR", {
|
|
16201
|
+
error,
|
|
16202
|
+
data
|
|
16203
|
+
});
|
|
16110
16204
|
throw error;
|
|
16111
16205
|
} finally {
|
|
16112
16206
|
await this.endLoading();
|
|
@@ -16638,7 +16732,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
16638
16732
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
16639
16733
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
16640
16734
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
16641
|
-
import { clone as clone11, isNil as
|
|
16735
|
+
import { clone as clone11, isNil as isNil14, mergeDeepRight } from "ramda";
|
|
16642
16736
|
dayjs2.extend(minMax);
|
|
16643
16737
|
dayjs2.extend(isSameOrBefore);
|
|
16644
16738
|
dayjs2.extend(quarterOfYear);
|
|
@@ -16727,10 +16821,10 @@ var BaseSeriesGenerator = class {
|
|
|
16727
16821
|
* @return {*} {(string | undefined)}
|
|
16728
16822
|
*/
|
|
16729
16823
|
translateVal(codeListKey, val, isExclude = false) {
|
|
16730
|
-
if (
|
|
16824
|
+
if (isNil14(val)) {
|
|
16731
16825
|
return void 0;
|
|
16732
16826
|
}
|
|
16733
|
-
if (
|
|
16827
|
+
if (isNil14(codeListKey)) {
|
|
16734
16828
|
return val;
|
|
16735
16829
|
}
|
|
16736
16830
|
const codeListItems = this.chartGenerator.codeListMap.get(codeListKey);
|
|
@@ -16760,7 +16854,7 @@ var BaseSeriesGenerator = class {
|
|
|
16760
16854
|
seriesCodeListId,
|
|
16761
16855
|
item[this.groupField]
|
|
16762
16856
|
);
|
|
16763
|
-
if (
|
|
16857
|
+
if (isNil14(groupVal)) {
|
|
16764
16858
|
return;
|
|
16765
16859
|
}
|
|
16766
16860
|
group = groupVal;
|
|
@@ -18373,7 +18467,6 @@ var MsgBoxNode = class extends UILogicNode {
|
|
|
18373
18467
|
default:
|
|
18374
18468
|
throw new ModelError21(this.model, "".concat(buttonsType, "\u6682\u672A\u652F\u6301"));
|
|
18375
18469
|
}
|
|
18376
|
-
console.log(this.model, modalParams);
|
|
18377
18470
|
const result = await ibiz.modal.confirm(modalParams);
|
|
18378
18471
|
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
18379
18472
|
}
|
|
@@ -19799,7 +19892,8 @@ var DataViewControlController = class extends MDControlController {
|
|
|
19799
19892
|
} else {
|
|
19800
19893
|
const { minorSortAppDEFieldId, minorSortDir } = this.model;
|
|
19801
19894
|
if (minorSortAppDEFieldId && minorSortDir) {
|
|
19802
|
-
|
|
19895
|
+
const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
|
|
19896
|
+
this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
|
|
19803
19897
|
} else {
|
|
19804
19898
|
this.state.sortQuery = "";
|
|
19805
19899
|
}
|
|
@@ -20537,6 +20631,9 @@ var FormController = class extends ControlController {
|
|
|
20537
20631
|
);
|
|
20538
20632
|
return values.findIndex((value) => !value) === -1;
|
|
20539
20633
|
}
|
|
20634
|
+
actionNotification(tag, opts) {
|
|
20635
|
+
super.actionNotification(tag, { data: this.data, ...opts || {} });
|
|
20636
|
+
}
|
|
20540
20637
|
};
|
|
20541
20638
|
|
|
20542
20639
|
// src/controller/control/form/search-form/search-form.service.ts
|
|
@@ -20613,11 +20710,20 @@ var SearchFormController = class extends FormController {
|
|
|
20613
20710
|
const params = await this.getDraftParams();
|
|
20614
20711
|
Object.assign(queryParams, params);
|
|
20615
20712
|
await this.evt.emit("onBeforeLoadDraft", { params: queryParams });
|
|
20616
|
-
|
|
20713
|
+
let res;
|
|
20714
|
+
try {
|
|
20715
|
+
res = await this.service.getDraft(this.context, queryParams);
|
|
20716
|
+
} catch (error) {
|
|
20717
|
+
this.actionNotification("GETDRAFTERROR", {
|
|
20718
|
+
error
|
|
20719
|
+
});
|
|
20720
|
+
throw error;
|
|
20721
|
+
}
|
|
20617
20722
|
this.state.data = res.data;
|
|
20618
20723
|
mergeDefaultInLeft(this.data, params);
|
|
20619
20724
|
this.state.isLoaded = true;
|
|
20620
20725
|
this.formStateNotify("DRAFT" /* DRAFT */);
|
|
20726
|
+
this.actionNotification("GETDRAFTSUCCESS");
|
|
20621
20727
|
return this.data;
|
|
20622
20728
|
}
|
|
20623
20729
|
/**
|
|
@@ -22164,6 +22270,9 @@ var EditFormController = class extends FormController {
|
|
|
22164
22270
|
res = await this.service.getDraft(this.context, queryParams);
|
|
22165
22271
|
} catch (error) {
|
|
22166
22272
|
await this.evt.emit("onLoadDraftError", void 0);
|
|
22273
|
+
this.actionNotification("GETDRAFTERROR", {
|
|
22274
|
+
error
|
|
22275
|
+
});
|
|
22167
22276
|
throw error;
|
|
22168
22277
|
} finally {
|
|
22169
22278
|
await this.endLoading();
|
|
@@ -22172,6 +22281,7 @@ var EditFormController = class extends FormController {
|
|
|
22172
22281
|
mergeDefaultInLeft2(this.data, params);
|
|
22173
22282
|
this.formStateNotify("DRAFT" /* DRAFT */);
|
|
22174
22283
|
await this.evt.emit("onLoadDraftSuccess", void 0);
|
|
22284
|
+
this.actionNotification("GETDRAFTSUCCESS");
|
|
22175
22285
|
this.state.isLoaded = true;
|
|
22176
22286
|
return this.data;
|
|
22177
22287
|
}
|
|
@@ -22197,6 +22307,9 @@ var EditFormController = class extends FormController {
|
|
|
22197
22307
|
res = await this.service.get(this.context, queryParams);
|
|
22198
22308
|
} catch (error) {
|
|
22199
22309
|
await this.evt.emit("onLoadError", void 0);
|
|
22310
|
+
this.actionNotification("GETERROR", {
|
|
22311
|
+
error
|
|
22312
|
+
});
|
|
22200
22313
|
throw error;
|
|
22201
22314
|
} finally {
|
|
22202
22315
|
await this.endLoading();
|
|
@@ -22205,6 +22318,7 @@ var EditFormController = class extends FormController {
|
|
|
22205
22318
|
this.state.data = res.data;
|
|
22206
22319
|
this.formStateNotify("LOAD" /* LOAD */);
|
|
22207
22320
|
await this.evt.emit("onLoadSuccess", void 0);
|
|
22321
|
+
this.actionNotification("GETSUCCESS");
|
|
22208
22322
|
this.state.isLoaded = true;
|
|
22209
22323
|
return this.data;
|
|
22210
22324
|
}
|
|
@@ -22225,11 +22339,15 @@ var EditFormController = class extends FormController {
|
|
|
22225
22339
|
}
|
|
22226
22340
|
await this.startLoading();
|
|
22227
22341
|
await this.evt.emit("onBeforeSave", void 0);
|
|
22342
|
+
const isCreate = this.data.srfuf === 0 /* CREATE */;
|
|
22228
22343
|
let res;
|
|
22229
22344
|
try {
|
|
22230
|
-
res =
|
|
22345
|
+
res = isCreate ? await this.service.create(this.context, this.data) : await this.service.update(this.context, this.data);
|
|
22231
22346
|
} catch (error) {
|
|
22232
22347
|
await this.evt.emit("onSaveError", void 0);
|
|
22348
|
+
this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
|
|
22349
|
+
error
|
|
22350
|
+
});
|
|
22233
22351
|
throw error;
|
|
22234
22352
|
} finally {
|
|
22235
22353
|
await this.endLoading();
|
|
@@ -22240,7 +22358,9 @@ var EditFormController = class extends FormController {
|
|
|
22240
22358
|
this.state.modified = false;
|
|
22241
22359
|
await this.evt.emit("onSaveSuccess", void 0);
|
|
22242
22360
|
this.formStateNotify("SAVE" /* SAVE */);
|
|
22243
|
-
|
|
22361
|
+
this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "SUCCESS"), {
|
|
22362
|
+
default: "".concat(this.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F")
|
|
22363
|
+
});
|
|
22244
22364
|
return this.data;
|
|
22245
22365
|
}
|
|
22246
22366
|
/**
|
|
@@ -22267,6 +22387,9 @@ var EditFormController = class extends FormController {
|
|
|
22267
22387
|
res = await this.service.remove(this.context, this.params);
|
|
22268
22388
|
} catch (error) {
|
|
22269
22389
|
await this.evt.emit("onRemoveError", void 0);
|
|
22390
|
+
this.actionNotification("REMOVEERROR", {
|
|
22391
|
+
error
|
|
22392
|
+
});
|
|
22270
22393
|
throw error;
|
|
22271
22394
|
} finally {
|
|
22272
22395
|
await this.endLoading();
|
|
@@ -22276,6 +22399,7 @@ var EditFormController = class extends FormController {
|
|
|
22276
22399
|
this.state.data = new ControlVO();
|
|
22277
22400
|
this.state.modified = false;
|
|
22278
22401
|
await this.evt.emit("onRemoveSuccess", void 0);
|
|
22402
|
+
this.actionNotification("REMOVESUCCESS");
|
|
22279
22403
|
return ok;
|
|
22280
22404
|
}
|
|
22281
22405
|
/**
|
|
@@ -22367,10 +22491,15 @@ var EditFormController = class extends FormController {
|
|
|
22367
22491
|
},
|
|
22368
22492
|
this.data
|
|
22369
22493
|
);
|
|
22494
|
+
} catch (error) {
|
|
22495
|
+
this.actionNotification("WFSTARTERROR", {
|
|
22496
|
+
error
|
|
22497
|
+
});
|
|
22498
|
+
throw error;
|
|
22370
22499
|
} finally {
|
|
22371
22500
|
await this.endLoading();
|
|
22372
22501
|
}
|
|
22373
|
-
|
|
22502
|
+
this.actionNotification("WFSTARTSUCCESS", { default: "\u6D41\u7A0B\u542F\u52A8\u6210\u529F" });
|
|
22374
22503
|
}
|
|
22375
22504
|
/**
|
|
22376
22505
|
* 工作流提交(调用前先确保调用保存)
|
|
@@ -22395,10 +22524,15 @@ var EditFormController = class extends FormController {
|
|
|
22395
22524
|
},
|
|
22396
22525
|
this.data
|
|
22397
22526
|
);
|
|
22527
|
+
} catch (error) {
|
|
22528
|
+
this.actionNotification("WFSUBMITERROR", {
|
|
22529
|
+
error
|
|
22530
|
+
});
|
|
22531
|
+
throw error;
|
|
22398
22532
|
} finally {
|
|
22399
22533
|
await this.endLoading();
|
|
22400
22534
|
}
|
|
22401
|
-
|
|
22535
|
+
this.actionNotification("WFSUBMITSUCCESS", { default: "\u6D41\u7A0B\u63D0\u4EA4\u6210\u529F" });
|
|
22402
22536
|
}
|
|
22403
22537
|
async dataChangeNotify(names) {
|
|
22404
22538
|
await super.dataChangeNotify(names);
|
|
@@ -23798,12 +23932,21 @@ var GridController = class extends MDControlController {
|
|
|
23798
23932
|
if (editingRow) {
|
|
23799
23933
|
throw new RuntimeError38("\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u884C\u7F16\u8F91\u4E2D\u7684\u884C\u7684\u64CD\u4F5C");
|
|
23800
23934
|
}
|
|
23801
|
-
|
|
23935
|
+
let res;
|
|
23936
|
+
try {
|
|
23937
|
+
res = await this.service.getDraft(this.context, this.params);
|
|
23938
|
+
} catch (error) {
|
|
23939
|
+
this.actionNotification("GETDRAFTERROR", {
|
|
23940
|
+
error
|
|
23941
|
+
});
|
|
23942
|
+
throw error;
|
|
23943
|
+
}
|
|
23802
23944
|
this.state.items.unshift(res.data);
|
|
23803
23945
|
const newRow = new GridRowState(res.data, this);
|
|
23804
23946
|
this.state.rows.unshift(newRow);
|
|
23805
23947
|
this.gridStateNotify(newRow, "DRAFT" /* DRAFT */);
|
|
23806
23948
|
this.switchRowEdit(this.state.rows[0], true);
|
|
23949
|
+
this.actionNotification("GETDRAFTSUCCESS", { data: res.data });
|
|
23807
23950
|
}
|
|
23808
23951
|
/**
|
|
23809
23952
|
* 保存
|
|
@@ -23843,6 +23986,13 @@ var GridController = class extends MDControlController {
|
|
|
23843
23986
|
tempContext[deName] = data.srfkey;
|
|
23844
23987
|
try {
|
|
23845
23988
|
res = isCreate ? await this.service.create(tempContext, data) : await this.service.update(tempContext, data);
|
|
23989
|
+
} catch (error) {
|
|
23990
|
+
await this.evt.emit("onSaveError", void 0);
|
|
23991
|
+
this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
|
|
23992
|
+
error,
|
|
23993
|
+
data: rowState.data
|
|
23994
|
+
});
|
|
23995
|
+
throw error;
|
|
23846
23996
|
} finally {
|
|
23847
23997
|
await this.endLoading();
|
|
23848
23998
|
}
|
|
@@ -23853,6 +24003,10 @@ var GridController = class extends MDControlController {
|
|
|
23853
24003
|
rowState.data = res.data;
|
|
23854
24004
|
rowState.modified = false;
|
|
23855
24005
|
ibiz.message.success("".concat(res.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F"));
|
|
24006
|
+
this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "SUCCESS"), {
|
|
24007
|
+
default: "".concat(res.data.srfmajortext || "", "\u4FDD\u5B58\u6210\u529F"),
|
|
24008
|
+
data: res.data
|
|
24009
|
+
});
|
|
23856
24010
|
this.gridStateNotify(rowState, "SAVE" /* SAVE */);
|
|
23857
24011
|
await this.evt.emit("onSaveSuccess", void 0);
|
|
23858
24012
|
}
|
|
@@ -24085,13 +24239,15 @@ var GridController = class extends MDControlController {
|
|
|
24085
24239
|
* @param {string} key 排序字段
|
|
24086
24240
|
* @param {string} order 排序顺序
|
|
24087
24241
|
*/
|
|
24088
|
-
setSort(
|
|
24089
|
-
if (
|
|
24090
|
-
|
|
24242
|
+
setSort(fieldId, order) {
|
|
24243
|
+
if (fieldId && order) {
|
|
24244
|
+
const fieldName = this.fieldIdNameMap.get(fieldId).toLowerCase();
|
|
24245
|
+
super.setSort(fieldName, order);
|
|
24091
24246
|
} else {
|
|
24092
24247
|
const { minorSortAppDEFieldId, minorSortDir } = this.model;
|
|
24093
24248
|
if (minorSortAppDEFieldId && minorSortDir) {
|
|
24094
|
-
|
|
24249
|
+
const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
|
|
24250
|
+
this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
|
|
24095
24251
|
} else {
|
|
24096
24252
|
this.state.sortQuery = "";
|
|
24097
24253
|
}
|
|
@@ -24859,7 +25015,8 @@ var ListController = class extends MDControlController {
|
|
|
24859
25015
|
} else {
|
|
24860
25016
|
const { minorSortAppDEFieldId, minorSortDir } = this.model;
|
|
24861
25017
|
if (minorSortAppDEFieldId && minorSortDir) {
|
|
24862
|
-
|
|
25018
|
+
const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId);
|
|
25019
|
+
this.state.sortQuery = "".concat(fieldName.toLowerCase(), ",").concat(minorSortDir.toLowerCase());
|
|
24863
25020
|
} else {
|
|
24864
25021
|
this.state.sortQuery = "";
|
|
24865
25022
|
}
|
|
@@ -28434,12 +28591,18 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
28434
28591
|
if (!(data == null ? void 0 : data[0])) {
|
|
28435
28592
|
throw new RuntimeError48("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
|
|
28436
28593
|
}
|
|
28437
|
-
const
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28594
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
28595
|
+
let openViewRef;
|
|
28596
|
+
if (openViewRefs) {
|
|
28597
|
+
openViewRef = await this.calcOpenViewRef(appUILogic, parameters);
|
|
28598
|
+
} else {
|
|
28599
|
+
openViewRef = appUILogic.openDataAppView;
|
|
28600
|
+
if (!openViewRef) {
|
|
28601
|
+
throw new RuntimeModelError49(
|
|
28602
|
+
appUILogic,
|
|
28603
|
+
"opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
|
|
28604
|
+
);
|
|
28605
|
+
}
|
|
28443
28606
|
}
|
|
28444
28607
|
const openView = openViewRef.refAppViewId;
|
|
28445
28608
|
if (!openView) {
|
|
@@ -28566,6 +28729,29 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
28566
28729
|
}
|
|
28567
28730
|
return findView;
|
|
28568
28731
|
}
|
|
28732
|
+
async calcOpenViewRef(appUILogic, parameters) {
|
|
28733
|
+
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
28734
|
+
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
28735
|
+
if (!formTypeName) {
|
|
28736
|
+
throw new RuntimeModelError49(
|
|
28737
|
+
appUILogic,
|
|
28738
|
+
"".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
|
|
28739
|
+
);
|
|
28740
|
+
}
|
|
28741
|
+
const { data } = parameters;
|
|
28742
|
+
const formTypeValue = data[0][formTypeName];
|
|
28743
|
+
if (!formTypeValue) {
|
|
28744
|
+
throw new RuntimeModelError49(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
28745
|
+
}
|
|
28746
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
28747
|
+
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
28748
|
+
if (!findView) {
|
|
28749
|
+
throw new RuntimeError48(
|
|
28750
|
+
"\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
28751
|
+
);
|
|
28752
|
+
}
|
|
28753
|
+
return findView;
|
|
28754
|
+
}
|
|
28569
28755
|
};
|
|
28570
28756
|
|
|
28571
28757
|
// src/logic-scheduler/trigger/view-event-trigger.ts
|
|
@@ -28582,7 +28768,7 @@ var ViewEventTrigger = class extends LogicTrigger {
|
|
|
28582
28768
|
* @type {string[]}
|
|
28583
28769
|
*/
|
|
28584
28770
|
this.listenEventNames = [];
|
|
28585
|
-
const names = logic.eventNames.split("
|
|
28771
|
+
const names = logic.eventNames.split(";");
|
|
28586
28772
|
this.listenEventNames = names.map(
|
|
28587
28773
|
(name) => StudioViewEvents[name] || name
|
|
28588
28774
|
);
|
|
@@ -28607,7 +28793,7 @@ var ControlEventTrigger = class extends LogicTrigger {
|
|
|
28607
28793
|
* @type {string[]}
|
|
28608
28794
|
*/
|
|
28609
28795
|
this.listenEventNames = [];
|
|
28610
|
-
const names = logic.eventNames.split("
|
|
28796
|
+
const names = logic.eventNames.split(";");
|
|
28611
28797
|
this.listenEventNames = names.map(
|
|
28612
28798
|
(name) => StudioControlEvents[name] || name
|
|
28613
28799
|
);
|
|
@@ -28970,6 +29156,7 @@ export {
|
|
|
28970
29156
|
getDeACMode,
|
|
28971
29157
|
getEditorProvider,
|
|
28972
29158
|
getFormDetailProvider,
|
|
29159
|
+
getFormTypeFieldName,
|
|
28973
29160
|
getGridColumnProvider,
|
|
28974
29161
|
getMatchResPath,
|
|
28975
29162
|
getOriginData,
|
|
@@ -28987,6 +29174,7 @@ export {
|
|
|
28987
29174
|
hasDeCodeName,
|
|
28988
29175
|
install,
|
|
28989
29176
|
installCommand,
|
|
29177
|
+
isDataContainer,
|
|
28990
29178
|
isValueChange,
|
|
28991
29179
|
matchMainState,
|
|
28992
29180
|
openRedirectView,
|