@ibiz-template/runtime 0.5.0-beta.0 → 0.5.0-beta.2
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 +372 -556
- 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 +31 -0
- 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 +2 -1
- 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/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/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-auth.service.d.ts +17 -0
- package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts +21 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +65 -3
- package/out/service/service/auth/v7-auth.service.d.ts +2 -0
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +15 -0
- 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 +43 -0
- package/src/controller/control/form/edit-form/edit-form.controller.ts +2 -1
- package/src/controller/control/gantt/gantt.controller.ts +7 -492
- package/src/controller/control/gantt/gantt.service.ts +5 -5
- package/src/controller/control/list/list.controller.ts +0 -54
- 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-auth.service.ts +19 -0
- package/src/service/dto/method.dto.ts +80 -3
- package/src/service/service/auth/v7-auth.service.ts +15 -0
- 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({
|
|
@@ -6708,6 +6772,21 @@ var AuthorityService = class {
|
|
|
6708
6772
|
import { CoreConst } from "@ibiz-template/core";
|
|
6709
6773
|
import { clearCookie, getCookie, setCookie } from "qx-util";
|
|
6710
6774
|
var V7AuthService = class {
|
|
6775
|
+
constructor() {
|
|
6776
|
+
this.isAnonymous = false;
|
|
6777
|
+
}
|
|
6778
|
+
async anonymousLogin() {
|
|
6779
|
+
const { anonymousUser, anonymousPwd } = ibiz.env;
|
|
6780
|
+
if (!anonymousUser || !anonymousPwd) {
|
|
6781
|
+
ibiz.log.error("\u672A\u627E\u5230\u533F\u540D\u767B\u5F55\u914D\u7F6E\u7528\u6237\u540D\u6216\u5BC6\u7801");
|
|
6782
|
+
return false;
|
|
6783
|
+
}
|
|
6784
|
+
const result = await this.login(anonymousUser, anonymousPwd);
|
|
6785
|
+
if (result) {
|
|
6786
|
+
this.isAnonymous = true;
|
|
6787
|
+
}
|
|
6788
|
+
return result;
|
|
6789
|
+
}
|
|
6711
6790
|
async login(loginName, password, remember) {
|
|
6712
6791
|
try {
|
|
6713
6792
|
const res = await ibiz.net.post("/v7/login", {
|
|
@@ -6830,6 +6909,15 @@ var MethodDto = class _MethodDto {
|
|
|
6830
6909
|
this.isLocalMode = isLocalMode;
|
|
6831
6910
|
this.dto = dto;
|
|
6832
6911
|
this.dtoMap = /* @__PURE__ */ new Map();
|
|
6912
|
+
/**
|
|
6913
|
+
* 当前 DTO 是否已经计算过关系相关逻辑
|
|
6914
|
+
*
|
|
6915
|
+
* @link this.calcRs
|
|
6916
|
+
* @author chitanda
|
|
6917
|
+
* @date 2023-12-26 16:12:18
|
|
6918
|
+
* @protected
|
|
6919
|
+
*/
|
|
6920
|
+
this.isCalcRs = false;
|
|
6833
6921
|
if (dto) {
|
|
6834
6922
|
this.app = ibiz.hub.getApp(entity.appId);
|
|
6835
6923
|
this.fields = dto.appDEMethodDTOFields || [];
|
|
@@ -6885,8 +6973,9 @@ var MethodDto = class _MethodDto {
|
|
|
6885
6973
|
* @param {IData} data
|
|
6886
6974
|
* @return {*} {Promise<IData>}
|
|
6887
6975
|
*/
|
|
6888
|
-
async get(context, data) {
|
|
6976
|
+
async get(context, data, ignore = false) {
|
|
6889
6977
|
const params = {};
|
|
6978
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
6890
6979
|
for (let i = 0; i < this.fields.length; i++) {
|
|
6891
6980
|
const field = this.fields[i];
|
|
6892
6981
|
const key = field.codeName.toLowerCase();
|
|
@@ -6902,22 +6991,30 @@ var MethodDto = class _MethodDto {
|
|
|
6902
6991
|
params[key] = data[key].length === 0 ? null : this.convertArrayToListMap(data[key]);
|
|
6903
6992
|
}
|
|
6904
6993
|
} else {
|
|
6905
|
-
if (data[key] !== void 0) {
|
|
6994
|
+
if (data[key] !== void 0 && ignore === false) {
|
|
6906
6995
|
break;
|
|
6907
6996
|
}
|
|
6908
6997
|
if (!field.refAppDataEntityId) {
|
|
6909
6998
|
break;
|
|
6910
6999
|
}
|
|
7000
|
+
let configs = uiDomain.getDERConfig(field.refAppDataEntityId);
|
|
7001
|
+
const index = configs.findIndex(
|
|
7002
|
+
(config) => config.majorDECodeName === this.entity.codeName
|
|
7003
|
+
);
|
|
7004
|
+
configs = configs.slice(index + 1);
|
|
6911
7005
|
const dto = await this.getFieldDto(context, field);
|
|
6912
7006
|
const filterParams = {};
|
|
6913
7007
|
if (field.refPickupAppDEFieldId) {
|
|
6914
7008
|
filterParams[field.refPickupAppDEFieldId] = data.srfkey;
|
|
6915
7009
|
}
|
|
7010
|
+
configs.forEach((config) => {
|
|
7011
|
+
filterParams[config.pickupDEFName.toLowerCase()] = null;
|
|
7012
|
+
});
|
|
6916
7013
|
const items = await dto.select(context, filterParams);
|
|
6917
7014
|
if (items) {
|
|
6918
7015
|
const arr = [];
|
|
6919
7016
|
for (let j = 0; j < items.length; j++) {
|
|
6920
|
-
arr.push(await dto.get(context, items[j]));
|
|
7017
|
+
arr.push(await dto.get(context, items[j], true));
|
|
6921
7018
|
}
|
|
6922
7019
|
params[key] = arr;
|
|
6923
7020
|
}
|
|
@@ -6946,6 +7043,7 @@ var MethodDto = class _MethodDto {
|
|
|
6946
7043
|
if (this.isLocalMode) {
|
|
6947
7044
|
this.service.local.clear();
|
|
6948
7045
|
}
|
|
7046
|
+
await this.calcRs(context);
|
|
6949
7047
|
return Promise.all(
|
|
6950
7048
|
data.map(async (datum) => {
|
|
6951
7049
|
const all = this.fields.filter((field) => field.type === "DTOS").map(async (field) => {
|
|
@@ -6981,6 +7079,48 @@ var MethodDto = class _MethodDto {
|
|
|
6981
7079
|
})
|
|
6982
7080
|
);
|
|
6983
7081
|
}
|
|
7082
|
+
/**
|
|
7083
|
+
* 递归计算当前 DTO 相关实体的父关系配置
|
|
7084
|
+
*
|
|
7085
|
+
* @author chitanda
|
|
7086
|
+
* @date 2023-12-26 16:12:13
|
|
7087
|
+
* @protected
|
|
7088
|
+
* @param {IContext} context
|
|
7089
|
+
* @param {number} [depth=0] 递归层级,避免进入死循环。最大递归层级为 10
|
|
7090
|
+
* @return {*} {Promise<void>}
|
|
7091
|
+
*/
|
|
7092
|
+
async calcRs(context, depth = 0) {
|
|
7093
|
+
if (this.isCalcRs || depth > 10) {
|
|
7094
|
+
return;
|
|
7095
|
+
}
|
|
7096
|
+
this.isCalcRs = true;
|
|
7097
|
+
depth += 1;
|
|
7098
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
7099
|
+
const dtoFields = this.fields.filter((field) => field.type === "DTOS");
|
|
7100
|
+
for (let i = 0; i < dtoFields.length; i++) {
|
|
7101
|
+
const field = dtoFields[i];
|
|
7102
|
+
if (!field.refAppDataEntityId) {
|
|
7103
|
+
continue;
|
|
7104
|
+
}
|
|
7105
|
+
const configs = uiDomain.getDERConfig(field.refAppDataEntityId);
|
|
7106
|
+
const index = configs.findIndex(
|
|
7107
|
+
(config) => config.pickupDEFName === field.refPickupAppDEFieldId
|
|
7108
|
+
);
|
|
7109
|
+
if (index === -1) {
|
|
7110
|
+
const dto = await this.getFieldDto(context, field);
|
|
7111
|
+
uiDomain.setDERConfig(field.refAppDataEntityId, {
|
|
7112
|
+
majorDEName: this.entity.name,
|
|
7113
|
+
majorDECodeName: this.entity.codeName,
|
|
7114
|
+
majorDECodeName2: this.entity.codeName2,
|
|
7115
|
+
minorDEName: dto.entity.name,
|
|
7116
|
+
minorDECodeName: dto.entity.codeName,
|
|
7117
|
+
minorDECodeName2: dto.entity.codeName2,
|
|
7118
|
+
pickupDEFName: field.refPickupAppDEFieldId
|
|
7119
|
+
});
|
|
7120
|
+
await dto.calcRs(context, depth);
|
|
7121
|
+
}
|
|
7122
|
+
}
|
|
7123
|
+
}
|
|
6984
7124
|
/**
|
|
6985
7125
|
* 获取子属性 DTO
|
|
6986
7126
|
*
|
|
@@ -9381,18 +9521,6 @@ var calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
|
9381
9521
|
}
|
|
9382
9522
|
return result;
|
|
9383
9523
|
};
|
|
9384
|
-
var calcNodeDataItem = (nodeModel, data) => {
|
|
9385
|
-
var _a;
|
|
9386
|
-
const dataItem = {};
|
|
9387
|
-
(_a = nodeModel.detreeNodeDataItems) == null ? void 0 : _a.forEach((item) => {
|
|
9388
|
-
if (item.id && item.appDEFieldId) {
|
|
9389
|
-
Object.assign(dataItem, {
|
|
9390
|
-
[item.id.toLowerCase()]: data[item.appDEFieldId.toLowerCase()]
|
|
9391
|
-
});
|
|
9392
|
-
}
|
|
9393
|
-
});
|
|
9394
|
-
return dataItem;
|
|
9395
|
-
};
|
|
9396
9524
|
|
|
9397
9525
|
// src/service/vo/gantt-node-data/gantt-static-node-data.ts
|
|
9398
9526
|
var GanttStaticNodeData = class extends TreeStaticNodeData {
|
|
@@ -9454,7 +9582,6 @@ var GanttDataSetNodeData = class extends TreeDataSetNodeData {
|
|
|
9454
9582
|
nodeModel,
|
|
9455
9583
|
data
|
|
9456
9584
|
);
|
|
9457
|
-
this.nodeDataItem = calcNodeDataItem(nodeModel, data);
|
|
9458
9585
|
}
|
|
9459
9586
|
};
|
|
9460
9587
|
|
|
@@ -12596,6 +12723,36 @@ var MDControlController = class extends ControlController {
|
|
|
12596
12723
|
this.state.mdctrlActiveMode = 0;
|
|
12597
12724
|
this.state.groups = [];
|
|
12598
12725
|
}
|
|
12726
|
+
/**
|
|
12727
|
+
* 批操作工具栏
|
|
12728
|
+
*
|
|
12729
|
+
* @author zk
|
|
12730
|
+
* @date 2023-08-02 06:08:34
|
|
12731
|
+
* @readonly
|
|
12732
|
+
* @type {(IToolbarController | undefined)}
|
|
12733
|
+
* @memberof ListController
|
|
12734
|
+
*/
|
|
12735
|
+
get batchToolbarController() {
|
|
12736
|
+
const controller = this.view.getController(
|
|
12737
|
+
"".concat(this.model.name, "_batchtoolbar")
|
|
12738
|
+
);
|
|
12739
|
+
return controller;
|
|
12740
|
+
}
|
|
12741
|
+
/**
|
|
12742
|
+
* 快速工具栏
|
|
12743
|
+
*
|
|
12744
|
+
* @author zk
|
|
12745
|
+
* @date 2023-08-02 06:08:34
|
|
12746
|
+
* @readonly
|
|
12747
|
+
* @type {(IToolbarController | undefined)}
|
|
12748
|
+
* @memberof ListController
|
|
12749
|
+
*/
|
|
12750
|
+
get quickToolbarController() {
|
|
12751
|
+
const controller = this.view.getController(
|
|
12752
|
+
"".concat(this.model.name, "_quicktoolbar")
|
|
12753
|
+
);
|
|
12754
|
+
return controller;
|
|
12755
|
+
}
|
|
12599
12756
|
async onCreated() {
|
|
12600
12757
|
var _a;
|
|
12601
12758
|
await super.onCreated();
|
|
@@ -12854,6 +13011,7 @@ var MDControlController = class extends ControlController {
|
|
|
12854
13011
|
});
|
|
12855
13012
|
}
|
|
12856
13013
|
setSelection(selection) {
|
|
13014
|
+
var _a, _b;
|
|
12857
13015
|
const { selectedData } = this.state;
|
|
12858
13016
|
if (!isElementSame(selectedData, selection)) {
|
|
12859
13017
|
this.state.selectedData = selection;
|
|
@@ -12861,6 +13019,15 @@ var MDControlController = class extends ControlController {
|
|
|
12861
13019
|
data: selection
|
|
12862
13020
|
});
|
|
12863
13021
|
}
|
|
13022
|
+
const data = selection == null ? void 0 : selection[0];
|
|
13023
|
+
(_a = this.batchToolbarController) == null ? void 0 : _a.calcButtonState(
|
|
13024
|
+
data,
|
|
13025
|
+
this.model.appDataEntityId
|
|
13026
|
+
);
|
|
13027
|
+
(_b = this.quickToolbarController) == null ? void 0 : _b.calcButtonState(
|
|
13028
|
+
data,
|
|
13029
|
+
this.model.appDataEntityId
|
|
13030
|
+
);
|
|
12864
13031
|
}
|
|
12865
13032
|
/**
|
|
12866
13033
|
* 行单击事件
|
|
@@ -16015,7 +16182,6 @@ var UIActionProviderBase = class {
|
|
|
16015
16182
|
* @return {*} {Promise<IUIActionResult>}
|
|
16016
16183
|
*/
|
|
16017
16184
|
async exec(action, args) {
|
|
16018
|
-
const { context, params, data } = args;
|
|
16019
16185
|
const result = {
|
|
16020
16186
|
refresh: action.reloadData,
|
|
16021
16187
|
refreshMode: action.refreshMode,
|
|
@@ -16037,12 +16203,17 @@ var UIActionProviderBase = class {
|
|
|
16037
16203
|
if (result.cancel === true) {
|
|
16038
16204
|
return this.returnError(result);
|
|
16039
16205
|
}
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16206
|
+
if (action.uilogicAttachMode === "AFTER") {
|
|
16207
|
+
if (!appDEUILogicId) {
|
|
16208
|
+
throw new RuntimeModelError46(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
16209
|
+
}
|
|
16210
|
+
await execUILogic(
|
|
16211
|
+
appDEUILogicId,
|
|
16212
|
+
appDataEntityId,
|
|
16213
|
+
this.mergeArgsByResult(args, result)
|
|
16214
|
+
);
|
|
16215
|
+
}
|
|
16216
|
+
const nextActionParams = this.mergeArgsByResult(args, result);
|
|
16046
16217
|
if (action.closeEditView) {
|
|
16047
16218
|
this.doNextAction(action, nextActionParams, action.appId);
|
|
16048
16219
|
} else {
|
|
@@ -16058,14 +16229,25 @@ var UIActionProviderBase = class {
|
|
|
16058
16229
|
}
|
|
16059
16230
|
}
|
|
16060
16231
|
}
|
|
16061
|
-
if (action.uilogicAttachMode === "AFTER") {
|
|
16062
|
-
if (!appDEUILogicId) {
|
|
16063
|
-
throw new RuntimeModelError46(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
16064
|
-
}
|
|
16065
|
-
await execUILogic(appDEUILogicId, appDataEntityId, args);
|
|
16066
|
-
}
|
|
16067
16232
|
return result;
|
|
16068
16233
|
}
|
|
16234
|
+
/**
|
|
16235
|
+
* 根据界面行为逻辑返回值,合并参数获得后续逻辑要用的参数
|
|
16236
|
+
* @author lxm
|
|
16237
|
+
* @date 2023-12-25 02:42:23
|
|
16238
|
+
* @protected
|
|
16239
|
+
* @param {IUILogicParams} args 当前环境的参数
|
|
16240
|
+
* @param {IUIActionResult} result 上一次逻辑执行的结果
|
|
16241
|
+
* @return {*} {IUILogicParams}
|
|
16242
|
+
*/
|
|
16243
|
+
mergeArgsByResult(args, result) {
|
|
16244
|
+
return {
|
|
16245
|
+
...args,
|
|
16246
|
+
context: result.nextContext || args.context,
|
|
16247
|
+
data: result.data || args.data,
|
|
16248
|
+
params: result.nextParams || args.params
|
|
16249
|
+
};
|
|
16250
|
+
}
|
|
16069
16251
|
/**
|
|
16070
16252
|
* 有错误和取消时对result做的处理
|
|
16071
16253
|
* @author lxm
|
|
@@ -21481,7 +21663,8 @@ var EditFormController = class extends FormController {
|
|
|
21481
21663
|
* @param {IData} data
|
|
21482
21664
|
*/
|
|
21483
21665
|
setSimpleData(data) {
|
|
21484
|
-
const
|
|
21666
|
+
const UIData = this.service.toUIData(data);
|
|
21667
|
+
const cloneData = UIData.clone();
|
|
21485
21668
|
this.formItems.forEach((item) => {
|
|
21486
21669
|
if (!Object.prototype.hasOwnProperty.call(cloneData, item.name)) {
|
|
21487
21670
|
cloneData[item.name] = null;
|
|
@@ -23470,57 +23653,6 @@ var ListController = class extends MDControlController {
|
|
|
23470
23653
|
}
|
|
23471
23654
|
}
|
|
23472
23655
|
}
|
|
23473
|
-
/**
|
|
23474
|
-
* 工具栏
|
|
23475
|
-
*
|
|
23476
|
-
* @author zk
|
|
23477
|
-
* @date 2023-08-02 06:08:34
|
|
23478
|
-
* @readonly
|
|
23479
|
-
* @type {(IToolbarController | undefined)}
|
|
23480
|
-
* @memberof ListController
|
|
23481
|
-
*/
|
|
23482
|
-
get batchToolbarController() {
|
|
23483
|
-
const controller = this.view.getController(
|
|
23484
|
-
"".concat(this.model.name, "_batchtoolbar")
|
|
23485
|
-
);
|
|
23486
|
-
return controller;
|
|
23487
|
-
}
|
|
23488
|
-
/**
|
|
23489
|
-
* 工具栏
|
|
23490
|
-
*
|
|
23491
|
-
* @author zk
|
|
23492
|
-
* @date 2023-08-02 06:08:34
|
|
23493
|
-
* @readonly
|
|
23494
|
-
* @type {(IToolbarController | undefined)}
|
|
23495
|
-
* @memberof ListController
|
|
23496
|
-
*/
|
|
23497
|
-
get quickToolbarController() {
|
|
23498
|
-
const controller = this.view.getController(
|
|
23499
|
-
"".concat(this.model.name, "_quicktoolbar")
|
|
23500
|
-
);
|
|
23501
|
-
return controller;
|
|
23502
|
-
}
|
|
23503
|
-
/**
|
|
23504
|
-
* 根据数据计算工具栏权限和状态
|
|
23505
|
-
*
|
|
23506
|
-
* @author zk
|
|
23507
|
-
* @date 2023-08-02 06:08:11
|
|
23508
|
-
* @param {IData[]} selection
|
|
23509
|
-
* @memberof ListController
|
|
23510
|
-
*/
|
|
23511
|
-
setSelection(selection) {
|
|
23512
|
-
var _a, _b;
|
|
23513
|
-
super.setSelection(selection);
|
|
23514
|
-
const data = selection == null ? void 0 : selection[0];
|
|
23515
|
-
(_a = this.batchToolbarController) == null ? void 0 : _a.calcButtonState(
|
|
23516
|
-
data,
|
|
23517
|
-
this.model.appDataEntityId
|
|
23518
|
-
);
|
|
23519
|
-
(_b = this.quickToolbarController) == null ? void 0 : _b.calcButtonState(
|
|
23520
|
-
data,
|
|
23521
|
-
this.model.appDataEntityId
|
|
23522
|
-
);
|
|
23523
|
-
}
|
|
23524
23656
|
/**
|
|
23525
23657
|
* 加载更多
|
|
23526
23658
|
* @author lxm
|
|
@@ -24487,30 +24619,43 @@ var SearchBarService = class {
|
|
|
24487
24619
|
});
|
|
24488
24620
|
return res;
|
|
24489
24621
|
}
|
|
24622
|
+
/**
|
|
24623
|
+
* 批量新建
|
|
24624
|
+
* @param {IData} data
|
|
24625
|
+
* @return {*}
|
|
24626
|
+
* @author: zhujiamin
|
|
24627
|
+
* @Date: 2023-12-26 15:49:00
|
|
24628
|
+
*/
|
|
24629
|
+
async createBatch(data) {
|
|
24630
|
+
const createParams = this.convertFrontDataToBack(data);
|
|
24631
|
+
const res = await this.app.net.post("".concat(this.themeUrl), createParams);
|
|
24632
|
+
return res;
|
|
24633
|
+
}
|
|
24490
24634
|
/**
|
|
24491
24635
|
* 更新数据
|
|
24492
24636
|
*
|
|
24493
24637
|
*/
|
|
24494
24638
|
async update(id, data) {
|
|
24495
|
-
const updateParams =
|
|
24496
|
-
if (data.theme_model) {
|
|
24497
|
-
Object.assign(updateParams, {
|
|
24498
|
-
theme_model: JSON.stringify(data.theme_model)
|
|
24499
|
-
});
|
|
24500
|
-
}
|
|
24501
|
-
if (data.caption) {
|
|
24502
|
-
Object.assign(updateParams, {
|
|
24503
|
-
name: data.caption
|
|
24504
|
-
});
|
|
24505
|
-
}
|
|
24506
|
-
if (typeof data.show === "boolean") {
|
|
24507
|
-
Object.assign(updateParams, {
|
|
24508
|
-
show: data.show
|
|
24509
|
-
});
|
|
24510
|
-
}
|
|
24639
|
+
const [updateParams] = this.convertFrontDataToBack([data]);
|
|
24511
24640
|
const res = await this.app.net.put("".concat(this.themeUrl, "/").concat(id), updateParams);
|
|
24512
24641
|
return res;
|
|
24513
24642
|
}
|
|
24643
|
+
/**
|
|
24644
|
+
* 批量更新数据
|
|
24645
|
+
* @param {IData} data
|
|
24646
|
+
* @return {*}
|
|
24647
|
+
* @author: zhujiamin
|
|
24648
|
+
* @Date: 2023-12-26 11:11:34
|
|
24649
|
+
*/
|
|
24650
|
+
async updateBatch(data) {
|
|
24651
|
+
const updateParams = this.convertFrontDataToBack(data);
|
|
24652
|
+
const idUrl = updateParams.map((item) => item.id).join(";");
|
|
24653
|
+
const res = await this.app.net.put(
|
|
24654
|
+
"".concat(this.themeUrl, "/").concat(idUrl),
|
|
24655
|
+
updateParams
|
|
24656
|
+
);
|
|
24657
|
+
return res;
|
|
24658
|
+
}
|
|
24514
24659
|
/**
|
|
24515
24660
|
* 转换后台数据成前端需要的格式
|
|
24516
24661
|
* @param {IData} data
|
|
@@ -24527,6 +24672,41 @@ var SearchBarService = class {
|
|
|
24527
24672
|
if (item.theme_model) {
|
|
24528
24673
|
tempItem.searchGroupData = JSON.parse(item.theme_model);
|
|
24529
24674
|
}
|
|
24675
|
+
if (typeof item.valid_flag === "number") {
|
|
24676
|
+
tempItem.show = item.valid_flag === 1;
|
|
24677
|
+
}
|
|
24678
|
+
if (item.order_value) {
|
|
24679
|
+
tempItem.order = item.order_value;
|
|
24680
|
+
}
|
|
24681
|
+
return tempItem;
|
|
24682
|
+
});
|
|
24683
|
+
}
|
|
24684
|
+
/**
|
|
24685
|
+
* 转换前端数据成后台需要的格式
|
|
24686
|
+
* @param {IData} data
|
|
24687
|
+
* @return {*}
|
|
24688
|
+
* @author: zhujiamin
|
|
24689
|
+
* @Date: 2023-12-22 11:19:50
|
|
24690
|
+
*/
|
|
24691
|
+
convertFrontDataToBack(data) {
|
|
24692
|
+
return data.map((item) => {
|
|
24693
|
+
const tempItem = {
|
|
24694
|
+
appId: item.appId,
|
|
24695
|
+
app_view_tag: this.viewTag,
|
|
24696
|
+
id: item.id
|
|
24697
|
+
};
|
|
24698
|
+
if (item.caption) {
|
|
24699
|
+
tempItem.name = item.caption;
|
|
24700
|
+
}
|
|
24701
|
+
if (item.searchGroupData && Object.keys(item.searchGroupData).length > 0) {
|
|
24702
|
+
tempItem.theme_model = JSON.stringify(item.searchGroupData);
|
|
24703
|
+
}
|
|
24704
|
+
if (typeof item.show === "boolean") {
|
|
24705
|
+
tempItem.valid_flag = item.show ? 1 : 0;
|
|
24706
|
+
}
|
|
24707
|
+
if (item.order) {
|
|
24708
|
+
tempItem.order_value = item.order;
|
|
24709
|
+
}
|
|
24530
24710
|
return tempItem;
|
|
24531
24711
|
});
|
|
24532
24712
|
}
|
|
@@ -24563,7 +24743,7 @@ var SearchBarController = class extends ControlController {
|
|
|
24563
24743
|
* @author: zhujiamin
|
|
24564
24744
|
* @Date: 2023-12-21 10:17:43
|
|
24565
24745
|
*/
|
|
24566
|
-
this.isBackendSearchGroup =
|
|
24746
|
+
this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
|
|
24567
24747
|
}
|
|
24568
24748
|
/**
|
|
24569
24749
|
* 表格控制器
|
|
@@ -24781,12 +24961,42 @@ var SearchBarController = class extends ControlController {
|
|
|
24781
24961
|
this.state.searchBarGroups = [];
|
|
24782
24962
|
if (this.isBackendSearchGroup) {
|
|
24783
24963
|
if (this.model.searchBarGroups && this.model.searchBarGroups.length > 0) {
|
|
24784
|
-
this.state.searchBarGroups = this.model.searchBarGroups.map(
|
|
24785
|
-
|
|
24786
|
-
|
|
24787
|
-
|
|
24788
|
-
|
|
24789
|
-
|
|
24964
|
+
this.state.searchBarGroups = this.model.searchBarGroups.map(
|
|
24965
|
+
(item, index) => {
|
|
24966
|
+
const tempGroup = {
|
|
24967
|
+
...item,
|
|
24968
|
+
saved: false,
|
|
24969
|
+
show: true,
|
|
24970
|
+
searchGroupData: {},
|
|
24971
|
+
order: (index + 1) * 100
|
|
24972
|
+
};
|
|
24973
|
+
if (item.data) {
|
|
24974
|
+
try {
|
|
24975
|
+
const tempData = JSON.parse(item.data);
|
|
24976
|
+
if (tempData.theme_model) {
|
|
24977
|
+
if (tempData.theme_model.sort) {
|
|
24978
|
+
tempGroup.searchGroupData.sort = tempData.theme_model.sort;
|
|
24979
|
+
}
|
|
24980
|
+
if (tempData.theme_model.columnstates) {
|
|
24981
|
+
tempGroup.searchGroupData.columnstates = tempData.theme_model.columnstates;
|
|
24982
|
+
}
|
|
24983
|
+
if (tempData.theme_model.filternodes) {
|
|
24984
|
+
tempGroup.searchGroupData.filternodes = tempData.theme_model.filternodes;
|
|
24985
|
+
}
|
|
24986
|
+
if (tempData.theme_model.searchconds) {
|
|
24987
|
+
tempGroup.searchGroupData.searchconds = tempData.theme_model.searchconds;
|
|
24988
|
+
}
|
|
24989
|
+
}
|
|
24990
|
+
if (tempData.valid_flag) {
|
|
24991
|
+
tempGroup.show = tempData.valid_flag === "1";
|
|
24992
|
+
}
|
|
24993
|
+
} catch (error) {
|
|
24994
|
+
ibiz.log.error(error);
|
|
24995
|
+
}
|
|
24996
|
+
}
|
|
24997
|
+
return tempGroup;
|
|
24998
|
+
}
|
|
24999
|
+
);
|
|
24790
25000
|
}
|
|
24791
25001
|
const res = await this.service.fetch();
|
|
24792
25002
|
if (res.ok) {
|
|
@@ -24798,16 +25008,26 @@ var SearchBarController = class extends ControlController {
|
|
|
24798
25008
|
mergeInLeft3(existGroup, group);
|
|
24799
25009
|
existGroup.saved = true;
|
|
24800
25010
|
} else {
|
|
25011
|
+
const tempMaxOrderIndex = this.state.searchBarGroups.reduce(
|
|
25012
|
+
(maxIndex, item, currentIndex) => item.order > this.state.searchBarGroups[maxIndex].order ? currentIndex : maxIndex,
|
|
25013
|
+
0
|
|
25014
|
+
);
|
|
24801
25015
|
this.state.searchBarGroups.push({
|
|
24802
|
-
...group,
|
|
24803
25016
|
appId: this.context.srfappid,
|
|
24804
|
-
show: true,
|
|
24805
25017
|
saved: true,
|
|
24806
|
-
|
|
25018
|
+
show: true,
|
|
25019
|
+
searchGroupData: {},
|
|
25020
|
+
order: (tempMaxOrderIndex + 2) * 100,
|
|
25021
|
+
// 以后台给的为准
|
|
25022
|
+
...group
|
|
24807
25023
|
});
|
|
24808
25024
|
}
|
|
24809
25025
|
});
|
|
24810
25026
|
}
|
|
25027
|
+
this.state.searchBarGroups.sort((a, b) => a.order - b.order);
|
|
25028
|
+
this.state.searchBarGroups.forEach((item, index) => {
|
|
25029
|
+
item.order = (index + 1) * 100;
|
|
25030
|
+
});
|
|
24811
25031
|
}
|
|
24812
25032
|
}
|
|
24813
25033
|
/**
|
|
@@ -24828,8 +25048,9 @@ var SearchBarController = class extends ControlController {
|
|
|
24828
25048
|
};
|
|
24829
25049
|
if (this.state.selectedSearchGroupItem.saved) {
|
|
24830
25050
|
await this.service.update(this.state.selectedSearchGroupItem.id, {
|
|
24831
|
-
|
|
24832
|
-
show: this.state.selectedSearchGroupItem.show
|
|
25051
|
+
searchGroupData: saveParams,
|
|
25052
|
+
show: this.state.selectedSearchGroupItem.show,
|
|
25053
|
+
order: this.state.selectedSearchGroupItem.order
|
|
24833
25054
|
});
|
|
24834
25055
|
ibiz.message.success("\u4FDD\u5B58\u6210\u529F");
|
|
24835
25056
|
} else {
|
|
@@ -24861,6 +25082,7 @@ var SearchBarController = class extends ControlController {
|
|
|
24861
25082
|
const res = await this.service.get(groupItem.id);
|
|
24862
25083
|
if (res.ok) {
|
|
24863
25084
|
mergeInLeft3(groupItem, res.data);
|
|
25085
|
+
groupItem.show = true;
|
|
24864
25086
|
}
|
|
24865
25087
|
}
|
|
24866
25088
|
if (groupItem.searchGroupData && groupItem.searchGroupData.filternodes) {
|
|
@@ -28341,9 +28563,6 @@ var ReportPanelController = class extends ControlController {
|
|
|
28341
28563
|
}
|
|
28342
28564
|
};
|
|
28343
28565
|
|
|
28344
|
-
// src/controller/control/gantt/gantt.controller.ts
|
|
28345
|
-
import { recursiveIterate as recursiveIterate12 } from "@ibiz-template/core";
|
|
28346
|
-
|
|
28347
28566
|
// src/controller/control/gantt/gantt.service.ts
|
|
28348
28567
|
import { ModelError as ModelError30 } from "@ibiz-template/core";
|
|
28349
28568
|
var GanttService = class extends TreeService {
|
|
@@ -28375,12 +28594,12 @@ var GanttService = class extends TreeService {
|
|
|
28375
28594
|
* @param {TreeFetchOpts} opts
|
|
28376
28595
|
* @return {*} {(Promise<IGanttNodeData[] | undefined>)}
|
|
28377
28596
|
*/
|
|
28378
|
-
async
|
|
28597
|
+
async fetchChildNodes(parentNodeData, opts) {
|
|
28379
28598
|
const { hasQuery } = opts;
|
|
28380
28599
|
let childrenNodes = [];
|
|
28381
28600
|
if (!parentNodeData) {
|
|
28382
28601
|
const rootNode = getRootNode(this.model);
|
|
28383
|
-
childrenNodes = await this.
|
|
28602
|
+
childrenNodes = await this.fetchNodeDatasByType(
|
|
28384
28603
|
rootNode,
|
|
28385
28604
|
void 0,
|
|
28386
28605
|
void 0,
|
|
@@ -28400,7 +28619,7 @@ var GanttService = class extends TreeService {
|
|
|
28400
28619
|
this.model,
|
|
28401
28620
|
childNodeRS.childDETreeNodeId
|
|
28402
28621
|
);
|
|
28403
|
-
return this.
|
|
28622
|
+
return this.fetchNodeDatasByType(
|
|
28404
28623
|
childNode,
|
|
28405
28624
|
childNodeRS,
|
|
28406
28625
|
parentNodeData,
|
|
@@ -28427,7 +28646,7 @@ var GanttService = class extends TreeService {
|
|
|
28427
28646
|
* @param {TreeFetchOpts} opts
|
|
28428
28647
|
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28429
28648
|
*/
|
|
28430
|
-
async
|
|
28649
|
+
async fetchNodeDatasByType(nodeModel, nodeRS, parentNodeData, opts) {
|
|
28431
28650
|
const leaf = getChildNodeRSs(this.model, {
|
|
28432
28651
|
parentId: nodeModel.id,
|
|
28433
28652
|
hasQuery: opts.hasQuery
|
|
@@ -28475,7 +28694,7 @@ var GanttService = class extends TreeService {
|
|
|
28475
28694
|
result.map(async (childNode, index) => {
|
|
28476
28695
|
if (expanded && // 全展开合只展开首节点expanded都为true
|
|
28477
28696
|
(!expandFirstOnly || expandFirstOnly && index === 0) || isExpandedRoot) {
|
|
28478
|
-
const subChildrenNodes = await this.
|
|
28697
|
+
const subChildrenNodes = await this.fetchChildNodes(
|
|
28479
28698
|
childNode,
|
|
28480
28699
|
opts
|
|
28481
28700
|
);
|
|
@@ -28597,54 +28816,7 @@ var GanttService = class extends TreeService {
|
|
|
28597
28816
|
};
|
|
28598
28817
|
|
|
28599
28818
|
// src/controller/control/gantt/gantt.controller.ts
|
|
28600
|
-
var GanttController = class extends
|
|
28601
|
-
constructor() {
|
|
28602
|
-
super(...arguments);
|
|
28603
|
-
/**
|
|
28604
|
-
* 表格列适配器
|
|
28605
|
-
*
|
|
28606
|
-
* @type {{ [key: string]: IGridColumnProvider }}
|
|
28607
|
-
* @memberof GanttController
|
|
28608
|
-
*/
|
|
28609
|
-
this.providers = {};
|
|
28610
|
-
/**
|
|
28611
|
-
* 所有表格列控制器集合
|
|
28612
|
-
*
|
|
28613
|
-
* @type {{ [key: string]: GridColumnController }}
|
|
28614
|
-
* @memberof GanttController
|
|
28615
|
-
*/
|
|
28616
|
-
this.columns = {};
|
|
28617
|
-
/**
|
|
28618
|
-
* 所有表格属性列的控制器
|
|
28619
|
-
*
|
|
28620
|
-
* @type {{ [key: string]: GridFieldColumnController }}
|
|
28621
|
-
* @memberof GanttController
|
|
28622
|
-
*/
|
|
28623
|
-
this.fieldColumns = {};
|
|
28624
|
-
/**
|
|
28625
|
-
* 所有表格操作列的控制器
|
|
28626
|
-
*
|
|
28627
|
-
* @type {{ [key: string]: GridUAColumnController }}
|
|
28628
|
-
* @memberof GanttController
|
|
28629
|
-
*/
|
|
28630
|
-
this.uaColumns = {};
|
|
28631
|
-
/**
|
|
28632
|
-
* 上下文菜单控制器
|
|
28633
|
-
*
|
|
28634
|
-
* @author tony001
|
|
28635
|
-
* @date 2023-12-11 16:12:57
|
|
28636
|
-
* @type {{ [p: string]: ContextMenuController }}
|
|
28637
|
-
*/
|
|
28638
|
-
this.contextMenus = {};
|
|
28639
|
-
/**
|
|
28640
|
-
* 是否启用快速搜索
|
|
28641
|
-
*
|
|
28642
|
-
* @author tony001
|
|
28643
|
-
* @date 2023-12-11 16:12:13
|
|
28644
|
-
* @type {boolean}
|
|
28645
|
-
*/
|
|
28646
|
-
this.enableQuickSearch = false;
|
|
28647
|
-
}
|
|
28819
|
+
var GanttController = class extends TreeGridExController {
|
|
28648
28820
|
/**
|
|
28649
28821
|
* 初始化状态
|
|
28650
28822
|
*
|
|
@@ -28654,9 +28826,6 @@ var GanttController = class extends MDControlController {
|
|
|
28654
28826
|
*/
|
|
28655
28827
|
initState() {
|
|
28656
28828
|
super.initState();
|
|
28657
|
-
this.state.size = 0;
|
|
28658
|
-
this.state.query = "";
|
|
28659
|
-
this.state.columnStates = [];
|
|
28660
28829
|
this.state.rootNodes = [];
|
|
28661
28830
|
this.state.ganttStyle = {};
|
|
28662
28831
|
}
|
|
@@ -28669,131 +28838,16 @@ var GanttController = class extends MDControlController {
|
|
|
28669
28838
|
*/
|
|
28670
28839
|
onDataChange(msg) {
|
|
28671
28840
|
}
|
|
28672
|
-
async onCreated() {
|
|
28673
|
-
var _a, _b;
|
|
28674
|
-
await super.onCreated();
|
|
28675
|
-
await this.initGridColumns();
|
|
28676
|
-
this.initColumnStates();
|
|
28677
|
-
if ((_a = this.model.detreeNodes) == null ? void 0 : _a[0].enableQuickSearch) {
|
|
28678
|
-
this.enableQuickSearch = true;
|
|
28679
|
-
}
|
|
28680
|
-
if (this.dataEntity) {
|
|
28681
|
-
const searchFields = (_b = this.dataEntity.appDEFields) == null ? void 0 : _b.filter((field) => {
|
|
28682
|
-
return field.enableQuickSearch;
|
|
28683
|
-
});
|
|
28684
|
-
const placeHolders = [];
|
|
28685
|
-
searchFields == null ? void 0 : searchFields.forEach((searchField) => {
|
|
28686
|
-
if ((searchField == null ? void 0 : searchField.lnlanguageRes) && searchField.lnlanguageRes.lanResTag) {
|
|
28687
|
-
placeHolders.push(
|
|
28688
|
-
ibiz.i18n.t(
|
|
28689
|
-
searchField.lnlanguageRes.lanResTag,
|
|
28690
|
-
searchField.logicName
|
|
28691
|
-
)
|
|
28692
|
-
);
|
|
28693
|
-
} else if (searchField == null ? void 0 : searchField.logicName) {
|
|
28694
|
-
placeHolders.push(searchField.logicName);
|
|
28695
|
-
}
|
|
28696
|
-
});
|
|
28697
|
-
if (placeHolders.length > 0) {
|
|
28698
|
-
this.state.placeHolder = placeHolders.join("\u3001");
|
|
28699
|
-
}
|
|
28700
|
-
}
|
|
28701
|
-
this.service = new GanttService(this.model);
|
|
28702
|
-
await this.service.init(this.context);
|
|
28703
|
-
this.model.detreeNodes.forEach((node) => {
|
|
28704
|
-
var _a2, _b2;
|
|
28705
|
-
if ((_b2 = (_a2 = node.decontextMenu) == null ? void 0 : _a2.detoolbarItems) == null ? void 0 : _b2.length) {
|
|
28706
|
-
this.contextMenus[node.decontextMenu.id] = new ContextMenuController(
|
|
28707
|
-
node.decontextMenu,
|
|
28708
|
-
this.context,
|
|
28709
|
-
this.params,
|
|
28710
|
-
this.ctx
|
|
28711
|
-
);
|
|
28712
|
-
}
|
|
28713
|
-
});
|
|
28714
|
-
await Promise.all(
|
|
28715
|
-
Object.values(this.contextMenus).map((menu) => menu.created())
|
|
28716
|
-
);
|
|
28717
|
-
}
|
|
28718
|
-
/**
|
|
28719
|
-
* 初始化表格列
|
|
28720
|
-
*
|
|
28721
|
-
* @protected
|
|
28722
|
-
* @return {*} {Promise<void>}
|
|
28723
|
-
* @memberof GanttController
|
|
28724
|
-
*/
|
|
28725
|
-
async initGridColumns() {
|
|
28726
|
-
if (this.model.detreeColumns) {
|
|
28727
|
-
await Promise.all(
|
|
28728
|
-
this.model.detreeColumns.map(
|
|
28729
|
-
async (column) => this.initColumnsController(column)
|
|
28730
|
-
)
|
|
28731
|
-
);
|
|
28732
|
-
}
|
|
28733
|
-
}
|
|
28734
28841
|
/**
|
|
28735
|
-
*
|
|
28842
|
+
* 初始化对应类型的部件服务
|
|
28736
28843
|
*
|
|
28737
28844
|
* @protected
|
|
28738
|
-
* @param {IDETreeColumn} column
|
|
28739
28845
|
* @return {*} {Promise<void>}
|
|
28740
28846
|
* @memberof GanttController
|
|
28741
28847
|
*/
|
|
28742
|
-
async
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
return;
|
|
28746
|
-
}
|
|
28747
|
-
this.providers[column.codeName] = provider;
|
|
28748
|
-
const controller = await provider.createController(column, this);
|
|
28749
|
-
this.columns[column.codeName] = controller;
|
|
28750
|
-
if (column.columnType === "DEFGRIDCOLUMN") {
|
|
28751
|
-
this.fieldColumns[column.codeName] = controller;
|
|
28752
|
-
} else if (column.columnType === "UAGRIDCOLUMN") {
|
|
28753
|
-
this.uaColumns[column.codeName] = controller;
|
|
28754
|
-
}
|
|
28755
|
-
}
|
|
28756
|
-
/**
|
|
28757
|
-
* 初始化表格列状态
|
|
28758
|
-
*
|
|
28759
|
-
* @protected
|
|
28760
|
-
* @memberof GanttController
|
|
28761
|
-
*/
|
|
28762
|
-
initColumnStates() {
|
|
28763
|
-
recursiveIterate12(
|
|
28764
|
-
this.model,
|
|
28765
|
-
(column) => {
|
|
28766
|
-
if (column.columnType !== "GROUPGRIDCOLUMN") {
|
|
28767
|
-
this.state.columnStates.push({
|
|
28768
|
-
key: column.codeName,
|
|
28769
|
-
caption: column.caption,
|
|
28770
|
-
hidden: !!column.hideDefault,
|
|
28771
|
-
uaColumn: column.columnType === "UAGRIDCOLUMN"
|
|
28772
|
-
});
|
|
28773
|
-
}
|
|
28774
|
-
},
|
|
28775
|
-
{ childrenFields: ["detreeColumns"] }
|
|
28776
|
-
);
|
|
28777
|
-
this.calcColumnFixed();
|
|
28778
|
-
}
|
|
28779
|
-
/**
|
|
28780
|
-
* 计算列的固定状态
|
|
28781
|
-
*
|
|
28782
|
-
* @protected
|
|
28783
|
-
* @memberof GanttController
|
|
28784
|
-
*/
|
|
28785
|
-
calcColumnFixed() {
|
|
28786
|
-
const showColumns = this.state.columnStates.filter(
|
|
28787
|
-
(column) => !column.hidden
|
|
28788
|
-
);
|
|
28789
|
-
const allNum = showColumns.length;
|
|
28790
|
-
showColumns.forEach((column, index) => {
|
|
28791
|
-
if (column.uaColumn) {
|
|
28792
|
-
column.fixed = index + 1 <= Math.floor(allNum / 2) ? "left" : "right";
|
|
28793
|
-
} else {
|
|
28794
|
-
column.fixed = "right";
|
|
28795
|
-
}
|
|
28796
|
-
});
|
|
28848
|
+
async initService() {
|
|
28849
|
+
this.service = new GanttService(this.model);
|
|
28850
|
+
await this.service.init(this.context);
|
|
28797
28851
|
}
|
|
28798
28852
|
/**
|
|
28799
28853
|
* 设置甘特图样式
|
|
@@ -28804,214 +28858,6 @@ var GanttController = class extends MDControlController {
|
|
|
28804
28858
|
setGanttStyle(style) {
|
|
28805
28859
|
this.state.ganttStyle = style;
|
|
28806
28860
|
}
|
|
28807
|
-
/**
|
|
28808
|
-
* 加载
|
|
28809
|
-
*
|
|
28810
|
-
* @author tony001
|
|
28811
|
-
* @date 2023-12-12 11:12:08
|
|
28812
|
-
* @param {MDCtrlLoadParams} [args={}]
|
|
28813
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28814
|
-
*/
|
|
28815
|
-
async load(args = {}) {
|
|
28816
|
-
const isInitialLoad = args.isInitialLoad === true;
|
|
28817
|
-
if (isInitialLoad) {
|
|
28818
|
-
await this.startLoading();
|
|
28819
|
-
}
|
|
28820
|
-
let nodes;
|
|
28821
|
-
try {
|
|
28822
|
-
nodes = await this.loadNodes();
|
|
28823
|
-
} finally {
|
|
28824
|
-
if (isInitialLoad) {
|
|
28825
|
-
await this.endLoading();
|
|
28826
|
-
}
|
|
28827
|
-
}
|
|
28828
|
-
await this.afterLoad(args, nodes);
|
|
28829
|
-
this.state.isLoaded = true;
|
|
28830
|
-
await this.evt.emit("onLoadSuccess", {
|
|
28831
|
-
isInitialLoad
|
|
28832
|
-
});
|
|
28833
|
-
return nodes;
|
|
28834
|
-
}
|
|
28835
|
-
/**
|
|
28836
|
-
* 获取节点模型
|
|
28837
|
-
*
|
|
28838
|
-
* @param {string} id
|
|
28839
|
-
* @return {*} {(IDETreeNode | undefined)}
|
|
28840
|
-
* @memberof GanttController
|
|
28841
|
-
*/
|
|
28842
|
-
getNodeModel(id) {
|
|
28843
|
-
var _a;
|
|
28844
|
-
return (_a = this.model.detreeNodes) == null ? void 0 : _a.find((item) => item.id === id);
|
|
28845
|
-
}
|
|
28846
|
-
/**
|
|
28847
|
-
* 获取查询参数
|
|
28848
|
-
*
|
|
28849
|
-
* @author tony001
|
|
28850
|
-
* @date 2023-12-12 11:12:22
|
|
28851
|
-
* @param {IParams} [extraParams]
|
|
28852
|
-
* @return {*} {Promise<IParams>}
|
|
28853
|
-
*/
|
|
28854
|
-
async getFetchParams(extraParams) {
|
|
28855
|
-
const params = await super.getFetchParams(extraParams);
|
|
28856
|
-
if (this.state.query) {
|
|
28857
|
-
params.query = this.state.query;
|
|
28858
|
-
}
|
|
28859
|
-
return params;
|
|
28860
|
-
}
|
|
28861
|
-
/**
|
|
28862
|
-
* 加载节点
|
|
28863
|
-
*
|
|
28864
|
-
* @author tony001
|
|
28865
|
-
* @date 2023-12-12 11:12:33
|
|
28866
|
-
* @param {IGanttNodeData} [parentNode]
|
|
28867
|
-
* @return {*} {Promise<IGanttNodeData[]>}
|
|
28868
|
-
*/
|
|
28869
|
-
async loadNodes(parentNode) {
|
|
28870
|
-
const params = await this.getFetchParams();
|
|
28871
|
-
const hasQuery = !!params.query;
|
|
28872
|
-
this.state.isLoading = true;
|
|
28873
|
-
let nodes;
|
|
28874
|
-
try {
|
|
28875
|
-
nodes = await this.service.fetchGanttChildNodes(parentNode, {
|
|
28876
|
-
context: this.context.clone(),
|
|
28877
|
-
params,
|
|
28878
|
-
hasQuery,
|
|
28879
|
-
defaultExpandedKeys: []
|
|
28880
|
-
}) || [];
|
|
28881
|
-
} finally {
|
|
28882
|
-
this.state.isLoading = false;
|
|
28883
|
-
}
|
|
28884
|
-
if (parentNode) {
|
|
28885
|
-
parentNode.children = nodes;
|
|
28886
|
-
} else {
|
|
28887
|
-
this.state.rootNodes = nodes;
|
|
28888
|
-
}
|
|
28889
|
-
this.state.items = [];
|
|
28890
|
-
recursiveIterate12(
|
|
28891
|
-
{ children: this.state.rootNodes },
|
|
28892
|
-
(node) => {
|
|
28893
|
-
this.state.items.push(node);
|
|
28894
|
-
}
|
|
28895
|
-
);
|
|
28896
|
-
return nodes;
|
|
28897
|
-
}
|
|
28898
|
-
/**
|
|
28899
|
-
* 甘特节点点击事件
|
|
28900
|
-
*
|
|
28901
|
-
* @param {IGanttNodeData} nodeData
|
|
28902
|
-
* @return {*} {Promise<void>}
|
|
28903
|
-
* @memberof GanttController
|
|
28904
|
-
*/
|
|
28905
|
-
async onGanttNodeClick(nodeData) {
|
|
28906
|
-
if (this.state.singleSelect) {
|
|
28907
|
-
const { selectedData } = this.state;
|
|
28908
|
-
const filterArr = selectedData.filter((item) => item.id !== nodeData.id);
|
|
28909
|
-
if (filterArr.length === selectedData.length) {
|
|
28910
|
-
this.setSelection(
|
|
28911
|
-
this.state.singleSelect ? [nodeData] : selectedData.concat([nodeData])
|
|
28912
|
-
);
|
|
28913
|
-
} else {
|
|
28914
|
-
this.setSelection(filterArr);
|
|
28915
|
-
}
|
|
28916
|
-
}
|
|
28917
|
-
if (this.state.mdctrlActiveMode === 1) {
|
|
28918
|
-
await this.setActive(nodeData);
|
|
28919
|
-
}
|
|
28920
|
-
}
|
|
28921
|
-
/**
|
|
28922
|
-
* 甘特节点双击事件
|
|
28923
|
-
*
|
|
28924
|
-
* @param {IGanttNodeData} nodeData
|
|
28925
|
-
* @return {*} {Promise<void>}
|
|
28926
|
-
* @memberof GanttController
|
|
28927
|
-
*/
|
|
28928
|
-
async onDbGanttNodeClick(nodeData) {
|
|
28929
|
-
if (this.state.mdctrlActiveMode === 2) {
|
|
28930
|
-
await this.setActive(nodeData);
|
|
28931
|
-
}
|
|
28932
|
-
}
|
|
28933
|
-
/**
|
|
28934
|
-
* 设置激活
|
|
28935
|
-
*
|
|
28936
|
-
* @param {IGanttNodeData} item
|
|
28937
|
-
* @return {*} {Promise<void>}
|
|
28938
|
-
* @memberof GanttController
|
|
28939
|
-
*/
|
|
28940
|
-
setActive(item) {
|
|
28941
|
-
const nodeParams = this.parseGanttNodeData(item);
|
|
28942
|
-
return this.evt.emit("onActive", { ...nodeParams, nodeData: item });
|
|
28943
|
-
}
|
|
28944
|
-
/**
|
|
28945
|
-
* 设置选中
|
|
28946
|
-
*
|
|
28947
|
-
* @param {IData[]} selection
|
|
28948
|
-
* @memberof GanttController
|
|
28949
|
-
*/
|
|
28950
|
-
setSelection(selection) {
|
|
28951
|
-
const selectionIds = selection.map((item) => item.id);
|
|
28952
|
-
const filterArr = this.state.items.filter(
|
|
28953
|
-
(item) => selectionIds.includes(item.id)
|
|
28954
|
-
);
|
|
28955
|
-
super.setSelection(filterArr);
|
|
28956
|
-
}
|
|
28957
|
-
/**
|
|
28958
|
-
* 执行界面行为
|
|
28959
|
-
*
|
|
28960
|
-
* @param {string} uiActionId
|
|
28961
|
-
* @param {IGanttNodeData} nodeData
|
|
28962
|
-
* @param {MouseEvent} event
|
|
28963
|
-
* @param {string} appId
|
|
28964
|
-
* @return {*} {Promise<void>}
|
|
28965
|
-
* @memberof GanttController
|
|
28966
|
-
*/
|
|
28967
|
-
async doUIAction(uiActionId, nodeData, event, appId) {
|
|
28968
|
-
const eventArgs = this.getEventArgs();
|
|
28969
|
-
const nodeParams = this.parseGanttNodeData(nodeData);
|
|
28970
|
-
const result = await UIActionUtil.exec(
|
|
28971
|
-
uiActionId,
|
|
28972
|
-
{
|
|
28973
|
-
...eventArgs,
|
|
28974
|
-
...nodeParams,
|
|
28975
|
-
event
|
|
28976
|
-
},
|
|
28977
|
-
appId
|
|
28978
|
-
);
|
|
28979
|
-
if (result.closeView) {
|
|
28980
|
-
this.view.closeView();
|
|
28981
|
-
} else if (result.refresh) {
|
|
28982
|
-
switch (result.refreshMode) {
|
|
28983
|
-
case 1:
|
|
28984
|
-
this.refreshNodeChildren(nodeData);
|
|
28985
|
-
break;
|
|
28986
|
-
case 2:
|
|
28987
|
-
this.refreshNodeChildren(nodeData, true);
|
|
28988
|
-
break;
|
|
28989
|
-
case 3:
|
|
28990
|
-
this.refresh();
|
|
28991
|
-
break;
|
|
28992
|
-
default:
|
|
28993
|
-
}
|
|
28994
|
-
}
|
|
28995
|
-
}
|
|
28996
|
-
/**
|
|
28997
|
-
* 解析甘特节点获取通用数据,和完整的上下文和视图参数。
|
|
28998
|
-
*
|
|
28999
|
-
* @protected
|
|
29000
|
-
* @param {IGanttNodeData} nodeData
|
|
29001
|
-
* @return {*} {{
|
|
29002
|
-
* data: IData[];
|
|
29003
|
-
* context: IContext;
|
|
29004
|
-
* params: IParams;
|
|
29005
|
-
* }}
|
|
29006
|
-
* @memberof GanttController
|
|
29007
|
-
*/
|
|
29008
|
-
parseGanttNodeData(nodeData) {
|
|
29009
|
-
return {
|
|
29010
|
-
data: [{ ...nodeData, ...nodeData.deData || {} }],
|
|
29011
|
-
context: Object.assign(this.context.clone(), nodeData.context || {}),
|
|
29012
|
-
params: { ...this.params, ...nodeData.params || {} }
|
|
29013
|
-
};
|
|
29014
|
-
}
|
|
29015
28861
|
/**
|
|
29016
28862
|
* 转化节点数据项
|
|
29017
28863
|
* vo -> do
|
|
@@ -29069,37 +28915,6 @@ var GanttController = class extends MDControlController {
|
|
|
29069
28915
|
}
|
|
29070
28916
|
}
|
|
29071
28917
|
}
|
|
29072
|
-
/**
|
|
29073
|
-
* 刷新指定树节点的子节点数据
|
|
29074
|
-
*
|
|
29075
|
-
* @param {(IGanttNodeData | IData)} nodeData 指定树节点数据,可以是节点数据,也可以是对应的实体数据
|
|
29076
|
-
* @param {boolean} [refreshParent=false] 是否是刷新给定节点数据的父节点的子节点数据
|
|
29077
|
-
* @return {*} {Promise<void>}
|
|
29078
|
-
* @memberof GanttController
|
|
29079
|
-
*/
|
|
29080
|
-
async refreshNodeChildren(nodeData, refreshParent = false) {
|
|
29081
|
-
const key = nodeData.srfkey ? "srfkey" : "id";
|
|
29082
|
-
const currentNode = this.state.items.find(
|
|
29083
|
-
(item) => item[key] === nodeData[key]
|
|
29084
|
-
);
|
|
29085
|
-
if (!currentNode) {
|
|
29086
|
-
ibiz.log.error("\u627E\u4E0D\u5230\u5BF9\u5E94\u7684\u6811\u8282\u70B9\u6570\u636E", nodeData);
|
|
29087
|
-
return;
|
|
29088
|
-
}
|
|
29089
|
-
if (refreshParent) {
|
|
29090
|
-
const { parent } = currentNode;
|
|
29091
|
-
if (!parent || !this.model.rootVisible && this.state.rootNodes.includes(parent)) {
|
|
29092
|
-
this.refresh();
|
|
29093
|
-
return;
|
|
29094
|
-
}
|
|
29095
|
-
}
|
|
29096
|
-
const targetNode = refreshParent ? currentNode.parent : currentNode;
|
|
29097
|
-
const nodes = await this.loadNodes(targetNode);
|
|
29098
|
-
this.evt.emit("onAfterRefreshParent", {
|
|
29099
|
-
parentNode: targetNode,
|
|
29100
|
-
children: nodes
|
|
29101
|
-
});
|
|
29102
|
-
}
|
|
29103
28918
|
};
|
|
29104
28919
|
|
|
29105
28920
|
// src/controller/hub.controller.ts
|
|
@@ -31561,6 +31376,7 @@ export {
|
|
|
31561
31376
|
getControlProvider,
|
|
31562
31377
|
getControlsByView,
|
|
31563
31378
|
getDEMethodProvider,
|
|
31379
|
+
getDERedirectToView,
|
|
31564
31380
|
getDeACMode,
|
|
31565
31381
|
getDefaultValue,
|
|
31566
31382
|
getEditorProvider,
|