@ibiz-template/runtime 0.5.7-alpha.8 → 0.6.0-alpha.0
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 +475 -82
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts.map +1 -1
- package/out/application.js +0 -1
- package/out/command/app/open-app-view/open-app-view.d.ts +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +4 -3
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +4 -3
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts +43 -5
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar-filter.controller.js +79 -6
- package/out/controller/control/search-bar/search-bar.controller.d.ts +10 -1
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +48 -6
- package/out/controller/control/search-bar/use-searchcond.d.ts.map +1 -1
- package/out/controller/control/search-bar/use-searchcond.js +7 -1
- package/out/controller/notification/internal-message.controller.d.ts +21 -2
- package/out/controller/notification/internal-message.controller.d.ts.map +1 -1
- package/out/controller/notification/internal-message.controller.js +91 -3
- package/out/controller/notification/notice.controller.d.ts +3 -1
- package/out/controller/notification/notice.controller.d.ts.map +1 -1
- package/out/controller/notification/notice.controller.js +6 -0
- package/out/hub/config/app-view-config-service.d.ts +14 -0
- package/out/hub/config/app-view-config-service.d.ts.map +1 -1
- package/out/hub/config/app-view-config-service.js +27 -11
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts +4 -0
- package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts.map +1 -1
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts +9 -0
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts.map +1 -1
- package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts +59 -3
- package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/notice/i-notice.controller.d.ts +16 -0
- package/out/interface/controller/controller/notice/i-notice.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/notice/index.d.ts +2 -2
- package/out/interface/controller/controller/notice/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/provider/i-internal-message.provider.d.ts +1 -1
- package/out/interface/provider/i-internal-message.provider.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/interface/service/service/i-internal-message.service.d.ts +16 -1
- package/out/interface/service/service/i-internal-message.service.d.ts.map +1 -1
- package/out/interface/service/service/i-mark-open-data.service.d.ts +20 -1
- package/out/interface/service/service/i-mark-open-data.service.d.ts.map +1 -1
- package/out/interface/service/service/index.d.ts +1 -1
- package/out/interface/service/service/index.d.ts.map +1 -1
- package/out/interface/util/i-notification-util/i-notification-util.d.ts +7 -0
- package/out/interface/util/i-notification-util/i-notification-util.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-de-ui-logic-executor.js +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +2 -2
- package/out/service/de-service-util.d.ts +1 -1
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +2 -2
- package/out/service/service/control/control.service.d.ts +10 -2
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/control/control.service.js +17 -1
- package/out/service/service/control/md-control.service.d.ts +2 -2
- package/out/service/service/control/md-control.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.d.ts +1 -1
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +2 -2
- package/out/service/service/entity/method/de-action.d.ts +6 -6
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +16 -16
- package/out/service/service/entity/method/fetch.d.ts +1 -1
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +2 -2
- package/out/service/service/entity/method/method.d.ts +2 -2
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +4 -4
- package/out/service/service/internal-message/internal-message.service.d.ts +16 -1
- package/out/service/service/internal-message/internal-message.service.d.ts.map +1 -1
- package/out/service/service/internal-message/internal-message.service.js +42 -0
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts +26 -1
- package/out/service/service/mark-open-data/mark-open-data.service.d.ts.map +1 -1
- package/out/service/service/mark-open-data/mark-open-data.service.js +45 -0
- package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts +1 -1
- package/out/service/utils/dyna-sys-params/dyna-sys-params.js +4 -4
- package/out/service/utils/util/util.d.ts.map +1 -1
- package/out/service/utils/util/util.js +21 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +3 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts +10 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +25 -1
- package/out/ui-logic/index.d.ts.map +1 -1
- package/out/ui-logic/index.js +1 -2
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +11 -1
- package/package.json +5 -5
- package/src/application.ts +0 -2
- package/src/command/app/open-app-view/open-app-view.ts +6 -3
- package/src/controller/control/grid/grid/grid.controller.ts +4 -5
- package/src/controller/control/search-bar/search-bar-filter.controller.ts +90 -10
- package/src/controller/control/search-bar/search-bar.controller.ts +67 -11
- package/src/controller/control/search-bar/use-searchcond.ts +9 -2
- package/src/controller/notification/internal-message.controller.ts +102 -6
- package/src/controller/notification/notice.controller.ts +9 -1
- package/src/hub/config/app-view-config-service.ts +29 -0
- package/src/interface/common/i-app-view-config-service/i-app-view-config-service.ts +4 -0
- package/src/interface/common/i-open-view-options/i-open-view-options.ts +10 -0
- package/src/interface/controller/controller/notice/i-internal-message.controller.ts +66 -3
- package/src/interface/controller/controller/notice/i-notice.controller.ts +18 -0
- package/src/interface/controller/controller/notice/index.ts +2 -2
- package/src/interface/controller/state/control/i-grid.state.ts +8 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +16 -0
- package/src/interface/provider/i-internal-message.provider.ts +1 -2
- package/src/interface/service/service/i-app-de.service.ts +1 -0
- package/src/interface/service/service/i-internal-message.service.ts +18 -1
- package/src/interface/service/service/i-mark-open-data.service.ts +31 -1
- package/src/interface/service/service/index.ts +1 -0
- package/src/interface/util/i-notification-util/i-notification-util.ts +9 -0
- package/src/logic-scheduler/executor/app-de-ui-logic-executor.ts +1 -1
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +2 -2
- package/src/service/de-service-util.ts +2 -1
- package/src/service/service/control/control.service.ts +20 -2
- package/src/service/service/control/md-control.service.ts +2 -2
- package/src/service/service/entity/de.service.ts +2 -1
- package/src/service/service/entity/method/de-action.ts +16 -7
- package/src/service/service/entity/method/fetch.ts +2 -1
- package/src/service/service/entity/method/method.ts +5 -0
- package/src/service/service/internal-message/internal-message.service.ts +46 -2
- package/src/service/service/mark-open-data/mark-open-data.service.ts +61 -1
- package/src/service/utils/dyna-sys-params/dyna-sys-params.ts +6 -6
- package/src/service/utils/util/util.ts +20 -1
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +2 -0
- package/src/ui-action/provider/front-ui-action-provider.ts +25 -1
- package/src/ui-logic/index.ts +1 -2
- package/src/utils/open-redirect-view/open-redirect-view.ts +10 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuntimeError, recursiveIterate } from '@ibiz-template/core';
|
|
2
2
|
import { isNil } from 'ramda';
|
|
3
|
-
import { IFilterNode } from '../../../interface';
|
|
3
|
+
import { IFilterLeafNode, IFilterNode } from '../../../interface';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 获取初始过滤项树节点数据集合
|
|
@@ -35,12 +35,18 @@ export function formatFilters(node: IFilterNode): IData {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const leafNode = node as IFilterLeafNode;
|
|
39
|
+
const temp: IData = {
|
|
39
40
|
condtype: 'DEFIELD',
|
|
40
41
|
fieldname: node.field,
|
|
41
42
|
condop: node.valueOP,
|
|
42
43
|
value: node.value,
|
|
43
44
|
};
|
|
45
|
+
|
|
46
|
+
if (leafNode.valueItem) {
|
|
47
|
+
temp.valueItem = leafNode.valueItem;
|
|
48
|
+
}
|
|
49
|
+
return temp;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
/**
|
|
@@ -66,6 +72,7 @@ export function parseFilters(data: IData): IFilterNode {
|
|
|
66
72
|
field: data.fieldname || null,
|
|
67
73
|
valueOP: data.condop || null,
|
|
68
74
|
value: data.value || null,
|
|
75
|
+
valueItem: data.valueItem || undefined,
|
|
69
76
|
};
|
|
70
77
|
}
|
|
71
78
|
throw new RuntimeError(`无效的condtype:${data.condtype}`);
|
|
@@ -2,15 +2,23 @@ import { IInternalMessage, IPortalMessage } from '@ibiz-template/core';
|
|
|
2
2
|
import { QXEvent } from 'qx-util';
|
|
3
3
|
import {
|
|
4
4
|
IInternalMessageController,
|
|
5
|
-
|
|
5
|
+
IInternalMessageEvent,
|
|
6
6
|
} from '../../interface';
|
|
7
7
|
import { InternalMessageService } from '../../service';
|
|
8
8
|
|
|
9
|
+
function isHTML(str: string): boolean {
|
|
10
|
+
if (str === '') return false;
|
|
11
|
+
const doc = new DOMParser().parseFromString(str, 'text/html');
|
|
12
|
+
return Array.from(doc.body.childNodes).some(node => node.nodeType === 1);
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
export class InternalMessageController implements IInternalMessageController {
|
|
10
|
-
readonly evt: QXEvent<
|
|
16
|
+
readonly evt: QXEvent<IInternalMessageEvent> = new QXEvent();
|
|
11
17
|
|
|
12
18
|
total: number = 0;
|
|
13
19
|
|
|
20
|
+
unreadCount: number = 0;
|
|
21
|
+
|
|
14
22
|
/**
|
|
15
23
|
* 当前分页
|
|
16
24
|
* @author lxm
|
|
@@ -23,21 +31,53 @@ export class InternalMessageController implements IInternalMessageController {
|
|
|
23
31
|
|
|
24
32
|
messages: IInternalMessage[] = [];
|
|
25
33
|
|
|
34
|
+
unreadOnly = false;
|
|
35
|
+
|
|
26
36
|
protected service = new InternalMessageService();
|
|
27
37
|
|
|
28
38
|
async init(): Promise<void> {
|
|
29
|
-
this.load();
|
|
39
|
+
await this.load();
|
|
30
40
|
this.listenMqtt();
|
|
41
|
+
await this.refreshUnreadCount();
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
async load(): Promise<void> {
|
|
34
|
-
|
|
45
|
+
try {
|
|
46
|
+
await this.fetch(false);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
ibiz.log.error(error);
|
|
49
|
+
}
|
|
35
50
|
}
|
|
36
51
|
|
|
37
52
|
async loadMore(): Promise<void> {
|
|
38
53
|
await this.fetch(true);
|
|
39
54
|
}
|
|
40
55
|
|
|
56
|
+
async refreshUnreadCount(): Promise<void> {
|
|
57
|
+
try {
|
|
58
|
+
this.unreadCount = await this.service.getUnreadNum();
|
|
59
|
+
this.evt.emit('unreadCountChange', this.unreadCount);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
ibiz.log.error(error);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 切换是否只读
|
|
67
|
+
* @author lxm
|
|
68
|
+
* @date 2024-02-04 10:21:22
|
|
69
|
+
* @param {val} [boolean] 是否只读
|
|
70
|
+
*/
|
|
71
|
+
toggleUnReadOnly(val?: boolean): void {
|
|
72
|
+
const nextVal = val === undefined ? !this.unreadOnly : val;
|
|
73
|
+
if (this.unreadOnly === nextVal) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.unreadOnly = nextVal;
|
|
77
|
+
this.evt.emit('unreadOnlyChange', this.unreadOnly);
|
|
78
|
+
this.load();
|
|
79
|
+
}
|
|
80
|
+
|
|
41
81
|
protected async fetch(loadMore: boolean = false): Promise<void> {
|
|
42
82
|
// *计算查询参数
|
|
43
83
|
if (loadMore === false) {
|
|
@@ -46,12 +86,31 @@ export class InternalMessageController implements IInternalMessageController {
|
|
|
46
86
|
this.page += 1;
|
|
47
87
|
}
|
|
48
88
|
|
|
49
|
-
const fetchParams = {
|
|
89
|
+
const fetchParams: IParams = {
|
|
50
90
|
page: this.page,
|
|
51
91
|
size: this.size,
|
|
52
92
|
sort: 'update_time,desc',
|
|
53
93
|
};
|
|
54
94
|
|
|
95
|
+
// 是否只搜索未读
|
|
96
|
+
if (this.unreadOnly) {
|
|
97
|
+
fetchParams.searchconds = [
|
|
98
|
+
{
|
|
99
|
+
condtype: 'GROUP',
|
|
100
|
+
condop: 'AND',
|
|
101
|
+
bnotmode: false,
|
|
102
|
+
searchconds: [
|
|
103
|
+
{
|
|
104
|
+
condop: 'EQ',
|
|
105
|
+
condtype: 'DEFIELD',
|
|
106
|
+
fieldname: 'status',
|
|
107
|
+
value: 'RECEIVED',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
|
|
55
114
|
const res = await this.service.fetch(fetchParams);
|
|
56
115
|
this.total = res.total!;
|
|
57
116
|
|
|
@@ -60,6 +119,7 @@ export class InternalMessageController implements IInternalMessageController {
|
|
|
60
119
|
} else {
|
|
61
120
|
this.messages = res.data;
|
|
62
121
|
}
|
|
122
|
+
|
|
63
123
|
this.evt.emit('dataChange');
|
|
64
124
|
}
|
|
65
125
|
|
|
@@ -77,7 +137,43 @@ export class InternalMessageController implements IInternalMessageController {
|
|
|
77
137
|
}
|
|
78
138
|
|
|
79
139
|
// todo 目前会有一种情况,不带data,弹右下角消息提示
|
|
80
|
-
|
|
140
|
+
if (msg.content) {
|
|
141
|
+
ibiz.notification.info({
|
|
142
|
+
isHtmlDesc: isHTML(msg.content),
|
|
143
|
+
desc: msg.content,
|
|
144
|
+
position: 'bottom-right',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
81
147
|
});
|
|
82
148
|
}
|
|
149
|
+
|
|
150
|
+
async markRead(message: IInternalMessage): Promise<void> {
|
|
151
|
+
if (message.status !== 'RECEIVED') {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const find = this.messages.find(msg => msg.id === message.id);
|
|
155
|
+
if (!find) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// todo 后台接口适配
|
|
160
|
+
await this.service.markRead(message.id);
|
|
161
|
+
// find.status = 'READ';
|
|
162
|
+
// this.unreadCount -= 1;
|
|
163
|
+
|
|
164
|
+
this.evt.emit('unreadCountChange', this.unreadCount);
|
|
165
|
+
this.evt.emit('dataChange');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 获取完整信息
|
|
170
|
+
* @author lxm
|
|
171
|
+
* @date 2024-01-30 05:03:25
|
|
172
|
+
* @param {string} id
|
|
173
|
+
* @return {*} {Promise<IInternalMessage>}
|
|
174
|
+
*/
|
|
175
|
+
async get(id: string): Promise<IInternalMessage> {
|
|
176
|
+
const res = await this.service.get(id);
|
|
177
|
+
return res.data;
|
|
178
|
+
}
|
|
83
179
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QXEvent } from 'qx-util';
|
|
2
|
+
import { INoticeController, INoticeEvent } from '../../interface';
|
|
2
3
|
import { AsyncActionController } from './async-action.controller';
|
|
3
4
|
import { InternalMessageController } from './internal-message.controller';
|
|
4
5
|
|
|
5
6
|
export class NoticeController implements INoticeController {
|
|
7
|
+
readonly evt: QXEvent<INoticeEvent> = new QXEvent();
|
|
8
|
+
|
|
6
9
|
total = 0;
|
|
7
10
|
|
|
8
11
|
asyncAction = new AsyncActionController();
|
|
@@ -12,5 +15,10 @@ export class NoticeController implements INoticeController {
|
|
|
12
15
|
async init(): Promise<void> {
|
|
13
16
|
await this.internalMessage.init();
|
|
14
17
|
await this.asyncAction.init();
|
|
18
|
+
|
|
19
|
+
this.internalMessage.evt.on('unreadCountChange', () => {
|
|
20
|
+
this.total = this.internalMessage.unreadCount;
|
|
21
|
+
this.evt.emit('totalChange', this.total);
|
|
22
|
+
});
|
|
15
23
|
}
|
|
16
24
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { IAppView } from '@ibiz/model-core';
|
|
2
3
|
import { IAppViewConfigService, IViewConfig } from '../../interface';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -38,6 +39,33 @@ export class AppViewConfigService implements IAppViewConfigService {
|
|
|
38
39
|
return id;
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* 获取视图自定义Option
|
|
44
|
+
*
|
|
45
|
+
* @author zk
|
|
46
|
+
* @date 2024-01-31 11:01:20
|
|
47
|
+
* @protected
|
|
48
|
+
* @param {IAppView} model
|
|
49
|
+
* @return {*} {IData}
|
|
50
|
+
* @memberof AppViewConfigService
|
|
51
|
+
*/
|
|
52
|
+
protected getCustomOption(model: IAppView): { modalOption: IData } {
|
|
53
|
+
const { appViewParams } = model;
|
|
54
|
+
// 解析ModalOption参数
|
|
55
|
+
const optionProperty = appViewParams?.find(
|
|
56
|
+
item => item.id === 'modaloption',
|
|
57
|
+
)?.value;
|
|
58
|
+
let modalOption = {};
|
|
59
|
+
if (optionProperty) {
|
|
60
|
+
try {
|
|
61
|
+
modalOption = JSON.parse(optionProperty);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
ibiz.log.error(`视图参数modalOption 解析失败:${error}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { modalOption };
|
|
67
|
+
}
|
|
68
|
+
|
|
41
69
|
has(key: string): boolean {
|
|
42
70
|
const id = this.calcAppViewId(key);
|
|
43
71
|
return this.viewConfigs.has(id);
|
|
@@ -66,6 +94,7 @@ export class AppViewConfigService implements IAppViewConfigService {
|
|
|
66
94
|
height: model.height,
|
|
67
95
|
appDataEntityId: model.appDataEntityId,
|
|
68
96
|
redirectView: model.redirectView,
|
|
97
|
+
...this.getCustomOption(model),
|
|
69
98
|
});
|
|
70
99
|
}
|
|
71
100
|
return this.viewConfigs.get(id)!;
|
|
@@ -7,13 +7,26 @@ import { QXEvent } from 'qx-util';
|
|
|
7
7
|
* @date 2024-01-26 10:47:41
|
|
8
8
|
* @interface InternalMessageEvent
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface IInternalMessageEvent {
|
|
11
11
|
/**
|
|
12
12
|
* 所有数据的变更,新增,删除,更新都算
|
|
13
13
|
* @author lxm
|
|
14
14
|
* @date 2024-01-26 10:56:50
|
|
15
15
|
*/
|
|
16
16
|
dataChange: () => void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 未读数量变更
|
|
20
|
+
* @author lxm
|
|
21
|
+
* @date 2024-01-30 02:46:55
|
|
22
|
+
*/
|
|
23
|
+
unreadCountChange: (num: number) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 是否只显示未读变更
|
|
26
|
+
* @author lxm
|
|
27
|
+
* @date 2024-01-30 02:46:55
|
|
28
|
+
*/
|
|
29
|
+
unreadOnlyChange: (val: boolean) => void;
|
|
17
30
|
}
|
|
18
31
|
|
|
19
32
|
/**
|
|
@@ -28,9 +41,9 @@ export interface IInternalMessageController {
|
|
|
28
41
|
* 事件
|
|
29
42
|
* @author lxm
|
|
30
43
|
* @date 2024-01-26 10:48:53
|
|
31
|
-
* @type {QXEvent<
|
|
44
|
+
* @type {QXEvent<IInternalMessageEvent>}
|
|
32
45
|
*/
|
|
33
|
-
readonly evt: QXEvent<
|
|
46
|
+
readonly evt: QXEvent<IInternalMessageEvent>;
|
|
34
47
|
|
|
35
48
|
/**
|
|
36
49
|
* 总条数
|
|
@@ -56,6 +69,22 @@ export interface IInternalMessageController {
|
|
|
56
69
|
*/
|
|
57
70
|
readonly messages: IInternalMessage[];
|
|
58
71
|
|
|
72
|
+
/**
|
|
73
|
+
* 未读消息个数
|
|
74
|
+
* @author lxm
|
|
75
|
+
* @date 2024-01-30 02:39:54
|
|
76
|
+
* @type {number}
|
|
77
|
+
*/
|
|
78
|
+
readonly unreadCount: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 是否只查询未读的消息
|
|
82
|
+
* @author lxm
|
|
83
|
+
* @date 2024-02-04 10:26:00
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
86
|
+
unreadOnly: boolean;
|
|
87
|
+
|
|
59
88
|
/**
|
|
60
89
|
* 加载(会重置数据)
|
|
61
90
|
* @author lxm
|
|
@@ -71,4 +100,38 @@ export interface IInternalMessageController {
|
|
|
71
100
|
* @return {*} {Promise<void>}
|
|
72
101
|
*/
|
|
73
102
|
loadMore(): Promise<void>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 刷新未读数据条数
|
|
106
|
+
* @author lxm
|
|
107
|
+
* @date 2024-02-04 09:37:58
|
|
108
|
+
* @return {*} {Promise<void>}
|
|
109
|
+
*/
|
|
110
|
+
refreshUnreadCount(): Promise<void>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 把某条消息记录标记为已读
|
|
114
|
+
* @author lxm
|
|
115
|
+
* @date 2024-01-30 02:31:17
|
|
116
|
+
* @param {IInternalMessage} message
|
|
117
|
+
* @return {*} {Promise<void>}
|
|
118
|
+
*/
|
|
119
|
+
markRead(message: IInternalMessage): Promise<void>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 获取完整消息
|
|
123
|
+
* @author lxm
|
|
124
|
+
* @date 2024-01-30 05:03:51
|
|
125
|
+
* @param {string} id
|
|
126
|
+
* @return {*} {Promise<IInternalMessage>}
|
|
127
|
+
*/
|
|
128
|
+
get(id: string): Promise<IInternalMessage>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 切换是否只读
|
|
132
|
+
* @author lxm
|
|
133
|
+
* @date 2024-02-04 10:21:22
|
|
134
|
+
* @param {val} [boolean] 是否只读
|
|
135
|
+
*/
|
|
136
|
+
toggleUnReadOnly(val?: boolean): void;
|
|
74
137
|
}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
import { QXEvent } from 'qx-util';
|
|
1
2
|
import { IAsyncActionController } from './i-async-action.controller';
|
|
2
3
|
import { IInternalMessageController } from './i-internal-message.controller';
|
|
3
4
|
|
|
5
|
+
export interface INoticeEvent {
|
|
6
|
+
/**
|
|
7
|
+
* 需要处理的通知总数变更
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2024-01-26 10:56:50
|
|
10
|
+
*/
|
|
11
|
+
totalChange: (total: number) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
4
14
|
export interface INoticeController {
|
|
15
|
+
/**
|
|
16
|
+
* 事件
|
|
17
|
+
* @author lxm
|
|
18
|
+
* @date 2024-01-26 10:48:53
|
|
19
|
+
* @type {QXEvent<InternalMessageEvent>}
|
|
20
|
+
*/
|
|
21
|
+
readonly evt: QXEvent<INoticeEvent>;
|
|
22
|
+
|
|
5
23
|
/**
|
|
6
24
|
* 需要处理的通知总数
|
|
7
25
|
* @author lxm
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { INoticeController } from './i-notice.controller';
|
|
1
|
+
export type { INoticeController, INoticeEvent } from './i-notice.controller';
|
|
2
2
|
export type {
|
|
3
3
|
IAsyncActionController,
|
|
4
4
|
IAsyncActionEvent,
|
|
5
5
|
} from './i-async-action.controller';
|
|
6
6
|
export type {
|
|
7
7
|
IInternalMessageController,
|
|
8
|
-
|
|
8
|
+
IInternalMessageEvent,
|
|
9
9
|
} from './i-internal-message.controller';
|
|
@@ -44,6 +44,14 @@ export interface IGridState extends IMDControlState {
|
|
|
44
44
|
* @type {boolean}
|
|
45
45
|
*/
|
|
46
46
|
rowEditOpen: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 表格popover层级
|
|
50
|
+
* @author fzh
|
|
51
|
+
* @date 2024-02-04 18:57:18
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
zIndex?: number;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
export interface IGridRowState {
|
|
@@ -76,6 +76,22 @@ export interface IFilterLeafNode {
|
|
|
76
76
|
* @type {string}
|
|
77
77
|
*/
|
|
78
78
|
valueOP: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 禁用,禁止修改
|
|
82
|
+
* @author lxm
|
|
83
|
+
* @date 2024-02-01 02:51:40
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 值项的值
|
|
90
|
+
* @author lxm
|
|
91
|
+
* @date 2024-02-04 06:40:17
|
|
92
|
+
* @type {unknown}
|
|
93
|
+
*/
|
|
94
|
+
valueItem?: unknown;
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
export type IFilterNode = IFilterBranchNode | IFilterLeafNode;
|
|
@@ -25,5 +25,22 @@ export interface IInternalMessageService {
|
|
|
25
25
|
* @param {string} actionID
|
|
26
26
|
* @return {*} {Promise<IHttpResponse<IInternalMessage[]>>}
|
|
27
27
|
*/
|
|
28
|
-
get(actionID: string): Promise<IHttpResponse<IInternalMessage
|
|
28
|
+
get(actionID: string): Promise<IHttpResponse<IInternalMessage>>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 设置已读
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2024-02-04 03:59:52
|
|
34
|
+
* @param {string} messageId
|
|
35
|
+
* @return {*} {Promise<void>}
|
|
36
|
+
*/
|
|
37
|
+
markRead(messageId: string): Promise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 获取未读数据的总条数
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2024-02-04 09:35:06
|
|
43
|
+
* @return {*} {Promise<number>}
|
|
44
|
+
*/
|
|
45
|
+
getUnreadNum(): Promise<number>;
|
|
29
46
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { IHttpResponse } from '@ibiz-template/core';
|
|
1
|
+
import { IHttpResponse, IMarkOpenData } from '@ibiz-template/core';
|
|
2
2
|
|
|
3
3
|
export type MarkOpenDataActionType = 'VIEW' | 'EDIT' | 'UPDATE' | 'CLOSE';
|
|
4
4
|
|
|
5
|
+
export type MarkOpenDataCallbackFun = (data: IMarkOpenData) => void;
|
|
6
|
+
|
|
5
7
|
export interface IMarkOpenDataService {
|
|
6
8
|
/**
|
|
7
9
|
* 获取站内信的集合
|
|
@@ -15,4 +17,32 @@ export interface IMarkOpenDataService {
|
|
|
15
17
|
key: string,
|
|
16
18
|
action: MarkOpenDataActionType,
|
|
17
19
|
): Promise<IHttpResponse>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 监听指定实体指定主键的消息
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2024-02-01 04:45:31
|
|
25
|
+
* @param {string} deName
|
|
26
|
+
* @param {string} key
|
|
27
|
+
* @param {CallbackFun} callback
|
|
28
|
+
*/
|
|
29
|
+
subscribe(
|
|
30
|
+
deName: string,
|
|
31
|
+
key: string,
|
|
32
|
+
callback: MarkOpenDataCallbackFun,
|
|
33
|
+
): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 取消监听指定实体指定主键的消息
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2024-02-01 04:48:19
|
|
39
|
+
* @param {string} deName
|
|
40
|
+
* @param {string} key
|
|
41
|
+
* @param {MarkOpenDataCallbackFun} callback
|
|
42
|
+
*/
|
|
43
|
+
unsubscribe(
|
|
44
|
+
deName: string,
|
|
45
|
+
key: string,
|
|
46
|
+
callback: MarkOpenDataCallbackFun,
|
|
47
|
+
): void;
|
|
18
48
|
}
|
|
@@ -23,6 +23,15 @@ export interface NotificationParams {
|
|
|
23
23
|
* @type {string}
|
|
24
24
|
*/
|
|
25
25
|
desc?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 描述是否是html字符串
|
|
29
|
+
* @author lxm
|
|
30
|
+
* @date 2024-02-04 03:18:25
|
|
31
|
+
* @type {boolean}
|
|
32
|
+
*/
|
|
33
|
+
isHtmlDesc?: boolean;
|
|
34
|
+
|
|
26
35
|
/**
|
|
27
36
|
* 自动关闭的延时,单位秒,不关闭可以写 0
|
|
28
37
|
*
|
|
@@ -20,6 +20,6 @@ export class AppDEUILogicExecutor extends LogicExecutor {
|
|
|
20
20
|
if (!appDEUILogicId) {
|
|
21
21
|
throw new RuntimeModelError(this.logic, '没有配置实体界面逻辑');
|
|
22
22
|
}
|
|
23
|
-
execUILogic(appDEUILogicId!, appDataEntityId!, executeParams);
|
|
23
|
+
return execUILogic(appDEUILogicId!, appDataEntityId!, executeParams);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -119,7 +119,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
119
119
|
openView,
|
|
120
120
|
tempContext,
|
|
121
121
|
tempParams,
|
|
122
|
-
rest,
|
|
122
|
+
{ ...rest, openMode: openViewRef.openMode },
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -251,7 +251,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
251
251
|
newViewRef.refAppViewId,
|
|
252
252
|
tempContext,
|
|
253
253
|
tempParams,
|
|
254
|
-
rest,
|
|
254
|
+
{ ...rest, openMode: newViewRef.openMode },
|
|
255
255
|
);
|
|
256
256
|
|
|
257
257
|
// 执行批添加新建逻辑
|
|
@@ -195,8 +195,9 @@ export class DEServiceUtil {
|
|
|
195
195
|
context: IContext,
|
|
196
196
|
params?: IData | IData[] | undefined,
|
|
197
197
|
params2?: IParams | undefined,
|
|
198
|
+
header?: IData,
|
|
198
199
|
): Promise<IHttpResponse<IData>> {
|
|
199
200
|
const service = await this.getService(context, appDataEntityId);
|
|
200
|
-
return service.exec(methodName, context, params, params2);
|
|
201
|
+
return service.exec(methodName, context, params, params2, header);
|
|
201
202
|
}
|
|
202
203
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IHttpResponse, clone } from '@ibiz-template/core';
|
|
2
|
-
import {
|
|
2
|
+
import { IAjaxControl } from '@ibiz/model-core';
|
|
3
3
|
import { ControlVO } from '../../vo/control.vo';
|
|
4
4
|
import { UIMapField } from '../../vo/ui-map-field';
|
|
5
5
|
import { IAppService } from '../../../interface';
|
|
6
6
|
|
|
7
|
-
export class ControlService<T extends
|
|
7
|
+
export class ControlService<T extends IAjaxControl = IAjaxControl> {
|
|
8
8
|
app!: IAppService;
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -72,16 +72,34 @@ export class ControlService<T extends IControl = IControl> {
|
|
|
72
72
|
data?: IData,
|
|
73
73
|
params?: IParams,
|
|
74
74
|
): Promise<IHttpResponse> {
|
|
75
|
+
const header = this.handleCustomRequestHeader();
|
|
75
76
|
const res = await this.app.deService.exec(
|
|
76
77
|
this.model.appDataEntityId!,
|
|
77
78
|
methodName,
|
|
78
79
|
context,
|
|
79
80
|
data,
|
|
80
81
|
params,
|
|
82
|
+
header,
|
|
81
83
|
);
|
|
82
84
|
return res;
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
/**
|
|
88
|
+
* 处理自定义请求头
|
|
89
|
+
*
|
|
90
|
+
* @author zk
|
|
91
|
+
* @date 2024-02-02 11:02:55
|
|
92
|
+
* @memberof ControlService
|
|
93
|
+
*/
|
|
94
|
+
protected handleCustomRequestHeader(): IData {
|
|
95
|
+
const customHeader = {};
|
|
96
|
+
const { enableItemPrivilege } = this.model;
|
|
97
|
+
if (enableItemPrivilege) {
|
|
98
|
+
Object.assign(customHeader, { srfdataaccaction: true });
|
|
99
|
+
}
|
|
100
|
+
return customHeader;
|
|
101
|
+
}
|
|
102
|
+
|
|
85
103
|
/**
|
|
86
104
|
* 处理响应
|
|
87
105
|
*
|