@ibiz-template/runtime 0.7.17-alpha.0 → 0.7.18
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 +432 -215
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/app-menu/app-menu.controller.d.ts +23 -0
- package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/app-menu/app-menu.controller.js +38 -0
- package/out/controller/control/app-menu/custom-app-menu.controller.d.ts +1 -1
- package/out/controller/control/app-menu/custom-app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/app-menu/custom-app-menu.controller.js +11 -4
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +2 -0
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +1 -1
- package/out/controller/control/gantt/gantt.controller.d.ts +12 -4
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +110 -28
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +1 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +2 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.js +21 -0
- package/out/interface/controller/event/control/i-gantt.event.d.ts +10 -9
- package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +4 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +11 -4
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +4 -0
- package/out/service/service/entity/method/method-input.d.ts +1 -1
- package/out/service/service/entity/method/method-input.js +1 -1
- package/out/service/service/entity/method/method-renturn.d.ts +10 -0
- package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
- package/out/service/service/entity/method/method-renturn.js +15 -0
- package/out/utils/file-util/file-util.d.ts +20 -0
- package/out/utils/file-util/file-util.d.ts.map +1 -1
- package/out/utils/file-util/file-util.js +52 -1
- package/package.json +4 -3
package/dist/index.esm.js
CHANGED
|
@@ -5064,10 +5064,12 @@ var AnimeUtil = class {
|
|
|
5064
5064
|
|
|
5065
5065
|
// src/utils/file-util/file-util.ts
|
|
5066
5066
|
import {
|
|
5067
|
+
CoreConst,
|
|
5067
5068
|
RuntimeError as RuntimeError5,
|
|
5068
5069
|
downloadFileFromBlob
|
|
5069
5070
|
} from "@ibiz-template/core";
|
|
5070
5071
|
import qs2 from "qs";
|
|
5072
|
+
import { getCookie } from "qx-util";
|
|
5071
5073
|
var FileUtil = class {
|
|
5072
5074
|
/**
|
|
5073
5075
|
* 计算OSSCat参数
|
|
@@ -5207,6 +5209,55 @@ var FileUtil = class {
|
|
|
5207
5209
|
}
|
|
5208
5210
|
return fileName;
|
|
5209
5211
|
}
|
|
5212
|
+
/**
|
|
5213
|
+
* 选择文件并上传
|
|
5214
|
+
*
|
|
5215
|
+
* @param {IContext} context
|
|
5216
|
+
* @param {IParams} params
|
|
5217
|
+
* @param {IData} data
|
|
5218
|
+
* @param {IData} [option={}]
|
|
5219
|
+
* @return {*} {Promise<IData[]>}
|
|
5220
|
+
* @memberof FileUtil
|
|
5221
|
+
*/
|
|
5222
|
+
async chooseFileAndUpload(context, params, data, option = {}) {
|
|
5223
|
+
const { accept, multiple } = option;
|
|
5224
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(context, params, data);
|
|
5225
|
+
const files = await ibiz.util.file.chooseFile(accept, multiple);
|
|
5226
|
+
const promises = [];
|
|
5227
|
+
const headers = { Authorization: "Bearer ".concat(getCookie(CoreConst.TOKEN)) };
|
|
5228
|
+
for (let i = 0; i < files.length; i++) {
|
|
5229
|
+
const promise = await ibiz.util.file.fileUpload(
|
|
5230
|
+
urls.uploadUrl,
|
|
5231
|
+
files[i],
|
|
5232
|
+
headers
|
|
5233
|
+
);
|
|
5234
|
+
promises.push(promise);
|
|
5235
|
+
}
|
|
5236
|
+
return Promise.all(promises);
|
|
5237
|
+
}
|
|
5238
|
+
/**
|
|
5239
|
+
* 选择文件
|
|
5240
|
+
*
|
|
5241
|
+
* @param {string} [accept='']
|
|
5242
|
+
* @param {boolean} [multiple=false]
|
|
5243
|
+
* @return {*} {Promise<FileList>}
|
|
5244
|
+
* @memberof FileUtil
|
|
5245
|
+
*/
|
|
5246
|
+
chooseFile(accept = "", multiple = false) {
|
|
5247
|
+
return new Promise((resolve) => {
|
|
5248
|
+
const inputElement = document.createElement("input");
|
|
5249
|
+
inputElement.type = "file";
|
|
5250
|
+
inputElement.accept = accept;
|
|
5251
|
+
inputElement.multiple = multiple;
|
|
5252
|
+
inputElement.webkitdirectory = false;
|
|
5253
|
+
inputElement.addEventListener("change", (e) => {
|
|
5254
|
+
resolve(e.target.files);
|
|
5255
|
+
});
|
|
5256
|
+
document.body.appendChild(inputElement);
|
|
5257
|
+
inputElement.click();
|
|
5258
|
+
document.body.removeChild(inputElement);
|
|
5259
|
+
});
|
|
5260
|
+
}
|
|
5210
5261
|
};
|
|
5211
5262
|
|
|
5212
5263
|
// src/utils/short-cut/short-cut-util.ts
|
|
@@ -10620,6 +10671,7 @@ var MethodDto = class {
|
|
|
10620
10671
|
*/
|
|
10621
10672
|
async get(context, data, ignore = false) {
|
|
10622
10673
|
if (context.srfsimple === true && this.isLocalMode === false) {
|
|
10674
|
+
data = this.format(context, data);
|
|
10623
10675
|
return data;
|
|
10624
10676
|
}
|
|
10625
10677
|
const params = {};
|
|
@@ -10710,6 +10762,9 @@ var MethodDto = class {
|
|
|
10710
10762
|
async sets(context, data) {
|
|
10711
10763
|
if (context.srfsimple === true && this.isLocalMode === false) {
|
|
10712
10764
|
if (data && data.length > 0) {
|
|
10765
|
+
for (let i = 0; i < data.length; i++) {
|
|
10766
|
+
data[i] = this.format(context, data[i]);
|
|
10767
|
+
}
|
|
10713
10768
|
return data.map((item) => {
|
|
10714
10769
|
return this.service.createEntity(item);
|
|
10715
10770
|
});
|
|
@@ -10808,8 +10863,13 @@ var MethodDto = class {
|
|
|
10808
10863
|
for (let i = 0; i < this.fields.length; i++) {
|
|
10809
10864
|
const field = this.fields[i];
|
|
10810
10865
|
const key = field.codeName.toLowerCase();
|
|
10811
|
-
if (field.type === "DTOS" && field.listMap
|
|
10812
|
-
|
|
10866
|
+
if (field.type === "DTOS" && field.listMap) {
|
|
10867
|
+
if (Object.prototype.toString.call(data[key]) === "[object Object]") {
|
|
10868
|
+
params[key] = convertListMapToArray(data[key]);
|
|
10869
|
+
}
|
|
10870
|
+
if (Object.prototype.toString.call(data[key]) === "[object Array]") {
|
|
10871
|
+
params[key] = convertArrayToListMap(data[key]);
|
|
10872
|
+
}
|
|
10813
10873
|
}
|
|
10814
10874
|
}
|
|
10815
10875
|
return { ...data, ...params };
|
|
@@ -11938,11 +11998,11 @@ var AuthorityService = class {
|
|
|
11938
11998
|
};
|
|
11939
11999
|
|
|
11940
12000
|
// src/service/service/auth/v7-auth.service.ts
|
|
11941
|
-
import { CoreConst } from "@ibiz-template/core";
|
|
11942
|
-
import { clearCookie, getCookie, setCookie } from "qx-util";
|
|
12001
|
+
import { CoreConst as CoreConst2 } from "@ibiz-template/core";
|
|
12002
|
+
import { clearCookie, getCookie as getCookie2, setCookie } from "qx-util";
|
|
11943
12003
|
var V7AuthService = class {
|
|
11944
12004
|
get isAnonymous() {
|
|
11945
|
-
return
|
|
12005
|
+
return getCookie2(CoreConst2.IS_ANONYMOUS) === "1";
|
|
11946
12006
|
}
|
|
11947
12007
|
/**
|
|
11948
12008
|
* 使用匿名账号登录
|
|
@@ -11959,16 +12019,16 @@ var V7AuthService = class {
|
|
|
11959
12019
|
}
|
|
11960
12020
|
const result = await this.login(anonymousUser, anonymousPwd);
|
|
11961
12021
|
if (result) {
|
|
11962
|
-
setCookie(
|
|
11963
|
-
const token =
|
|
11964
|
-
const expirein =
|
|
11965
|
-
const remember =
|
|
11966
|
-
const refreshToken =
|
|
11967
|
-
setCookie(
|
|
11968
|
-
setCookie(
|
|
11969
|
-
setCookie(
|
|
12022
|
+
setCookie(CoreConst2.IS_ANONYMOUS, "1", 0, true);
|
|
12023
|
+
const token = getCookie2(CoreConst2.TOKEN);
|
|
12024
|
+
const expirein = getCookie2(CoreConst2.TOKEN_EXPIRES);
|
|
12025
|
+
const remember = getCookie2(CoreConst2.TOKEN_REMEMBER);
|
|
12026
|
+
const refreshToken = getCookie2(CoreConst2.REFRESH_TOKEN);
|
|
12027
|
+
setCookie(CoreConst2.TOKEN, token, 0, true);
|
|
12028
|
+
setCookie(CoreConst2.TOKEN_EXPIRES, expirein, 0, true);
|
|
12029
|
+
setCookie(CoreConst2.TOKEN_REMEMBER, remember, 0, true);
|
|
11970
12030
|
if (refreshToken) {
|
|
11971
|
-
setCookie(
|
|
12031
|
+
setCookie(CoreConst2.REFRESH_TOKEN, refreshToken, 0, true);
|
|
11972
12032
|
}
|
|
11973
12033
|
}
|
|
11974
12034
|
return result;
|
|
@@ -12001,20 +12061,20 @@ var V7AuthService = class {
|
|
|
12001
12061
|
if (data && data.token) {
|
|
12002
12062
|
const cacheDay = remember ? 30 : 0;
|
|
12003
12063
|
if (remember) {
|
|
12004
|
-
setCookie(
|
|
12064
|
+
setCookie(CoreConst2.TOKEN_REMEMBER, "1", cacheDay, true);
|
|
12005
12065
|
}
|
|
12006
|
-
setCookie(
|
|
12066
|
+
setCookie(CoreConst2.TOKEN, data.token, cacheDay, true);
|
|
12007
12067
|
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (data.expirein || 7199) * 1e3;
|
|
12008
|
-
setCookie(
|
|
12068
|
+
setCookie(CoreConst2.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay, true);
|
|
12009
12069
|
if (data.refresh_token) {
|
|
12010
12070
|
setCookie(
|
|
12011
|
-
|
|
12071
|
+
CoreConst2.REFRESH_TOKEN,
|
|
12012
12072
|
data.refresh_token,
|
|
12013
12073
|
cacheDay,
|
|
12014
12074
|
true
|
|
12015
12075
|
);
|
|
12016
12076
|
}
|
|
12017
|
-
clearCookie(
|
|
12077
|
+
clearCookie(CoreConst2.IS_ANONYMOUS);
|
|
12018
12078
|
}
|
|
12019
12079
|
return true;
|
|
12020
12080
|
} catch (err) {
|
|
@@ -12076,15 +12136,15 @@ var V7AuthService = class {
|
|
|
12076
12136
|
if (this.isAnonymous) {
|
|
12077
12137
|
return;
|
|
12078
12138
|
}
|
|
12079
|
-
const token =
|
|
12080
|
-
const expirein =
|
|
12139
|
+
const token = getCookie2(CoreConst2.TOKEN);
|
|
12140
|
+
const expirein = getCookie2(CoreConst2.TOKEN_EXPIRES);
|
|
12081
12141
|
if (token && expirein) {
|
|
12082
12142
|
let wait = Number(expirein) - (/* @__PURE__ */ new Date()).getTime();
|
|
12083
12143
|
const early = 5 * 60 * 1e3;
|
|
12084
12144
|
wait = wait > early ? wait - early : 0;
|
|
12085
12145
|
setTimeout(async () => {
|
|
12086
|
-
const remember =
|
|
12087
|
-
const refreshToken =
|
|
12146
|
+
const remember = getCookie2(CoreConst2.TOKEN_REMEMBER);
|
|
12147
|
+
const refreshToken = getCookie2(CoreConst2.REFRESH_TOKEN);
|
|
12088
12148
|
const cacheDay = remember ? 30 : 0;
|
|
12089
12149
|
let res;
|
|
12090
12150
|
if (refreshToken != null && refreshToken !== "") {
|
|
@@ -12094,14 +12154,14 @@ var V7AuthService = class {
|
|
|
12094
12154
|
}
|
|
12095
12155
|
if (res.ok) {
|
|
12096
12156
|
if (remember) {
|
|
12097
|
-
setCookie(
|
|
12157
|
+
setCookie(CoreConst2.TOKEN_REMEMBER, "1", cacheDay, true);
|
|
12098
12158
|
}
|
|
12099
|
-
setCookie(
|
|
12159
|
+
setCookie(CoreConst2.TOKEN, res.data.token, cacheDay, true);
|
|
12100
12160
|
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (res.data.expirein || 7199) * 1e3;
|
|
12101
|
-
setCookie(
|
|
12161
|
+
setCookie(CoreConst2.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay, true);
|
|
12102
12162
|
if (res.data.refresh_token) {
|
|
12103
12163
|
setCookie(
|
|
12104
|
-
|
|
12164
|
+
CoreConst2.REFRESH_TOKEN,
|
|
12105
12165
|
res.data.refresh_token,
|
|
12106
12166
|
cacheDay,
|
|
12107
12167
|
true
|
|
@@ -12124,27 +12184,27 @@ var V7AuthService = class {
|
|
|
12124
12184
|
* @return {*} {Promise<void>}
|
|
12125
12185
|
*/
|
|
12126
12186
|
async refreshToken() {
|
|
12127
|
-
const remember =
|
|
12128
|
-
const refreshToken =
|
|
12187
|
+
const remember = getCookie2(CoreConst2.TOKEN_REMEMBER);
|
|
12188
|
+
const refreshToken = getCookie2(CoreConst2.REFRESH_TOKEN);
|
|
12129
12189
|
if (refreshToken != null && refreshToken !== "") {
|
|
12130
12190
|
const res = await ibiz.net.get("/uaa/refresh_token/".concat(refreshToken));
|
|
12131
12191
|
if (res.ok) {
|
|
12132
12192
|
const cacheDay = remember ? 30 : 0;
|
|
12133
12193
|
if (remember) {
|
|
12134
|
-
setCookie(
|
|
12194
|
+
setCookie(CoreConst2.TOKEN_REMEMBER, "1", cacheDay, true);
|
|
12135
12195
|
}
|
|
12136
|
-
setCookie(
|
|
12196
|
+
setCookie(CoreConst2.TOKEN, res.data.token, cacheDay, true);
|
|
12137
12197
|
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (res.data.expirein || 7199) * 1e3;
|
|
12138
|
-
setCookie(
|
|
12198
|
+
setCookie(CoreConst2.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay, true);
|
|
12139
12199
|
if (res.data.refresh_token) {
|
|
12140
12200
|
setCookie(
|
|
12141
|
-
|
|
12201
|
+
CoreConst2.REFRESH_TOKEN,
|
|
12142
12202
|
res.data.refresh_token,
|
|
12143
12203
|
cacheDay,
|
|
12144
12204
|
true
|
|
12145
12205
|
);
|
|
12146
12206
|
}
|
|
12147
|
-
clearCookie(
|
|
12207
|
+
clearCookie(CoreConst2.IS_ANONYMOUS);
|
|
12148
12208
|
}
|
|
12149
12209
|
}
|
|
12150
12210
|
}
|
|
@@ -12156,8 +12216,8 @@ var V7AuthService = class {
|
|
|
12156
12216
|
* @return {*} {(IAuthInfo | undefined)}
|
|
12157
12217
|
*/
|
|
12158
12218
|
getAuthInfo() {
|
|
12159
|
-
const token =
|
|
12160
|
-
const isAnonymous = !!
|
|
12219
|
+
const token = getCookie2(CoreConst2.TOKEN);
|
|
12220
|
+
const isAnonymous = !!getCookie2(CoreConst2.IS_ANONYMOUS);
|
|
12161
12221
|
return token ? {
|
|
12162
12222
|
token,
|
|
12163
12223
|
isAnonymous
|
|
@@ -12184,11 +12244,11 @@ var V7AuthService = class {
|
|
|
12184
12244
|
* @protected
|
|
12185
12245
|
*/
|
|
12186
12246
|
clearAuthData() {
|
|
12187
|
-
clearCookie(
|
|
12188
|
-
clearCookie(
|
|
12189
|
-
clearCookie(
|
|
12190
|
-
clearCookie(
|
|
12191
|
-
clearCookie(
|
|
12247
|
+
clearCookie(CoreConst2.TOKEN);
|
|
12248
|
+
clearCookie(CoreConst2.TOKEN_EXPIRES);
|
|
12249
|
+
clearCookie(CoreConst2.TOKEN_REMEMBER);
|
|
12250
|
+
clearCookie(CoreConst2.REFRESH_TOKEN);
|
|
12251
|
+
clearCookie(CoreConst2.IS_ANONYMOUS);
|
|
12192
12252
|
ibiz.appData = void 0;
|
|
12193
12253
|
ibiz.orgData = void 0;
|
|
12194
12254
|
}
|
|
@@ -12284,7 +12344,7 @@ var MethodInput = class {
|
|
|
12284
12344
|
return data;
|
|
12285
12345
|
}
|
|
12286
12346
|
/**
|
|
12287
|
-
*
|
|
12347
|
+
* 格式化
|
|
12288
12348
|
*
|
|
12289
12349
|
* @author tony001
|
|
12290
12350
|
* @date 2024-05-21 23:05:38
|
|
@@ -12365,6 +12425,21 @@ var MethodReturn = class {
|
|
|
12365
12425
|
}
|
|
12366
12426
|
return new AppDataEntity(this.entity, data);
|
|
12367
12427
|
}
|
|
12428
|
+
/**
|
|
12429
|
+
* 格式化
|
|
12430
|
+
*
|
|
12431
|
+
* @author tony001
|
|
12432
|
+
* @date 2024-05-23 18:05:35
|
|
12433
|
+
* @param {IContext} context
|
|
12434
|
+
* @param {IData} data
|
|
12435
|
+
* @return {*} {Promise<IData>}
|
|
12436
|
+
*/
|
|
12437
|
+
async format(context, data) {
|
|
12438
|
+
if (this.dto) {
|
|
12439
|
+
return this.dto.format(context, data);
|
|
12440
|
+
}
|
|
12441
|
+
return data;
|
|
12442
|
+
}
|
|
12368
12443
|
};
|
|
12369
12444
|
|
|
12370
12445
|
// src/service/service/entity/method/method.ts
|
|
@@ -13068,6 +13143,9 @@ var FetchMethod = class extends Method {
|
|
|
13068
13143
|
);
|
|
13069
13144
|
}
|
|
13070
13145
|
const items = res.data || [];
|
|
13146
|
+
for (let i = 0; i < items.length; i++) {
|
|
13147
|
+
items[i] = await this.result.format(context, items[i]);
|
|
13148
|
+
}
|
|
13071
13149
|
res.data = items.map((item) => this.createEntity(item));
|
|
13072
13150
|
}
|
|
13073
13151
|
if (res.data) {
|
|
@@ -18916,6 +18994,158 @@ import {
|
|
|
18916
18994
|
RuntimeError as RuntimeError37,
|
|
18917
18995
|
RuntimeModelError as RuntimeModelError27
|
|
18918
18996
|
} from "@ibiz-template/core";
|
|
18997
|
+
|
|
18998
|
+
// src/controller/control/app-menu/custom-app-menu.controller.ts
|
|
18999
|
+
var CustomAppMenuController = class {
|
|
19000
|
+
/**
|
|
19001
|
+
* Creates an instance of CustomAppMenuController.
|
|
19002
|
+
* @author tony001
|
|
19003
|
+
* @date 2024-05-09 15:05:33
|
|
19004
|
+
* @param {IAppMenu} model
|
|
19005
|
+
* @param {AppMenuController} menu
|
|
19006
|
+
*/
|
|
19007
|
+
constructor(model, menu) {
|
|
19008
|
+
this.model = model;
|
|
19009
|
+
this.menu = menu;
|
|
19010
|
+
/**
|
|
19011
|
+
*自定义定制范围类型(public:公开,personal:个人,data:数据,默认是按照个人区分,配置了应用功能组件才生效)
|
|
19012
|
+
*
|
|
19013
|
+
* @author tony001
|
|
19014
|
+
* @date 2024-05-09 17:05:43
|
|
19015
|
+
* @type {('public' | 'personal' | 'data')}
|
|
19016
|
+
*/
|
|
19017
|
+
this.type = "personal";
|
|
19018
|
+
/**
|
|
19019
|
+
*所属数据类型(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
19020
|
+
*
|
|
19021
|
+
* @author tony001
|
|
19022
|
+
* @date 2024-05-09 17:05:55
|
|
19023
|
+
* @type {string}
|
|
19024
|
+
*/
|
|
19025
|
+
this.ownerType = "";
|
|
19026
|
+
/**
|
|
19027
|
+
*所属数据标识(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
19028
|
+
*
|
|
19029
|
+
* @author tony001
|
|
19030
|
+
* @date 2024-05-09 17:05:10
|
|
19031
|
+
* @type {string}
|
|
19032
|
+
*/
|
|
19033
|
+
this.ownerId = "";
|
|
19034
|
+
this.context = menu.context;
|
|
19035
|
+
this.params = menu.params;
|
|
19036
|
+
this.init();
|
|
19037
|
+
}
|
|
19038
|
+
/**
|
|
19039
|
+
* 初始化
|
|
19040
|
+
*
|
|
19041
|
+
* @author tony001
|
|
19042
|
+
* @date 2024-05-09 15:05:40
|
|
19043
|
+
* @private
|
|
19044
|
+
*/
|
|
19045
|
+
init() {
|
|
19046
|
+
var _a;
|
|
19047
|
+
this.type = "personal";
|
|
19048
|
+
this.ownerId = this.context.srfpersonid;
|
|
19049
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
19050
|
+
const menuUtil = app.getAppUtil("DYNAMENU", "CUSTOM");
|
|
19051
|
+
if (menuUtil) {
|
|
19052
|
+
this.util = new UtilService(menuUtil);
|
|
19053
|
+
} else {
|
|
19054
|
+
this.config = new ConfigService(
|
|
19055
|
+
this.model.appId,
|
|
19056
|
+
"menu",
|
|
19057
|
+
"menu_".concat(this.menu.view.name.toLowerCase(), "_").concat((_a = this.model.codeName) == null ? void 0 : _a.toLowerCase())
|
|
19058
|
+
);
|
|
19059
|
+
}
|
|
19060
|
+
}
|
|
19061
|
+
/**
|
|
19062
|
+
* 获取资源标识(仅用于功能组件服务)
|
|
19063
|
+
*
|
|
19064
|
+
* @author tony001
|
|
19065
|
+
* @date 2024-05-09 16:05:48
|
|
19066
|
+
* @private
|
|
19067
|
+
* @return {*} {string}
|
|
19068
|
+
*/
|
|
19069
|
+
getResourceTag() {
|
|
19070
|
+
var _a;
|
|
19071
|
+
const base = "".concat(this.context.srfappid, "_menu_").concat(this.menu.view.name.toLowerCase(), "_").concat((_a = this.model.codeName) == null ? void 0 : _a.toLowerCase());
|
|
19072
|
+
switch (this.type) {
|
|
19073
|
+
case "personal":
|
|
19074
|
+
return "".concat(base, "_").concat(this.context.srfpersonid);
|
|
19075
|
+
case "data":
|
|
19076
|
+
return "".concat(base, "_").concat(this.ownerType, "_").concat(this.ownerId);
|
|
19077
|
+
default:
|
|
19078
|
+
return base;
|
|
19079
|
+
}
|
|
19080
|
+
}
|
|
19081
|
+
/**
|
|
19082
|
+
* 加载自定义模型
|
|
19083
|
+
*
|
|
19084
|
+
* @author tony001
|
|
19085
|
+
* @date 2024-05-09 17:05:57
|
|
19086
|
+
* @return {*} {Promise<IData>}
|
|
19087
|
+
*/
|
|
19088
|
+
async loadCustomModelData() {
|
|
19089
|
+
let res;
|
|
19090
|
+
if (this.util) {
|
|
19091
|
+
res = await this.util.load(
|
|
19092
|
+
this.getResourceTag(),
|
|
19093
|
+
this.context,
|
|
19094
|
+
this.params
|
|
19095
|
+
);
|
|
19096
|
+
} else {
|
|
19097
|
+
res = await this.config.load();
|
|
19098
|
+
}
|
|
19099
|
+
if (res && res.model) {
|
|
19100
|
+
const result = JSON.parse(res.model);
|
|
19101
|
+
return result;
|
|
19102
|
+
}
|
|
19103
|
+
return [];
|
|
19104
|
+
}
|
|
19105
|
+
/**
|
|
19106
|
+
* 重置自定义模型
|
|
19107
|
+
*
|
|
19108
|
+
* @author tony001
|
|
19109
|
+
* @date 2024-05-09 17:05:14
|
|
19110
|
+
* @return {*} {Promise<IData>}
|
|
19111
|
+
*/
|
|
19112
|
+
async resetCustomModelData() {
|
|
19113
|
+
return this.saveCustomModelData([]);
|
|
19114
|
+
}
|
|
19115
|
+
/**
|
|
19116
|
+
* 保存自定义模型
|
|
19117
|
+
*
|
|
19118
|
+
* @author tony001
|
|
19119
|
+
* @date 2024-05-09 17:05:51
|
|
19120
|
+
* @param {IData[]} model
|
|
19121
|
+
* @param {IData} [opts={}]
|
|
19122
|
+
* @return {*} {Promise<IData>}
|
|
19123
|
+
*/
|
|
19124
|
+
async saveCustomModelData(model, opts = {}) {
|
|
19125
|
+
const data = {
|
|
19126
|
+
model: JSON.stringify(model)
|
|
19127
|
+
};
|
|
19128
|
+
if (this.util) {
|
|
19129
|
+
await this.util.save(
|
|
19130
|
+
this.getResourceTag(),
|
|
19131
|
+
this.context,
|
|
19132
|
+
{
|
|
19133
|
+
...this.params,
|
|
19134
|
+
type: this.type,
|
|
19135
|
+
ownerType: this.ownerType,
|
|
19136
|
+
ownerId: this.ownerId,
|
|
19137
|
+
modelId: this.model.id
|
|
19138
|
+
},
|
|
19139
|
+
data
|
|
19140
|
+
);
|
|
19141
|
+
} else {
|
|
19142
|
+
await this.config.save(data);
|
|
19143
|
+
}
|
|
19144
|
+
return model;
|
|
19145
|
+
}
|
|
19146
|
+
};
|
|
19147
|
+
|
|
19148
|
+
// src/controller/control/app-menu/app-menu.controller.ts
|
|
18919
19149
|
var AppMenuController = class extends ControlController {
|
|
18920
19150
|
constructor(model, context, params, ctx) {
|
|
18921
19151
|
super(model, context, params, ctx);
|
|
@@ -18926,7 +19156,24 @@ var AppMenuController = class extends ControlController {
|
|
|
18926
19156
|
* @type {{ [key: string]: IProvider }}
|
|
18927
19157
|
*/
|
|
18928
19158
|
this.itemProviders = {};
|
|
19159
|
+
/**
|
|
19160
|
+
* 自定义菜单控制器
|
|
19161
|
+
*
|
|
19162
|
+
* @type {(CustomAppMenuController | null)}
|
|
19163
|
+
* @memberof AppMenuController
|
|
19164
|
+
*/
|
|
19165
|
+
this.customController = null;
|
|
19166
|
+
/**
|
|
19167
|
+
* 自定义配置
|
|
19168
|
+
*
|
|
19169
|
+
* @type {IData[]}
|
|
19170
|
+
* @memberof AppMenuController
|
|
19171
|
+
*/
|
|
19172
|
+
this.saveConfigs = [];
|
|
18929
19173
|
this.flattenAllItems();
|
|
19174
|
+
if (model.enableCustomized) {
|
|
19175
|
+
this.customController = new CustomAppMenuController(model, this);
|
|
19176
|
+
}
|
|
18930
19177
|
}
|
|
18931
19178
|
initState() {
|
|
18932
19179
|
super.initState();
|
|
@@ -18950,6 +19197,24 @@ var AppMenuController = class extends ControlController {
|
|
|
18950
19197
|
(_a = this.model.appMenuItems) == null ? void 0 : _a.forEach((item) => {
|
|
18951
19198
|
this.initMenuItemState(item);
|
|
18952
19199
|
});
|
|
19200
|
+
if (this.customController) {
|
|
19201
|
+
await this.loadCustomMenusModel();
|
|
19202
|
+
}
|
|
19203
|
+
}
|
|
19204
|
+
/**
|
|
19205
|
+
* 加载自定义菜单模型
|
|
19206
|
+
*
|
|
19207
|
+
* @private
|
|
19208
|
+
* @return {*} {Promise<void>}
|
|
19209
|
+
* @memberof AppMenuController
|
|
19210
|
+
*/
|
|
19211
|
+
async loadCustomMenusModel() {
|
|
19212
|
+
const customConfigs = await this.customController.loadCustomModelData();
|
|
19213
|
+
if (!customConfigs || customConfigs.length === 0) {
|
|
19214
|
+
this.saveConfigs = [];
|
|
19215
|
+
} else {
|
|
19216
|
+
this.saveConfigs = customConfigs;
|
|
19217
|
+
}
|
|
18953
19218
|
}
|
|
18954
19219
|
/**
|
|
18955
19220
|
* 初始化菜单项的适配器
|
|
@@ -19114,149 +19379,6 @@ var AppMenuController = class extends ControlController {
|
|
|
19114
19379
|
}
|
|
19115
19380
|
};
|
|
19116
19381
|
|
|
19117
|
-
// src/controller/control/app-menu/custom-app-menu.controller.ts
|
|
19118
|
-
var CustomAppMenuController = class {
|
|
19119
|
-
/**
|
|
19120
|
-
* Creates an instance of CustomAppMenuController.
|
|
19121
|
-
* @author tony001
|
|
19122
|
-
* @date 2024-05-09 15:05:33
|
|
19123
|
-
* @param {IAppMenu} model
|
|
19124
|
-
* @param {AppMenuController} menu
|
|
19125
|
-
*/
|
|
19126
|
-
constructor(model, menu) {
|
|
19127
|
-
this.model = model;
|
|
19128
|
-
this.menu = menu;
|
|
19129
|
-
/**
|
|
19130
|
-
*自定义定制范围类型(public:公开,personal:个人,data:数据,默认是按照个人区分,配置了应用功能组件才生效)
|
|
19131
|
-
*
|
|
19132
|
-
* @author tony001
|
|
19133
|
-
* @date 2024-05-09 17:05:43
|
|
19134
|
-
* @type {('public' | 'personal' | 'data')}
|
|
19135
|
-
*/
|
|
19136
|
-
this.type = "personal";
|
|
19137
|
-
/**
|
|
19138
|
-
*所属数据类型(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
19139
|
-
*
|
|
19140
|
-
* @author tony001
|
|
19141
|
-
* @date 2024-05-09 17:05:55
|
|
19142
|
-
* @type {string}
|
|
19143
|
-
*/
|
|
19144
|
-
this.ownerType = "";
|
|
19145
|
-
/**
|
|
19146
|
-
*所属数据标识(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
19147
|
-
*
|
|
19148
|
-
* @author tony001
|
|
19149
|
-
* @date 2024-05-09 17:05:10
|
|
19150
|
-
* @type {string}
|
|
19151
|
-
*/
|
|
19152
|
-
this.ownerId = "";
|
|
19153
|
-
this.context = menu.context;
|
|
19154
|
-
this.params = menu.params;
|
|
19155
|
-
this.init();
|
|
19156
|
-
}
|
|
19157
|
-
/**
|
|
19158
|
-
* 初始化
|
|
19159
|
-
*
|
|
19160
|
-
* @author tony001
|
|
19161
|
-
* @date 2024-05-09 15:05:40
|
|
19162
|
-
* @private
|
|
19163
|
-
*/
|
|
19164
|
-
init() {
|
|
19165
|
-
var _a;
|
|
19166
|
-
this.type = "personal";
|
|
19167
|
-
this.ownerId = this.context.srfpersonid;
|
|
19168
|
-
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
19169
|
-
const menuUtil = app.getAppUtil("DYNAMENU", "CUSTOM");
|
|
19170
|
-
if (menuUtil) {
|
|
19171
|
-
this.util = new UtilService(menuUtil);
|
|
19172
|
-
} else {
|
|
19173
|
-
this.config = new ConfigService(
|
|
19174
|
-
this.model.appId,
|
|
19175
|
-
"menu",
|
|
19176
|
-
"menu_".concat(this.menu.view.name.toLowerCase(), "_").concat((_a = this.model.codeName) == null ? void 0 : _a.toLowerCase())
|
|
19177
|
-
);
|
|
19178
|
-
}
|
|
19179
|
-
}
|
|
19180
|
-
/**
|
|
19181
|
-
* 获取资源标识(仅用于功能组件服务)
|
|
19182
|
-
*
|
|
19183
|
-
* @author tony001
|
|
19184
|
-
* @date 2024-05-09 16:05:48
|
|
19185
|
-
* @private
|
|
19186
|
-
* @return {*} {string}
|
|
19187
|
-
*/
|
|
19188
|
-
getResourceTag() {
|
|
19189
|
-
var _a;
|
|
19190
|
-
const base = "".concat(this.context.srfappid, "_menu_").concat(this.menu.view.name.toLowerCase(), "_").concat((_a = this.model.codeName) == null ? void 0 : _a.toLowerCase());
|
|
19191
|
-
switch (this.type) {
|
|
19192
|
-
case "personal":
|
|
19193
|
-
return "".concat(base, "_").concat(this.context.srfpersonid);
|
|
19194
|
-
case "data":
|
|
19195
|
-
return "".concat(base, "_").concat(this.ownerType, "_").concat(this.ownerId);
|
|
19196
|
-
default:
|
|
19197
|
-
return base;
|
|
19198
|
-
}
|
|
19199
|
-
}
|
|
19200
|
-
/**
|
|
19201
|
-
* 加载自定义模型
|
|
19202
|
-
*
|
|
19203
|
-
* @author tony001
|
|
19204
|
-
* @date 2024-05-09 17:05:57
|
|
19205
|
-
* @return {*} {Promise<IData>}
|
|
19206
|
-
*/
|
|
19207
|
-
async loadCustomModelData() {
|
|
19208
|
-
let res;
|
|
19209
|
-
if (this.util) {
|
|
19210
|
-
res = await this.util.load(
|
|
19211
|
-
this.getResourceTag(),
|
|
19212
|
-
this.context,
|
|
19213
|
-
this.params
|
|
19214
|
-
);
|
|
19215
|
-
} else {
|
|
19216
|
-
res = await this.config.load();
|
|
19217
|
-
}
|
|
19218
|
-
return res;
|
|
19219
|
-
}
|
|
19220
|
-
/**
|
|
19221
|
-
* 重置自定义模型
|
|
19222
|
-
*
|
|
19223
|
-
* @author tony001
|
|
19224
|
-
* @date 2024-05-09 17:05:14
|
|
19225
|
-
* @return {*} {Promise<IData>}
|
|
19226
|
-
*/
|
|
19227
|
-
async resetCustomModelData() {
|
|
19228
|
-
return {};
|
|
19229
|
-
}
|
|
19230
|
-
/**
|
|
19231
|
-
* 保存自定义模型
|
|
19232
|
-
*
|
|
19233
|
-
* @author tony001
|
|
19234
|
-
* @date 2024-05-09 17:05:51
|
|
19235
|
-
* @param {IData[]} model
|
|
19236
|
-
* @param {IData} [opts={}]
|
|
19237
|
-
* @return {*} {Promise<IData>}
|
|
19238
|
-
*/
|
|
19239
|
-
async saveCustomModelData(model, opts = {}) {
|
|
19240
|
-
if (this.util) {
|
|
19241
|
-
await this.util.save(
|
|
19242
|
-
this.getResourceTag(),
|
|
19243
|
-
this.context,
|
|
19244
|
-
{
|
|
19245
|
-
...this.params,
|
|
19246
|
-
type: this.type,
|
|
19247
|
-
ownerType: this.ownerType,
|
|
19248
|
-
ownerId: this.ownerId,
|
|
19249
|
-
modelId: this.model.id
|
|
19250
|
-
},
|
|
19251
|
-
model
|
|
19252
|
-
);
|
|
19253
|
-
} else {
|
|
19254
|
-
await this.config.save(model);
|
|
19255
|
-
}
|
|
19256
|
-
return model;
|
|
19257
|
-
}
|
|
19258
|
-
};
|
|
19259
|
-
|
|
19260
19382
|
// src/controller/control/app-menu-icon-view/app-menu-icon-view.controller.ts
|
|
19261
19383
|
import {
|
|
19262
19384
|
findRecursiveChild as findRecursiveChild2,
|
|
@@ -19796,9 +19918,11 @@ var BaseSeriesGenerator = class {
|
|
|
19796
19918
|
prepareChartData(groupData, deData, catalog, group) {
|
|
19797
19919
|
var _a;
|
|
19798
19920
|
if (this.groupField) {
|
|
19921
|
+
deData["".concat(this.groupField, "_value")] = deData[this.groupField];
|
|
19799
19922
|
Object.assign(deData, { [this.groupField]: group });
|
|
19800
19923
|
}
|
|
19801
19924
|
if (this.catalogField) {
|
|
19925
|
+
deData["".concat(this.catalogField, "_value")] = deData[this.catalogField];
|
|
19802
19926
|
Object.assign(deData, { [this.catalogField]: catalog });
|
|
19803
19927
|
}
|
|
19804
19928
|
const tempChartData = new ChartData(deData, this.model, catalog, group);
|
|
@@ -24743,7 +24867,11 @@ var DataViewControlController = class extends MDControlController {
|
|
|
24743
24867
|
containerState.addState(detail.id, buttonState);
|
|
24744
24868
|
}
|
|
24745
24869
|
});
|
|
24746
|
-
await containerState.update(
|
|
24870
|
+
await containerState.update(
|
|
24871
|
+
this.context,
|
|
24872
|
+
void 0,
|
|
24873
|
+
this.model.appDataEntityId
|
|
24874
|
+
);
|
|
24747
24875
|
group.groupActionGroupState = containerState;
|
|
24748
24876
|
});
|
|
24749
24877
|
}
|
|
@@ -35274,10 +35402,11 @@ var TreeController = class extends MDControlController {
|
|
|
35274
35402
|
var _a, _b;
|
|
35275
35403
|
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
35276
35404
|
if (type === "inner") {
|
|
35405
|
+
const nodeModel = this.getNodeModel(dropNode._nodeId);
|
|
35277
35406
|
return !!this.findDropNodeRS(
|
|
35278
35407
|
dropNode._nodeId,
|
|
35279
35408
|
draggingNodeModel.appDataEntityId
|
|
35280
|
-
);
|
|
35409
|
+
) && !!(nodeModel == null ? void 0 : nodeModel.allowDrop);
|
|
35281
35410
|
}
|
|
35282
35411
|
if (((_a = draggingNode._parent) == null ? void 0 : _a._id) === ((_b = dropNode._parent) == null ? void 0 : _b._id)) {
|
|
35283
35412
|
const currentNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
@@ -36348,6 +36477,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
36348
36477
|
this.state.updating = false;
|
|
36349
36478
|
this.state.batching = false;
|
|
36350
36479
|
this.state.selectGroupKey = "";
|
|
36480
|
+
this.state.readonly = !!(this.context.srfreadonly === true || this.context.srfreadonly === "true");
|
|
36351
36481
|
this.state.draggable = this.enableEditOrder || this.enableEditGroup;
|
|
36352
36482
|
this.state.uaState = {};
|
|
36353
36483
|
}
|
|
@@ -36902,6 +37032,28 @@ var TreeGridExRowState = class {
|
|
|
36902
37032
|
editable: ibiz.config.grid.editShowMode === "all",
|
|
36903
37033
|
required: false
|
|
36904
37034
|
};
|
|
37035
|
+
let $readonly;
|
|
37036
|
+
Object.defineProperty(
|
|
37037
|
+
this.editColStates[fieldColumn.name],
|
|
37038
|
+
"readonly",
|
|
37039
|
+
{
|
|
37040
|
+
enumerable: true,
|
|
37041
|
+
configurable: true,
|
|
37042
|
+
get() {
|
|
37043
|
+
if ($readonly !== void 0) {
|
|
37044
|
+
return $readonly;
|
|
37045
|
+
}
|
|
37046
|
+
if (treeGrid.context) {
|
|
37047
|
+
return !!(treeGrid.context.srfreadonly === true || treeGrid.context.srfreadonly === "true");
|
|
37048
|
+
}
|
|
37049
|
+
return false;
|
|
37050
|
+
},
|
|
37051
|
+
set(val) {
|
|
37052
|
+
$readonly = val;
|
|
37053
|
+
return true;
|
|
37054
|
+
}
|
|
37055
|
+
}
|
|
37056
|
+
);
|
|
36905
37057
|
});
|
|
36906
37058
|
}
|
|
36907
37059
|
}
|
|
@@ -39078,9 +39230,6 @@ var GanttService = class extends TreeService {
|
|
|
39078
39230
|
|
|
39079
39231
|
// src/controller/control/gantt/gantt.controller.ts
|
|
39080
39232
|
var GanttController = class extends TreeGridExController {
|
|
39081
|
-
get _evt() {
|
|
39082
|
-
return this.evt;
|
|
39083
|
-
}
|
|
39084
39233
|
/**
|
|
39085
39234
|
* 初始化状态
|
|
39086
39235
|
*
|
|
@@ -39157,7 +39306,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39157
39306
|
if (item._nodeType === "DE") {
|
|
39158
39307
|
await this.onNodeDataActive(nodeParams);
|
|
39159
39308
|
}
|
|
39160
|
-
return this.
|
|
39309
|
+
return this.evt.emit("onActive", { ...nodeParams, nodeData: item });
|
|
39161
39310
|
}
|
|
39162
39311
|
/**
|
|
39163
39312
|
* 节点数据激活
|
|
@@ -39187,12 +39336,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39187
39336
|
});
|
|
39188
39337
|
const children = this.model.rootVisible ? nodes : nodes[0]._children;
|
|
39189
39338
|
if (children) {
|
|
39190
|
-
|
|
39191
|
-
if (state) {
|
|
39192
|
-
this._evt.emit("onDefaultExpand", {
|
|
39193
|
-
nodes: children
|
|
39194
|
-
});
|
|
39195
|
-
}
|
|
39339
|
+
await this.handleDefaultExpandNodes(children);
|
|
39196
39340
|
}
|
|
39197
39341
|
},
|
|
39198
39342
|
{
|
|
@@ -39228,34 +39372,30 @@ var GanttController = class extends TreeGridExController {
|
|
|
39228
39372
|
}
|
|
39229
39373
|
const targetNode = refreshParent ? currentNode._parent : currentNode;
|
|
39230
39374
|
const nodes = await this.loadNodes(targetNode);
|
|
39231
|
-
|
|
39232
|
-
|
|
39233
|
-
this._evt.emit("onDefaultExpand", {
|
|
39234
|
-
nodes
|
|
39235
|
-
});
|
|
39236
|
-
}
|
|
39237
|
-
this._evt.emit("onAfterRefreshParent", {
|
|
39375
|
+
await this.handleDefaultExpandNodes(nodes);
|
|
39376
|
+
this.evt.emit("onAfterRefreshParent", {
|
|
39238
39377
|
parentNode: targetNode,
|
|
39239
39378
|
children: nodes
|
|
39240
39379
|
});
|
|
39241
39380
|
}
|
|
39242
39381
|
/**
|
|
39243
|
-
*
|
|
39382
|
+
* 处理默认展开
|
|
39244
39383
|
*
|
|
39245
39384
|
* @param {ITreeNodeData[]} data 子节点数据
|
|
39246
39385
|
* @return {*} {Promise<void>}
|
|
39247
39386
|
*/
|
|
39248
39387
|
async handleDefaultExpandNodes(data) {
|
|
39249
|
-
let state = false;
|
|
39250
39388
|
for (let i = 0; i < data.length; i++) {
|
|
39251
39389
|
const nodeData = data[i];
|
|
39252
39390
|
if (this.state.expandedKeys.includes(nodeData._id)) {
|
|
39253
|
-
|
|
39254
|
-
const
|
|
39391
|
+
const key = nodeData.srfkey ? "srfkey" : "_id";
|
|
39392
|
+
const currentNode = this.state.items.find(
|
|
39393
|
+
(item) => item[key] === nodeData[key]
|
|
39394
|
+
);
|
|
39395
|
+
const nodes = await this.loadNodes(currentNode);
|
|
39255
39396
|
await this.handleDefaultExpandNodes(nodes);
|
|
39256
39397
|
}
|
|
39257
39398
|
}
|
|
39258
|
-
return state;
|
|
39259
39399
|
}
|
|
39260
39400
|
/**
|
|
39261
39401
|
* 打开编辑数据视图
|
|
@@ -39398,7 +39538,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39398
39538
|
nodeData._deData
|
|
39399
39539
|
);
|
|
39400
39540
|
} catch (error) {
|
|
39401
|
-
await this.
|
|
39541
|
+
await this.evt.emit("onSaveError", void 0);
|
|
39402
39542
|
this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
|
|
39403
39543
|
error,
|
|
39404
39544
|
data: rowState.data
|
|
@@ -39408,7 +39548,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39408
39548
|
rowState.data._deData = res.data;
|
|
39409
39549
|
rowState.modified = false;
|
|
39410
39550
|
this.gridStateNotify(rowState, "SAVE" /* SAVE */);
|
|
39411
|
-
await this.
|
|
39551
|
+
await this.evt.emit("onSaveSuccess", void 0);
|
|
39412
39552
|
}
|
|
39413
39553
|
/**
|
|
39414
39554
|
* 删除
|
|
@@ -39435,7 +39575,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39435
39575
|
return;
|
|
39436
39576
|
}
|
|
39437
39577
|
}
|
|
39438
|
-
await this.
|
|
39578
|
+
await this.evt.emit("onBeforeRemove", void 0);
|
|
39439
39579
|
await this.startLoading();
|
|
39440
39580
|
let needRefresh = false;
|
|
39441
39581
|
let refreshNode;
|
|
@@ -39480,7 +39620,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39480
39620
|
await this.refreshNodeChildren(refreshNode);
|
|
39481
39621
|
}
|
|
39482
39622
|
} catch (error) {
|
|
39483
|
-
await this.
|
|
39623
|
+
await this.evt.emit("onRemoveError", void 0);
|
|
39484
39624
|
this.actionNotification("REMOVEERROR", {
|
|
39485
39625
|
error,
|
|
39486
39626
|
data
|
|
@@ -39490,7 +39630,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39490
39630
|
await this.endLoading();
|
|
39491
39631
|
}
|
|
39492
39632
|
this.state.selectedData = [];
|
|
39493
|
-
await this.
|
|
39633
|
+
await this.evt.emit("onRemoveSuccess", void 0);
|
|
39494
39634
|
}
|
|
39495
39635
|
/**
|
|
39496
39636
|
* 后台删除结束后界面删除逻辑
|
|
@@ -39598,11 +39738,88 @@ var GanttController = class extends TreeGridExController {
|
|
|
39598
39738
|
if (editShowMode === "row") {
|
|
39599
39739
|
this.switchRowEdit(rowState, true);
|
|
39600
39740
|
}
|
|
39601
|
-
this.
|
|
39741
|
+
this.evt.emit("onNewRow", { row: parentRow });
|
|
39602
39742
|
this.actionNotification("GETDRAFTSUCCESS", { data: draftData });
|
|
39603
39743
|
}
|
|
39604
39744
|
}
|
|
39605
39745
|
}
|
|
39746
|
+
/**
|
|
39747
|
+
* 处理节点拖入事件
|
|
39748
|
+
*
|
|
39749
|
+
* @param {IGanttNodeData} draggingNode 拖动节点
|
|
39750
|
+
* @param {IGanttNodeData} dropNode 目标节点
|
|
39751
|
+
* @param {('inner' | 'prev' | 'next')} dropType 拖放类型
|
|
39752
|
+
* @return {*} {Promise<void>}
|
|
39753
|
+
* @memberof GanttController
|
|
39754
|
+
*/
|
|
39755
|
+
async onNodeDrop(draggingNode, dropNode, dropType) {
|
|
39756
|
+
var _a, _b;
|
|
39757
|
+
if (dropType === "inner" && !dropNode._leaf && dropNode._children === void 0) {
|
|
39758
|
+
await this.expandNodeByKey([dropNode._id]);
|
|
39759
|
+
}
|
|
39760
|
+
const modifiedNodeDatas = [];
|
|
39761
|
+
const draggingNodeModel = this.getNodeModel(draggingNode._nodeId);
|
|
39762
|
+
const dropInNode = dropType === "inner" ? dropNode : dropNode._parent;
|
|
39763
|
+
let orderNodeModel = this.getNodeModel(dropNode._nodeId);
|
|
39764
|
+
if (dropType === "inner" || ((_a = dropNode._parent) == null ? void 0 : _a._id) !== ((_b = draggingNode._parent) == null ? void 0 : _b._id)) {
|
|
39765
|
+
const dropNodeRs = this.findDropNodeRS(
|
|
39766
|
+
dropInNode._nodeId,
|
|
39767
|
+
draggingNodeModel.appDataEntityId
|
|
39768
|
+
);
|
|
39769
|
+
if (dropNodeRs) {
|
|
39770
|
+
draggingNode._deData[dropNodeRs.pickupDEFName] = dropInNode._value;
|
|
39771
|
+
modifiedNodeDatas.push(draggingNode);
|
|
39772
|
+
orderNodeModel = this.getNodeModel(dropNodeRs.childDETreeNodeId);
|
|
39773
|
+
}
|
|
39774
|
+
draggingNode._parent = dropInNode;
|
|
39775
|
+
draggingNode._nodeId = orderNodeModel.id;
|
|
39776
|
+
}
|
|
39777
|
+
const { sortAppDEFieldId, sortDir, allowOrder } = orderNodeModel;
|
|
39778
|
+
if (allowOrder === true) {
|
|
39779
|
+
if (!sortAppDEFieldId) {
|
|
39780
|
+
throw new RuntimeModelError72(
|
|
39781
|
+
orderNodeModel,
|
|
39782
|
+
ibiz.i18n.t("runtime.controller.control.tree.sortAttribute")
|
|
39783
|
+
);
|
|
39784
|
+
}
|
|
39785
|
+
const sortField = sortAppDEFieldId.toLowerCase();
|
|
39786
|
+
const isAsc = sortDir === "ASC";
|
|
39787
|
+
const changedArr = dropInNode._children;
|
|
39788
|
+
if (!isAsc) {
|
|
39789
|
+
changedArr.reverse();
|
|
39790
|
+
}
|
|
39791
|
+
const getNextSort = (num) => {
|
|
39792
|
+
return num + (100 - num % 100);
|
|
39793
|
+
};
|
|
39794
|
+
const getSort = (deData) => {
|
|
39795
|
+
return deData[sortField] || 0;
|
|
39796
|
+
};
|
|
39797
|
+
let lastSort;
|
|
39798
|
+
changedArr.forEach((item, index) => {
|
|
39799
|
+
const deData = item._deData;
|
|
39800
|
+
if (lastSort === void 0) {
|
|
39801
|
+
if (item === draggingNode) {
|
|
39802
|
+
if (index === 0) {
|
|
39803
|
+
lastSort = 100;
|
|
39804
|
+
} else {
|
|
39805
|
+
lastSort = getNextSort(getSort(changedArr[index - 1]._deData));
|
|
39806
|
+
}
|
|
39807
|
+
deData[sortField] = lastSort;
|
|
39808
|
+
if (modifiedNodeDatas.indexOf(item) === -1) {
|
|
39809
|
+
modifiedNodeDatas.push(item);
|
|
39810
|
+
}
|
|
39811
|
+
}
|
|
39812
|
+
} else {
|
|
39813
|
+
if (lastSort >= getSort(deData)) {
|
|
39814
|
+
deData[sortField] = getNextSort(lastSort);
|
|
39815
|
+
modifiedNodeDatas.push(item);
|
|
39816
|
+
}
|
|
39817
|
+
lastSort = getSort(deData);
|
|
39818
|
+
}
|
|
39819
|
+
});
|
|
39820
|
+
}
|
|
39821
|
+
await this.updateDeNodeData(modifiedNodeDatas);
|
|
39822
|
+
}
|
|
39606
39823
|
onDEDataChange(msg) {
|
|
39607
39824
|
}
|
|
39608
39825
|
};
|