@ibiz-template/runtime 0.2.9 → 0.2.11
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 +72 -38
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- 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 +4 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +6 -5
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.js +5 -2
- package/out/controller/control/map/map.controller.js +2 -2
- package/out/controller/control/panel/panel/panel-item.controller.d.ts +1 -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 +1 -0
- package/out/controller/control/panel/panel/panel.controller.d.ts +3 -1
- package/out/controller/control/panel/panel/panel.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel.controller.js +20 -2
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts +6 -0
- package/out/interface/controller/controller/control/panel-item/i-panel-item.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-map.state.d.ts +4 -4
- package/out/interface/controller/state/control/i-map.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +6 -9
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +14 -16
- package/out/model/data-entity/data-entity.d.ts +0 -11
- package/out/model/data-entity/data-entity.d.ts.map +1 -1
- package/out/model/data-entity/data-entity.js +0 -14
- package/out/service/vo/map-data/map-data.d.ts +1 -1
- package/out/service/vo/map-data/map-data.d.ts.map +1 -1
- package/out/service/vo/map-data/map-data.js +4 -3
- package/out/service/vo/panel-data/panel-data.d.ts +9 -4
- package/out/service/vo/panel-data/panel-data.d.ts.map +1 -1
- package/out/service/vo/panel-data/panel-data.js +18 -1
- package/package.json +2 -2
- package/src/controller/control/form/edit-form/edit-form.controller.ts +4 -0
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +6 -4
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts +5 -1
- package/src/controller/control/map/map.controller.ts +2 -2
- package/src/controller/control/panel/panel/panel-item.controller.ts +2 -0
- package/src/controller/control/panel/panel/panel.controller.ts +21 -3
- package/src/interface/controller/controller/control/panel-item/i-panel-item.controller.ts +7 -0
- package/src/interface/controller/state/control/i-map.state.ts +4 -4
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +17 -16
- package/src/model/data-entity/data-entity.ts +0 -17
- package/src/service/vo/map-data/map-data.ts +6 -4
- package/src/service/vo/panel-data/panel-data.ts +25 -6
|
@@ -79,9 +79,9 @@ export class MapController
|
|
|
79
79
|
const tempareaData: IMapData[] = [];
|
|
80
80
|
const temppointData: IMapData[] = [];
|
|
81
81
|
result.forEach(item => {
|
|
82
|
-
if (item.
|
|
82
|
+
if (item._itemStyle === 'REGION') {
|
|
83
83
|
tempareaData.push(item);
|
|
84
|
-
} else if (item.
|
|
84
|
+
} else if (item._itemStyle === 'POINT') {
|
|
85
85
|
temppointData.push(item);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
@@ -117,6 +117,14 @@ export class PanelController<
|
|
|
117
117
|
this.load();
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
protected async onDestroyed(): Promise<void> {
|
|
121
|
+
await super.onDestroyed();
|
|
122
|
+
this.data.destroy?.();
|
|
123
|
+
Object.values(this.panelItems).forEach(item => {
|
|
124
|
+
item.destroy();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
/**
|
|
121
129
|
* 初始化面板成员控制器
|
|
122
130
|
*
|
|
@@ -185,6 +193,8 @@ export class PanelController<
|
|
|
185
193
|
// 转换数据,处理原始数据和面板项的映射。
|
|
186
194
|
const panelData = this.convertData(data);
|
|
187
195
|
|
|
196
|
+
// 清空上一个,如果存在的话。
|
|
197
|
+
this.data.destroy?.();
|
|
188
198
|
this.state.data = panelData;
|
|
189
199
|
this.panelStateNotify(PanelNotifyState.LOAD);
|
|
190
200
|
}
|
|
@@ -223,9 +233,18 @@ export class PanelController<
|
|
|
223
233
|
* @returns {*} {IData}
|
|
224
234
|
* @memberof PanelController
|
|
225
235
|
*/
|
|
226
|
-
convertData(data: IData):
|
|
236
|
+
convertData(data: IData): PanelData {
|
|
227
237
|
const fields = getAllPanelField(this.model);
|
|
228
|
-
|
|
238
|
+
const fieldKeys = fields.map(item => item.id!);
|
|
239
|
+
const panelData = new PanelData(fields, data);
|
|
240
|
+
|
|
241
|
+
// 面板属性变更的触发变更通知
|
|
242
|
+
panelData._evt.on('change', key => {
|
|
243
|
+
if (fieldKeys.includes(key)) {
|
|
244
|
+
this.dataChangeNotify([key]);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
return panelData;
|
|
229
248
|
}
|
|
230
249
|
|
|
231
250
|
/**
|
|
@@ -270,7 +289,6 @@ export class PanelController<
|
|
|
270
289
|
|
|
271
290
|
// 改变值
|
|
272
291
|
this.state.data[name] = value;
|
|
273
|
-
this.dataChangeNotify([name]);
|
|
274
292
|
}
|
|
275
293
|
|
|
276
294
|
protected initControlScheduler(logics: IControlLogic[] = []): void {
|
|
@@ -76,12 +76,12 @@ export interface IMapData {
|
|
|
76
76
|
_id: string;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* 呈现样式
|
|
80
80
|
* @author lxm
|
|
81
|
-
* @date 2023-
|
|
82
|
-
* @type {
|
|
81
|
+
* @date 2023-11-02 04:59:12
|
|
82
|
+
* @type {string}
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
_itemStyle: string;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* 地图项id
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { notNilEmpty } from 'qx-util';
|
|
13
13
|
import { OpenAppViewCommand } from '../../command';
|
|
14
14
|
import { IModalData, IUILogicParams } from '../../interface';
|
|
15
|
-
import { calcDeCodeNameById
|
|
15
|
+
import { calcDeCodeNameById } from '../../model';
|
|
16
16
|
import { convertNavData } from '../../utils';
|
|
17
17
|
import { LogicExecutor } from './logic-executor';
|
|
18
18
|
import { Srfuf } from '../../service';
|
|
@@ -47,16 +47,13 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* 执行应用预置界面逻辑opendata
|
|
50
|
+
* 执行应用预置界面逻辑 opendata
|
|
51
51
|
*
|
|
52
|
-
* @author
|
|
53
|
-
* @date
|
|
54
|
-
* @
|
|
55
|
-
* @param {
|
|
56
|
-
* @
|
|
57
|
-
* @param {(IData | null)} data 数据集合
|
|
58
|
-
* @param {IParams} params 视图参数
|
|
59
|
-
* @param {IData} [opts] 额外参数,event是js原生事件
|
|
52
|
+
* @author chitanda
|
|
53
|
+
* @date 2023-11-02 11:11:36
|
|
54
|
+
* @param {IAppUIOpenDataLogic} appUILogic 应用预置界面逻辑 opendata 模型对象
|
|
55
|
+
* @param {IUILogicParams} parameters
|
|
56
|
+
* @return {*} {Promise<IModalData>}
|
|
60
57
|
*/
|
|
61
58
|
async executeOpenDataAppUILogic(
|
|
62
59
|
appUILogic: IAppUIOpenDataLogic,
|
|
@@ -67,6 +64,7 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
67
64
|
if (!data?.[0]) {
|
|
68
65
|
throw new RuntimeError('opendata没有可操作数据!');
|
|
69
66
|
}
|
|
67
|
+
// openDataAppViews 只有[索引实体]或[多表单实体]才会有值
|
|
70
68
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
71
69
|
let openViewRef: IAppUILogicRefViewBase | undefined;
|
|
72
70
|
if (openViewRefs) {
|
|
@@ -118,18 +116,21 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
118
116
|
appUILogic: IAppUIOpenDataLogic,
|
|
119
117
|
parameters: IUILogicParams,
|
|
120
118
|
): Promise<IAppUILogicRefViewBase> {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
120
|
+
parameters.view.model.appDataEntityId!,
|
|
121
|
+
)!;
|
|
122
|
+
// [多表单实体] or [索引实体]类型属性
|
|
123
|
+
const typeFileName =
|
|
124
|
+
appDataEntity.formTypeAppDEFieldId || appDataEntity.dataTypeAppDEFieldId;
|
|
125
|
+
if (!typeFileName) {
|
|
125
126
|
throw new RuntimeModelError(
|
|
126
127
|
appUILogic,
|
|
127
|
-
`${
|
|
128
|
+
`${appDataEntity.codeName}[多表单实体] or [索引实体]缺少类型属性配置`,
|
|
128
129
|
);
|
|
129
130
|
}
|
|
130
131
|
const { data } = parameters;
|
|
131
132
|
// 表单类型值
|
|
132
|
-
const formTypeValue = data[0][
|
|
133
|
+
const formTypeValue = data[0][typeFileName];
|
|
133
134
|
if (!formTypeValue) {
|
|
134
135
|
throw new RuntimeModelError(appUILogic, '数据源无表单类型应用实体属性值');
|
|
135
136
|
}
|
|
@@ -52,23 +52,6 @@ export async function getDeACMode(
|
|
|
52
52
|
return deACMode;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/**
|
|
56
|
-
* 从实体里找到表单类型应用实体属性
|
|
57
|
-
*
|
|
58
|
-
* @author zk
|
|
59
|
-
* @date 2023-09-07 05:09:41
|
|
60
|
-
* @export
|
|
61
|
-
* @param {string} entityId
|
|
62
|
-
* @param {string} [srfappid]
|
|
63
|
-
* @return {*} {(Promise<string | undefined>)}
|
|
64
|
-
*/
|
|
65
|
-
export async function getFormTypeFieldName(
|
|
66
|
-
entityId: string,
|
|
67
|
-
): Promise<string | undefined> {
|
|
68
|
-
const appDataEntity = await ibiz.hub.getAppDataEntity(entityId)!;
|
|
69
|
-
return appDataEntity.formTypeAppDEFieldId;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
55
|
/**
|
|
73
56
|
* 从实体里找到实体逻辑
|
|
74
57
|
* @author lxm
|
|
@@ -16,13 +16,15 @@ function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
const AreaItemStyles: string[] = ['REGION', 'REGION2', 'REGION3', 'REGION4'];
|
|
20
|
+
|
|
19
21
|
export class MapData implements IMapData {
|
|
20
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
23
|
[key: string | symbol]: any;
|
|
22
24
|
|
|
23
25
|
_id: string;
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
_itemStyle: string;
|
|
26
28
|
|
|
27
29
|
_mapItemId: string;
|
|
28
30
|
|
|
@@ -43,7 +45,7 @@ export class MapData implements IMapData {
|
|
|
43
45
|
constructor(deData: IData, mapItem: ISysMapItem) {
|
|
44
46
|
const {
|
|
45
47
|
id,
|
|
46
|
-
|
|
48
|
+
itemStyle,
|
|
47
49
|
longitudeAppDEFieldId,
|
|
48
50
|
latitudeAppDEFieldId,
|
|
49
51
|
textAppDEFieldId,
|
|
@@ -56,11 +58,11 @@ export class MapData implements IMapData {
|
|
|
56
58
|
|
|
57
59
|
this._id = id + deData.srfkey;
|
|
58
60
|
|
|
59
|
-
this.
|
|
61
|
+
this._itemStyle = itemStyle!;
|
|
60
62
|
|
|
61
63
|
this._mapItemId = id!;
|
|
62
64
|
|
|
63
|
-
if (
|
|
65
|
+
if (AreaItemStyles.includes(this._itemStyle)) {
|
|
64
66
|
if (longitudeAppDEFieldId) {
|
|
65
67
|
keyMap.set('_areaCode', longitudeAppDEFieldId);
|
|
66
68
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-constructor-return */
|
|
2
2
|
|
|
3
3
|
import { IPanelField } from '@ibiz/model-core';
|
|
4
|
+
import { QXEvent } from 'qx-util';
|
|
4
5
|
|
|
5
6
|
// 更新属性,缺的补充定义
|
|
6
7
|
function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
@@ -16,6 +17,8 @@ function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
type ChangeCallBack = (field: string) => void;
|
|
21
|
+
|
|
19
22
|
/**
|
|
20
23
|
* 面板数据
|
|
21
24
|
* @author lxm
|
|
@@ -28,15 +31,16 @@ export class PanelData {
|
|
|
28
31
|
[key: string | symbol]: any;
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
34
|
+
* 事件
|
|
32
35
|
* @author lxm
|
|
33
|
-
* @date 2023-
|
|
36
|
+
* @date 2023-11-02 02:35:33
|
|
34
37
|
* @protected
|
|
35
|
-
* @type {IParams}
|
|
36
38
|
*/
|
|
37
|
-
|
|
39
|
+
declare _evt: QXEvent<{ change: ChangeCallBack }>;
|
|
38
40
|
|
|
39
41
|
constructor(fields: IPanelField[], origin: IParams) {
|
|
42
|
+
const _evt = new QXEvent<{ change: ChangeCallBack }>();
|
|
43
|
+
|
|
40
44
|
// 面板属性映射绑定项
|
|
41
45
|
const keyMap: Record<string, string | undefined> = {};
|
|
42
46
|
// 绑定项映射面板属性
|
|
@@ -61,13 +65,24 @@ export class PanelData {
|
|
|
61
65
|
}
|
|
62
66
|
} else {
|
|
63
67
|
// 没有面板属性的直接修改原始对象,视图面板对象一开始就是空的,没有任何属性
|
|
64
|
-
origin[
|
|
68
|
+
origin[p] = value;
|
|
69
|
+
}
|
|
70
|
+
_evt.emit('change', p);
|
|
71
|
+
// 修改面板属性,同步抛原值变更
|
|
72
|
+
if (keyMap[p] && keyMap[p] !== p) {
|
|
73
|
+
_evt.emit('change', keyMap[p]!);
|
|
74
|
+
}
|
|
75
|
+
// 修改原值变更,同时抛面板属性变更
|
|
76
|
+
if (reverseKeyMap[p] && reverseKeyMap[p] !== p) {
|
|
77
|
+
_evt.emit('change', reverseKeyMap[p]!);
|
|
65
78
|
}
|
|
66
|
-
|
|
67
79
|
return true;
|
|
68
80
|
},
|
|
69
81
|
|
|
70
82
|
get(target: PanelData, p: string, _receiver: unknown): unknown {
|
|
83
|
+
if (p === '_evt') {
|
|
84
|
+
return _evt;
|
|
85
|
+
}
|
|
71
86
|
// 有映射拿原始对象
|
|
72
87
|
if (keyMap[p]) {
|
|
73
88
|
return origin[keyMap[p]!];
|
|
@@ -90,4 +105,8 @@ export class PanelData {
|
|
|
90
105
|
},
|
|
91
106
|
});
|
|
92
107
|
}
|
|
108
|
+
|
|
109
|
+
destroy(): void {
|
|
110
|
+
this._evt.reset();
|
|
111
|
+
}
|
|
93
112
|
}
|