@ibiz-template/runtime 0.4.17-dev.1 → 0.5.0-beta.1
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 +629 -816
- package/dist/index.system.min.js +2 -2
- package/out/controller/common/control/md-control.controller.d.ts +21 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +38 -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/gantt/gantt.controller.d.ts +6 -189
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +6 -412
- package/out/controller/control/gantt/gantt.service.d.ts +2 -2
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +5 -5
- 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/list/list.controller.d.ts +1 -30
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +0 -41
- 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/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +48 -4
- package/out/controller/control/search-bar/search-bar.service.d.ts +24 -0
- package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.service.js +62 -16
- package/out/interface/controller/event/control/i-gantt.event.d.ts +2 -44
- package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +2 -41
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +8 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/service/i-parent-config/i-parent-config.d.ts +67 -0
- package/out/interface/service/i-parent-config/i-parent-config.d.ts.map +1 -0
- package/out/interface/service/i-parent-config/i-parent-config.js +1 -0
- package/out/interface/service/index.d.ts +1 -0
- package/out/interface/service/index.d.ts.map +1 -1
- 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 +22 -3
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +65 -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/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +0 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +1 -2
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +0 -7
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +0 -18
- package/out/ui-action/provider/ui-action-provider-base.d.ts +10 -0
- package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
- package/out/ui-action/provider/ui-action-provider-base.js +20 -9
- package/out/utils/index.d.ts +1 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +25 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +72 -31
- package/out/utils/ui-domain/ui-domain.d.ts +28 -0
- package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
- package/out/utils/ui-domain/ui-domain.js +40 -0
- package/package.json +6 -6
- package/src/controller/common/control/md-control.controller.ts +50 -2
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -6
- package/src/controller/control/gantt/gantt.controller.ts +7 -492
- package/src/controller/control/gantt/gantt.service.ts +5 -5
- package/src/controller/control/kanban/kanban.controller.ts +2 -2
- package/src/controller/control/list/list.controller.ts +0 -54
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +1 -1
- package/src/controller/control/search-bar/index.ts +1 -0
- package/src/controller/control/search-bar/search-bar.controller.ts +63 -10
- package/src/controller/control/search-bar/search-bar.service.ts +70 -16
- package/src/interface/controller/event/control/i-gantt.event.ts +2 -38
- package/src/interface/controller/state/control/i-gantt.state.ts +2 -47
- package/src/interface/controller/state/control/i-search-bar.state.ts +9 -1
- package/src/interface/service/i-parent-config/i-parent-config.ts +66 -0
- package/src/interface/service/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 +77 -5
- package/src/service/service/entity/de.service.ts +26 -1
- package/src/service/service/entity/method/method.ts +1 -13
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +1 -4
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +0 -21
- package/src/ui-action/provider/ui-action-provider-base.ts +34 -15
- package/src/utils/index.ts +1 -0
- package/src/utils/open-redirect-view/open-redirect-view.ts +93 -38
- package/src/utils/ui-domain/ui-domain.ts +44 -0
package/dist/index.esm.js
CHANGED
|
@@ -1091,15 +1091,14 @@ async function toLocalOpenWFRedirectView(context, linkUrl, opts = {}) {
|
|
|
1091
1091
|
context.srfprocessinstanceid = params.srfprocessinstanceid;
|
|
1092
1092
|
delete params.srfprocessinstanceid;
|
|
1093
1093
|
}
|
|
1094
|
-
|
|
1095
|
-
OpenAppViewCommand.TAG,
|
|
1096
|
-
deRdView.id,
|
|
1094
|
+
return {
|
|
1097
1095
|
context,
|
|
1098
1096
|
params,
|
|
1099
|
-
opts
|
|
1100
|
-
|
|
1097
|
+
opts,
|
|
1098
|
+
viewId: deRdView.id
|
|
1099
|
+
};
|
|
1101
1100
|
}
|
|
1102
|
-
async function
|
|
1101
|
+
async function getDERedirectToView(appView, context, params = {}, opts = {}) {
|
|
1103
1102
|
var _a;
|
|
1104
1103
|
const navContext = appView.appViewNavContexts || [];
|
|
1105
1104
|
const navContextData = convertNavData(navContext, params, context);
|
|
@@ -1128,20 +1127,17 @@ async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
|
1128
1127
|
linkUrl = linkUrl.slice(linkUrl.indexOf("appredirectview?"));
|
|
1129
1128
|
}
|
|
1130
1129
|
if (linkUrl.startsWith("http://") || linkUrl.startsWith("https://")) {
|
|
1131
|
-
return
|
|
1132
|
-
const newWindow = window.open(linkUrl, "_blank");
|
|
1133
|
-
if (newWindow) {
|
|
1134
|
-
newWindow.callback = () => {
|
|
1135
|
-
resolve({ ok: true, data: [] });
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
});
|
|
1130
|
+
return { type: "url", url: linkUrl };
|
|
1139
1131
|
}
|
|
1140
1132
|
if (linkUrl.startsWith("appredirectview?")) {
|
|
1141
|
-
await toLocalOpenWFRedirectView(
|
|
1142
|
-
|
|
1133
|
+
const toView = await toLocalOpenWFRedirectView(
|
|
1134
|
+
context,
|
|
1135
|
+
linkUrl,
|
|
1136
|
+
opts
|
|
1137
|
+
);
|
|
1138
|
+
return { type: "view", ...toView };
|
|
1143
1139
|
}
|
|
1144
|
-
|
|
1140
|
+
throw new RuntimeError("\u672A\u652F\u6301\u7684linkUrl\u683C\u5F0F:".concat(linkUrl));
|
|
1145
1141
|
}
|
|
1146
1142
|
}
|
|
1147
1143
|
} finally {
|
|
@@ -1152,27 +1148,29 @@ async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
|
1152
1148
|
const rdTagItems = rdTag.split(":");
|
|
1153
1149
|
const wfRdTag = rdTagItems.length === 2 ? rdTag : rdTagItems.slice(0, 2).join(":");
|
|
1154
1150
|
const deRdTag = "".concat(entity.name.toUpperCase(), ":").concat(rdTag);
|
|
1155
|
-
const allRefViews =
|
|
1156
|
-
|
|
1151
|
+
const allRefViews = [];
|
|
1152
|
+
if (appView.redirectAppViewRefs) {
|
|
1153
|
+
allRefViews.push(...appView.redirectAppViewRefs);
|
|
1154
|
+
}
|
|
1155
|
+
if (appView.appViewRefs) {
|
|
1156
|
+
allRefViews.push(...appView.appViewRefs);
|
|
1157
|
+
}
|
|
1158
|
+
const refView = allRefViews.find((view) => {
|
|
1157
1159
|
const matchKey = view.name || view.id;
|
|
1158
1160
|
return matchKey === deRdTag || matchKey === rdTag || matchKey === wfRdTag;
|
|
1159
1161
|
});
|
|
1160
1162
|
if (refView) {
|
|
1161
1163
|
const viewId = refView.refAppViewId;
|
|
1162
1164
|
if (viewId) {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
+
return {
|
|
1166
|
+
type: "view",
|
|
1165
1167
|
viewId,
|
|
1166
1168
|
context,
|
|
1167
1169
|
params,
|
|
1168
|
-
{ ...opts, data: [curData] }
|
|
1169
|
-
|
|
1170
|
-
if (result) {
|
|
1171
|
-
return result;
|
|
1172
|
-
}
|
|
1173
|
-
} else {
|
|
1174
|
-
throw new RuntimeModelError2(refView, "\u672A\u914D\u7F6E\u5B9E\u9645\u5F15\u7528\u89C6\u56FE");
|
|
1170
|
+
opts: { ...opts, data: [curData] }
|
|
1171
|
+
};
|
|
1175
1172
|
}
|
|
1173
|
+
throw new RuntimeModelError2(refView, "\u672A\u914D\u7F6E\u5B9E\u9645\u5F15\u7528\u89C6\u56FE");
|
|
1176
1174
|
} else {
|
|
1177
1175
|
ibiz.log.error(
|
|
1178
1176
|
"\u91CD\u5B9A\u5411\u89C6\u56FE\u5F15\u7528\u6709\uFF1A",
|
|
@@ -1187,7 +1185,34 @@ async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
|
1187
1185
|
"\u672A\u627E\u5230\u91CD\u5B9A\u5411\u6807\u8BC6[".concat(rdTag, "]\u6216[").concat(deRdTag, "]\u6216\u5DE5\u4F5C\u6D41[").concat(wfRdTag, "]\u5BF9\u5E94\u89C6\u56FE")
|
|
1188
1186
|
);
|
|
1189
1187
|
}
|
|
1190
|
-
|
|
1188
|
+
}
|
|
1189
|
+
async function openDERedirectView(appView, context, params = {}, opts = {}) {
|
|
1190
|
+
let toView;
|
|
1191
|
+
try {
|
|
1192
|
+
toView = await getDERedirectToView(appView, context, params, opts);
|
|
1193
|
+
} catch (error) {
|
|
1194
|
+
ibiz.log.error(error);
|
|
1195
|
+
return { ok: false, data: [] };
|
|
1196
|
+
}
|
|
1197
|
+
if (toView.type === "url") {
|
|
1198
|
+
const openUrl = toView.url;
|
|
1199
|
+
return new Promise((resolve) => {
|
|
1200
|
+
const newWindow = window.open(openUrl, "_blank");
|
|
1201
|
+
if (newWindow) {
|
|
1202
|
+
newWindow.callback = () => {
|
|
1203
|
+
resolve({ ok: true, data: [] });
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
const result = await ibiz.commands.execute(
|
|
1209
|
+
OpenAppViewCommand.TAG,
|
|
1210
|
+
toView.viewId,
|
|
1211
|
+
toView.context,
|
|
1212
|
+
toView.params,
|
|
1213
|
+
toView.opts
|
|
1214
|
+
);
|
|
1215
|
+
return result || { ok: true, data: [] };
|
|
1191
1216
|
}
|
|
1192
1217
|
async function calcDERdTag(entity, rdView, params, data) {
|
|
1193
1218
|
let rdTag = "";
|
|
@@ -1196,7 +1221,7 @@ async function calcDERdTag(entity, rdView, params, data) {
|
|
|
1196
1221
|
const { codeName } = findFieldById(entity, typeFieldId);
|
|
1197
1222
|
const value = data[codeName.toLowerCase()];
|
|
1198
1223
|
if (notNilEmpty3(value)) {
|
|
1199
|
-
return "".concat(value);
|
|
1224
|
+
return "".concat(value.toUpperCase());
|
|
1200
1225
|
}
|
|
1201
1226
|
ibiz.log.warn(
|
|
1202
1227
|
"\u91CD\u5B9A\u5411\u89C6\u56FE[".concat(rdView.name, "]\u81EA\u5B9A\u4E49\u7C7B\u522B\u5C5E\u6027[").concat(typeFieldId, "]\u503C\u4E3A\u7A7A"),
|
|
@@ -2709,12 +2734,50 @@ var UIDomain = class {
|
|
|
2709
2734
|
* @param {string} [id]
|
|
2710
2735
|
*/
|
|
2711
2736
|
constructor(id) {
|
|
2737
|
+
/**
|
|
2738
|
+
* DTO 父子关系映射
|
|
2739
|
+
*
|
|
2740
|
+
* @author chitanda
|
|
2741
|
+
* @date 2023-12-26 15:12:13
|
|
2742
|
+
* @protected
|
|
2743
|
+
* @type {Map<string, IParentConfig[]>}
|
|
2744
|
+
*/
|
|
2745
|
+
this.rsMap = /* @__PURE__ */ new Map();
|
|
2712
2746
|
if (id) {
|
|
2713
2747
|
this.id = id;
|
|
2714
2748
|
} else {
|
|
2715
2749
|
this.id = createUUID();
|
|
2716
2750
|
}
|
|
2717
2751
|
}
|
|
2752
|
+
/**
|
|
2753
|
+
* 设置当前界面域下,指定实体的相关父关系以及属性。在 DTO 包解析时设置此参数,销毁时清空
|
|
2754
|
+
*
|
|
2755
|
+
* @author chitanda
|
|
2756
|
+
* @date 2023-12-26 15:12:31
|
|
2757
|
+
* @param {string} entity
|
|
2758
|
+
* @param {IParentConfig} config
|
|
2759
|
+
*/
|
|
2760
|
+
setDERConfig(deCodeName, config) {
|
|
2761
|
+
if (!this.rsMap.has(deCodeName)) {
|
|
2762
|
+
this.rsMap.set(deCodeName, []);
|
|
2763
|
+
}
|
|
2764
|
+
const arr = this.rsMap.get(deCodeName);
|
|
2765
|
+
arr.push(config);
|
|
2766
|
+
}
|
|
2767
|
+
/**
|
|
2768
|
+
* 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
|
|
2769
|
+
*
|
|
2770
|
+
* @author chitanda
|
|
2771
|
+
* @date 2023-12-26 16:12:07
|
|
2772
|
+
* @param {string} deCodeName
|
|
2773
|
+
* @return {*} {IParentConfig[]}
|
|
2774
|
+
*/
|
|
2775
|
+
getDERConfig(deCodeName) {
|
|
2776
|
+
if (this.rsMap.has(deCodeName)) {
|
|
2777
|
+
return this.rsMap.get(deCodeName);
|
|
2778
|
+
}
|
|
2779
|
+
return [];
|
|
2780
|
+
}
|
|
2718
2781
|
/**
|
|
2719
2782
|
* 界面域销毁
|
|
2720
2783
|
*
|
|
@@ -2722,6 +2785,7 @@ var UIDomain = class {
|
|
|
2722
2785
|
* @date 2023-12-22 15:12:49
|
|
2723
2786
|
*/
|
|
2724
2787
|
destroy() {
|
|
2788
|
+
this.rsMap.clear();
|
|
2725
2789
|
const apps = ibiz.hub.getAllApps();
|
|
2726
2790
|
apps.forEach((app) => {
|
|
2727
2791
|
app.deService.reset({
|
|
@@ -5602,6 +5666,205 @@ var FileService = class {
|
|
|
5602
5666
|
}
|
|
5603
5667
|
};
|
|
5604
5668
|
|
|
5669
|
+
// src/service/app-data-entity/app-data-entity.ts
|
|
5670
|
+
import { clone as clone5, isNil as isNil7 } from "ramda";
|
|
5671
|
+
import { DataTypes } from "@ibiz-template/core";
|
|
5672
|
+
import { createUUID as createUUID3 } from "qx-util";
|
|
5673
|
+
|
|
5674
|
+
// src/service/constant/srfuf.ts
|
|
5675
|
+
var Srfuf = /* @__PURE__ */ ((Srfuf2) => {
|
|
5676
|
+
Srfuf2[Srfuf2["CREATE"] = 0] = "CREATE";
|
|
5677
|
+
Srfuf2[Srfuf2["UPDATE"] = 1] = "UPDATE";
|
|
5678
|
+
return Srfuf2;
|
|
5679
|
+
})(Srfuf || {});
|
|
5680
|
+
|
|
5681
|
+
// src/service/app-data-entity/app-data-entity.ts
|
|
5682
|
+
var AppDataEntity = class _AppDataEntity {
|
|
5683
|
+
get srfuf() {
|
|
5684
|
+
return this.srfkey === this.tempsrfkey ? 1 /* UPDATE */ : 0 /* CREATE */;
|
|
5685
|
+
}
|
|
5686
|
+
/**
|
|
5687
|
+
* Creates an instance of AppDataEntity.
|
|
5688
|
+
*
|
|
5689
|
+
* @author chitanda
|
|
5690
|
+
* @date 2023-11-16 15:11:08
|
|
5691
|
+
* @param {IAppDataEntity} entity
|
|
5692
|
+
* @param {(IData | AppDataEntity)} [data={}]
|
|
5693
|
+
*/
|
|
5694
|
+
constructor(entity, data = {}) {
|
|
5695
|
+
Object.defineProperty(this, "_entity", {
|
|
5696
|
+
enumerable: false,
|
|
5697
|
+
configurable: true,
|
|
5698
|
+
value: entity
|
|
5699
|
+
});
|
|
5700
|
+
Object.defineProperty(this, "_data", {
|
|
5701
|
+
enumerable: false,
|
|
5702
|
+
configurable: true,
|
|
5703
|
+
value: data instanceof _AppDataEntity ? clone5(data._data) : clone5(data)
|
|
5704
|
+
});
|
|
5705
|
+
Object.defineProperty(this, "srfdeid", {
|
|
5706
|
+
get() {
|
|
5707
|
+
return entity.id;
|
|
5708
|
+
}
|
|
5709
|
+
});
|
|
5710
|
+
Object.defineProperty(this, "srfdecodename", {
|
|
5711
|
+
get() {
|
|
5712
|
+
return entity.codeName;
|
|
5713
|
+
}
|
|
5714
|
+
});
|
|
5715
|
+
const keyAppField = findModelChild(
|
|
5716
|
+
entity.appDEFields || [],
|
|
5717
|
+
entity.keyAppDEFieldId
|
|
5718
|
+
);
|
|
5719
|
+
if (keyAppField) {
|
|
5720
|
+
const key = keyAppField.codeName.toLowerCase();
|
|
5721
|
+
Object.defineProperty(this, "srfkeyfield", {
|
|
5722
|
+
get() {
|
|
5723
|
+
return key;
|
|
5724
|
+
}
|
|
5725
|
+
});
|
|
5726
|
+
Object.defineProperty(this, "srfkey", {
|
|
5727
|
+
set(val) {
|
|
5728
|
+
this._data[key] = val;
|
|
5729
|
+
},
|
|
5730
|
+
get() {
|
|
5731
|
+
return this._data[key];
|
|
5732
|
+
}
|
|
5733
|
+
});
|
|
5734
|
+
} else {
|
|
5735
|
+
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u952E\u5B57\u6BB5"));
|
|
5736
|
+
}
|
|
5737
|
+
const majorAppField = findModelChild(
|
|
5738
|
+
entity.appDEFields || [],
|
|
5739
|
+
entity.majorAppDEFieldId
|
|
5740
|
+
);
|
|
5741
|
+
if (majorAppField) {
|
|
5742
|
+
const major = majorAppField.codeName.toLowerCase();
|
|
5743
|
+
Object.defineProperty(this, "srfmajorfield", {
|
|
5744
|
+
get() {
|
|
5745
|
+
return major;
|
|
5746
|
+
}
|
|
5747
|
+
});
|
|
5748
|
+
Object.defineProperty(this, "srfmajortext", {
|
|
5749
|
+
set(val) {
|
|
5750
|
+
this._data[major] = val;
|
|
5751
|
+
},
|
|
5752
|
+
get() {
|
|
5753
|
+
return this._data[major];
|
|
5754
|
+
}
|
|
5755
|
+
});
|
|
5756
|
+
} else {
|
|
5757
|
+
ibiz.log.warn("\u5B9E\u4F53[".concat(entity.codeName, "]\u672A\u914D\u7F6E\u4E3B\u6587\u672C\u5B57\u6BB5"));
|
|
5758
|
+
}
|
|
5759
|
+
Object.defineProperty(this, "tempsrfkey", {
|
|
5760
|
+
enumerable: false,
|
|
5761
|
+
configurable: true,
|
|
5762
|
+
writable: true,
|
|
5763
|
+
value: isNil7(this.srfkey) ? createUUID3() : this.srfkey
|
|
5764
|
+
});
|
|
5765
|
+
this.defineProperties();
|
|
5766
|
+
}
|
|
5767
|
+
/**
|
|
5768
|
+
* 代理实际数据
|
|
5769
|
+
*
|
|
5770
|
+
* @author chitanda
|
|
5771
|
+
* @date 2022-10-11 22:10:55
|
|
5772
|
+
* @protected
|
|
5773
|
+
*/
|
|
5774
|
+
defineProperties() {
|
|
5775
|
+
var _a;
|
|
5776
|
+
const { _data, convertVal } = this;
|
|
5777
|
+
const properties = {};
|
|
5778
|
+
const keys = Object.keys(_data);
|
|
5779
|
+
keys.forEach((key) => {
|
|
5780
|
+
properties[key] = {
|
|
5781
|
+
enumerable: true,
|
|
5782
|
+
set(val) {
|
|
5783
|
+
_data[key] = val;
|
|
5784
|
+
},
|
|
5785
|
+
get() {
|
|
5786
|
+
return _data[key];
|
|
5787
|
+
}
|
|
5788
|
+
};
|
|
5789
|
+
});
|
|
5790
|
+
(_a = this._entity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
5791
|
+
const key = field.codeName.toLowerCase();
|
|
5792
|
+
properties[key] = {
|
|
5793
|
+
enumerable: true,
|
|
5794
|
+
set(val) {
|
|
5795
|
+
_data[key] = convertVal(val, field.stdDataType);
|
|
5796
|
+
},
|
|
5797
|
+
get() {
|
|
5798
|
+
return _data[key];
|
|
5799
|
+
}
|
|
5800
|
+
};
|
|
5801
|
+
_data[key] = convertVal(_data[key], field.stdDataType);
|
|
5802
|
+
});
|
|
5803
|
+
Object.defineProperties(this, properties);
|
|
5804
|
+
}
|
|
5805
|
+
/**
|
|
5806
|
+
* 克隆数据
|
|
5807
|
+
*
|
|
5808
|
+
* @author chitanda
|
|
5809
|
+
* @date 2022-10-11 00:10:15
|
|
5810
|
+
* @return {*} {AppDataEntity}
|
|
5811
|
+
*/
|
|
5812
|
+
clone() {
|
|
5813
|
+
const entity = new _AppDataEntity(this._entity, this._data);
|
|
5814
|
+
entity.srfkey = this.srfkey;
|
|
5815
|
+
return entity;
|
|
5816
|
+
}
|
|
5817
|
+
/**
|
|
5818
|
+
* 合并参数
|
|
5819
|
+
*
|
|
5820
|
+
* @author chitanda
|
|
5821
|
+
* @date 2022-10-19 11:10:25
|
|
5822
|
+
* @param {(IData | AppDataEntity)} data
|
|
5823
|
+
* @return {*} {AppDataEntity}
|
|
5824
|
+
*/
|
|
5825
|
+
assign(data) {
|
|
5826
|
+
let _data = {};
|
|
5827
|
+
if (data instanceof _AppDataEntity) {
|
|
5828
|
+
_data = data._data;
|
|
5829
|
+
} else {
|
|
5830
|
+
_data = data;
|
|
5831
|
+
}
|
|
5832
|
+
Object.keys(_data).forEach((key) => {
|
|
5833
|
+
if (_data[key] === void 0) {
|
|
5834
|
+
delete _data[key];
|
|
5835
|
+
}
|
|
5836
|
+
});
|
|
5837
|
+
Object.assign(this._data, _data);
|
|
5838
|
+
return this;
|
|
5839
|
+
}
|
|
5840
|
+
/**
|
|
5841
|
+
* 根据属性的数据类型转换值
|
|
5842
|
+
* @author lxm
|
|
5843
|
+
* @date 2023-09-25 03:37:28
|
|
5844
|
+
* @protected
|
|
5845
|
+
* @param {unknown} value
|
|
5846
|
+
* @param {(number | undefined)} dataType
|
|
5847
|
+
* @return {*} {unknown}
|
|
5848
|
+
*/
|
|
5849
|
+
convertVal(value, dataType) {
|
|
5850
|
+
if (value == null) {
|
|
5851
|
+
return value;
|
|
5852
|
+
}
|
|
5853
|
+
if (isNil7(dataType)) {
|
|
5854
|
+
return value;
|
|
5855
|
+
}
|
|
5856
|
+
if (DataTypes.isNumber(dataType)) {
|
|
5857
|
+
const numVal = !isNil7(value) && value !== "" ? Number(value) : value;
|
|
5858
|
+
if (Number.isNaN(numVal)) {
|
|
5859
|
+
ibiz.log.debug("".concat(value, "\u4E0D\u80FD\u8F6C\u6362\u6210\u6570\u5B57"));
|
|
5860
|
+
return value;
|
|
5861
|
+
}
|
|
5862
|
+
return numVal;
|
|
5863
|
+
}
|
|
5864
|
+
return value;
|
|
5865
|
+
}
|
|
5866
|
+
};
|
|
5867
|
+
|
|
5605
5868
|
// src/service/service/entity/de.service.ts
|
|
5606
5869
|
var DEService = class {
|
|
5607
5870
|
/**
|
|
@@ -5820,6 +6083,26 @@ var DEService = class {
|
|
|
5820
6083
|
const resPath = calcResPath(context, this.model);
|
|
5821
6084
|
return resPath + curPath;
|
|
5822
6085
|
}
|
|
6086
|
+
newEntity(data) {
|
|
6087
|
+
if (data instanceof AppDataEntity) {
|
|
6088
|
+
return data.clone();
|
|
6089
|
+
}
|
|
6090
|
+
return new AppDataEntity(this.model, data);
|
|
6091
|
+
}
|
|
6092
|
+
/**
|
|
6093
|
+
* 创建数据对象实例
|
|
6094
|
+
*
|
|
6095
|
+
* @author chitanda
|
|
6096
|
+
* @date 2023-12-23 19:12:57
|
|
6097
|
+
* @param {(IData[] | IDataEntity[] | IData | IDataEntity)} data
|
|
6098
|
+
* @return {*} {(IDataEntity | IDataEntity[])}
|
|
6099
|
+
*/
|
|
6100
|
+
createEntity(data) {
|
|
6101
|
+
if (Array.isArray(data)) {
|
|
6102
|
+
return data.map((item) => this.newEntity(item));
|
|
6103
|
+
}
|
|
6104
|
+
return this.newEntity(data);
|
|
6105
|
+
}
|
|
5823
6106
|
/**
|
|
5824
6107
|
* 服务实例销毁
|
|
5825
6108
|
*
|
|
@@ -5833,20 +6116,11 @@ var DEService = class {
|
|
|
5833
6116
|
};
|
|
5834
6117
|
|
|
5835
6118
|
// 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 || {});
|
|
6119
|
+
import { clone as clone7 } from "@ibiz-template/core";
|
|
5848
6120
|
|
|
5849
6121
|
// src/service/vo/control.vo.ts
|
|
6122
|
+
import { createUUID as createUUID4 } from "qx-util";
|
|
6123
|
+
import { clone as clone6, isNil as isNil8 } from "ramda";
|
|
5850
6124
|
var BuildInKeys = [
|
|
5851
6125
|
"srfkey",
|
|
5852
6126
|
"srfmajortext",
|
|
@@ -5935,7 +6209,7 @@ var ControlVO = class _ControlVO {
|
|
|
5935
6209
|
enumerable: false,
|
|
5936
6210
|
configurable: true,
|
|
5937
6211
|
writable: true,
|
|
5938
|
-
value:
|
|
6212
|
+
value: isNil8(this.srfkey) ? createUUID4() : this.srfkey
|
|
5939
6213
|
});
|
|
5940
6214
|
}
|
|
5941
6215
|
Object.defineProperty(this, "srfuf", {
|
|
@@ -6034,7 +6308,7 @@ var ControlVO = class _ControlVO {
|
|
|
6034
6308
|
* @return {*} {ControlVO}
|
|
6035
6309
|
*/
|
|
6036
6310
|
clone() {
|
|
6037
|
-
const cloneOrigin =
|
|
6311
|
+
const cloneOrigin = clone6(this.$origin);
|
|
6038
6312
|
const newVal = new _ControlVO(cloneOrigin, this.$dataUIMap);
|
|
6039
6313
|
Object.keys(this).forEach((key) => {
|
|
6040
6314
|
newVal[key] = this[key];
|
|
@@ -6111,7 +6385,7 @@ var ControlService = class {
|
|
|
6111
6385
|
* @returns {*} {IHttpResponse}
|
|
6112
6386
|
*/
|
|
6113
6387
|
handleResponse(res) {
|
|
6114
|
-
return
|
|
6388
|
+
return clone7(res);
|
|
6115
6389
|
}
|
|
6116
6390
|
/**
|
|
6117
6391
|
* 实体数据转ui数据
|
|
@@ -6570,7 +6844,7 @@ var V7AuthService = class {
|
|
|
6570
6844
|
};
|
|
6571
6845
|
|
|
6572
6846
|
// src/service/service/async-action/async-action.service.ts
|
|
6573
|
-
import { isNil as
|
|
6847
|
+
import { isNil as isNil9 } from "ramda";
|
|
6574
6848
|
var AsyncActionService = class {
|
|
6575
6849
|
/**
|
|
6576
6850
|
* 获取异步操作的集合
|
|
@@ -6581,7 +6855,7 @@ var AsyncActionService = class {
|
|
|
6581
6855
|
*/
|
|
6582
6856
|
async fetch(params = {}) {
|
|
6583
6857
|
const res = await ibiz.net.post("/portal/asyncaction/all", params);
|
|
6584
|
-
if (
|
|
6858
|
+
if (isNil9(res.data)) {
|
|
6585
6859
|
res.data = [];
|
|
6586
6860
|
}
|
|
6587
6861
|
return res;
|
|
@@ -6606,201 +6880,10 @@ import {
|
|
|
6606
6880
|
RuntimeError as RuntimeError20,
|
|
6607
6881
|
RuntimeModelError as RuntimeModelError19
|
|
6608
6882
|
} from "@ibiz-template/core";
|
|
6609
|
-
import { isArray as
|
|
6883
|
+
import { isArray as isArray6, isNil as isNil10 } from "lodash-es";
|
|
6610
6884
|
|
|
6611
6885
|
// src/service/service/entity/method/method.ts
|
|
6612
6886
|
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
6887
|
|
|
6805
6888
|
// src/service/dto/method.dto.ts
|
|
6806
6889
|
import { ModelError as ModelError6 } from "@ibiz-template/core";
|
|
@@ -6811,6 +6894,15 @@ var MethodDto = class _MethodDto {
|
|
|
6811
6894
|
this.isLocalMode = isLocalMode;
|
|
6812
6895
|
this.dto = dto;
|
|
6813
6896
|
this.dtoMap = /* @__PURE__ */ new Map();
|
|
6897
|
+
/**
|
|
6898
|
+
* 当前 DTO 是否已经计算过关系相关逻辑
|
|
6899
|
+
*
|
|
6900
|
+
* @link this.calcRs
|
|
6901
|
+
* @author chitanda
|
|
6902
|
+
* @date 2023-12-26 16:12:18
|
|
6903
|
+
* @protected
|
|
6904
|
+
*/
|
|
6905
|
+
this.isCalcRs = false;
|
|
6814
6906
|
if (dto) {
|
|
6815
6907
|
this.app = ibiz.hub.getApp(entity.appId);
|
|
6816
6908
|
this.fields = dto.appDEMethodDTOFields || [];
|
|
@@ -6868,6 +6960,7 @@ var MethodDto = class _MethodDto {
|
|
|
6868
6960
|
*/
|
|
6869
6961
|
async get(context, data) {
|
|
6870
6962
|
const params = {};
|
|
6963
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
6871
6964
|
for (let i = 0; i < this.fields.length; i++) {
|
|
6872
6965
|
const field = this.fields[i];
|
|
6873
6966
|
const key = field.codeName.toLowerCase();
|
|
@@ -6889,11 +6982,19 @@ var MethodDto = class _MethodDto {
|
|
|
6889
6982
|
if (!field.refAppDataEntityId) {
|
|
6890
6983
|
break;
|
|
6891
6984
|
}
|
|
6985
|
+
let configs = uiDomain.getDERConfig(field.refAppDataEntityId);
|
|
6986
|
+
const index = configs.findIndex(
|
|
6987
|
+
(config) => config.majorDECodeName === this.entity.codeName
|
|
6988
|
+
);
|
|
6989
|
+
configs = configs.slice(index + 1);
|
|
6892
6990
|
const dto = await this.getFieldDto(context, field);
|
|
6893
6991
|
const filterParams = {};
|
|
6894
6992
|
if (field.refPickupAppDEFieldId) {
|
|
6895
6993
|
filterParams[field.refPickupAppDEFieldId] = data.srfkey;
|
|
6896
6994
|
}
|
|
6995
|
+
configs.forEach((config) => {
|
|
6996
|
+
filterParams[config.pickupDEFName.toLowerCase()] = null;
|
|
6997
|
+
});
|
|
6897
6998
|
const items = await dto.select(context, filterParams);
|
|
6898
6999
|
if (items) {
|
|
6899
7000
|
const arr = [];
|
|
@@ -6921,12 +7022,13 @@ var MethodDto = class _MethodDto {
|
|
|
6921
7022
|
* @date 2022-10-10 23:10:50
|
|
6922
7023
|
* @param {IContext} context
|
|
6923
7024
|
* @param {IData[]} data
|
|
6924
|
-
* @return {*} {Promise<
|
|
7025
|
+
* @return {*} {Promise<IDataEntity[]>}
|
|
6925
7026
|
*/
|
|
6926
7027
|
async sets(context, data) {
|
|
6927
7028
|
if (this.isLocalMode) {
|
|
6928
7029
|
this.service.local.clear();
|
|
6929
7030
|
}
|
|
7031
|
+
await this.calcRs(context);
|
|
6930
7032
|
return Promise.all(
|
|
6931
7033
|
data.map(async (datum) => {
|
|
6932
7034
|
const all = this.fields.filter((field) => field.type === "DTOS").map(async (field) => {
|
|
@@ -6942,7 +7044,6 @@ var MethodDto = class _MethodDto {
|
|
|
6942
7044
|
if (items) {
|
|
6943
7045
|
const pKey = datum[this.entity.keyAppDEFieldId];
|
|
6944
7046
|
items.forEach((item) => {
|
|
6945
|
-
item.srfpkey = pKey;
|
|
6946
7047
|
item[field.refPickupAppDEFieldId] = pKey;
|
|
6947
7048
|
});
|
|
6948
7049
|
await dto.sets(context, items);
|
|
@@ -6954,7 +7055,7 @@ var MethodDto = class _MethodDto {
|
|
|
6954
7055
|
for (let i = 0; i < all.length; i++) {
|
|
6955
7056
|
await all[i];
|
|
6956
7057
|
}
|
|
6957
|
-
const entityData =
|
|
7058
|
+
const entityData = this.service.createEntity(datum);
|
|
6958
7059
|
if (this.isLocalMode) {
|
|
6959
7060
|
await this.service.local.add(context, entityData);
|
|
6960
7061
|
}
|
|
@@ -6962,6 +7063,48 @@ var MethodDto = class _MethodDto {
|
|
|
6962
7063
|
})
|
|
6963
7064
|
);
|
|
6964
7065
|
}
|
|
7066
|
+
/**
|
|
7067
|
+
* 递归计算当前 DTO 相关实体的父关系配置
|
|
7068
|
+
*
|
|
7069
|
+
* @author chitanda
|
|
7070
|
+
* @date 2023-12-26 16:12:13
|
|
7071
|
+
* @protected
|
|
7072
|
+
* @param {IContext} context
|
|
7073
|
+
* @param {number} [depth=0] 递归层级,避免进入死循环。最大递归层级为 10
|
|
7074
|
+
* @return {*} {Promise<void>}
|
|
7075
|
+
*/
|
|
7076
|
+
async calcRs(context, depth = 0) {
|
|
7077
|
+
if (this.isCalcRs || depth > 10) {
|
|
7078
|
+
return;
|
|
7079
|
+
}
|
|
7080
|
+
this.isCalcRs = true;
|
|
7081
|
+
depth += 1;
|
|
7082
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
7083
|
+
const dtoFields = this.fields.filter((field) => field.type === "DTOS");
|
|
7084
|
+
for (let i = 0; i < dtoFields.length; i++) {
|
|
7085
|
+
const field = dtoFields[i];
|
|
7086
|
+
if (!field.refAppDataEntityId) {
|
|
7087
|
+
continue;
|
|
7088
|
+
}
|
|
7089
|
+
const configs = uiDomain.getDERConfig(field.refAppDataEntityId);
|
|
7090
|
+
const index = configs.findIndex(
|
|
7091
|
+
(config) => config.pickupDEFName === field.refPickupAppDEFieldId
|
|
7092
|
+
);
|
|
7093
|
+
if (index === -1) {
|
|
7094
|
+
const dto = await this.getFieldDto(context, field);
|
|
7095
|
+
uiDomain.setDERConfig(field.refAppDataEntityId, {
|
|
7096
|
+
majorDEName: this.entity.name,
|
|
7097
|
+
majorDECodeName: this.entity.codeName,
|
|
7098
|
+
majorDECodeName2: this.entity.codeName2,
|
|
7099
|
+
minorDEName: dto.entity.name,
|
|
7100
|
+
minorDECodeName: dto.entity.codeName,
|
|
7101
|
+
minorDECodeName2: dto.entity.codeName2,
|
|
7102
|
+
pickupDEFName: field.refPickupAppDEFieldId
|
|
7103
|
+
});
|
|
7104
|
+
await dto.calcRs(context, depth);
|
|
7105
|
+
}
|
|
7106
|
+
}
|
|
7107
|
+
}
|
|
6965
7108
|
/**
|
|
6966
7109
|
* 获取子属性 DTO
|
|
6967
7110
|
*
|
|
@@ -7190,29 +7333,20 @@ var Method = class {
|
|
|
7190
7333
|
* @return {*} {(IDataEntity | IDataEntity[])}
|
|
7191
7334
|
*/
|
|
7192
7335
|
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);
|
|
7336
|
+
return this.service.createEntity(data);
|
|
7203
7337
|
}
|
|
7204
7338
|
};
|
|
7205
7339
|
|
|
7206
7340
|
// src/de-logic/index.ts
|
|
7207
7341
|
import { HttpError as HttpError3, HttpResponse as HttpResponse2, RuntimeError as RuntimeError19 } from "@ibiz-template/core";
|
|
7208
|
-
import { isArray as
|
|
7342
|
+
import { isArray as isArray5 } from "lodash-es";
|
|
7209
7343
|
import { clone as clone12 } from "ramda";
|
|
7210
7344
|
|
|
7211
7345
|
// src/de-logic/de-logic.ts
|
|
7212
7346
|
import { ModelError as ModelError12, RuntimeModelError as RuntimeModelError18 } from "@ibiz-template/core";
|
|
7213
7347
|
|
|
7214
7348
|
// src/de-logic/de-logic-context.ts
|
|
7215
|
-
import { isArray as
|
|
7349
|
+
import { isArray as isArray4 } from "lodash-es";
|
|
7216
7350
|
var DELogicContext = class {
|
|
7217
7351
|
/**
|
|
7218
7352
|
* Creates an instance of DELogicContext.
|
|
@@ -7259,7 +7393,7 @@ var DELogicContext = class {
|
|
|
7259
7393
|
* @type {string}
|
|
7260
7394
|
*/
|
|
7261
7395
|
this.defaultParamName = "Default";
|
|
7262
|
-
this.parameters = { context, data:
|
|
7396
|
+
this.parameters = { context, data: isArray4(data) ? data : [data], params };
|
|
7263
7397
|
}
|
|
7264
7398
|
/**
|
|
7265
7399
|
* 上下文
|
|
@@ -8292,7 +8426,7 @@ async function execFieldLogics(entity, type, context, data, params = {}) {
|
|
|
8292
8426
|
if (!data) {
|
|
8293
8427
|
return;
|
|
8294
8428
|
}
|
|
8295
|
-
if (
|
|
8429
|
+
if (isArray5(data)) {
|
|
8296
8430
|
await Promise.all(
|
|
8297
8431
|
data.map(
|
|
8298
8432
|
(item) => execSingleFieldLogics(entity, type, context, item, params)
|
|
@@ -8314,7 +8448,7 @@ var DEActionMethod = class extends Method {
|
|
|
8314
8448
|
* @return {*} {(Promise<IData | IData[]>)}
|
|
8315
8449
|
*/
|
|
8316
8450
|
async inputHandle(context, data) {
|
|
8317
|
-
if (
|
|
8451
|
+
if (isArray6(data)) {
|
|
8318
8452
|
return data;
|
|
8319
8453
|
}
|
|
8320
8454
|
return this.input.handle(context, data);
|
|
@@ -8373,7 +8507,7 @@ var DEActionMethod = class extends Method {
|
|
|
8373
8507
|
if (this.method.needResourceKey) {
|
|
8374
8508
|
let srfkey = context[this.entity.codeName.toLowerCase()];
|
|
8375
8509
|
if (isNil10(srfkey)) {
|
|
8376
|
-
srfkey =
|
|
8510
|
+
srfkey = isArray6(data) ? null : data == null ? void 0 : data[this.entity.keyAppDEFieldId];
|
|
8377
8511
|
}
|
|
8378
8512
|
path2 = "".concat(path2, "/").concat(srfkey);
|
|
8379
8513
|
}
|
|
@@ -8512,7 +8646,7 @@ var DEActionMethod = class extends Method {
|
|
|
8512
8646
|
try {
|
|
8513
8647
|
const addData = this.createEntity(entity);
|
|
8514
8648
|
let resultData;
|
|
8515
|
-
if (
|
|
8649
|
+
if (isArray6(addData)) {
|
|
8516
8650
|
resultData = await Promise.all(
|
|
8517
8651
|
addData.map((item) => this.service.local.add(context, item))
|
|
8518
8652
|
);
|
|
@@ -8583,7 +8717,7 @@ var DEActionMethod = class extends Method {
|
|
|
8583
8717
|
try {
|
|
8584
8718
|
const updateData = this.createEntity(entity);
|
|
8585
8719
|
let resultData;
|
|
8586
|
-
if (
|
|
8720
|
+
if (isArray6(updateData)) {
|
|
8587
8721
|
resultData = await Promise.all(
|
|
8588
8722
|
updateData.map((item) => this.service.local.update(context, item))
|
|
8589
8723
|
);
|
|
@@ -8649,12 +8783,12 @@ import {
|
|
|
8649
8783
|
ModelError as ModelError13,
|
|
8650
8784
|
RuntimeModelError as RuntimeModelError20
|
|
8651
8785
|
} from "@ibiz-template/core";
|
|
8652
|
-
import { isArray as
|
|
8786
|
+
import { isArray as isArray7 } from "lodash-es";
|
|
8653
8787
|
import { clone as clone13, isEmpty as isEmpty7, isNil as isNil11 } from "ramda";
|
|
8654
8788
|
import { ascSort as ascSort2, descSort } from "qx-util";
|
|
8655
8789
|
var FetchMethod = class extends Method {
|
|
8656
8790
|
async exec(context, params, params2) {
|
|
8657
|
-
const searchParams = params && !
|
|
8791
|
+
const searchParams = params && !isArray7(params) ? params : params2 || {};
|
|
8658
8792
|
if (this.isLocalMode) {
|
|
8659
8793
|
const items2 = await this.searchLocal(
|
|
8660
8794
|
null,
|
|
@@ -9371,18 +9505,6 @@ var calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
|
9371
9505
|
}
|
|
9372
9506
|
return result;
|
|
9373
9507
|
};
|
|
9374
|
-
var calcNodeDataItem = (nodeModel, data) => {
|
|
9375
|
-
var _a;
|
|
9376
|
-
const dataItem = {};
|
|
9377
|
-
(_a = nodeModel.detreeNodeDataItems) == null ? void 0 : _a.forEach((item) => {
|
|
9378
|
-
if (item.id && item.appDEFieldId) {
|
|
9379
|
-
Object.assign(dataItem, {
|
|
9380
|
-
[item.id.toLowerCase()]: data[item.appDEFieldId.toLowerCase()]
|
|
9381
|
-
});
|
|
9382
|
-
}
|
|
9383
|
-
});
|
|
9384
|
-
return dataItem;
|
|
9385
|
-
};
|
|
9386
9508
|
|
|
9387
9509
|
// src/service/vo/gantt-node-data/gantt-static-node-data.ts
|
|
9388
9510
|
var GanttStaticNodeData = class extends TreeStaticNodeData {
|
|
@@ -9444,7 +9566,6 @@ var GanttDataSetNodeData = class extends TreeDataSetNodeData {
|
|
|
9444
9566
|
nodeModel,
|
|
9445
9567
|
data
|
|
9446
9568
|
);
|
|
9447
|
-
this.nodeDataItem = calcNodeDataItem(nodeModel, data);
|
|
9448
9569
|
}
|
|
9449
9570
|
};
|
|
9450
9571
|
|
|
@@ -9581,7 +9702,7 @@ var MqttService = class {
|
|
|
9581
9702
|
|
|
9582
9703
|
// src/service/de-service-util.ts
|
|
9583
9704
|
import { RuntimeError as RuntimeError21 } from "@ibiz-template/core";
|
|
9584
|
-
var
|
|
9705
|
+
var _DEServiceUtil = class _DEServiceUtil {
|
|
9585
9706
|
/**
|
|
9586
9707
|
* Creates an instance of DEServiceUtil.
|
|
9587
9708
|
*
|
|
@@ -9600,13 +9721,6 @@ var DEServiceUtil = class {
|
|
|
9600
9721
|
* @type {Map<string, Map<string, IAppDEService>>} Map<域标识, Map<实体标识, 实体服务>>
|
|
9601
9722
|
*/
|
|
9602
9723
|
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
9724
|
}
|
|
9611
9725
|
/**
|
|
9612
9726
|
* 注册服务工厂方法
|
|
@@ -9616,8 +9730,8 @@ var DEServiceUtil = class {
|
|
|
9616
9730
|
* @param {string} id 实体标识
|
|
9617
9731
|
* @param {DEServiceConstructor} constructor
|
|
9618
9732
|
*/
|
|
9619
|
-
register(id, constructor) {
|
|
9620
|
-
this.constructorCache.set(id, constructor);
|
|
9733
|
+
static register(id, constructor) {
|
|
9734
|
+
this.constructorCache.set(id.toUpperCase(), constructor);
|
|
9621
9735
|
}
|
|
9622
9736
|
/**
|
|
9623
9737
|
* 根据实体标识获取实体服务
|
|
@@ -9642,7 +9756,7 @@ var DEServiceUtil = class {
|
|
|
9642
9756
|
if (!entityModel) {
|
|
9643
9757
|
throw new RuntimeError21("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
9644
9758
|
}
|
|
9645
|
-
const constructor =
|
|
9759
|
+
const constructor = _DEServiceUtil.constructorCache.get(id.toUpperCase());
|
|
9646
9760
|
let service;
|
|
9647
9761
|
if (constructor) {
|
|
9648
9762
|
service = await constructor(sandboxId, entityModel);
|
|
@@ -9706,6 +9820,15 @@ var DEServiceUtil = class {
|
|
|
9706
9820
|
return service.exec(methodName, context, params, params2);
|
|
9707
9821
|
}
|
|
9708
9822
|
};
|
|
9823
|
+
/**
|
|
9824
|
+
* 实体服务构造方法缓存
|
|
9825
|
+
*
|
|
9826
|
+
* @author lxm
|
|
9827
|
+
* @date 2023-05-15 08:37:13
|
|
9828
|
+
* @protected
|
|
9829
|
+
*/
|
|
9830
|
+
_DEServiceUtil.constructorCache = /* @__PURE__ */ new Map();
|
|
9831
|
+
var DEServiceUtil = _DEServiceUtil;
|
|
9709
9832
|
|
|
9710
9833
|
// src/command/app/open-app-view/open-app-view.ts
|
|
9711
9834
|
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
@@ -12584,15 +12707,45 @@ var MDControlController = class extends ControlController {
|
|
|
12584
12707
|
this.state.mdctrlActiveMode = 0;
|
|
12585
12708
|
this.state.groups = [];
|
|
12586
12709
|
}
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12710
|
+
/**
|
|
12711
|
+
* 批操作工具栏
|
|
12712
|
+
*
|
|
12713
|
+
* @author zk
|
|
12714
|
+
* @date 2023-08-02 06:08:34
|
|
12715
|
+
* @readonly
|
|
12716
|
+
* @type {(IToolbarController | undefined)}
|
|
12717
|
+
* @memberof ListController
|
|
12718
|
+
*/
|
|
12719
|
+
get batchToolbarController() {
|
|
12720
|
+
const controller = this.view.getController(
|
|
12721
|
+
"".concat(this.model.name, "_batchtoolbar")
|
|
12722
|
+
);
|
|
12723
|
+
return controller;
|
|
12724
|
+
}
|
|
12725
|
+
/**
|
|
12726
|
+
* 快速工具栏
|
|
12727
|
+
*
|
|
12728
|
+
* @author zk
|
|
12729
|
+
* @date 2023-08-02 06:08:34
|
|
12730
|
+
* @readonly
|
|
12731
|
+
* @type {(IToolbarController | undefined)}
|
|
12732
|
+
* @memberof ListController
|
|
12733
|
+
*/
|
|
12734
|
+
get quickToolbarController() {
|
|
12735
|
+
const controller = this.view.getController(
|
|
12736
|
+
"".concat(this.model.name, "_quicktoolbar")
|
|
12737
|
+
);
|
|
12738
|
+
return controller;
|
|
12739
|
+
}
|
|
12740
|
+
async onCreated() {
|
|
12741
|
+
var _a;
|
|
12742
|
+
await super.onCreated();
|
|
12743
|
+
this.dataEntity = await ibiz.hub.getAppDataEntity(
|
|
12744
|
+
this.model.appDataEntityId,
|
|
12745
|
+
this.model.appId
|
|
12746
|
+
);
|
|
12747
|
+
(_a = this.dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
|
|
12748
|
+
this.fieldIdNameMap.set(field.id, field.name);
|
|
12596
12749
|
});
|
|
12597
12750
|
const fn = this.onDataChange.bind(this);
|
|
12598
12751
|
this.onDataChange = debounce((msg) => {
|
|
@@ -12687,7 +12840,10 @@ var MDControlController = class extends ControlController {
|
|
|
12687
12840
|
if (this.state.isSimple) {
|
|
12688
12841
|
return [];
|
|
12689
12842
|
}
|
|
12690
|
-
|
|
12843
|
+
const silent = args.silent === true;
|
|
12844
|
+
if (!silent) {
|
|
12845
|
+
await this.startLoading();
|
|
12846
|
+
}
|
|
12691
12847
|
try {
|
|
12692
12848
|
const isInitialLoad = args.isInitialLoad === true;
|
|
12693
12849
|
const isLoadMore = args.isLoadMore === true;
|
|
@@ -12719,7 +12875,9 @@ var MDControlController = class extends ControlController {
|
|
|
12719
12875
|
});
|
|
12720
12876
|
throw error;
|
|
12721
12877
|
} finally {
|
|
12722
|
-
|
|
12878
|
+
if (!silent) {
|
|
12879
|
+
await this.endLoading();
|
|
12880
|
+
}
|
|
12723
12881
|
}
|
|
12724
12882
|
this.state.items.forEach((item, index) => {
|
|
12725
12883
|
item.srfserialnum = index + 1;
|
|
@@ -12837,6 +12995,7 @@ var MDControlController = class extends ControlController {
|
|
|
12837
12995
|
});
|
|
12838
12996
|
}
|
|
12839
12997
|
setSelection(selection) {
|
|
12998
|
+
var _a, _b;
|
|
12840
12999
|
const { selectedData } = this.state;
|
|
12841
13000
|
if (!isElementSame(selectedData, selection)) {
|
|
12842
13001
|
this.state.selectedData = selection;
|
|
@@ -12844,6 +13003,15 @@ var MDControlController = class extends ControlController {
|
|
|
12844
13003
|
data: selection
|
|
12845
13004
|
});
|
|
12846
13005
|
}
|
|
13006
|
+
const data = selection == null ? void 0 : selection[0];
|
|
13007
|
+
(_a = this.batchToolbarController) == null ? void 0 : _a.calcButtonState(
|
|
13008
|
+
data,
|
|
13009
|
+
this.model.appDataEntityId
|
|
13010
|
+
);
|
|
13011
|
+
(_b = this.quickToolbarController) == null ? void 0 : _b.calcButtonState(
|
|
13012
|
+
data,
|
|
13013
|
+
this.model.appDataEntityId
|
|
13014
|
+
);
|
|
12847
13015
|
}
|
|
12848
13016
|
/**
|
|
12849
13017
|
* 行单击事件
|
|
@@ -14563,7 +14731,7 @@ import { recursiveIterate as recursiveIterate2, RuntimeError as RuntimeError46 }
|
|
|
14563
14731
|
|
|
14564
14732
|
// src/ui-action/provider/backend-ui-action-provider.ts
|
|
14565
14733
|
import { RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
|
|
14566
|
-
import { isArray as
|
|
14734
|
+
import { isArray as isArray8 } from "qx-util";
|
|
14567
14735
|
|
|
14568
14736
|
// src/ui-action/provider/ui-action-provider-base.ts
|
|
14569
14737
|
import { RuntimeModelError as RuntimeModelError46 } from "@ibiz-template/core";
|
|
@@ -15998,7 +16166,6 @@ var UIActionProviderBase = class {
|
|
|
15998
16166
|
* @return {*} {Promise<IUIActionResult>}
|
|
15999
16167
|
*/
|
|
16000
16168
|
async exec(action, args) {
|
|
16001
|
-
const { context, params, data } = args;
|
|
16002
16169
|
const result = {
|
|
16003
16170
|
refresh: action.reloadData,
|
|
16004
16171
|
refreshMode: action.refreshMode,
|
|
@@ -16020,12 +16187,17 @@ var UIActionProviderBase = class {
|
|
|
16020
16187
|
if (result.cancel === true) {
|
|
16021
16188
|
return this.returnError(result);
|
|
16022
16189
|
}
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16190
|
+
if (action.uilogicAttachMode === "AFTER") {
|
|
16191
|
+
if (!appDEUILogicId) {
|
|
16192
|
+
throw new RuntimeModelError46(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
16193
|
+
}
|
|
16194
|
+
await execUILogic(
|
|
16195
|
+
appDEUILogicId,
|
|
16196
|
+
appDataEntityId,
|
|
16197
|
+
this.mergeArgsByResult(args, result)
|
|
16198
|
+
);
|
|
16199
|
+
}
|
|
16200
|
+
const nextActionParams = this.mergeArgsByResult(args, result);
|
|
16029
16201
|
if (action.closeEditView) {
|
|
16030
16202
|
this.doNextAction(action, nextActionParams, action.appId);
|
|
16031
16203
|
} else {
|
|
@@ -16041,14 +16213,25 @@ var UIActionProviderBase = class {
|
|
|
16041
16213
|
}
|
|
16042
16214
|
}
|
|
16043
16215
|
}
|
|
16044
|
-
if (action.uilogicAttachMode === "AFTER") {
|
|
16045
|
-
if (!appDEUILogicId) {
|
|
16046
|
-
throw new RuntimeModelError46(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
16047
|
-
}
|
|
16048
|
-
await execUILogic(appDEUILogicId, appDataEntityId, args);
|
|
16049
|
-
}
|
|
16050
16216
|
return result;
|
|
16051
16217
|
}
|
|
16218
|
+
/**
|
|
16219
|
+
* 根据界面行为逻辑返回值,合并参数获得后续逻辑要用的参数
|
|
16220
|
+
* @author lxm
|
|
16221
|
+
* @date 2023-12-25 02:42:23
|
|
16222
|
+
* @protected
|
|
16223
|
+
* @param {IUILogicParams} args 当前环境的参数
|
|
16224
|
+
* @param {IUIActionResult} result 上一次逻辑执行的结果
|
|
16225
|
+
* @return {*} {IUILogicParams}
|
|
16226
|
+
*/
|
|
16227
|
+
mergeArgsByResult(args, result) {
|
|
16228
|
+
return {
|
|
16229
|
+
...args,
|
|
16230
|
+
context: result.nextContext || args.context,
|
|
16231
|
+
data: result.data || args.data,
|
|
16232
|
+
params: result.nextParams || args.params
|
|
16233
|
+
};
|
|
16234
|
+
}
|
|
16052
16235
|
/**
|
|
16053
16236
|
* 有错误和取消时对result做的处理
|
|
16054
16237
|
* @author lxm
|
|
@@ -16290,7 +16473,7 @@ var BackendUIActionProvider = class extends UIActionProviderBase {
|
|
|
16290
16473
|
}
|
|
16291
16474
|
}
|
|
16292
16475
|
Object.assign(actionResult, {
|
|
16293
|
-
data:
|
|
16476
|
+
data: isArray8(res.data) ? res.data : [res.data],
|
|
16294
16477
|
nextContext: resultContext,
|
|
16295
16478
|
nextParams: tempParams
|
|
16296
16479
|
});
|
|
@@ -19369,15 +19552,11 @@ var FormDetailController = class {
|
|
|
19369
19552
|
calcDynaClass(data) {
|
|
19370
19553
|
if (this.model.dynaClass) {
|
|
19371
19554
|
const dynaClass = calcDynaClass(this.model.dynaClass, data);
|
|
19372
|
-
|
|
19373
|
-
this.state.class.containerDyna = dynaClass;
|
|
19374
|
-
}
|
|
19555
|
+
this.state.class.containerDyna = dynaClass;
|
|
19375
19556
|
}
|
|
19376
19557
|
if (this.model.labelDynaClass) {
|
|
19377
19558
|
const dynaClass = calcDynaClass(this.model.labelDynaClass, data);
|
|
19378
|
-
|
|
19379
|
-
this.state.class.labelDyna = dynaClass;
|
|
19380
|
-
}
|
|
19559
|
+
this.state.class.labelDyna = dynaClass;
|
|
19381
19560
|
}
|
|
19382
19561
|
}
|
|
19383
19562
|
/**
|
|
@@ -23457,57 +23636,6 @@ var ListController = class extends MDControlController {
|
|
|
23457
23636
|
}
|
|
23458
23637
|
}
|
|
23459
23638
|
}
|
|
23460
|
-
/**
|
|
23461
|
-
* 工具栏
|
|
23462
|
-
*
|
|
23463
|
-
* @author zk
|
|
23464
|
-
* @date 2023-08-02 06:08:34
|
|
23465
|
-
* @readonly
|
|
23466
|
-
* @type {(IToolbarController | undefined)}
|
|
23467
|
-
* @memberof ListController
|
|
23468
|
-
*/
|
|
23469
|
-
get batchToolbarController() {
|
|
23470
|
-
const controller = this.view.getController(
|
|
23471
|
-
"".concat(this.model.name, "_batchtoolbar")
|
|
23472
|
-
);
|
|
23473
|
-
return controller;
|
|
23474
|
-
}
|
|
23475
|
-
/**
|
|
23476
|
-
* 工具栏
|
|
23477
|
-
*
|
|
23478
|
-
* @author zk
|
|
23479
|
-
* @date 2023-08-02 06:08:34
|
|
23480
|
-
* @readonly
|
|
23481
|
-
* @type {(IToolbarController | undefined)}
|
|
23482
|
-
* @memberof ListController
|
|
23483
|
-
*/
|
|
23484
|
-
get quickToolbarController() {
|
|
23485
|
-
const controller = this.view.getController(
|
|
23486
|
-
"".concat(this.model.name, "_quicktoolbar")
|
|
23487
|
-
);
|
|
23488
|
-
return controller;
|
|
23489
|
-
}
|
|
23490
|
-
/**
|
|
23491
|
-
* 根据数据计算工具栏权限和状态
|
|
23492
|
-
*
|
|
23493
|
-
* @author zk
|
|
23494
|
-
* @date 2023-08-02 06:08:11
|
|
23495
|
-
* @param {IData[]} selection
|
|
23496
|
-
* @memberof ListController
|
|
23497
|
-
*/
|
|
23498
|
-
setSelection(selection) {
|
|
23499
|
-
var _a, _b;
|
|
23500
|
-
super.setSelection(selection);
|
|
23501
|
-
const data = selection == null ? void 0 : selection[0];
|
|
23502
|
-
(_a = this.batchToolbarController) == null ? void 0 : _a.calcButtonState(
|
|
23503
|
-
data,
|
|
23504
|
-
this.model.appDataEntityId
|
|
23505
|
-
);
|
|
23506
|
-
(_b = this.quickToolbarController) == null ? void 0 : _b.calcButtonState(
|
|
23507
|
-
data,
|
|
23508
|
-
this.model.appDataEntityId
|
|
23509
|
-
);
|
|
23510
|
-
}
|
|
23511
23639
|
/**
|
|
23512
23640
|
* 加载更多
|
|
23513
23641
|
* @author lxm
|
|
@@ -24474,30 +24602,43 @@ var SearchBarService = class {
|
|
|
24474
24602
|
});
|
|
24475
24603
|
return res;
|
|
24476
24604
|
}
|
|
24605
|
+
/**
|
|
24606
|
+
* 批量新建
|
|
24607
|
+
* @param {IData} data
|
|
24608
|
+
* @return {*}
|
|
24609
|
+
* @author: zhujiamin
|
|
24610
|
+
* @Date: 2023-12-26 15:49:00
|
|
24611
|
+
*/
|
|
24612
|
+
async createBatch(data) {
|
|
24613
|
+
const createParams = this.convertFrontDataToBack(data);
|
|
24614
|
+
const res = await this.app.net.post("".concat(this.themeUrl), createParams);
|
|
24615
|
+
return res;
|
|
24616
|
+
}
|
|
24477
24617
|
/**
|
|
24478
24618
|
* 更新数据
|
|
24479
24619
|
*
|
|
24480
24620
|
*/
|
|
24481
24621
|
async update(id, data) {
|
|
24482
|
-
const updateParams =
|
|
24483
|
-
if (data.theme_model) {
|
|
24484
|
-
Object.assign(updateParams, {
|
|
24485
|
-
theme_model: JSON.stringify(data.theme_model)
|
|
24486
|
-
});
|
|
24487
|
-
}
|
|
24488
|
-
if (data.caption) {
|
|
24489
|
-
Object.assign(updateParams, {
|
|
24490
|
-
name: data.caption
|
|
24491
|
-
});
|
|
24492
|
-
}
|
|
24493
|
-
if (typeof data.show === "boolean") {
|
|
24494
|
-
Object.assign(updateParams, {
|
|
24495
|
-
show: data.show
|
|
24496
|
-
});
|
|
24497
|
-
}
|
|
24622
|
+
const [updateParams] = this.convertFrontDataToBack([data]);
|
|
24498
24623
|
const res = await this.app.net.put("".concat(this.themeUrl, "/").concat(id), updateParams);
|
|
24499
24624
|
return res;
|
|
24500
24625
|
}
|
|
24626
|
+
/**
|
|
24627
|
+
* 批量更新数据
|
|
24628
|
+
* @param {IData} data
|
|
24629
|
+
* @return {*}
|
|
24630
|
+
* @author: zhujiamin
|
|
24631
|
+
* @Date: 2023-12-26 11:11:34
|
|
24632
|
+
*/
|
|
24633
|
+
async updateBatch(data) {
|
|
24634
|
+
const updateParams = this.convertFrontDataToBack(data);
|
|
24635
|
+
const idUrl = updateParams.map((item) => item.id).join(";");
|
|
24636
|
+
const res = await this.app.net.put(
|
|
24637
|
+
"".concat(this.themeUrl, "/").concat(idUrl),
|
|
24638
|
+
updateParams
|
|
24639
|
+
);
|
|
24640
|
+
return res;
|
|
24641
|
+
}
|
|
24501
24642
|
/**
|
|
24502
24643
|
* 转换后台数据成前端需要的格式
|
|
24503
24644
|
* @param {IData} data
|
|
@@ -24514,6 +24655,41 @@ var SearchBarService = class {
|
|
|
24514
24655
|
if (item.theme_model) {
|
|
24515
24656
|
tempItem.searchGroupData = JSON.parse(item.theme_model);
|
|
24516
24657
|
}
|
|
24658
|
+
if (typeof item.valid_flag === "number") {
|
|
24659
|
+
tempItem.show = item.valid_flag === 1;
|
|
24660
|
+
}
|
|
24661
|
+
if (item.order_value) {
|
|
24662
|
+
tempItem.order = item.order_value;
|
|
24663
|
+
}
|
|
24664
|
+
return tempItem;
|
|
24665
|
+
});
|
|
24666
|
+
}
|
|
24667
|
+
/**
|
|
24668
|
+
* 转换前端数据成后台需要的格式
|
|
24669
|
+
* @param {IData} data
|
|
24670
|
+
* @return {*}
|
|
24671
|
+
* @author: zhujiamin
|
|
24672
|
+
* @Date: 2023-12-22 11:19:50
|
|
24673
|
+
*/
|
|
24674
|
+
convertFrontDataToBack(data) {
|
|
24675
|
+
return data.map((item) => {
|
|
24676
|
+
const tempItem = {
|
|
24677
|
+
appId: item.appId,
|
|
24678
|
+
app_view_tag: this.viewTag,
|
|
24679
|
+
id: item.id
|
|
24680
|
+
};
|
|
24681
|
+
if (item.caption) {
|
|
24682
|
+
tempItem.name = item.caption;
|
|
24683
|
+
}
|
|
24684
|
+
if (item.searchGroupData && Object.keys(item.searchGroupData).length > 0) {
|
|
24685
|
+
tempItem.theme_model = JSON.stringify(item.searchGroupData);
|
|
24686
|
+
}
|
|
24687
|
+
if (typeof item.show === "boolean") {
|
|
24688
|
+
tempItem.valid_flag = item.show ? 1 : 0;
|
|
24689
|
+
}
|
|
24690
|
+
if (item.order) {
|
|
24691
|
+
tempItem.order_value = item.order;
|
|
24692
|
+
}
|
|
24517
24693
|
return tempItem;
|
|
24518
24694
|
});
|
|
24519
24695
|
}
|
|
@@ -24550,7 +24726,7 @@ var SearchBarController = class extends ControlController {
|
|
|
24550
24726
|
* @author: zhujiamin
|
|
24551
24727
|
* @Date: 2023-12-21 10:17:43
|
|
24552
24728
|
*/
|
|
24553
|
-
this.isBackendSearchGroup =
|
|
24729
|
+
this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
|
|
24554
24730
|
}
|
|
24555
24731
|
/**
|
|
24556
24732
|
* 表格控制器
|
|
@@ -24768,12 +24944,42 @@ var SearchBarController = class extends ControlController {
|
|
|
24768
24944
|
this.state.searchBarGroups = [];
|
|
24769
24945
|
if (this.isBackendSearchGroup) {
|
|
24770
24946
|
if (this.model.searchBarGroups && this.model.searchBarGroups.length > 0) {
|
|
24771
|
-
this.state.searchBarGroups = this.model.searchBarGroups.map(
|
|
24772
|
-
|
|
24773
|
-
|
|
24774
|
-
|
|
24775
|
-
|
|
24776
|
-
|
|
24947
|
+
this.state.searchBarGroups = this.model.searchBarGroups.map(
|
|
24948
|
+
(item, index) => {
|
|
24949
|
+
const tempGroup = {
|
|
24950
|
+
...item,
|
|
24951
|
+
saved: false,
|
|
24952
|
+
show: true,
|
|
24953
|
+
searchGroupData: {},
|
|
24954
|
+
order: (index + 1) * 100
|
|
24955
|
+
};
|
|
24956
|
+
if (item.data) {
|
|
24957
|
+
try {
|
|
24958
|
+
const tempData = JSON.parse(item.data);
|
|
24959
|
+
if (tempData.theme_model) {
|
|
24960
|
+
if (tempData.theme_model.sort) {
|
|
24961
|
+
tempGroup.searchGroupData.sort = tempData.theme_model.sort;
|
|
24962
|
+
}
|
|
24963
|
+
if (tempData.theme_model.columnstates) {
|
|
24964
|
+
tempGroup.searchGroupData.columnstates = tempData.theme_model.columnstates;
|
|
24965
|
+
}
|
|
24966
|
+
if (tempData.theme_model.filternodes) {
|
|
24967
|
+
tempGroup.searchGroupData.filternodes = tempData.theme_model.filternodes;
|
|
24968
|
+
}
|
|
24969
|
+
if (tempData.theme_model.searchconds) {
|
|
24970
|
+
tempGroup.searchGroupData.searchconds = tempData.theme_model.searchconds;
|
|
24971
|
+
}
|
|
24972
|
+
}
|
|
24973
|
+
if (tempData.valid_flag) {
|
|
24974
|
+
tempGroup.show = tempData.valid_flag === "1";
|
|
24975
|
+
}
|
|
24976
|
+
} catch (error) {
|
|
24977
|
+
ibiz.log.error(error);
|
|
24978
|
+
}
|
|
24979
|
+
}
|
|
24980
|
+
return tempGroup;
|
|
24981
|
+
}
|
|
24982
|
+
);
|
|
24777
24983
|
}
|
|
24778
24984
|
const res = await this.service.fetch();
|
|
24779
24985
|
if (res.ok) {
|
|
@@ -24785,16 +24991,26 @@ var SearchBarController = class extends ControlController {
|
|
|
24785
24991
|
mergeInLeft3(existGroup, group);
|
|
24786
24992
|
existGroup.saved = true;
|
|
24787
24993
|
} else {
|
|
24994
|
+
const tempMaxOrderIndex = this.state.searchBarGroups.reduce(
|
|
24995
|
+
(maxIndex, item, currentIndex) => item.order > this.state.searchBarGroups[maxIndex].order ? currentIndex : maxIndex,
|
|
24996
|
+
0
|
|
24997
|
+
);
|
|
24788
24998
|
this.state.searchBarGroups.push({
|
|
24789
|
-
...group,
|
|
24790
24999
|
appId: this.context.srfappid,
|
|
24791
|
-
show: true,
|
|
24792
25000
|
saved: true,
|
|
24793
|
-
|
|
25001
|
+
show: true,
|
|
25002
|
+
searchGroupData: {},
|
|
25003
|
+
order: (tempMaxOrderIndex + 2) * 100,
|
|
25004
|
+
// 以后台给的为准
|
|
25005
|
+
...group
|
|
24794
25006
|
});
|
|
24795
25007
|
}
|
|
24796
25008
|
});
|
|
24797
25009
|
}
|
|
25010
|
+
this.state.searchBarGroups.sort((a, b) => a.order - b.order);
|
|
25011
|
+
this.state.searchBarGroups.forEach((item, index) => {
|
|
25012
|
+
item.order = (index + 1) * 100;
|
|
25013
|
+
});
|
|
24798
25014
|
}
|
|
24799
25015
|
}
|
|
24800
25016
|
/**
|
|
@@ -24815,8 +25031,9 @@ var SearchBarController = class extends ControlController {
|
|
|
24815
25031
|
};
|
|
24816
25032
|
if (this.state.selectedSearchGroupItem.saved) {
|
|
24817
25033
|
await this.service.update(this.state.selectedSearchGroupItem.id, {
|
|
24818
|
-
|
|
24819
|
-
show: this.state.selectedSearchGroupItem.show
|
|
25034
|
+
searchGroupData: saveParams,
|
|
25035
|
+
show: this.state.selectedSearchGroupItem.show,
|
|
25036
|
+
order: this.state.selectedSearchGroupItem.order
|
|
24820
25037
|
});
|
|
24821
25038
|
ibiz.message.success("\u4FDD\u5B58\u6210\u529F");
|
|
24822
25039
|
} else {
|
|
@@ -24848,6 +25065,7 @@ var SearchBarController = class extends ControlController {
|
|
|
24848
25065
|
const res = await this.service.get(groupItem.id);
|
|
24849
25066
|
if (res.ok) {
|
|
24850
25067
|
mergeInLeft3(groupItem, res.data);
|
|
25068
|
+
groupItem.show = true;
|
|
24851
25069
|
}
|
|
24852
25070
|
}
|
|
24853
25071
|
if (groupItem.searchGroupData && groupItem.searchGroupData.filternodes) {
|
|
@@ -26486,7 +26704,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
26486
26704
|
*/
|
|
26487
26705
|
async loadMore() {
|
|
26488
26706
|
if (this.state.total > this.state.items.length && !this.state.isLoading) {
|
|
26489
|
-
await this.load({ isLoadMore: true });
|
|
26707
|
+
await this.load({ isLoadMore: true, silent: true });
|
|
26490
26708
|
}
|
|
26491
26709
|
}
|
|
26492
26710
|
/**
|
|
@@ -27203,7 +27421,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27203
27421
|
/**
|
|
27204
27422
|
* 打开批操作工具栏
|
|
27205
27423
|
*
|
|
27206
|
-
* @param {string} groupKey
|
|
27424
|
+
* @param {string | number} groupKey
|
|
27207
27425
|
* @memberof KanbanController
|
|
27208
27426
|
*/
|
|
27209
27427
|
openBatch(groupKey) {
|
|
@@ -28328,9 +28546,6 @@ var ReportPanelController = class extends ControlController {
|
|
|
28328
28546
|
}
|
|
28329
28547
|
};
|
|
28330
28548
|
|
|
28331
|
-
// src/controller/control/gantt/gantt.controller.ts
|
|
28332
|
-
import { recursiveIterate as recursiveIterate12 } from "@ibiz-template/core";
|
|
28333
|
-
|
|
28334
28549
|
// src/controller/control/gantt/gantt.service.ts
|
|
28335
28550
|
import { ModelError as ModelError30 } from "@ibiz-template/core";
|
|
28336
28551
|
var GanttService = class extends TreeService {
|
|
@@ -28362,12 +28577,12 @@ var GanttService = class extends TreeService {
|
|
|
28362
28577
|
* @param {TreeFetchOpts} opts
|
|
28363
28578
|
* @return {*} {(Promise<IGanttNodeData[] | undefined>)}
|
|
28364
28579
|
*/
|
|
28365
|
-
async
|
|
28580
|
+
async fetchChildNodes(parentNodeData, opts) {
|
|
28366
28581
|
const { hasQuery } = opts;
|
|
28367
28582
|
let childrenNodes = [];
|
|
28368
28583
|
if (!parentNodeData) {
|
|
28369
28584
|
const rootNode = getRootNode(this.model);
|
|
28370
|
-
childrenNodes = await this.
|
|
28585
|
+
childrenNodes = await this.fetchNodeDatasByType(
|
|
28371
28586
|
rootNode,
|
|
28372
28587
|
void 0,
|
|
28373
28588
|
void 0,
|
|
@@ -28387,7 +28602,7 @@ var GanttService = class extends TreeService {
|
|
|
28387
28602
|
this.model,
|
|
28388
28603
|
childNodeRS.childDETreeNodeId
|
|
28389
28604
|
);
|
|
28390
|
-
return this.
|
|
28605
|
+
return this.fetchNodeDatasByType(
|
|
28391
28606
|
childNode,
|
|
28392
28607
|
childNodeRS,
|
|
28393
28608
|
parentNodeData,
|
|
@@ -28414,7 +28629,7 @@ var GanttService = class extends TreeService {
|
|
|
28414
28629
|
* @param {TreeFetchOpts} opts
|
|
28415
28630
|
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28416
28631
|
*/
|
|
28417
|
-
async
|
|
28632
|
+
async fetchNodeDatasByType(nodeModel, nodeRS, parentNodeData, opts) {
|
|
28418
28633
|
const leaf = getChildNodeRSs(this.model, {
|
|
28419
28634
|
parentId: nodeModel.id,
|
|
28420
28635
|
hasQuery: opts.hasQuery
|
|
@@ -28462,7 +28677,7 @@ var GanttService = class extends TreeService {
|
|
|
28462
28677
|
result.map(async (childNode, index) => {
|
|
28463
28678
|
if (expanded && // 全展开合只展开首节点expanded都为true
|
|
28464
28679
|
(!expandFirstOnly || expandFirstOnly && index === 0) || isExpandedRoot) {
|
|
28465
|
-
const subChildrenNodes = await this.
|
|
28680
|
+
const subChildrenNodes = await this.fetchChildNodes(
|
|
28466
28681
|
childNode,
|
|
28467
28682
|
opts
|
|
28468
28683
|
);
|
|
@@ -28584,54 +28799,7 @@ var GanttService = class extends TreeService {
|
|
|
28584
28799
|
};
|
|
28585
28800
|
|
|
28586
28801
|
// src/controller/control/gantt/gantt.controller.ts
|
|
28587
|
-
var GanttController = class extends
|
|
28588
|
-
constructor() {
|
|
28589
|
-
super(...arguments);
|
|
28590
|
-
/**
|
|
28591
|
-
* 表格列适配器
|
|
28592
|
-
*
|
|
28593
|
-
* @type {{ [key: string]: IGridColumnProvider }}
|
|
28594
|
-
* @memberof GanttController
|
|
28595
|
-
*/
|
|
28596
|
-
this.providers = {};
|
|
28597
|
-
/**
|
|
28598
|
-
* 所有表格列控制器集合
|
|
28599
|
-
*
|
|
28600
|
-
* @type {{ [key: string]: GridColumnController }}
|
|
28601
|
-
* @memberof GanttController
|
|
28602
|
-
*/
|
|
28603
|
-
this.columns = {};
|
|
28604
|
-
/**
|
|
28605
|
-
* 所有表格属性列的控制器
|
|
28606
|
-
*
|
|
28607
|
-
* @type {{ [key: string]: GridFieldColumnController }}
|
|
28608
|
-
* @memberof GanttController
|
|
28609
|
-
*/
|
|
28610
|
-
this.fieldColumns = {};
|
|
28611
|
-
/**
|
|
28612
|
-
* 所有表格操作列的控制器
|
|
28613
|
-
*
|
|
28614
|
-
* @type {{ [key: string]: GridUAColumnController }}
|
|
28615
|
-
* @memberof GanttController
|
|
28616
|
-
*/
|
|
28617
|
-
this.uaColumns = {};
|
|
28618
|
-
/**
|
|
28619
|
-
* 上下文菜单控制器
|
|
28620
|
-
*
|
|
28621
|
-
* @author tony001
|
|
28622
|
-
* @date 2023-12-11 16:12:57
|
|
28623
|
-
* @type {{ [p: string]: ContextMenuController }}
|
|
28624
|
-
*/
|
|
28625
|
-
this.contextMenus = {};
|
|
28626
|
-
/**
|
|
28627
|
-
* 是否启用快速搜索
|
|
28628
|
-
*
|
|
28629
|
-
* @author tony001
|
|
28630
|
-
* @date 2023-12-11 16:12:13
|
|
28631
|
-
* @type {boolean}
|
|
28632
|
-
*/
|
|
28633
|
-
this.enableQuickSearch = false;
|
|
28634
|
-
}
|
|
28802
|
+
var GanttController = class extends TreeGridExController {
|
|
28635
28803
|
/**
|
|
28636
28804
|
* 初始化状态
|
|
28637
28805
|
*
|
|
@@ -28641,9 +28809,6 @@ var GanttController = class extends MDControlController {
|
|
|
28641
28809
|
*/
|
|
28642
28810
|
initState() {
|
|
28643
28811
|
super.initState();
|
|
28644
|
-
this.state.size = 0;
|
|
28645
|
-
this.state.query = "";
|
|
28646
|
-
this.state.columnStates = [];
|
|
28647
28812
|
this.state.rootNodes = [];
|
|
28648
28813
|
this.state.ganttStyle = {};
|
|
28649
28814
|
}
|
|
@@ -28656,131 +28821,16 @@ var GanttController = class extends MDControlController {
|
|
|
28656
28821
|
*/
|
|
28657
28822
|
onDataChange(msg) {
|
|
28658
28823
|
}
|
|
28659
|
-
async onCreated() {
|
|
28660
|
-
var _a, _b;
|
|
28661
|
-
await super.onCreated();
|
|
28662
|
-
await this.initGridColumns();
|
|
28663
|
-
this.initColumnStates();
|
|
28664
|
-
if ((_a = this.model.detreeNodes) == null ? void 0 : _a[0].enableQuickSearch) {
|
|
28665
|
-
this.enableQuickSearch = true;
|
|
28666
|
-
}
|
|
28667
|
-
if (this.dataEntity) {
|
|
28668
|
-
const searchFields = (_b = this.dataEntity.appDEFields) == null ? void 0 : _b.filter((field) => {
|
|
28669
|
-
return field.enableQuickSearch;
|
|
28670
|
-
});
|
|
28671
|
-
const placeHolders = [];
|
|
28672
|
-
searchFields == null ? void 0 : searchFields.forEach((searchField) => {
|
|
28673
|
-
if ((searchField == null ? void 0 : searchField.lnlanguageRes) && searchField.lnlanguageRes.lanResTag) {
|
|
28674
|
-
placeHolders.push(
|
|
28675
|
-
ibiz.i18n.t(
|
|
28676
|
-
searchField.lnlanguageRes.lanResTag,
|
|
28677
|
-
searchField.logicName
|
|
28678
|
-
)
|
|
28679
|
-
);
|
|
28680
|
-
} else if (searchField == null ? void 0 : searchField.logicName) {
|
|
28681
|
-
placeHolders.push(searchField.logicName);
|
|
28682
|
-
}
|
|
28683
|
-
});
|
|
28684
|
-
if (placeHolders.length > 0) {
|
|
28685
|
-
this.state.placeHolder = placeHolders.join("\u3001");
|
|
28686
|
-
}
|
|
28687
|
-
}
|
|
28688
|
-
this.service = new GanttService(this.model);
|
|
28689
|
-
await this.service.init(this.context);
|
|
28690
|
-
this.model.detreeNodes.forEach((node) => {
|
|
28691
|
-
var _a2, _b2;
|
|
28692
|
-
if ((_b2 = (_a2 = node.decontextMenu) == null ? void 0 : _a2.detoolbarItems) == null ? void 0 : _b2.length) {
|
|
28693
|
-
this.contextMenus[node.decontextMenu.id] = new ContextMenuController(
|
|
28694
|
-
node.decontextMenu,
|
|
28695
|
-
this.context,
|
|
28696
|
-
this.params,
|
|
28697
|
-
this.ctx
|
|
28698
|
-
);
|
|
28699
|
-
}
|
|
28700
|
-
});
|
|
28701
|
-
await Promise.all(
|
|
28702
|
-
Object.values(this.contextMenus).map((menu) => menu.created())
|
|
28703
|
-
);
|
|
28704
|
-
}
|
|
28705
|
-
/**
|
|
28706
|
-
* 初始化表格列
|
|
28707
|
-
*
|
|
28708
|
-
* @protected
|
|
28709
|
-
* @return {*} {Promise<void>}
|
|
28710
|
-
* @memberof GanttController
|
|
28711
|
-
*/
|
|
28712
|
-
async initGridColumns() {
|
|
28713
|
-
if (this.model.detreeColumns) {
|
|
28714
|
-
await Promise.all(
|
|
28715
|
-
this.model.detreeColumns.map(
|
|
28716
|
-
async (column) => this.initColumnsController(column)
|
|
28717
|
-
)
|
|
28718
|
-
);
|
|
28719
|
-
}
|
|
28720
|
-
}
|
|
28721
28824
|
/**
|
|
28722
|
-
*
|
|
28825
|
+
* 初始化对应类型的部件服务
|
|
28723
28826
|
*
|
|
28724
28827
|
* @protected
|
|
28725
|
-
* @param {IDETreeColumn} column
|
|
28726
28828
|
* @return {*} {Promise<void>}
|
|
28727
28829
|
* @memberof GanttController
|
|
28728
28830
|
*/
|
|
28729
|
-
async
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
return;
|
|
28733
|
-
}
|
|
28734
|
-
this.providers[column.codeName] = provider;
|
|
28735
|
-
const controller = await provider.createController(column, this);
|
|
28736
|
-
this.columns[column.codeName] = controller;
|
|
28737
|
-
if (column.columnType === "DEFGRIDCOLUMN") {
|
|
28738
|
-
this.fieldColumns[column.codeName] = controller;
|
|
28739
|
-
} else if (column.columnType === "UAGRIDCOLUMN") {
|
|
28740
|
-
this.uaColumns[column.codeName] = controller;
|
|
28741
|
-
}
|
|
28742
|
-
}
|
|
28743
|
-
/**
|
|
28744
|
-
* 初始化表格列状态
|
|
28745
|
-
*
|
|
28746
|
-
* @protected
|
|
28747
|
-
* @memberof GanttController
|
|
28748
|
-
*/
|
|
28749
|
-
initColumnStates() {
|
|
28750
|
-
recursiveIterate12(
|
|
28751
|
-
this.model,
|
|
28752
|
-
(column) => {
|
|
28753
|
-
if (column.columnType !== "GROUPGRIDCOLUMN") {
|
|
28754
|
-
this.state.columnStates.push({
|
|
28755
|
-
key: column.codeName,
|
|
28756
|
-
caption: column.caption,
|
|
28757
|
-
hidden: !!column.hideDefault,
|
|
28758
|
-
uaColumn: column.columnType === "UAGRIDCOLUMN"
|
|
28759
|
-
});
|
|
28760
|
-
}
|
|
28761
|
-
},
|
|
28762
|
-
{ childrenFields: ["detreeColumns"] }
|
|
28763
|
-
);
|
|
28764
|
-
this.calcColumnFixed();
|
|
28765
|
-
}
|
|
28766
|
-
/**
|
|
28767
|
-
* 计算列的固定状态
|
|
28768
|
-
*
|
|
28769
|
-
* @protected
|
|
28770
|
-
* @memberof GanttController
|
|
28771
|
-
*/
|
|
28772
|
-
calcColumnFixed() {
|
|
28773
|
-
const showColumns = this.state.columnStates.filter(
|
|
28774
|
-
(column) => !column.hidden
|
|
28775
|
-
);
|
|
28776
|
-
const allNum = showColumns.length;
|
|
28777
|
-
showColumns.forEach((column, index) => {
|
|
28778
|
-
if (column.uaColumn) {
|
|
28779
|
-
column.fixed = index + 1 <= Math.floor(allNum / 2) ? "left" : "right";
|
|
28780
|
-
} else {
|
|
28781
|
-
column.fixed = "right";
|
|
28782
|
-
}
|
|
28783
|
-
});
|
|
28831
|
+
async initService() {
|
|
28832
|
+
this.service = new GanttService(this.model);
|
|
28833
|
+
await this.service.init(this.context);
|
|
28784
28834
|
}
|
|
28785
28835
|
/**
|
|
28786
28836
|
* 设置甘特图样式
|
|
@@ -28791,214 +28841,6 @@ var GanttController = class extends MDControlController {
|
|
|
28791
28841
|
setGanttStyle(style) {
|
|
28792
28842
|
this.state.ganttStyle = style;
|
|
28793
28843
|
}
|
|
28794
|
-
/**
|
|
28795
|
-
* 加载
|
|
28796
|
-
*
|
|
28797
|
-
* @author tony001
|
|
28798
|
-
* @date 2023-12-12 11:12:08
|
|
28799
|
-
* @param {MDCtrlLoadParams} [args={}]
|
|
28800
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28801
|
-
*/
|
|
28802
|
-
async load(args = {}) {
|
|
28803
|
-
const isInitialLoad = args.isInitialLoad === true;
|
|
28804
|
-
if (isInitialLoad) {
|
|
28805
|
-
await this.startLoading();
|
|
28806
|
-
}
|
|
28807
|
-
let nodes;
|
|
28808
|
-
try {
|
|
28809
|
-
nodes = await this.loadNodes();
|
|
28810
|
-
} finally {
|
|
28811
|
-
if (isInitialLoad) {
|
|
28812
|
-
await this.endLoading();
|
|
28813
|
-
}
|
|
28814
|
-
}
|
|
28815
|
-
await this.afterLoad(args, nodes);
|
|
28816
|
-
this.state.isLoaded = true;
|
|
28817
|
-
await this.evt.emit("onLoadSuccess", {
|
|
28818
|
-
isInitialLoad
|
|
28819
|
-
});
|
|
28820
|
-
return nodes;
|
|
28821
|
-
}
|
|
28822
|
-
/**
|
|
28823
|
-
* 获取节点模型
|
|
28824
|
-
*
|
|
28825
|
-
* @param {string} id
|
|
28826
|
-
* @return {*} {(IDETreeNode | undefined)}
|
|
28827
|
-
* @memberof GanttController
|
|
28828
|
-
*/
|
|
28829
|
-
getNodeModel(id) {
|
|
28830
|
-
var _a;
|
|
28831
|
-
return (_a = this.model.detreeNodes) == null ? void 0 : _a.find((item) => item.id === id);
|
|
28832
|
-
}
|
|
28833
|
-
/**
|
|
28834
|
-
* 获取查询参数
|
|
28835
|
-
*
|
|
28836
|
-
* @author tony001
|
|
28837
|
-
* @date 2023-12-12 11:12:22
|
|
28838
|
-
* @param {IParams} [extraParams]
|
|
28839
|
-
* @return {*} {Promise<IParams>}
|
|
28840
|
-
*/
|
|
28841
|
-
async getFetchParams(extraParams) {
|
|
28842
|
-
const params = await super.getFetchParams(extraParams);
|
|
28843
|
-
if (this.state.query) {
|
|
28844
|
-
params.query = this.state.query;
|
|
28845
|
-
}
|
|
28846
|
-
return params;
|
|
28847
|
-
}
|
|
28848
|
-
/**
|
|
28849
|
-
* 加载节点
|
|
28850
|
-
*
|
|
28851
|
-
* @author tony001
|
|
28852
|
-
* @date 2023-12-12 11:12:33
|
|
28853
|
-
* @param {IGanttNodeData} [parentNode]
|
|
28854
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28855
|
-
*/
|
|
28856
|
-
async loadNodes(parentNode) {
|
|
28857
|
-
const params = await this.getFetchParams();
|
|
28858
|
-
const hasQuery = !!params.query;
|
|
28859
|
-
this.state.isLoading = true;
|
|
28860
|
-
let nodes;
|
|
28861
|
-
try {
|
|
28862
|
-
nodes = await this.service.fetchGanttChildNodes(parentNode, {
|
|
28863
|
-
context: this.context.clone(),
|
|
28864
|
-
params,
|
|
28865
|
-
hasQuery,
|
|
28866
|
-
defaultExpandedKeys: []
|
|
28867
|
-
}) || [];
|
|
28868
|
-
} finally {
|
|
28869
|
-
this.state.isLoading = false;
|
|
28870
|
-
}
|
|
28871
|
-
if (parentNode) {
|
|
28872
|
-
parentNode.children = nodes;
|
|
28873
|
-
} else {
|
|
28874
|
-
this.state.rootNodes = nodes;
|
|
28875
|
-
}
|
|
28876
|
-
this.state.items = [];
|
|
28877
|
-
recursiveIterate12(
|
|
28878
|
-
{ children: this.state.rootNodes },
|
|
28879
|
-
(node) => {
|
|
28880
|
-
this.state.items.push(node);
|
|
28881
|
-
}
|
|
28882
|
-
);
|
|
28883
|
-
return nodes;
|
|
28884
|
-
}
|
|
28885
|
-
/**
|
|
28886
|
-
* 甘特节点点击事件
|
|
28887
|
-
*
|
|
28888
|
-
* @param {IGanttNodeData} nodeData
|
|
28889
|
-
* @return {*} {Promise<void>}
|
|
28890
|
-
* @memberof GanttController
|
|
28891
|
-
*/
|
|
28892
|
-
async onGanttNodeClick(nodeData) {
|
|
28893
|
-
if (this.state.singleSelect) {
|
|
28894
|
-
const { selectedData } = this.state;
|
|
28895
|
-
const filterArr = selectedData.filter((item) => item.id !== nodeData.id);
|
|
28896
|
-
if (filterArr.length === selectedData.length) {
|
|
28897
|
-
this.setSelection(
|
|
28898
|
-
this.state.singleSelect ? [nodeData] : selectedData.concat([nodeData])
|
|
28899
|
-
);
|
|
28900
|
-
} else {
|
|
28901
|
-
this.setSelection(filterArr);
|
|
28902
|
-
}
|
|
28903
|
-
}
|
|
28904
|
-
if (this.state.mdctrlActiveMode === 1) {
|
|
28905
|
-
await this.setActive(nodeData);
|
|
28906
|
-
}
|
|
28907
|
-
}
|
|
28908
|
-
/**
|
|
28909
|
-
* 甘特节点双击事件
|
|
28910
|
-
*
|
|
28911
|
-
* @param {IGanttNodeData} nodeData
|
|
28912
|
-
* @return {*} {Promise<void>}
|
|
28913
|
-
* @memberof GanttController
|
|
28914
|
-
*/
|
|
28915
|
-
async onDbGanttNodeClick(nodeData) {
|
|
28916
|
-
if (this.state.mdctrlActiveMode === 2) {
|
|
28917
|
-
await this.setActive(nodeData);
|
|
28918
|
-
}
|
|
28919
|
-
}
|
|
28920
|
-
/**
|
|
28921
|
-
* 设置激活
|
|
28922
|
-
*
|
|
28923
|
-
* @param {IGanttNodeData} item
|
|
28924
|
-
* @return {*} {Promise<void>}
|
|
28925
|
-
* @memberof GanttController
|
|
28926
|
-
*/
|
|
28927
|
-
setActive(item) {
|
|
28928
|
-
const nodeParams = this.parseGanttNodeData(item);
|
|
28929
|
-
return this.evt.emit("onActive", { ...nodeParams, nodeData: item });
|
|
28930
|
-
}
|
|
28931
|
-
/**
|
|
28932
|
-
* 设置选中
|
|
28933
|
-
*
|
|
28934
|
-
* @param {IData[]} selection
|
|
28935
|
-
* @memberof GanttController
|
|
28936
|
-
*/
|
|
28937
|
-
setSelection(selection) {
|
|
28938
|
-
const selectionIds = selection.map((item) => item.id);
|
|
28939
|
-
const filterArr = this.state.items.filter(
|
|
28940
|
-
(item) => selectionIds.includes(item.id)
|
|
28941
|
-
);
|
|
28942
|
-
super.setSelection(filterArr);
|
|
28943
|
-
}
|
|
28944
|
-
/**
|
|
28945
|
-
* 执行界面行为
|
|
28946
|
-
*
|
|
28947
|
-
* @param {string} uiActionId
|
|
28948
|
-
* @param {IGanttNodeData} nodeData
|
|
28949
|
-
* @param {MouseEvent} event
|
|
28950
|
-
* @param {string} appId
|
|
28951
|
-
* @return {*} {Promise<void>}
|
|
28952
|
-
* @memberof GanttController
|
|
28953
|
-
*/
|
|
28954
|
-
async doUIAction(uiActionId, nodeData, event, appId) {
|
|
28955
|
-
const eventArgs = this.getEventArgs();
|
|
28956
|
-
const nodeParams = this.parseGanttNodeData(nodeData);
|
|
28957
|
-
const result = await UIActionUtil.exec(
|
|
28958
|
-
uiActionId,
|
|
28959
|
-
{
|
|
28960
|
-
...eventArgs,
|
|
28961
|
-
...nodeParams,
|
|
28962
|
-
event
|
|
28963
|
-
},
|
|
28964
|
-
appId
|
|
28965
|
-
);
|
|
28966
|
-
if (result.closeView) {
|
|
28967
|
-
this.view.closeView();
|
|
28968
|
-
} else if (result.refresh) {
|
|
28969
|
-
switch (result.refreshMode) {
|
|
28970
|
-
case 1:
|
|
28971
|
-
this.refreshNodeChildren(nodeData);
|
|
28972
|
-
break;
|
|
28973
|
-
case 2:
|
|
28974
|
-
this.refreshNodeChildren(nodeData, true);
|
|
28975
|
-
break;
|
|
28976
|
-
case 3:
|
|
28977
|
-
this.refresh();
|
|
28978
|
-
break;
|
|
28979
|
-
default:
|
|
28980
|
-
}
|
|
28981
|
-
}
|
|
28982
|
-
}
|
|
28983
|
-
/**
|
|
28984
|
-
* 解析甘特节点获取通用数据,和完整的上下文和视图参数。
|
|
28985
|
-
*
|
|
28986
|
-
* @protected
|
|
28987
|
-
* @param {IGanttNodeData} nodeData
|
|
28988
|
-
* @return {*} {{
|
|
28989
|
-
* data: IData[];
|
|
28990
|
-
* context: IContext;
|
|
28991
|
-
* params: IParams;
|
|
28992
|
-
* }}
|
|
28993
|
-
* @memberof GanttController
|
|
28994
|
-
*/
|
|
28995
|
-
parseGanttNodeData(nodeData) {
|
|
28996
|
-
return {
|
|
28997
|
-
data: [{ ...nodeData, ...nodeData.deData || {} }],
|
|
28998
|
-
context: Object.assign(this.context.clone(), nodeData.context || {}),
|
|
28999
|
-
params: { ...this.params, ...nodeData.params || {} }
|
|
29000
|
-
};
|
|
29001
|
-
}
|
|
29002
28844
|
/**
|
|
29003
28845
|
* 转化节点数据项
|
|
29004
28846
|
* vo -> do
|
|
@@ -29056,37 +28898,6 @@ var GanttController = class extends MDControlController {
|
|
|
29056
28898
|
}
|
|
29057
28899
|
}
|
|
29058
28900
|
}
|
|
29059
|
-
/**
|
|
29060
|
-
* 刷新指定树节点的子节点数据
|
|
29061
|
-
*
|
|
29062
|
-
* @param {(IGanttNodeData | IData)} nodeData 指定树节点数据,可以是节点数据,也可以是对应的实体数据
|
|
29063
|
-
* @param {boolean} [refreshParent=false] 是否是刷新给定节点数据的父节点的子节点数据
|
|
29064
|
-
* @return {*} {Promise<void>}
|
|
29065
|
-
* @memberof GanttController
|
|
29066
|
-
*/
|
|
29067
|
-
async refreshNodeChildren(nodeData, refreshParent = false) {
|
|
29068
|
-
const key = nodeData.srfkey ? "srfkey" : "id";
|
|
29069
|
-
const currentNode = this.state.items.find(
|
|
29070
|
-
(item) => item[key] === nodeData[key]
|
|
29071
|
-
);
|
|
29072
|
-
if (!currentNode) {
|
|
29073
|
-
ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u6811\u8282\u70B9\u6570\u636E", nodeData);
|
|
29074
|
-
return;
|
|
29075
|
-
}
|
|
29076
|
-
if (refreshParent) {
|
|
29077
|
-
const { parent } = currentNode;
|
|
29078
|
-
if (!parent || !this.model.rootVisible && this.state.rootNodes.includes(parent)) {
|
|
29079
|
-
this.refresh();
|
|
29080
|
-
return;
|
|
29081
|
-
}
|
|
29082
|
-
}
|
|
29083
|
-
const targetNode = refreshParent ? currentNode.parent : currentNode;
|
|
29084
|
-
const nodes = await this.loadNodes(targetNode);
|
|
29085
|
-
this.evt.emit("onAfterRefreshParent", {
|
|
29086
|
-
parentNode: targetNode,
|
|
29087
|
-
children: nodes
|
|
29088
|
-
});
|
|
29089
|
-
}
|
|
29090
28901
|
};
|
|
29091
28902
|
|
|
29092
28903
|
// src/controller/hub.controller.ts
|
|
@@ -31452,6 +31263,7 @@ export {
|
|
|
31452
31263
|
ScriptFactory,
|
|
31453
31264
|
ScriptFunction,
|
|
31454
31265
|
SearchBarController,
|
|
31266
|
+
SearchBarFilterController,
|
|
31455
31267
|
SearchFilter,
|
|
31456
31268
|
SearchFormController,
|
|
31457
31269
|
SearchFormService,
|
|
@@ -31547,6 +31359,7 @@ export {
|
|
|
31547
31359
|
getControlProvider,
|
|
31548
31360
|
getControlsByView,
|
|
31549
31361
|
getDEMethodProvider,
|
|
31362
|
+
getDERedirectToView,
|
|
31550
31363
|
getDeACMode,
|
|
31551
31364
|
getDefaultValue,
|
|
31552
31365
|
getEditorProvider,
|