@ibiz-template/runtime 0.1.32 → 0.1.34
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 +448 -235
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/control.controller.d.ts +1 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +21 -1
- package/out/controller/common/control/md-control.controller.js +2 -2
- package/out/controller/common/editor/code-list-editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/code-list-editor.controller.js +1 -1
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +1 -2
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +2 -1
- package/out/controller/control/calendar/calendar.controller.js +1 -1
- package/out/controller/control/data-view/data-view.controller.js +5 -3
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +7 -7
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +22 -16
- package/out/controller/control/form/search-form/search-form.service.d.ts +8 -0
- package/out/controller/control/form/search-form/search-form.service.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.service.js +19 -2
- package/out/controller/control/grid/grid/grid.controller.js +2 -2
- package/out/controller/control/panel/panel/panel-item.controller.d.ts +6 -0
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +11 -0
- package/out/controller/control/panel/panel/panel.controller.d.ts +3 -0
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +13 -0
- package/out/controller/control/panel/view-layout-panel/view-layout-panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/view-layout-panel/view-layout-panel.controller.js +7 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +15 -7
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts +4 -4
- package/out/interface/common/i-data-ability-params/i-data-ability-params.d.ts.map +1 -1
- package/out/interface/common/i-float-window-options/i-float-window-options.d.ts +75 -0
- package/out/interface/common/i-float-window-options/i-float-window-options.d.ts.map +1 -0
- package/out/interface/common/i-float-window-options/i-float-window-options.js +1 -0
- package/out/interface/common/index.d.ts +1 -0
- package/out/interface/common/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-control.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-edit-form.controller.d.ts +6 -5
- package/out/interface/controller/controller/control/i-edit-form.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/i.controller.d.ts +1 -1
- package/out/interface/controller/event/argument/index.d.ts +1 -0
- package/out/interface/controller/event/argument/index.d.ts.map +1 -1
- package/out/interface/controller/event/argument/panel-item.event.d.ts +26 -0
- package/out/interface/controller/event/argument/panel-item.event.d.ts.map +1 -0
- package/out/interface/controller/event/argument/panel-item.event.js +1 -0
- package/out/interface/controller/event/control/i-panel.event.d.ts +12 -1
- package/out/interface/controller/event/control/i-panel.event.d.ts.map +1 -1
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +7 -0
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +24 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts +24 -1
- package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-action-executor.d.ts +15 -0
- package/out/logic-scheduler/executor/app-ui-action-executor.d.ts.map +1 -0
- package/out/logic-scheduler/executor/app-ui-action-executor.js +16 -0
- package/out/logic-scheduler/index.d.ts.map +1 -1
- package/out/logic-scheduler/index.js +6 -0
- package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts.map +1 -1
- package/out/logic-scheduler/scheduler/control-logic-scheduler.js +6 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +2 -2
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -1
- package/out/logic-scheduler/scheduler/logic-scheduler.js +3 -3
- package/out/logic-scheduler/trigger/control-event-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/control-event-trigger.js +3 -1
- package/out/service/service/entity/de.service.d.ts +36 -2
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +79 -7
- package/out/service/service/entity/method/ac-fetch.d.ts +14 -0
- package/out/service/service/entity/method/ac-fetch.d.ts.map +1 -0
- package/out/service/service/entity/method/ac-fetch.js +15 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +2 -1
- package/out/service/service/entity/method/method.d.ts +1 -0
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +7 -4
- package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.js +12 -5
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.js +16 -2
- package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +5 -0
- package/package.json +5 -5
- package/src/controller/common/control/control.controller.ts +25 -1
- package/src/controller/common/control/md-control.controller.ts +2 -2
- package/src/controller/common/editor/code-list-editor.controller.ts +4 -1
- package/src/controller/common/editor/editor.controller.ts +1 -2
- package/src/controller/common/view/view.controller.ts +2 -0
- package/src/controller/control/calendar/calendar.controller.ts +1 -1
- package/src/controller/control/data-view/data-view.controller.ts +3 -3
- package/src/controller/control/form/edit-form/edit-form.controller.ts +27 -30
- package/src/controller/control/form/search-form/search-form.service.ts +20 -2
- package/src/controller/control/grid/grid/grid.controller.ts +2 -2
- package/src/controller/control/panel/panel/panel-item.controller.ts +12 -0
- package/src/controller/control/panel/panel/panel.controller.ts +20 -0
- package/src/controller/control/panel/view-layout-panel/view-layout-panel.controller.ts +11 -0
- package/src/controller/control/tree/tree.controller.ts +15 -8
- package/src/interface/common/i-data-ability-params/i-data-ability-params.ts +4 -4
- package/src/interface/common/i-float-window-options/i-float-window-options.ts +74 -0
- package/src/interface/common/index.ts +1 -0
- package/src/interface/controller/controller/control/i-control.controller.ts +1 -1
- package/src/interface/controller/controller/control/i-edit-form.controller.ts +6 -5
- package/src/interface/controller/controller/i.controller.ts +1 -1
- package/src/interface/controller/event/argument/index.ts +1 -0
- package/src/interface/controller/event/argument/panel-item.event.ts +27 -0
- package/src/interface/controller/event/control/i-panel.event.ts +13 -1
- package/src/interface/logic-scheduler/i-scheduler-logic.ts +8 -0
- package/src/interface/service/service/i-app-de.service.ts +36 -0
- package/src/interface/util/i-overlay-controller/i-overlay-controller.ts +39 -1
- package/src/logic-scheduler/executor/app-ui-action-executor.ts +20 -0
- package/src/logic-scheduler/index.ts +12 -0
- package/src/logic-scheduler/scheduler/control-logic-scheduler.ts +6 -0
- package/src/logic-scheduler/scheduler/logic-scheduler.ts +7 -4
- package/src/logic-scheduler/trigger/control-event-trigger.ts +3 -1
- package/src/service/service/entity/de.service.ts +97 -7
- package/src/service/service/entity/method/ac-fetch.ts +16 -0
- package/src/service/service/entity/method/de-action.ts +7 -1
- package/src/service/service/entity/method/method.ts +11 -4
- package/src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts +12 -5
- package/src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts +24 -2
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/entity/de.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA4B,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"de.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/entity/de.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA4B,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;;;;;;GAOG;AACH,qBAAa,SAAU,YAAW,aAAa;IAsDjC,SAAS,CAAC,KAAK,EAAE,cAAc;IArD3C;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IAEpC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAC;IAE7B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IAE9D;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAiB;IAExC;;;;;;OAMG;gBACmB,KAAK,EAAE,cAAc;IAU3C;;;;;;;;;OASG;IACH,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IA6BhE;;;;;;;;;;OAUG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,KAAK,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,aAAa,CAAC;IAQzB;;;;;;;;;;OAUG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,KAAK,EACd,OAAO,GAAE,OAAY,GACpB,OAAO,CAAC,aAAa,CAAC;IAQzB;;;;;;;;;OASG;IACH,SAAS,CACP,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAClC,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,IAAI,CAAC;IA0BhB;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;CAQhD"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ModelError, RuntimeError } from '@ibiz-template/core';
|
|
2
|
-
import { DECache } from '../../utils';
|
|
2
|
+
import { DECache, calcResPath } from '../../utils';
|
|
3
3
|
import { WorkFlowService } from '../work-flow/work-flow.service';
|
|
4
4
|
import { FileService } from '../file/file.service';
|
|
5
5
|
import { findModelChild } from '../../../model';
|
|
6
6
|
import { DEActionMethod } from './method/de-action';
|
|
7
7
|
import { FetchMethod } from './method/fetch';
|
|
8
8
|
import { ConfigService } from '../config/config.service';
|
|
9
|
+
import { AcFetchMethod } from './method/ac-fetch';
|
|
9
10
|
/**
|
|
10
11
|
* 实体服务
|
|
11
12
|
*
|
|
@@ -49,14 +50,16 @@ export class DEService {
|
|
|
49
50
|
* 获取实体服务方法实例
|
|
50
51
|
*
|
|
51
52
|
* @author chitanda
|
|
52
|
-
* @date
|
|
53
|
+
* @date 2023-10-12 17:10:10
|
|
53
54
|
* @protected
|
|
54
55
|
* @param {string} id
|
|
56
|
+
* @param {boolean} [acMode=false]
|
|
55
57
|
* @return {*} {Method}
|
|
56
58
|
*/
|
|
57
|
-
getMethod(id) {
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
getMethod(id, acMode = false) {
|
|
60
|
+
const cacheId = acMode ? `ac-${id}` : id;
|
|
61
|
+
if (this.methodMap.has(cacheId)) {
|
|
62
|
+
return this.methodMap.get(cacheId);
|
|
60
63
|
}
|
|
61
64
|
const model = findModelChild(this.model.appDEMethods, id);
|
|
62
65
|
let method = null;
|
|
@@ -66,12 +69,17 @@ export class DEService {
|
|
|
66
69
|
break;
|
|
67
70
|
case 'FETCH':
|
|
68
71
|
case 'FETCHTEMP':
|
|
69
|
-
|
|
72
|
+
if (acMode) {
|
|
73
|
+
method = new AcFetchMethod(this.model, model);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
method = new FetchMethod(this.model, model);
|
|
77
|
+
}
|
|
70
78
|
break;
|
|
71
79
|
default:
|
|
72
80
|
throw new ModelError(model, `未支持的服务方法类型: ${model.methodType}`);
|
|
73
81
|
}
|
|
74
|
-
this.methodMap.set(
|
|
82
|
+
this.methodMap.set(cacheId, method);
|
|
75
83
|
return method;
|
|
76
84
|
}
|
|
77
85
|
/**
|
|
@@ -92,4 +100,68 @@ export class DEService {
|
|
|
92
100
|
}
|
|
93
101
|
throw new RuntimeError(`${this.model.codeName}未支持「${id}」方法`);
|
|
94
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* 执行服务方法 ac 模式
|
|
105
|
+
*
|
|
106
|
+
* @author chitanda
|
|
107
|
+
* @date 2022-09-13 19:09:55
|
|
108
|
+
* @param {string} id 执行服务方法标识
|
|
109
|
+
* @param {IParams} context
|
|
110
|
+
* @param {IData} [params={}] 请求参数
|
|
111
|
+
* @param {IParams} [params2={}] 查询参数
|
|
112
|
+
* @return {*} {Promise<IHttpResponse>}
|
|
113
|
+
*/
|
|
114
|
+
execAc(id, context, params, params2 = {}) {
|
|
115
|
+
const method = this.getMethod(id, true);
|
|
116
|
+
if (method) {
|
|
117
|
+
return method.exec(context, params, params2);
|
|
118
|
+
}
|
|
119
|
+
throw new RuntimeError(`${this.model.codeName}未支持「${id}」方法`);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 实体级别 AI 聊天会话
|
|
123
|
+
*
|
|
124
|
+
* @author chitanda
|
|
125
|
+
* @date 2023-10-12 11:10:00
|
|
126
|
+
* @param {IParams} context
|
|
127
|
+
* @param {IParams} [params={}]
|
|
128
|
+
* @param {FetchEventSourceInit} [options={}]
|
|
129
|
+
* @return {*} {Promise<void>}
|
|
130
|
+
*/
|
|
131
|
+
aiChatSse(onmessage, context, params = {}, data = {}) {
|
|
132
|
+
const app = ibiz.hub.getApp(this.model.appId);
|
|
133
|
+
const path = this.calcSsePath(context);
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
app.net.sse(`/${path}`, Object.assign({ srfactag: 'AIChat' }, params), {
|
|
136
|
+
headers: {
|
|
137
|
+
'Content-Type': 'application/json',
|
|
138
|
+
},
|
|
139
|
+
body: JSON.stringify(data),
|
|
140
|
+
onmessage: (e) => {
|
|
141
|
+
onmessage(e);
|
|
142
|
+
},
|
|
143
|
+
onclose: () => {
|
|
144
|
+
resolve();
|
|
145
|
+
},
|
|
146
|
+
onerror: (e) => {
|
|
147
|
+
reject(e);
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 计算请求路径
|
|
154
|
+
*
|
|
155
|
+
* @author chitanda
|
|
156
|
+
* @date 2023-10-12 11:10:56
|
|
157
|
+
* @protected
|
|
158
|
+
* @param {IParams} context
|
|
159
|
+
* @return {*} {string}
|
|
160
|
+
*/
|
|
161
|
+
calcSsePath(context) {
|
|
162
|
+
const srfkey = context[this.model.codeName.toLowerCase()];
|
|
163
|
+
const curPath = `/${this.model.codeName2.toLowerCase()}/ssechatcompletion${srfkey ? `/${srfkey}` : ''}`;
|
|
164
|
+
const resPath = calcResPath(context, this.model);
|
|
165
|
+
return resPath + curPath;
|
|
166
|
+
}
|
|
95
167
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FetchMethod } from './fetch';
|
|
2
|
+
/**
|
|
3
|
+
* ac 模式下的数据集获取请求
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-10-12 17:10:03
|
|
7
|
+
* @export
|
|
8
|
+
* @class AcFetchMethod
|
|
9
|
+
* @extends {FetchMethod}
|
|
10
|
+
*/
|
|
11
|
+
export declare class AcFetchMethod extends FetchMethod {
|
|
12
|
+
protected mergeRequestPath(path: string, methodName: string): string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ac-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ac-fetch.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/ac-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAGrE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FetchMethod } from './fetch';
|
|
2
|
+
/**
|
|
3
|
+
* ac 模式下的数据集获取请求
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-10-12 17:10:03
|
|
7
|
+
* @export
|
|
8
|
+
* @class AcFetchMethod
|
|
9
|
+
* @extends {FetchMethod}
|
|
10
|
+
*/
|
|
11
|
+
export class AcFetchMethod extends FetchMethod {
|
|
12
|
+
mergeRequestPath(path, methodName) {
|
|
13
|
+
return `${path}/ac/${methodName}?srfac=ac`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de-action.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/de-action.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"de-action.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/de-action.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,MAAM;IAChC,MAAM,EAAE,YAAY,CAAC;IAE7B;;;;;;;;OAQG;IACH,SAAS,KAAK,WAAW,IAAI,OAAO,CAEnC;IAEK,IAAI,CACR,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,EACZ,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAmF/B;;;;;;;;OAQG;IACG,MAAM,CACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAUtC;;;;;;;;OAQG;IACG,MAAM,CACV,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAYtC;;;;;;;;;OASG;IACG,MAAM,CACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,WAAW,EACzB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IActC;;;;;;;;OAQG;IACG,GAAG,CACP,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAatC;;;;;;;;OAQG;IACG,QAAQ,CACZ,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAUhC;;;;;;;;OAQG;IACG,UAAU,CACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GACZ,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAUtC;;;;;;;;OAQG;IACG,YAAY,CAChB,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAatC;;;;;;;;OAQG;IACG,UAAU,CACd,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAoBtC;;;;;;;;OAQG;IACG,UAAU,CACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GACZ,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAatC;;;;;;;;OAQG;IACG,OAAO,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAqBtC;;;;;;OAMG;IACG,eAAe,CACnB,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,aAAa,CAAC;CAc1B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpResponse, RuntimeModelError, } from '@ibiz-template/core';
|
|
2
|
+
import { clone } from 'ramda';
|
|
2
3
|
import { Method } from './method';
|
|
3
4
|
import { findDELogic } from '../../../../model';
|
|
4
5
|
import { execDELogicAction, execFieldLogics } from '../../../../de-logic';
|
|
@@ -32,7 +33,7 @@ export class DEActionMethod extends Method {
|
|
|
32
33
|
if (!deLogic) {
|
|
33
34
|
throw new RuntimeModelError(this.method, '缺少实体处理逻辑');
|
|
34
35
|
}
|
|
35
|
-
return execDELogicAction(deLogic, context, data
|
|
36
|
+
return execDELogicAction(deLogic, clone(context), data ? clone(data) : {}, params ? clone(params) : {});
|
|
36
37
|
}
|
|
37
38
|
if (data && !this.isLocalMode) {
|
|
38
39
|
data = await this.input.handle(context, data);
|
|
@@ -77,6 +77,7 @@ export declare abstract class Method {
|
|
|
77
77
|
* @return {*} {Promise<HttpResponse<any>>}
|
|
78
78
|
*/
|
|
79
79
|
protected request(path: string, context: IParams, data?: IData, params?: IParams): Promise<HttpResponse<any>>;
|
|
80
|
+
protected mergeRequestPath(path: string, methodName: string): string;
|
|
80
81
|
/**
|
|
81
82
|
* 根据上下文计算当前请求路径
|
|
82
83
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,KAAK,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,EACZ,MAAM,CAAC,EAAE,OAAO,GAEf,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,KAAK,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,EACZ,MAAM,CAAC,EAAE,OAAO,GAEf,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IA8C7B,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAIpE;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAM5C;;;;;;;OAOG;cACa,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;CAM/D"}
|
|
@@ -49,17 +49,17 @@ export class Method {
|
|
|
49
49
|
let res = null;
|
|
50
50
|
switch (requestMethod) {
|
|
51
51
|
case 'POST':
|
|
52
|
-
res = await this.app.net.post(
|
|
52
|
+
res = await this.app.net.post(this.mergeRequestPath(path, methodName), notNilEmpty(data) ? data : params);
|
|
53
53
|
break;
|
|
54
54
|
case 'GET':
|
|
55
|
-
res = await this.app.net.get(
|
|
55
|
+
res = await this.app.net.get(this.mergeRequestPath(path, methodName), data || params);
|
|
56
56
|
break;
|
|
57
57
|
case 'PUT': {
|
|
58
|
-
res = await this.app.net.put(
|
|
58
|
+
res = await this.app.net.put(this.mergeRequestPath(path, methodName), notNilEmpty(data) ? data : params);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case 'DELETE':
|
|
62
|
-
res = await this.app.net.delete(
|
|
62
|
+
res = await this.app.net.delete(this.mergeRequestPath(path, methodName), data || params);
|
|
63
63
|
break;
|
|
64
64
|
default:
|
|
65
65
|
if (requestMethod) {
|
|
@@ -73,6 +73,9 @@ export class Method {
|
|
|
73
73
|
}
|
|
74
74
|
throw new RuntimeModelError(this.method, `未支持的行为类型[${actionType}]`);
|
|
75
75
|
}
|
|
76
|
+
mergeRequestPath(path, methodName) {
|
|
77
|
+
return `${path}/${methodName}`;
|
|
78
|
+
}
|
|
76
79
|
/**
|
|
77
80
|
* 根据上下文计算当前请求路径
|
|
78
81
|
*
|
package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic-link-single-cond.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-logic-link-single-cond.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;IAmCrC,KAAK,EAAE,sBAAsB;IAlChD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;gBAEkB,KAAK,EAAE,sBAAsB;IAMhD;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO;CAsCnE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
2
|
import { testCond } from '../../../utils';
|
|
3
|
+
import { handleSrcVal } from '../../utils';
|
|
3
4
|
import { UILogicLinkCond } from '../ui-logic-link-cond/ui-logic-link-cond';
|
|
4
5
|
/**
|
|
5
6
|
* 界面逻辑连接条件项
|
|
@@ -40,7 +41,10 @@ export class UILogicLinkSingleCond extends UILogicLinkCond {
|
|
|
40
41
|
* @return {*} {boolean}
|
|
41
42
|
*/
|
|
42
43
|
test(ctx, context, data) {
|
|
43
|
-
const
|
|
44
|
+
const dstVal = handleSrcVal(ctx, {
|
|
45
|
+
srcDEUILogicParamId: this.dstParam,
|
|
46
|
+
srcFieldName: this.dstField,
|
|
47
|
+
});
|
|
44
48
|
switch (this.type) {
|
|
45
49
|
case 'ENTITYFIELD': {
|
|
46
50
|
if (!this.value) {
|
|
@@ -48,20 +52,23 @@ export class UILogicLinkSingleCond extends UILogicLinkCond {
|
|
|
48
52
|
}
|
|
49
53
|
// 数据对象属性
|
|
50
54
|
const value = data[this.value] != null ? data[this.value] : context[this.value];
|
|
51
|
-
return testCond(
|
|
55
|
+
return testCond(dstVal, this.op, value);
|
|
52
56
|
}
|
|
53
57
|
case 'SRCENTITYFIELD': {
|
|
54
58
|
if (!this.value) {
|
|
55
59
|
throw new RuntimeModelError(this.model, '当前条件值类型为[源数据对象属性],缺少配置条件值');
|
|
56
60
|
}
|
|
57
61
|
// 源数据对象属性
|
|
58
|
-
const
|
|
59
|
-
|
|
62
|
+
const srcVal = handleSrcVal(ctx, {
|
|
63
|
+
srcDEUILogicParamId: this.srcParam,
|
|
64
|
+
srcFieldName: this.value,
|
|
65
|
+
});
|
|
66
|
+
return testCond(dstVal, this.op, srcVal);
|
|
60
67
|
}
|
|
61
68
|
case 'CURTIME': // 当前时间
|
|
62
69
|
throw new ModelError(this.model, `暂未支持条件值类型为[当前时间]`);
|
|
63
70
|
default: // 直接使用目标对象参数属性和值做对比
|
|
64
|
-
return testCond(
|
|
71
|
+
return testCond(dstVal, this.op, this.value);
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-js-param-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"prepare-js-param-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAC3C,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA4C9C;;;;;;;OAOG;IACH,SAAS,CAAC,aAAa,CACrB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAwCP;;;;;;;;OAQG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAMP;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAKP;;;;;;;OAOG;IACH,SAAS,CAAC,UAAU,CAClB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAKP;;;;;;;OAOG;IACH,SAAS,CAAC,UAAU,CAClB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAKP;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACnB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;IAaP;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,cAAc,GAClB,IAAI;CAQR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
|
-
import { ModelError } from '@ibiz-template/core';
|
|
2
|
+
import { ModelError, RuntimeError } from '@ibiz-template/core';
|
|
3
3
|
import { clone } from 'ramda';
|
|
4
|
+
import { ScriptFactory } from '../../../utils';
|
|
4
5
|
import { handleSrcVal } from '../../utils';
|
|
5
6
|
import { UILogicNode } from '../ui-logic-node';
|
|
6
7
|
/**
|
|
@@ -63,6 +64,9 @@ export class PrepareJSParamNode extends UILogicNode {
|
|
|
63
64
|
*/
|
|
64
65
|
setParamValue(nodeParam, ctx) {
|
|
65
66
|
const { dstFieldName, dstDEUILogicParamId } = nodeParam;
|
|
67
|
+
if (!dstDEUILogicParamId) {
|
|
68
|
+
throw new RuntimeError('没有目标参数对象id');
|
|
69
|
+
}
|
|
66
70
|
// 目标参数
|
|
67
71
|
let dstField = dstFieldName;
|
|
68
72
|
// 实体参数对象转小写
|
|
@@ -72,7 +76,17 @@ export class PrepareJSParamNode extends UILogicNode {
|
|
|
72
76
|
// 源参数
|
|
73
77
|
const srcVal = handleSrcVal(ctx, nodeParam);
|
|
74
78
|
if (dstField) {
|
|
75
|
-
|
|
79
|
+
// 赋值属性的时候支持脚本写法
|
|
80
|
+
try {
|
|
81
|
+
ScriptFactory.execScriptFn({ srcVal, dstParam: ctx.params[dstDEUILogicParamId] }, `dstParam.${dstFieldName} = srcVal`, {
|
|
82
|
+
singleRowReturn: false,
|
|
83
|
+
isAsync: false,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
ibiz.log.error(`给目标参数属性${dstFieldName}赋值报错,目标参数:`, ctx.params[dstDEUILogicParamId]);
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
76
90
|
}
|
|
77
91
|
else {
|
|
78
92
|
ctx.params[dstDEUILogicParamId] = srcVal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAQJ,KAAK,EAAE,eAAe;IAPzC;;;;;;OAMG;gBACgB,KAAK,EAAE,eAAe;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"ui-logic-param.d.ts","sourceRoot":"","sources":["../../../src/ui-logic/ui-logic-param/ui-logic-param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,YAAY;IAQJ,KAAK,EAAE,eAAe;IAPzC;;;;;;OAMG;gBACgB,KAAK,EAAE,eAAe;IAEzC;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAqE/B;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CAWjC"}
|
|
@@ -30,6 +30,11 @@ export class UILogicParam {
|
|
|
30
30
|
const m = this.model;
|
|
31
31
|
const { context, viewParams, data, parameters } = ctx;
|
|
32
32
|
const app = ibiz.hub.getApp(context.srfappid);
|
|
33
|
+
// 特殊变量的特殊处理
|
|
34
|
+
if (m.codeName === 'layoutPanel') {
|
|
35
|
+
ctx.params[tag] = parameters.view.layoutPanel.panelItems;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
33
38
|
if (m.default) {
|
|
34
39
|
ctx.params[tag] = data && data.length > 0 ? data[0] : {};
|
|
35
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.1.
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
32
|
+
"@ibiz-template/core": "^0.1.34",
|
|
33
|
+
"@ibiz/model-core": "^0.0.19",
|
|
34
34
|
"@types/path-browserify": "^1.0.0",
|
|
35
35
|
"@types/qs": "^6.9.8",
|
|
36
36
|
"@types/systemjs": "^6.13.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@ibiz-template/core": "^0.1.0",
|
|
49
|
-
"@ibiz/model-core": "^0.0.
|
|
49
|
+
"@ibiz/model-core": "^0.0.19",
|
|
50
50
|
"async-validator": "^4.2.5",
|
|
51
51
|
"dayjs": "^1.11.7",
|
|
52
52
|
"echarts": "^5.4.3",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"qx-util": "^0.4.8",
|
|
58
58
|
"ramda": "^0.29.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "6b6ab37103623fbc1994241b511829a2013a72c0"
|
|
61
61
|
}
|
|
@@ -147,6 +147,13 @@ export class ControlController<
|
|
|
147
147
|
this.initControlScheduler(this.model.controlLogics);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
protected async onMounted(): Promise<void> {
|
|
151
|
+
await super.onMounted();
|
|
152
|
+
|
|
153
|
+
// 启动定时器触发
|
|
154
|
+
this.scheduler?.startTimerTrigger();
|
|
155
|
+
}
|
|
156
|
+
|
|
150
157
|
protected async onDestroyed(): Promise<void> {
|
|
151
158
|
await super.onDestroyed();
|
|
152
159
|
if (this.scheduler) {
|
|
@@ -213,7 +220,21 @@ export class ControlController<
|
|
|
213
220
|
} {
|
|
214
221
|
const context = this.context.clone();
|
|
215
222
|
const params = { ...this.params };
|
|
216
|
-
|
|
223
|
+
|
|
224
|
+
let data = this.getData() || [];
|
|
225
|
+
if (args?.data) {
|
|
226
|
+
data = Array.isArray(args.data) ? args.data : [args.data];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// 合并附加上下文
|
|
230
|
+
if (args?.context) {
|
|
231
|
+
Object.assign(context, args.context);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// 合并附加视图参数
|
|
235
|
+
if (args?.viewParam) {
|
|
236
|
+
Object.assign(params, args.viewParam);
|
|
237
|
+
}
|
|
217
238
|
return { context, params, data };
|
|
218
239
|
}
|
|
219
240
|
|
|
@@ -243,6 +264,9 @@ export class ControlController<
|
|
|
243
264
|
* @memberof ControlController
|
|
244
265
|
*/
|
|
245
266
|
protected handleControlParams(): void {
|
|
267
|
+
if (!this.model.controlParam) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
246
270
|
const { ctrlParams } = this.model.controlParam!;
|
|
247
271
|
let params = {};
|
|
248
272
|
if (notNilEmpty(ctrlParams)) {
|
|
@@ -198,7 +198,7 @@ export class MDControlController<
|
|
|
198
198
|
|
|
199
199
|
// *查询参数处理
|
|
200
200
|
const { context } = this.handlerAbilityParams(args);
|
|
201
|
-
const params = await this.getFetchParams(args?.
|
|
201
|
+
const params = await this.getFetchParams(args?.viewParam);
|
|
202
202
|
|
|
203
203
|
const res = await this.service.fetch(context, params);
|
|
204
204
|
// 更新分页数据总条数
|
|
@@ -309,7 +309,7 @@ export class MDControlController<
|
|
|
309
309
|
|
|
310
310
|
// 刷新数据,补全这一页缺少的数据
|
|
311
311
|
if (needRefresh) {
|
|
312
|
-
this.refresh();
|
|
312
|
+
await this.refresh();
|
|
313
313
|
}
|
|
314
314
|
} catch (error) {
|
|
315
315
|
await this._evt.emit('onRemoveError', undefined);
|
|
@@ -164,8 +164,7 @@ export class EditorController<T extends IEditor = IEditor>
|
|
|
164
164
|
if (navigateParams && data) {
|
|
165
165
|
selfParams = convertNavData(navigateParams!, data, params, context);
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
return { context: _context, params: _params };
|
|
167
|
+
return { context: _context, params: selfParams };
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
/**
|
|
@@ -265,6 +265,7 @@ export class ViewController<
|
|
|
265
265
|
// 初始化计时器服务
|
|
266
266
|
await this.initCounters();
|
|
267
267
|
|
|
268
|
+
// 初始化视图逻辑调度器
|
|
268
269
|
const appViewLogics = getViewLogics(this.model);
|
|
269
270
|
if (appViewLogics.length) {
|
|
270
271
|
this.scheduler = ibiz.scheduler.createViewScheduler(appViewLogics);
|
|
@@ -414,6 +415,7 @@ export class ViewController<
|
|
|
414
415
|
panel.evt.on('onControlEvent', event => {
|
|
415
416
|
this.scheduler!.triggerControlEvent(
|
|
416
417
|
event.triggerControlName,
|
|
418
|
+
event.triggerEventName,
|
|
417
419
|
event.triggerEvent,
|
|
418
420
|
);
|
|
419
421
|
});
|
|
@@ -76,7 +76,7 @@ export class CalendarController
|
|
|
76
76
|
const isInitialLoad = args.isInitialLoad === true;
|
|
77
77
|
// *查询参数处理
|
|
78
78
|
const { context } = this.handlerAbilityParams(args);
|
|
79
|
-
const params = await this.getFetchParams(args?.
|
|
79
|
+
const params = await this.getFetchParams(args?.viewParam);
|
|
80
80
|
// *发起请求
|
|
81
81
|
await this.startLoading();
|
|
82
82
|
let items;
|
|
@@ -155,13 +155,13 @@ export class DataViewControlController<
|
|
|
155
155
|
tempData = tempData.getOrigin();
|
|
156
156
|
}
|
|
157
157
|
if (tempData) {
|
|
158
|
-
group.groupActionGroupState
|
|
158
|
+
group.groupActionGroupState?.update(
|
|
159
159
|
tempData,
|
|
160
160
|
this.model.appDataEntityId!,
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
|
-
group.groupActionGroupState
|
|
164
|
+
group.groupActionGroupState?.update(
|
|
165
165
|
undefined,
|
|
166
166
|
this.model.appDataEntityId!,
|
|
167
167
|
);
|
|
@@ -173,7 +173,7 @@ export class DataViewControlController<
|
|
|
173
173
|
return group.children.indexOf(data) !== -1;
|
|
174
174
|
});
|
|
175
175
|
if (actionGroup) {
|
|
176
|
-
actionGroup.groupActionGroupState
|
|
176
|
+
actionGroup.groupActionGroupState?.update(
|
|
177
177
|
actionGroup.selectedData![0],
|
|
178
178
|
this.model.appDataEntityId!,
|
|
179
179
|
);
|