@ibiz-template/runtime 0.7.12 → 0.7.13
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 +317 -51
- package/dist/index.system.min.js +1 -1
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +8 -1
- package/out/controller/common/index.d.ts +1 -0
- package/out/controller/common/index.d.ts.map +1 -1
- package/out/controller/common/index.js +1 -0
- package/out/controller/common/view/app-login-view.controller.d.ts +54 -0
- package/out/controller/common/view/app-login-view.controller.d.ts.map +1 -0
- package/out/controller/common/view/app-login-view.controller.js +62 -0
- package/out/controller/hub.controller.d.ts +73 -2
- package/out/controller/hub.controller.d.ts.map +1 -1
- package/out/controller/hub.controller.js +88 -12
- package/out/controller/notification/internal-message.controller.js +1 -1
- package/out/engine/view-base.engine.d.ts +8 -1
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +14 -3
- package/out/interface/controller/app.d.ts +55 -7
- package/out/interface/controller/app.d.ts.map +1 -1
- package/out/interface/controller/controller/view/i-app-login-view.controller.d.ts +40 -0
- package/out/interface/controller/controller/view/i-app-login-view.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/view/i-app-login-view.controller.js +1 -0
- package/out/interface/controller/controller/view/index.d.ts +1 -0
- package/out/interface/controller/controller/view/index.d.ts.map +1 -1
- package/out/interface/service/service/i-auth.service.d.ts +11 -0
- package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
- package/out/interface/util/i-app-util/i-app-util.d.ts +77 -0
- package/out/interface/util/i-app-util/i-app-util.d.ts.map +1 -0
- package/out/interface/util/i-app-util/i-app-util.js +1 -0
- package/out/interface/util/i-short-cut/i-short-cut.d.ts +11 -3
- package/out/interface/util/i-short-cut/i-short-cut.d.ts.map +1 -1
- package/out/interface/util/index.d.ts +1 -0
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.d.ts +64 -0
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +85 -7
- package/out/service/service/authority/authority.service.d.ts.map +1 -1
- package/out/service/service/authority/authority.service.js +5 -3
- package/out/service/service/internal-message/internal-message.service.js +2 -2
- package/out/types.d.ts +9 -1
- package/out/types.d.ts.map +1 -1
- package/out/ui-action/provider/loginout-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/loginout-ui-action-provider.js +1 -4
- package/out/utils/file-util/file-util.d.ts +1 -1
- package/out/utils/file-util/file-util.d.ts.map +1 -1
- package/out/utils/file-util/file-util.js +14 -1
- 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/short-cut/short-cut-util.d.ts +24 -0
- package/out/utils/short-cut/short-cut-util.d.ts.map +1 -1
- package/out/utils/short-cut/short-cut-util.js +27 -0
- package/package.json +1 -1
- package/out/utils/short-cut/index.d.ts +0 -2
- package/out/utils/short-cut/index.d.ts.map +0 -1
- package/out/utils/short-cut/index.js +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -5135,6 +5135,7 @@ var FileUtil = class {
|
|
|
5135
5135
|
* @memberof FileUtil
|
|
5136
5136
|
*/
|
|
5137
5137
|
async fileDownload(url, name) {
|
|
5138
|
+
var _a;
|
|
5138
5139
|
const response = await ibiz.net.request(url, {
|
|
5139
5140
|
method: "get",
|
|
5140
5141
|
responseType: "blob",
|
|
@@ -5147,7 +5148,17 @@ var FileUtil = class {
|
|
|
5147
5148
|
if (!response.data) {
|
|
5148
5149
|
throw new RuntimeError5(ibiz.i18n.t("runtime.platform.fileStreamData"));
|
|
5149
5150
|
} else {
|
|
5150
|
-
|
|
5151
|
+
let fileName = "";
|
|
5152
|
+
const disposition = (_a = qs2.parse(response.headers["content-disposition"], {
|
|
5153
|
+
delimiter: ";"
|
|
5154
|
+
})) == null ? void 0 : _a.filename;
|
|
5155
|
+
if (disposition) {
|
|
5156
|
+
if (disposition.startsWith('"') && disposition.endsWith('"')) {
|
|
5157
|
+
fileName = disposition.substring(1, disposition.length - 1);
|
|
5158
|
+
}
|
|
5159
|
+
}
|
|
5160
|
+
if (name)
|
|
5161
|
+
fileName = name;
|
|
5151
5162
|
downloadFileFromBlob(response.data, fileName);
|
|
5152
5163
|
}
|
|
5153
5164
|
}
|
|
@@ -5181,6 +5192,7 @@ var FileUtil = class {
|
|
|
5181
5192
|
};
|
|
5182
5193
|
|
|
5183
5194
|
// src/utils/short-cut/short-cut-util.ts
|
|
5195
|
+
import { QXEvent as QXEvent2 } from "qx-util";
|
|
5184
5196
|
var ShortCutUtil = class {
|
|
5185
5197
|
/**
|
|
5186
5198
|
* Creates an instance of ShortCutUtil.
|
|
@@ -5195,6 +5207,13 @@ var ShortCutUtil = class {
|
|
|
5195
5207
|
* @memberof ShortCutUtil
|
|
5196
5208
|
*/
|
|
5197
5209
|
this.$ShortCut = [];
|
|
5210
|
+
/**
|
|
5211
|
+
* 事件监听器
|
|
5212
|
+
*
|
|
5213
|
+
* @protected
|
|
5214
|
+
* @memberof ShortCutUtil
|
|
5215
|
+
*/
|
|
5216
|
+
this.evt = new QXEvent2();
|
|
5198
5217
|
this.initShortCut();
|
|
5199
5218
|
}
|
|
5200
5219
|
/**
|
|
@@ -5223,8 +5242,27 @@ var ShortCutUtil = class {
|
|
|
5223
5242
|
* @memberof ShortCutUtil
|
|
5224
5243
|
*/
|
|
5225
5244
|
saveShortCut() {
|
|
5245
|
+
this.evt.emit("change", this.$ShortCut);
|
|
5226
5246
|
window.localStorage.setItem("IbizShortCut", JSON.stringify(this.$ShortCut));
|
|
5227
5247
|
}
|
|
5248
|
+
/**
|
|
5249
|
+
* 订阅数据改变事件
|
|
5250
|
+
*
|
|
5251
|
+
* @param {(data: IShortCut) => void} callback 回调
|
|
5252
|
+
* @memberof ShortCutUtil
|
|
5253
|
+
*/
|
|
5254
|
+
onChange(callback) {
|
|
5255
|
+
this.evt.on("change", callback);
|
|
5256
|
+
}
|
|
5257
|
+
/**
|
|
5258
|
+
* 取消订阅
|
|
5259
|
+
*
|
|
5260
|
+
* @param {(data: IShortCut) => void} callback
|
|
5261
|
+
* @memberof ShortCutUtil
|
|
5262
|
+
*/
|
|
5263
|
+
offChange(callback) {
|
|
5264
|
+
this.evt.off("change", callback);
|
|
5265
|
+
}
|
|
5228
5266
|
/**
|
|
5229
5267
|
* 计算快捷方式key
|
|
5230
5268
|
*
|
|
@@ -6664,7 +6702,7 @@ function getErrorViewProvider(code) {
|
|
|
6664
6702
|
|
|
6665
6703
|
// src/service/utils/app-counter/app-counter.ts
|
|
6666
6704
|
import { IBizContext, RuntimeError as RuntimeError14 } from "@ibiz-template/core";
|
|
6667
|
-
import { notNilEmpty as notNilEmpty5, QXEvent as
|
|
6705
|
+
import { notNilEmpty as notNilEmpty5, QXEvent as QXEvent3 } from "qx-util";
|
|
6668
6706
|
import { clone as clone3 } from "ramda";
|
|
6669
6707
|
var AppCounter = class {
|
|
6670
6708
|
/**
|
|
@@ -6679,7 +6717,7 @@ var AppCounter = class {
|
|
|
6679
6717
|
this.destroyed = false;
|
|
6680
6718
|
this.context = IBizContext.create();
|
|
6681
6719
|
this.params = {};
|
|
6682
|
-
this.evt = new
|
|
6720
|
+
this.evt = new QXEvent3();
|
|
6683
6721
|
/**
|
|
6684
6722
|
* 计数器数据
|
|
6685
6723
|
*
|
|
@@ -7014,7 +7052,7 @@ import {
|
|
|
7014
7052
|
RuntimeModelError as RuntimeModelError7
|
|
7015
7053
|
} from "@ibiz-template/core";
|
|
7016
7054
|
import { clone as clone4, isNil as isNil5 } from "ramda";
|
|
7017
|
-
import { QXEvent as
|
|
7055
|
+
import { QXEvent as QXEvent4, notNilEmpty as notNilEmpty6 } from "qx-util";
|
|
7018
7056
|
var DynamicCodeListCache = class {
|
|
7019
7057
|
constructor(codeList) {
|
|
7020
7058
|
/**
|
|
@@ -7059,7 +7097,7 @@ var DynamicCodeListCache = class {
|
|
|
7059
7097
|
* @date 2024-04-10 17:04:00
|
|
7060
7098
|
* @protected
|
|
7061
7099
|
*/
|
|
7062
|
-
this.evt = new
|
|
7100
|
+
this.evt = new QXEvent4();
|
|
7063
7101
|
/**
|
|
7064
7102
|
* 常见关键字
|
|
7065
7103
|
*
|
|
@@ -10361,8 +10399,8 @@ var AuthorityService = class {
|
|
|
10361
10399
|
if (this.enablePermission) {
|
|
10362
10400
|
const app = await ibiz.hub.getApp(this.appModel.appId);
|
|
10363
10401
|
const opPriv = await app.getOPPriv(dataAccessAction, appDeId);
|
|
10364
|
-
if (
|
|
10365
|
-
return
|
|
10402
|
+
if (this.enablePermission && (opPriv == null ? void 0 : opPriv.mapSysUniResCode) && !this.calcByResCode(opPriv.mapSysUniResCode)) {
|
|
10403
|
+
return false;
|
|
10366
10404
|
}
|
|
10367
10405
|
}
|
|
10368
10406
|
if (appDeId) {
|
|
@@ -10385,6 +10423,13 @@ var V7AuthService = class {
|
|
|
10385
10423
|
get isAnonymous() {
|
|
10386
10424
|
return getCookie(CoreConst.IS_ANONYMOUS) === "1";
|
|
10387
10425
|
}
|
|
10426
|
+
/**
|
|
10427
|
+
* 使用匿名账号登录
|
|
10428
|
+
*
|
|
10429
|
+
* @author tony001
|
|
10430
|
+
* @date 2024-05-14 17:05:47
|
|
10431
|
+
* @return {*} {Promise<boolean>}
|
|
10432
|
+
*/
|
|
10388
10433
|
async anonymousLogin() {
|
|
10389
10434
|
const { anonymousUser, anonymousPwd } = ibiz.env;
|
|
10390
10435
|
if (!anonymousUser || !anonymousPwd) {
|
|
@@ -10407,8 +10452,20 @@ var V7AuthService = class {
|
|
|
10407
10452
|
}
|
|
10408
10453
|
return result;
|
|
10409
10454
|
}
|
|
10455
|
+
/**
|
|
10456
|
+
* 登录
|
|
10457
|
+
*
|
|
10458
|
+
* @author tony001
|
|
10459
|
+
* @date 2024-05-14 17:05:54
|
|
10460
|
+
* @param {string} loginName
|
|
10461
|
+
* @param {string} password
|
|
10462
|
+
* @param {boolean} [remember]
|
|
10463
|
+
* @param {IData} [headers]
|
|
10464
|
+
* @return {*} {Promise<boolean>}
|
|
10465
|
+
*/
|
|
10410
10466
|
async login(loginName, password, remember, headers) {
|
|
10411
10467
|
try {
|
|
10468
|
+
this.clearAuthData();
|
|
10412
10469
|
const res = await ibiz.net.post(
|
|
10413
10470
|
"/v7/login",
|
|
10414
10471
|
{
|
|
@@ -10447,16 +10504,17 @@ var V7AuthService = class {
|
|
|
10447
10504
|
}
|
|
10448
10505
|
return false;
|
|
10449
10506
|
}
|
|
10507
|
+
/**
|
|
10508
|
+
* 登出
|
|
10509
|
+
*
|
|
10510
|
+
* @author tony001
|
|
10511
|
+
* @date 2024-05-14 17:05:04
|
|
10512
|
+
* @return {*} {Promise<boolean>}
|
|
10513
|
+
*/
|
|
10450
10514
|
async logout() {
|
|
10451
10515
|
try {
|
|
10452
10516
|
await ibiz.net.get("/v7/logout");
|
|
10453
|
-
|
|
10454
|
-
clearCookie(CoreConst.TOKEN_EXPIRES);
|
|
10455
|
-
clearCookie(CoreConst.TOKEN_REMEMBER);
|
|
10456
|
-
clearCookie(CoreConst.REFRESH_TOKEN);
|
|
10457
|
-
clearCookie(CoreConst.IS_ANONYMOUS);
|
|
10458
|
-
ibiz.appData = void 0;
|
|
10459
|
-
ibiz.orgData = void 0;
|
|
10517
|
+
this.clearAuthData();
|
|
10460
10518
|
return true;
|
|
10461
10519
|
} catch (err) {
|
|
10462
10520
|
ibiz.notification.error({
|
|
@@ -10466,6 +10524,33 @@ var V7AuthService = class {
|
|
|
10466
10524
|
}
|
|
10467
10525
|
return false;
|
|
10468
10526
|
}
|
|
10527
|
+
/**
|
|
10528
|
+
* 变更密码
|
|
10529
|
+
*
|
|
10530
|
+
* @author tony001
|
|
10531
|
+
* @date 2024-05-14 17:05:22
|
|
10532
|
+
* @param {string} oldPwd
|
|
10533
|
+
* @param {string} newPwd
|
|
10534
|
+
* @return {*} {Promise<boolean>}
|
|
10535
|
+
*/
|
|
10536
|
+
async changePwd(oldPwd, newPwd) {
|
|
10537
|
+
try {
|
|
10538
|
+
await ibiz.net.post("/uaa/changepwd", {
|
|
10539
|
+
oldPwd,
|
|
10540
|
+
newPwd
|
|
10541
|
+
});
|
|
10542
|
+
return true;
|
|
10543
|
+
} catch (err) {
|
|
10544
|
+
return false;
|
|
10545
|
+
}
|
|
10546
|
+
}
|
|
10547
|
+
/**
|
|
10548
|
+
* 页面未关闭情况下,自动延长登录时间
|
|
10549
|
+
*
|
|
10550
|
+
* @author tony001
|
|
10551
|
+
* @date 2024-05-14 17:05:38
|
|
10552
|
+
* @return {*} {Promise<void>}
|
|
10553
|
+
*/
|
|
10469
10554
|
async extendLogin() {
|
|
10470
10555
|
if (this.isAnonymous) {
|
|
10471
10556
|
return;
|
|
@@ -10510,6 +10595,13 @@ var V7AuthService = class {
|
|
|
10510
10595
|
}, wait);
|
|
10511
10596
|
}
|
|
10512
10597
|
}
|
|
10598
|
+
/**
|
|
10599
|
+
* 通过refreshToken换算token
|
|
10600
|
+
*
|
|
10601
|
+
* @author tony001
|
|
10602
|
+
* @date 2024-05-14 17:05:45
|
|
10603
|
+
* @return {*} {Promise<void>}
|
|
10604
|
+
*/
|
|
10513
10605
|
async refreshToken() {
|
|
10514
10606
|
const remember = getCookie(CoreConst.TOKEN_REMEMBER);
|
|
10515
10607
|
const refreshToken = getCookie(CoreConst.REFRESH_TOKEN);
|
|
@@ -10535,6 +10627,13 @@ var V7AuthService = class {
|
|
|
10535
10627
|
}
|
|
10536
10628
|
}
|
|
10537
10629
|
}
|
|
10630
|
+
/**
|
|
10631
|
+
* 获取当前环境的权限信息(无登录则返回undefined)
|
|
10632
|
+
*
|
|
10633
|
+
* @author tony001
|
|
10634
|
+
* @date 2024-05-14 17:05:57
|
|
10635
|
+
* @return {*} {(IAuthInfo | undefined)}
|
|
10636
|
+
*/
|
|
10538
10637
|
getAuthInfo() {
|
|
10539
10638
|
const token = getCookie(CoreConst.TOKEN);
|
|
10540
10639
|
const isAnonymous = !!getCookie(CoreConst.IS_ANONYMOUS);
|
|
@@ -10556,6 +10655,22 @@ var V7AuthService = class {
|
|
|
10556
10655
|
ibiz.appData = res.data;
|
|
10557
10656
|
}
|
|
10558
10657
|
}
|
|
10658
|
+
/**
|
|
10659
|
+
* 清空权限数据
|
|
10660
|
+
*
|
|
10661
|
+
* @author tony001
|
|
10662
|
+
* @date 2024-05-14 17:05:18
|
|
10663
|
+
* @protected
|
|
10664
|
+
*/
|
|
10665
|
+
clearAuthData() {
|
|
10666
|
+
clearCookie(CoreConst.TOKEN);
|
|
10667
|
+
clearCookie(CoreConst.TOKEN_EXPIRES);
|
|
10668
|
+
clearCookie(CoreConst.TOKEN_REMEMBER);
|
|
10669
|
+
clearCookie(CoreConst.REFRESH_TOKEN);
|
|
10670
|
+
clearCookie(CoreConst.IS_ANONYMOUS);
|
|
10671
|
+
ibiz.appData = void 0;
|
|
10672
|
+
ibiz.orgData = void 0;
|
|
10673
|
+
}
|
|
10559
10674
|
};
|
|
10560
10675
|
|
|
10561
10676
|
// src/service/service/async-action/async-action.service.ts
|
|
@@ -12875,7 +12990,7 @@ var InternalMessageService = class {
|
|
|
12875
12990
|
const fetchParams = {
|
|
12876
12991
|
page: 0,
|
|
12877
12992
|
size: 20,
|
|
12878
|
-
sort: "
|
|
12993
|
+
sort: "timestamp,desc"
|
|
12879
12994
|
};
|
|
12880
12995
|
Object.assign(fetchParams, params);
|
|
12881
12996
|
const res = await ibiz.net.post(
|
|
@@ -12939,7 +13054,7 @@ var InternalMessageService = class {
|
|
|
12939
13054
|
const res = await ibiz.net.post("".concat(this.baseUrl, "/fetch_cur_receiver"), {
|
|
12940
13055
|
page: 0,
|
|
12941
13056
|
size: 1,
|
|
12942
|
-
sort: "
|
|
13057
|
+
sort: "timestamp,desc",
|
|
12943
13058
|
searchconds: [
|
|
12944
13059
|
{
|
|
12945
13060
|
condtype: "GROUP",
|
|
@@ -13792,7 +13907,7 @@ var MapData = class {
|
|
|
13792
13907
|
};
|
|
13793
13908
|
|
|
13794
13909
|
// src/service/vo/panel-data/panel-data.ts
|
|
13795
|
-
import { QXEvent as
|
|
13910
|
+
import { QXEvent as QXEvent5 } from "qx-util";
|
|
13796
13911
|
function updateKeyDefine3(target, keys) {
|
|
13797
13912
|
keys.forEach((key) => {
|
|
13798
13913
|
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
@@ -13807,7 +13922,7 @@ function updateKeyDefine3(target, keys) {
|
|
|
13807
13922
|
}
|
|
13808
13923
|
var PanelData = class {
|
|
13809
13924
|
constructor(fields, origin) {
|
|
13810
|
-
const _evt = new
|
|
13925
|
+
const _evt = new QXEvent5();
|
|
13811
13926
|
const keyMap = {};
|
|
13812
13927
|
const reverseKeyMap = {};
|
|
13813
13928
|
fields.forEach((field) => {
|
|
@@ -14029,7 +14144,7 @@ var GanttCodeListNodeData = class extends TreeCodeListNodeData {
|
|
|
14029
14144
|
};
|
|
14030
14145
|
|
|
14031
14146
|
// src/service/mqtt/mqtt.service.ts
|
|
14032
|
-
import { QXEvent as
|
|
14147
|
+
import { QXEvent as QXEvent6, createUUID as createUUID7 } from "qx-util";
|
|
14033
14148
|
var MqttService = class {
|
|
14034
14149
|
/**
|
|
14035
14150
|
* Creates an instance of MqttService.
|
|
@@ -14050,7 +14165,7 @@ var MqttService = class {
|
|
|
14050
14165
|
* @author chitanda
|
|
14051
14166
|
* @date 2023-10-23 15:10:06
|
|
14052
14167
|
*/
|
|
14053
|
-
this.evt = new
|
|
14168
|
+
this.evt = new QXEvent6();
|
|
14054
14169
|
/**
|
|
14055
14170
|
* 连接选项
|
|
14056
14171
|
*
|
|
@@ -15148,7 +15263,7 @@ var LoadingState = class {
|
|
|
15148
15263
|
};
|
|
15149
15264
|
|
|
15150
15265
|
// src/controller/ctx/ctx.ts
|
|
15151
|
-
import { QXEvent as
|
|
15266
|
+
import { QXEvent as QXEvent7 } from "qx-util";
|
|
15152
15267
|
|
|
15153
15268
|
// src/controller/ctx/ctx.state.ts
|
|
15154
15269
|
var CTXState = class {
|
|
@@ -15178,7 +15293,7 @@ var CTX = class {
|
|
|
15178
15293
|
* @date 2023-04-26 07:54:46
|
|
15179
15294
|
* @protected
|
|
15180
15295
|
*/
|
|
15181
|
-
this.evt = new
|
|
15296
|
+
this.evt = new QXEvent7(3e3);
|
|
15182
15297
|
/**
|
|
15183
15298
|
* 当前视图控制器集合(包含自身视图控制器,部件控制器,和下一层级的视图的控制器)
|
|
15184
15299
|
* @author lxm
|
|
@@ -15521,8 +15636,8 @@ var ButtonContainerState = class {
|
|
|
15521
15636
|
};
|
|
15522
15637
|
|
|
15523
15638
|
// src/controller/utils/event/qx-event-ex.ts
|
|
15524
|
-
import { clearAll, QXEvent as
|
|
15525
|
-
var QXEventEx = class extends
|
|
15639
|
+
import { clearAll, QXEvent as QXEvent8 } from "qx-util";
|
|
15640
|
+
var QXEventEx = class extends QXEvent8 {
|
|
15526
15641
|
constructor() {
|
|
15527
15642
|
super(...arguments);
|
|
15528
15643
|
this.anyEventFns = [];
|
|
@@ -17381,6 +17496,58 @@ var AppDataUploadViewController = class extends ViewController {
|
|
|
17381
17496
|
var MobViewController = class extends ViewController {
|
|
17382
17497
|
};
|
|
17383
17498
|
|
|
17499
|
+
// src/controller/common/view/app-login-view.controller.ts
|
|
17500
|
+
import { AsyncSeriesHook as AsyncSeriesHook2 } from "qx-util";
|
|
17501
|
+
var AppLoginViewController = class extends ViewController {
|
|
17502
|
+
constructor() {
|
|
17503
|
+
super(...arguments);
|
|
17504
|
+
/**
|
|
17505
|
+
* 钩子
|
|
17506
|
+
*
|
|
17507
|
+
* @memberof AppLoginViewController
|
|
17508
|
+
*/
|
|
17509
|
+
this.hooks = {
|
|
17510
|
+
beforeLogin: new AsyncSeriesHook2(),
|
|
17511
|
+
afterLogin: new AsyncSeriesHook2()
|
|
17512
|
+
};
|
|
17513
|
+
}
|
|
17514
|
+
/**
|
|
17515
|
+
* 校验登录视图
|
|
17516
|
+
*
|
|
17517
|
+
* @return {*} {Promise<boolean>}
|
|
17518
|
+
* @memberof AppLoginViewController
|
|
17519
|
+
*/
|
|
17520
|
+
async validate(parentId) {
|
|
17521
|
+
const context = {
|
|
17522
|
+
validate: true,
|
|
17523
|
+
parentId
|
|
17524
|
+
};
|
|
17525
|
+
await this.hooks.beforeLogin.call(context);
|
|
17526
|
+
return context.validate;
|
|
17527
|
+
}
|
|
17528
|
+
/**
|
|
17529
|
+
* 销毁Hooks钩子
|
|
17530
|
+
*
|
|
17531
|
+
* @protected
|
|
17532
|
+
* @memberof AppLoginViewController
|
|
17533
|
+
*/
|
|
17534
|
+
destroyHooks() {
|
|
17535
|
+
this.hooks.beforeLogin.clear();
|
|
17536
|
+
this.hooks.afterLogin.clear();
|
|
17537
|
+
}
|
|
17538
|
+
/**
|
|
17539
|
+
* 生命周期-销毁完成
|
|
17540
|
+
*
|
|
17541
|
+
* @protected
|
|
17542
|
+
* @return {*} {Promise<void>}
|
|
17543
|
+
* @memberof AppLoginViewController
|
|
17544
|
+
*/
|
|
17545
|
+
async onDestroyed() {
|
|
17546
|
+
await super.onDeactivated();
|
|
17547
|
+
this.destroyHooks();
|
|
17548
|
+
}
|
|
17549
|
+
};
|
|
17550
|
+
|
|
17384
17551
|
// src/controller/common/view/wf-step-trace-view.controller.ts
|
|
17385
17552
|
var WFStepTraceViewController = class extends ViewController {
|
|
17386
17553
|
initState() {
|
|
@@ -23325,10 +23492,7 @@ var LoginOutUIActionProvider = class extends UIActionProviderBase {
|
|
|
23325
23492
|
desc: ibiz.i18n.t("runtime.uiAction.wantLogout")
|
|
23326
23493
|
});
|
|
23327
23494
|
if (confirm) {
|
|
23328
|
-
|
|
23329
|
-
if (bol) {
|
|
23330
|
-
window.location.reload();
|
|
23331
|
-
}
|
|
23495
|
+
await ibiz.hub.controller.logout();
|
|
23332
23496
|
}
|
|
23333
23497
|
return {};
|
|
23334
23498
|
}
|
|
@@ -39165,35 +39329,118 @@ var GanttController = class extends TreeGridExController {
|
|
|
39165
39329
|
// src/controller/hub.controller.ts
|
|
39166
39330
|
var HubController = class {
|
|
39167
39331
|
constructor() {
|
|
39332
|
+
/**
|
|
39333
|
+
* 全局共享数据对象
|
|
39334
|
+
*
|
|
39335
|
+
* @author tony001
|
|
39336
|
+
* @date 2024-05-14 14:05:22
|
|
39337
|
+
* @type {IData}
|
|
39338
|
+
*/
|
|
39168
39339
|
this.session = {};
|
|
39169
39340
|
}
|
|
39170
|
-
|
|
39171
|
-
|
|
39341
|
+
/**
|
|
39342
|
+
* 登录(包含调用登录逻辑,及跳转应用界面)
|
|
39343
|
+
*
|
|
39344
|
+
* @author tony001
|
|
39345
|
+
* @date 2024-05-14 16:05:04
|
|
39346
|
+
* @param {string} loginName
|
|
39347
|
+
* @param {string} password
|
|
39348
|
+
* @param {(boolean | undefined)} [remember]
|
|
39349
|
+
* @param {(IData | undefined)} [headers]
|
|
39350
|
+
* @param {(IData | undefined)} [opts]
|
|
39351
|
+
* @return {*} {Promise<boolean>}
|
|
39352
|
+
*/
|
|
39353
|
+
async login(loginName, password, remember, headers, opts) {
|
|
39354
|
+
const bol = await ibiz.appUtil.login(
|
|
39355
|
+
loginName,
|
|
39356
|
+
password,
|
|
39357
|
+
remember,
|
|
39358
|
+
headers,
|
|
39359
|
+
opts
|
|
39360
|
+
);
|
|
39361
|
+
return bol;
|
|
39172
39362
|
}
|
|
39173
|
-
|
|
39174
|
-
|
|
39175
|
-
|
|
39176
|
-
|
|
39177
|
-
|
|
39178
|
-
|
|
39179
|
-
|
|
39180
|
-
|
|
39181
|
-
|
|
39363
|
+
/**
|
|
39364
|
+
* 登出(包含调用登录逻辑,及跳转登录页)
|
|
39365
|
+
*
|
|
39366
|
+
* @author tony001
|
|
39367
|
+
* @date 2024-05-14 16:05:01
|
|
39368
|
+
* @param {(IData | undefined)} [opts]
|
|
39369
|
+
* @return {*} {Promise<boolean>}
|
|
39370
|
+
*/
|
|
39371
|
+
async logout(opts) {
|
|
39372
|
+
const bol = await ibiz.appUtil.logout(opts);
|
|
39373
|
+
return bol;
|
|
39374
|
+
}
|
|
39375
|
+
/**
|
|
39376
|
+
* 变更密码
|
|
39377
|
+
*
|
|
39378
|
+
* @author tony001
|
|
39379
|
+
* @date 2024-05-14 16:05:54
|
|
39380
|
+
* @param {string} oldPwd
|
|
39381
|
+
* @param {string} newPwd
|
|
39382
|
+
* @param {(IData | undefined)} [opts]
|
|
39383
|
+
* @return {*} {Promise<boolean>}
|
|
39384
|
+
*/
|
|
39385
|
+
async changePwd(oldPwd, newPwd, opts) {
|
|
39386
|
+
const bol = await ibiz.appUtil.changePwd(oldPwd, newPwd, opts);
|
|
39387
|
+
return bol;
|
|
39388
|
+
}
|
|
39389
|
+
/**
|
|
39390
|
+
* 切换组织(包括界面刷新)
|
|
39391
|
+
*
|
|
39392
|
+
* @author tony001
|
|
39393
|
+
* @date 2024-05-14 16:05:09
|
|
39394
|
+
* @param {string} oldOrgId
|
|
39395
|
+
* @param {string} newOrgId
|
|
39396
|
+
* @param {(IData | undefined)} [opts]
|
|
39397
|
+
* @return {*} {Promise<boolean>}
|
|
39398
|
+
*/
|
|
39399
|
+
async switchOrg(oldOrgId, newOrgId, opts) {
|
|
39400
|
+
const bol = await ibiz.appUtil.switchOrg(oldOrgId, newOrgId, opts);
|
|
39401
|
+
return bol;
|
|
39402
|
+
}
|
|
39403
|
+
/**
|
|
39404
|
+
* 切换主题
|
|
39405
|
+
*
|
|
39406
|
+
* @author tony001
|
|
39407
|
+
* @date 2024-05-14 16:05:12
|
|
39408
|
+
* @param {string} oldTheme
|
|
39409
|
+
* @param {string} newTheme
|
|
39410
|
+
* @param {(IData | undefined)} [opts]
|
|
39411
|
+
* @return {*} {Promise<boolean>}
|
|
39412
|
+
*/
|
|
39413
|
+
async switchTheme(oldTheme, newTheme, opts) {
|
|
39414
|
+
const bol = await ibiz.appUtil.switchTheme(oldTheme, newTheme, opts);
|
|
39415
|
+
return bol;
|
|
39416
|
+
}
|
|
39417
|
+
/**
|
|
39418
|
+
* 切换语言
|
|
39419
|
+
*
|
|
39420
|
+
* @author tony001
|
|
39421
|
+
* @date 2024-05-14 16:05:01
|
|
39422
|
+
* @param {string} oldLanguage
|
|
39423
|
+
* @param {string} newLanguage
|
|
39424
|
+
* @param {(IData | undefined)} [opts]
|
|
39425
|
+
* @return {*} {Promise<boolean>}
|
|
39426
|
+
*/
|
|
39427
|
+
async switchLanguage(oldLanguage, newLanguage, opts) {
|
|
39428
|
+
const bol = await ibiz.appUtil.switchTheme(oldLanguage, newLanguage, opts);
|
|
39182
39429
|
return bol;
|
|
39183
39430
|
}
|
|
39184
39431
|
};
|
|
39185
39432
|
|
|
39186
39433
|
// src/controller/notification/notice.controller.ts
|
|
39187
|
-
import { QXEvent as
|
|
39434
|
+
import { QXEvent as QXEvent11 } from "qx-util";
|
|
39188
39435
|
|
|
39189
39436
|
// src/controller/notification/async-action.controller.ts
|
|
39190
|
-
import { QXEvent as
|
|
39437
|
+
import { QXEvent as QXEvent9 } from "qx-util";
|
|
39191
39438
|
import { clone as clone33 } from "ramda";
|
|
39192
39439
|
import { isNil as isNil34, isNumber as isNumber2 } from "lodash-es";
|
|
39193
39440
|
import dayjs8 from "dayjs";
|
|
39194
39441
|
var AsyncActionController = class {
|
|
39195
39442
|
constructor() {
|
|
39196
|
-
this.evt = new
|
|
39443
|
+
this.evt = new QXEvent9();
|
|
39197
39444
|
this.total = 0;
|
|
39198
39445
|
this.actions = [];
|
|
39199
39446
|
/**
|
|
@@ -39330,7 +39577,7 @@ var AsyncActionController = class {
|
|
|
39330
39577
|
};
|
|
39331
39578
|
|
|
39332
39579
|
// src/controller/notification/internal-message.controller.ts
|
|
39333
|
-
import { QXEvent as
|
|
39580
|
+
import { QXEvent as QXEvent10 } from "qx-util";
|
|
39334
39581
|
function isHTML(str) {
|
|
39335
39582
|
if (str === "")
|
|
39336
39583
|
return false;
|
|
@@ -39339,7 +39586,7 @@ function isHTML(str) {
|
|
|
39339
39586
|
}
|
|
39340
39587
|
var InternalMessageController = class {
|
|
39341
39588
|
constructor() {
|
|
39342
|
-
this.evt = new
|
|
39589
|
+
this.evt = new QXEvent10();
|
|
39343
39590
|
this.total = 0;
|
|
39344
39591
|
this.unreadCount = 0;
|
|
39345
39592
|
/**
|
|
@@ -39402,7 +39649,7 @@ var InternalMessageController = class {
|
|
|
39402
39649
|
const fetchParams = {
|
|
39403
39650
|
page: this.page,
|
|
39404
39651
|
size: this.size,
|
|
39405
|
-
sort: "
|
|
39652
|
+
sort: "timestamp,desc"
|
|
39406
39653
|
};
|
|
39407
39654
|
if (this.unreadOnly) {
|
|
39408
39655
|
fetchParams.searchconds = [
|
|
@@ -39499,7 +39746,7 @@ var InternalMessageController = class {
|
|
|
39499
39746
|
// src/controller/notification/notice.controller.ts
|
|
39500
39747
|
var NoticeController = class {
|
|
39501
39748
|
constructor() {
|
|
39502
|
-
this.evt = new
|
|
39749
|
+
this.evt = new QXEvent11();
|
|
39503
39750
|
this.total = 0;
|
|
39504
39751
|
this.asyncAction = new AsyncActionController();
|
|
39505
39752
|
this.internalMessage = new InternalMessageController();
|
|
@@ -39799,7 +40046,14 @@ var AppHub = class {
|
|
|
39799
40046
|
async getAppDataEntity(id, appId2 = ibiz.env.appId) {
|
|
39800
40047
|
if (this.dataEntities.has(appId2)) {
|
|
39801
40048
|
const map = this.dataEntities.get(appId2);
|
|
39802
|
-
if (
|
|
40049
|
+
if (id.indexOf(".") === -1) {
|
|
40050
|
+
const targetEntity = Array.from(map.values()).find(
|
|
40051
|
+
(value) => value.codeName === id
|
|
40052
|
+
);
|
|
40053
|
+
if (targetEntity) {
|
|
40054
|
+
return targetEntity;
|
|
40055
|
+
}
|
|
40056
|
+
} else if (map.has(id)) {
|
|
39803
40057
|
return map.get(id);
|
|
39804
40058
|
}
|
|
39805
40059
|
}
|
|
@@ -40172,11 +40426,18 @@ var ViewEngineBase = class {
|
|
|
40172
40426
|
}
|
|
40173
40427
|
return void 0;
|
|
40174
40428
|
}
|
|
40429
|
+
/**
|
|
40430
|
+
* 快捷方式
|
|
40431
|
+
*
|
|
40432
|
+
* @param {*} args
|
|
40433
|
+
* @return {*} {(Promise<any>)}
|
|
40434
|
+
* @memberof ViewEngineBase
|
|
40435
|
+
*/
|
|
40175
40436
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
40176
40437
|
async onShortCut(args) {
|
|
40177
40438
|
const { data } = args;
|
|
40178
40439
|
const { context, model, params, modal } = this.view;
|
|
40179
|
-
if (
|
|
40440
|
+
if (["EMBED", "POPOVER"].includes(modal.mode)) {
|
|
40180
40441
|
throw new Error(
|
|
40181
40442
|
ibiz.i18n.t("runtime.engine.minimization", { mode: modal.mode })
|
|
40182
40443
|
);
|
|
@@ -40187,16 +40448,20 @@ var ViewEngineBase = class {
|
|
|
40187
40448
|
});
|
|
40188
40449
|
const isExist = ibiz.util.shortCut.isExist(key);
|
|
40189
40450
|
if (!isExist) {
|
|
40451
|
+
const caption = data && data[0].srfmajortext || model.caption;
|
|
40190
40452
|
ibiz.util.shortCut.addShortCut({
|
|
40191
40453
|
key,
|
|
40192
|
-
|
|
40454
|
+
caption,
|
|
40455
|
+
icon: model.sysImage,
|
|
40193
40456
|
appViewId: model.id,
|
|
40194
40457
|
context: IBizContext7.create(context),
|
|
40195
40458
|
params: { ...params },
|
|
40196
|
-
openMode: modal.mode
|
|
40459
|
+
openMode: modal.mode,
|
|
40460
|
+
fullPath: window.location.hash
|
|
40197
40461
|
});
|
|
40198
40462
|
this.view.state.isShortCut = true;
|
|
40199
|
-
|
|
40463
|
+
this.view.closeView();
|
|
40464
|
+
return null;
|
|
40200
40465
|
}
|
|
40201
40466
|
ibiz.util.shortCut.removeShortCut(key);
|
|
40202
40467
|
this.view.state.isShortCut = false;
|
|
@@ -42158,6 +42423,7 @@ export {
|
|
|
42158
42423
|
AppDataEntity,
|
|
42159
42424
|
AppDataUploadViewController,
|
|
42160
42425
|
AppFuncCommand,
|
|
42426
|
+
AppLoginViewController,
|
|
42161
42427
|
AppMenuController,
|
|
42162
42428
|
AppMenuIconViewController,
|
|
42163
42429
|
Application,
|