@ibiz-template/core 0.1.14 → 0.1.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 +330 -0
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/ibizsys.d.ts +9 -1
- package/out/ibizsys.d.ts.map +1 -1
- package/out/ibizsys.js +9 -1
- package/out/interface/i-portal-async-action/i-portal-async-action.d.ts +83 -0
- package/out/interface/i-portal-async-action/i-portal-async-action.d.ts.map +1 -0
- package/out/interface/i-portal-async-action/i-portal-async-action.js +1 -0
- package/out/interface/i-portal-message/i-portal-message.d.ts +68 -0
- package/out/interface/i-portal-message/i-portal-message.d.ts.map +1 -0
- package/out/interface/i-portal-message/i-portal-message.js +1 -0
- package/out/interface/index.d.ts +2 -0
- package/out/interface/index.d.ts.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/message-center/base/message-all.d.ts +13 -0
- package/out/utils/message-center/base/message-all.d.ts.map +1 -0
- package/out/utils/message-center/base/message-all.js +12 -0
- package/out/utils/message-center/base/message-base.d.ts +68 -0
- package/out/utils/message-center/base/message-base.d.ts.map +1 -0
- package/out/utils/message-center/base/message-base.js +70 -0
- package/out/utils/message-center/command/change/command-change.d.ts +13 -0
- package/out/utils/message-center/command/change/command-change.d.ts.map +1 -0
- package/out/utils/message-center/command/change/command-change.js +12 -0
- package/out/utils/message-center/command/command-base/command-base.d.ts +20 -0
- package/out/utils/message-center/command/command-base/command-base.d.ts.map +1 -0
- package/out/utils/message-center/command/command-base/command-base.js +28 -0
- package/out/utils/message-center/command/create/command-create.d.ts +22 -0
- package/out/utils/message-center/command/create/command-create.d.ts.map +1 -0
- package/out/utils/message-center/command/create/command-create.js +22 -0
- package/out/utils/message-center/command/message-command.d.ts +68 -0
- package/out/utils/message-center/command/message-command.d.ts.map +1 -0
- package/out/utils/message-center/command/message-command.js +113 -0
- package/out/utils/message-center/command/remove/command-remove.d.ts +22 -0
- package/out/utils/message-center/command/remove/command-remove.d.ts.map +1 -0
- package/out/utils/message-center/command/remove/command-remove.js +22 -0
- package/out/utils/message-center/command/update/command-update.d.ts +22 -0
- package/out/utils/message-center/command/update/command-update.d.ts.map +1 -0
- package/out/utils/message-center/command/update/command-update.js +22 -0
- package/out/utils/message-center/console/message-console.d.ts +21 -0
- package/out/utils/message-center/console/message-console.d.ts.map +1 -0
- package/out/utils/message-center/console/message-console.js +29 -0
- package/out/utils/message-center/index.d.ts +2 -0
- package/out/utils/message-center/index.d.ts.map +1 -0
- package/out/utils/message-center/index.js +1 -0
- package/out/utils/message-center/interface/i-app-data-entity.d.ts +20 -0
- package/out/utils/message-center/interface/i-app-data-entity.d.ts.map +1 -0
- package/out/utils/message-center/interface/i-app-data-entity.js +1 -0
- package/out/utils/message-center/interface/index.d.ts +2 -0
- package/out/utils/message-center/interface/index.d.ts.map +1 -0
- package/out/utils/message-center/interface/index.js +1 -0
- package/out/utils/message-center/message-center.d.ts +63 -0
- package/out/utils/message-center/message-center.d.ts.map +1 -0
- package/out/utils/message-center/message-center.js +79 -0
- package/package.json +2 -2
- package/src/ibizsys.ts +10 -1
- package/src/interface/i-portal-async-action/i-portal-async-action.ts +90 -0
- package/src/interface/i-portal-message/i-portal-message.ts +79 -0
- package/src/interface/index.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/message-center/base/message-all.ts +12 -0
- package/src/utils/message-center/base/message-base.ts +86 -0
- package/src/utils/message-center/command/change/command-change.ts +12 -0
- package/src/utils/message-center/command/command-base/command-base.ts +30 -0
- package/src/utils/message-center/command/create/command-create.ts +24 -0
- package/src/utils/message-center/command/message-command.ts +118 -0
- package/src/utils/message-center/command/remove/command-remove.ts +24 -0
- package/src/utils/message-center/command/update/command-update.ts +24 -0
- package/src/utils/message-center/console/message-console.ts +31 -0
- package/src/utils/message-center/index.ts +1 -0
- package/src/utils/message-center/interface/i-app-data-entity.ts +19 -0
- package/src/utils/message-center/interface/index.ts +1 -0
- package/src/utils/message-center/message-center.ts +82 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createUUID } from 'qx-util';
|
|
2
|
+
import { MessageBase } from '../base/message-base';
|
|
3
|
+
import { CommandCreate } from './create/command-create';
|
|
4
|
+
import { CommandUpdate } from './update/command-update';
|
|
5
|
+
import { CommandRemove } from './remove/command-remove';
|
|
6
|
+
import { CommandChange } from './change/command-change';
|
|
7
|
+
/**
|
|
8
|
+
* 指令消息
|
|
9
|
+
*
|
|
10
|
+
* @author chitanda
|
|
11
|
+
* @date 2023-09-05 16:09:41
|
|
12
|
+
* @export
|
|
13
|
+
* @class MessageCommand
|
|
14
|
+
* @extends {MessageBase}
|
|
15
|
+
*/
|
|
16
|
+
export class MessageCommand extends MessageBase {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
/**
|
|
20
|
+
* 数据变更指令消息
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2023-09-05 17:09:15
|
|
24
|
+
* @type {CommandChange}
|
|
25
|
+
*/
|
|
26
|
+
this.change = new CommandChange();
|
|
27
|
+
/**
|
|
28
|
+
* 新建消息
|
|
29
|
+
*
|
|
30
|
+
* @author chitanda
|
|
31
|
+
* @date 2023-09-05 17:09:55
|
|
32
|
+
* @type {CommandCreate}
|
|
33
|
+
*/
|
|
34
|
+
this.create = new CommandCreate(this);
|
|
35
|
+
/**
|
|
36
|
+
* 更新消息
|
|
37
|
+
*
|
|
38
|
+
* @author chitanda
|
|
39
|
+
* @date 2023-09-05 17:09:01
|
|
40
|
+
* @type {CommandUpdate}
|
|
41
|
+
*/
|
|
42
|
+
this.update = new CommandUpdate(this);
|
|
43
|
+
/**
|
|
44
|
+
* 删除消息
|
|
45
|
+
*
|
|
46
|
+
* @author chitanda
|
|
47
|
+
* @date 2023-09-05 17:09:05
|
|
48
|
+
* @type {CommandRemove}
|
|
49
|
+
*/
|
|
50
|
+
this.remove = new CommandRemove(this);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 推送指令消息
|
|
54
|
+
*
|
|
55
|
+
* @author chitanda
|
|
56
|
+
* @date 2023-09-05 17:09:50
|
|
57
|
+
* @param {IPortalMessage} msg
|
|
58
|
+
*/
|
|
59
|
+
next(msg) {
|
|
60
|
+
// 消息分子类型,子类型发完消息后,会让父发消息
|
|
61
|
+
// 所以子类型有父时,会一级一级的往上发消息。不需要在此处发全局消息
|
|
62
|
+
// change 特殊处理,不给父发消息
|
|
63
|
+
switch (msg.subtype) {
|
|
64
|
+
case 'OBJECTCREATED':
|
|
65
|
+
this.create.next(msg);
|
|
66
|
+
this.change.next(msg);
|
|
67
|
+
break;
|
|
68
|
+
case 'OBJECTUPDATED':
|
|
69
|
+
this.update.next(msg);
|
|
70
|
+
this.change.next(msg);
|
|
71
|
+
break;
|
|
72
|
+
case 'OBJECTREMOVED':
|
|
73
|
+
this.remove.next(msg);
|
|
74
|
+
this.change.next(msg);
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
super.next(msg);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
nextParent(msg) {
|
|
81
|
+
switch (msg.subtype) {
|
|
82
|
+
case 'OBJECTCREATED':
|
|
83
|
+
this.change.next(msg);
|
|
84
|
+
break;
|
|
85
|
+
case 'OBJECTUPDATED':
|
|
86
|
+
this.change.next(msg);
|
|
87
|
+
break;
|
|
88
|
+
case 'OBJECTREMOVED':
|
|
89
|
+
this.change.next(msg);
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
}
|
|
93
|
+
super.nextParent(msg);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 发送指令消息
|
|
97
|
+
*
|
|
98
|
+
* @author chitanda
|
|
99
|
+
* @date 2023-09-05 17:09:35
|
|
100
|
+
* @param {IData} data
|
|
101
|
+
* @param {IPortalMessage['subtype']} subtype
|
|
102
|
+
*/
|
|
103
|
+
send(data, subtype) {
|
|
104
|
+
const msg = {
|
|
105
|
+
messageid: createUUID(),
|
|
106
|
+
messagename: 'command',
|
|
107
|
+
type: 'COMMAND',
|
|
108
|
+
subtype,
|
|
109
|
+
data,
|
|
110
|
+
};
|
|
111
|
+
this.next(msg);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IAppDataEntity } from '../../interface';
|
|
2
|
+
import { CommandBase } from '../command-base/command-base';
|
|
3
|
+
/**
|
|
4
|
+
* 删除指令消息
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-09-05 17:09:03
|
|
8
|
+
* @export
|
|
9
|
+
* @class CommandRemove
|
|
10
|
+
* @extends {CommandBase}
|
|
11
|
+
*/
|
|
12
|
+
export declare class CommandRemove extends CommandBase {
|
|
13
|
+
/**
|
|
14
|
+
* 发送删除的数据
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2023-09-05 17:09:29
|
|
18
|
+
* @param {IAppDataEntity} data
|
|
19
|
+
*/
|
|
20
|
+
send(data: IAppDataEntity): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=command-remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-remove.d.ts","sourceRoot":"","sources":["../../../../../src/utils/message-center/command/remove/command-remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;CAGjC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommandBase } from '../command-base/command-base';
|
|
2
|
+
/**
|
|
3
|
+
* 删除指令消息
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-09-05 17:09:03
|
|
7
|
+
* @export
|
|
8
|
+
* @class CommandRemove
|
|
9
|
+
* @extends {CommandBase}
|
|
10
|
+
*/
|
|
11
|
+
export class CommandRemove extends CommandBase {
|
|
12
|
+
/**
|
|
13
|
+
* 发送删除的数据
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-09-05 17:09:29
|
|
17
|
+
* @param {IAppDataEntity} data
|
|
18
|
+
*/
|
|
19
|
+
send(data) {
|
|
20
|
+
this.sendCommand(data, 'OBJECTREMOVED');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IAppDataEntity } from '../../interface';
|
|
2
|
+
import { CommandBase } from '../command-base/command-base';
|
|
3
|
+
/**
|
|
4
|
+
* 更新指令消息
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-09-05 17:09:54
|
|
8
|
+
* @export
|
|
9
|
+
* @class CommandUpdate
|
|
10
|
+
* @extends {CommandBase}
|
|
11
|
+
*/
|
|
12
|
+
export declare class CommandUpdate extends CommandBase {
|
|
13
|
+
/**
|
|
14
|
+
* 发送更新的数据
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2023-09-05 17:09:37
|
|
18
|
+
* @param {IAppDataEntity} data
|
|
19
|
+
*/
|
|
20
|
+
send(data: IAppDataEntity): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=command-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-update.d.ts","sourceRoot":"","sources":["../../../../../src/utils/message-center/command/update/command-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;CAGjC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommandBase } from '../command-base/command-base';
|
|
2
|
+
/**
|
|
3
|
+
* 更新指令消息
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-09-05 17:09:54
|
|
7
|
+
* @export
|
|
8
|
+
* @class CommandUpdate
|
|
9
|
+
* @extends {CommandBase}
|
|
10
|
+
*/
|
|
11
|
+
export class CommandUpdate extends CommandBase {
|
|
12
|
+
/**
|
|
13
|
+
* 发送更新的数据
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-09-05 17:09:37
|
|
17
|
+
* @param {IAppDataEntity} data
|
|
18
|
+
*/
|
|
19
|
+
send(data) {
|
|
20
|
+
this.sendCommand(data, 'OBJECTUPDATED');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MessageBase } from '../base/message-base';
|
|
2
|
+
/**
|
|
3
|
+
* 日志消息
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-09-05 16:09:33
|
|
7
|
+
* @export
|
|
8
|
+
* @class MessageConsole
|
|
9
|
+
* @extends {MessageBase}
|
|
10
|
+
*/
|
|
11
|
+
export declare class MessageConsole extends MessageBase {
|
|
12
|
+
/**
|
|
13
|
+
* 发送日志消息
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-09-05 16:09:25
|
|
17
|
+
* @param {(IData | string)} data
|
|
18
|
+
*/
|
|
19
|
+
send(data: IData | string): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=message-console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-console.d.ts","sourceRoot":"","sources":["../../../../src/utils/message-center/console/message-console.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI;CASjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createUUID } from 'qx-util';
|
|
2
|
+
import { MessageBase } from '../base/message-base';
|
|
3
|
+
/**
|
|
4
|
+
* 日志消息
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-09-05 16:09:33
|
|
8
|
+
* @export
|
|
9
|
+
* @class MessageConsole
|
|
10
|
+
* @extends {MessageBase}
|
|
11
|
+
*/
|
|
12
|
+
export class MessageConsole extends MessageBase {
|
|
13
|
+
/**
|
|
14
|
+
* 发送日志消息
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2023-09-05 16:09:25
|
|
18
|
+
* @param {(IData | string)} data
|
|
19
|
+
*/
|
|
20
|
+
send(data) {
|
|
21
|
+
const msg = {
|
|
22
|
+
messageid: createUUID(),
|
|
23
|
+
messagename: 'console',
|
|
24
|
+
type: 'CONSOLE',
|
|
25
|
+
data,
|
|
26
|
+
};
|
|
27
|
+
this.next(msg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/message-center/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MessageCenter } from './message-center';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 应用实体数据对象
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2023-09-05 17:09:39
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IAppDataEntity
|
|
8
|
+
* @extends {IData}
|
|
9
|
+
*/
|
|
10
|
+
export interface IAppDataEntity extends IData {
|
|
11
|
+
/**
|
|
12
|
+
* 应用实体数据对象标识
|
|
13
|
+
*
|
|
14
|
+
* @author chitanda
|
|
15
|
+
* @date 2023-09-05 17:09:57
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
srfdecodename: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=i-app-data-entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-app-data-entity.d.ts","sourceRoot":"","sources":["../../../../src/utils/message-center/interface/i-app-data-entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAe,SAAQ,KAAK;IAC3C;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/message-center/interface/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { IPortalMessage } from '../../interface';
|
|
2
|
+
import { MessageAll } from './base/message-all';
|
|
3
|
+
import { MessageCommand } from './command/message-command';
|
|
4
|
+
import { MessageConsole } from './console/message-console';
|
|
5
|
+
/**
|
|
6
|
+
* 界面消息中心
|
|
7
|
+
*
|
|
8
|
+
* @author chitanda
|
|
9
|
+
* @date 2023-09-05 15:09:14
|
|
10
|
+
* @export
|
|
11
|
+
* @class MessageCenter
|
|
12
|
+
*/
|
|
13
|
+
export declare class MessageCenter {
|
|
14
|
+
/**
|
|
15
|
+
* 所有消息
|
|
16
|
+
*
|
|
17
|
+
* @author chitanda
|
|
18
|
+
* @date 2023-09-05 16:09:12
|
|
19
|
+
* @type {MessageAll}
|
|
20
|
+
*/
|
|
21
|
+
protected all: MessageAll;
|
|
22
|
+
/**
|
|
23
|
+
* 指令消息
|
|
24
|
+
*
|
|
25
|
+
* @author chitanda
|
|
26
|
+
* @date 2023-09-05 16:09:28
|
|
27
|
+
* @type {MessageCommand}
|
|
28
|
+
*/
|
|
29
|
+
readonly command: MessageCommand;
|
|
30
|
+
/**
|
|
31
|
+
* 日志消息
|
|
32
|
+
*
|
|
33
|
+
* @author chitanda
|
|
34
|
+
* @date 2023-09-05 16:09:48
|
|
35
|
+
* @type {MessageConsole}
|
|
36
|
+
*/
|
|
37
|
+
readonly console: MessageConsole;
|
|
38
|
+
/**
|
|
39
|
+
* 发送消息
|
|
40
|
+
*
|
|
41
|
+
* @author chitanda
|
|
42
|
+
* @date 2023-09-05 15:09:49
|
|
43
|
+
* @param {IPortalMessage} msg
|
|
44
|
+
*/
|
|
45
|
+
next(msg: IPortalMessage): void;
|
|
46
|
+
/**
|
|
47
|
+
* 订阅消息
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2023-09-05 17:09:32
|
|
51
|
+
* @param {(msg: IPortalMessage) => void} callback
|
|
52
|
+
*/
|
|
53
|
+
on(callback: (msg: IPortalMessage) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* 取消订阅
|
|
56
|
+
*
|
|
57
|
+
* @author chitanda
|
|
58
|
+
* @date 2023-09-05 17:09:38
|
|
59
|
+
* @param {(msg: IPortalMessage) => void} callback
|
|
60
|
+
*/
|
|
61
|
+
off(callback: (msg: IPortalMessage) => void): void;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=message-center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-center.d.ts","sourceRoot":"","sources":["../../../src/utils/message-center/message-center.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,UAAU,CAAoB;IAE7C;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAgC;IAEhE;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAgC;IAEhE;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAY/B;;;;;;OAMG;IACH,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAIjD;;;;;;OAMG;IACH,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAGnD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { MessageAll } from './base/message-all';
|
|
2
|
+
import { MessageCommand } from './command/message-command';
|
|
3
|
+
import { MessageConsole } from './console/message-console';
|
|
4
|
+
/**
|
|
5
|
+
* 界面消息中心
|
|
6
|
+
*
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2023-09-05 15:09:14
|
|
9
|
+
* @export
|
|
10
|
+
* @class MessageCenter
|
|
11
|
+
*/
|
|
12
|
+
export class MessageCenter {
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* 所有消息
|
|
16
|
+
*
|
|
17
|
+
* @author chitanda
|
|
18
|
+
* @date 2023-09-05 16:09:12
|
|
19
|
+
* @type {MessageAll}
|
|
20
|
+
*/
|
|
21
|
+
this.all = new MessageAll();
|
|
22
|
+
/**
|
|
23
|
+
* 指令消息
|
|
24
|
+
*
|
|
25
|
+
* @author chitanda
|
|
26
|
+
* @date 2023-09-05 16:09:28
|
|
27
|
+
* @type {MessageCommand}
|
|
28
|
+
*/
|
|
29
|
+
this.command = new MessageCommand(this.all);
|
|
30
|
+
/**
|
|
31
|
+
* 日志消息
|
|
32
|
+
*
|
|
33
|
+
* @author chitanda
|
|
34
|
+
* @date 2023-09-05 16:09:48
|
|
35
|
+
* @type {MessageConsole}
|
|
36
|
+
*/
|
|
37
|
+
this.console = new MessageConsole(this.all);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 发送消息
|
|
41
|
+
*
|
|
42
|
+
* @author chitanda
|
|
43
|
+
* @date 2023-09-05 15:09:49
|
|
44
|
+
* @param {IPortalMessage} msg
|
|
45
|
+
*/
|
|
46
|
+
next(msg) {
|
|
47
|
+
// 消息分子类型,子类型发完消息后,会让父发消息
|
|
48
|
+
// 所以子类型有父时,会一级一级的往上发消息。不需要在此处发全局消息
|
|
49
|
+
if (msg.type === 'COMMAND') {
|
|
50
|
+
this.command.next(msg);
|
|
51
|
+
}
|
|
52
|
+
else if (msg.type === 'CONSOLE') {
|
|
53
|
+
this.console.next(msg);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.all.next(msg);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 订阅消息
|
|
61
|
+
*
|
|
62
|
+
* @author chitanda
|
|
63
|
+
* @date 2023-09-05 17:09:32
|
|
64
|
+
* @param {(msg: IPortalMessage) => void} callback
|
|
65
|
+
*/
|
|
66
|
+
on(callback) {
|
|
67
|
+
this.all.on(callback);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 取消订阅
|
|
71
|
+
*
|
|
72
|
+
* @author chitanda
|
|
73
|
+
* @date 2023-09-05 17:09:38
|
|
74
|
+
* @param {(msg: IPortalMessage) => void} callback
|
|
75
|
+
*/
|
|
76
|
+
off(callback) {
|
|
77
|
+
this.all.off(callback);
|
|
78
|
+
}
|
|
79
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "核心包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"qx-util": "^0.4.8",
|
|
50
50
|
"ramda": "^0.29.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d363fb94c05e098f5a6c928533788e7cba99f833"
|
|
53
53
|
}
|
package/src/ibizsys.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Logger } from 'loglevel';
|
|
|
2
2
|
import { CommandController } from './command';
|
|
3
3
|
import { Environment } from './environment/environment';
|
|
4
4
|
import { OrgData } from './interface';
|
|
5
|
-
import { Net } from './utils';
|
|
5
|
+
import { MessageCenter, Net } from './utils';
|
|
6
6
|
import { logger } from './utils/logger/logger';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -49,6 +49,15 @@ export class IBizSys {
|
|
|
49
49
|
*/
|
|
50
50
|
commands: CommandController = new CommandController();
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* 界面消息中心
|
|
54
|
+
*
|
|
55
|
+
* @author chitanda
|
|
56
|
+
* @date 2023-09-05 17:09:38
|
|
57
|
+
* @type {MessageCenter}
|
|
58
|
+
*/
|
|
59
|
+
mc: MessageCenter = new MessageCenter();
|
|
60
|
+
|
|
52
61
|
/**
|
|
53
62
|
* sass 模式下的中心系统标识
|
|
54
63
|
*
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 异步作业信息
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2023-09-05 15:09:59
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IPortalAsyncAction
|
|
8
|
+
*/
|
|
9
|
+
export interface IPortalAsyncAction {
|
|
10
|
+
/**
|
|
11
|
+
* 会话标识
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2023-09-05 15:09:57
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
fulltopictag: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 异步作业类型
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2023-09-05 15:09:09
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
actiontype: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 异步作业执行结果
|
|
30
|
+
*
|
|
31
|
+
* @author chitanda
|
|
32
|
+
* @date 2023-09-05 15:09:33
|
|
33
|
+
* @type {unknown}
|
|
34
|
+
*/
|
|
35
|
+
actionresult?: unknown;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 步骤信息
|
|
39
|
+
*
|
|
40
|
+
* @author chitanda
|
|
41
|
+
* @date 2023-09-05 15:09:55
|
|
42
|
+
* @type {string}
|
|
43
|
+
*/
|
|
44
|
+
stepinfo?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 异步结果下载路径,目前是留给导出数据使用
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2023-09-05 15:09:03
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
asyncresultdownloadurl?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 预留参数
|
|
57
|
+
*
|
|
58
|
+
* @author chitanda
|
|
59
|
+
* @date 2023-09-05 15:09:32
|
|
60
|
+
* @type {unknown}
|
|
61
|
+
*/
|
|
62
|
+
actionparam?: unknown;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*预留参数2
|
|
66
|
+
*
|
|
67
|
+
* @author chitanda
|
|
68
|
+
* @date 2023-09-05 15:09:41
|
|
69
|
+
* @type {unknown}
|
|
70
|
+
*/
|
|
71
|
+
actionparam2?: unknown;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
*预留参数3
|
|
75
|
+
*
|
|
76
|
+
* @author chitanda
|
|
77
|
+
* @date 2023-09-05 15:09:43
|
|
78
|
+
* @type {unknown}
|
|
79
|
+
*/
|
|
80
|
+
actionparam3?: unknown;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*预留参数4
|
|
84
|
+
*
|
|
85
|
+
* @author chitanda
|
|
86
|
+
* @date 2023-09-05 15:09:45
|
|
87
|
+
* @type {unknown}
|
|
88
|
+
*/
|
|
89
|
+
actionparam4?: unknown;
|
|
90
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IPortalAsyncAction } from '../i-portal-async-action/i-portal-async-action';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 消息数据
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-09-05 15:09:02
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IPortalMessage
|
|
10
|
+
*/
|
|
11
|
+
export interface IPortalMessage {
|
|
12
|
+
/**
|
|
13
|
+
* 消息标识
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-09-05 15:09:43
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
messageid: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 消息名称
|
|
23
|
+
*
|
|
24
|
+
* @author chitanda
|
|
25
|
+
* @date 2023-09-05 15:09:49
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
messagename: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 消息类型
|
|
32
|
+
*
|
|
33
|
+
* @author chitanda
|
|
34
|
+
* @date 2023-09-05 15:09:09
|
|
35
|
+
* @type {('CONSOLE' | 'COMMAND')} 日志消息 | 命令
|
|
36
|
+
*/
|
|
37
|
+
type: 'CONSOLE' | 'COMMAND';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 消息子类型
|
|
41
|
+
*
|
|
42
|
+
* @author chitanda
|
|
43
|
+
* @date 2023-09-05 15:09:50
|
|
44
|
+
* @type {('MARKOPENDATA' | 'ASYNCACTION')} 标注打开数据 | 异步作业 | 数据更新 | 数据删除 | 数据创建
|
|
45
|
+
*/
|
|
46
|
+
subtype?:
|
|
47
|
+
| 'MARKOPENDATA'
|
|
48
|
+
| 'ASYNCACTION'
|
|
49
|
+
| 'OBJECTUPDATED'
|
|
50
|
+
| 'OBJECTREMOVED'
|
|
51
|
+
| 'OBJECTCREATED';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 内容摘要
|
|
55
|
+
*
|
|
56
|
+
* @author chitanda
|
|
57
|
+
* @date 2023-09-05 15:09:23
|
|
58
|
+
* @type {string}
|
|
59
|
+
*/
|
|
60
|
+
content?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 消息数据
|
|
64
|
+
*
|
|
65
|
+
* @author chitanda
|
|
66
|
+
* @date 2023-09-05 15:09:55
|
|
67
|
+
* @type {(IPortalAsyncAction | IData | string | unknown)}
|
|
68
|
+
*/
|
|
69
|
+
data?: IPortalAsyncAction | IData | string | unknown;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 消息路径
|
|
73
|
+
*
|
|
74
|
+
* @author chitanda
|
|
75
|
+
* @date 2023-09-05 15:09:25
|
|
76
|
+
* @type {string}
|
|
77
|
+
*/
|
|
78
|
+
url?: string;
|
|
79
|
+
}
|
package/src/interface/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './click-outside/click-outside';
|
|
2
2
|
export type { I18n } from './i-18n/i-18n';
|
|
3
3
|
export type { IEnvironment } from './i-environment/i-environment';
|
|
4
|
+
export type { IPortalAsyncAction } from './i-portal-async-action/i-portal-async-action';
|
|
5
|
+
export type { IPortalMessage } from './i-portal-message/i-portal-message';
|
|
4
6
|
export type { OrgData } from './org-data/org-data';
|