@ibiz-template/runtime 0.2.6 → 0.2.8
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 +326 -38
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +8 -1
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +9 -5
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts +6 -4
- package/out/controller/control/chart/generator/funnel-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/funnel-series-generator.js +7 -3
- package/out/controller/control/chart/generator/pie-series-generator.d.ts +6 -4
- package/out/controller/control/chart/generator/pie-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/pie-series-generator.js +7 -3
- package/out/controller/control/chart/generator/radar-series-generator.d.ts +1 -1
- package/out/controller/control/chart/generator/radar-series-generator.js +3 -3
- 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 +6 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +0 -4
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +5 -1
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/map/index.d.ts +3 -0
- package/out/controller/control/map/index.d.ts.map +1 -0
- package/out/controller/control/map/index.js +2 -0
- package/out/controller/control/map/map.controller.d.ts +39 -0
- package/out/controller/control/map/map.controller.d.ts.map +1 -0
- package/out/controller/control/map/map.controller.js +101 -0
- package/out/controller/control/map/map.service.d.ts +25 -0
- package/out/controller/control/map/map.service.d.ts.map +1 -0
- package/out/controller/control/map/map.service.js +55 -0
- package/out/controller/control/panel/panel/panel-item.controller.d.ts +3 -3
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +22 -16
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.d.ts +4 -0
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.d.ts.map +1 -1
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.js +3 -0
- package/out/interface/common/i-global-config/i-global-config.d.ts +8 -0
- package/out/interface/common/i-global-config/i-global-config.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-map.controller.d.ts +15 -0
- package/out/interface/controller/controller/control/i-map.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-map.controller.js +1 -0
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/event/control/i-map.event.d.ts +54 -0
- package/out/interface/controller/event/control/i-map.event.d.ts.map +1 -0
- package/out/interface/controller/event/control/i-map.event.js +1 -0
- package/out/interface/controller/event/control/index.d.ts +1 -0
- package/out/interface/controller/event/control/index.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.js +1 -0
- package/out/interface/controller/state/control/i-map.state.d.ts +111 -0
- package/out/interface/controller/state/control/i-map.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-map.state.js +1 -0
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/service/mqtt/mqtt.service.d.ts +2 -0
- package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
- package/out/service/mqtt/mqtt.service.js +3 -0
- package/out/service/vo/control.vo.js +2 -2
- package/out/service/vo/index.d.ts +1 -0
- package/out/service/vo/index.d.ts.map +1 -1
- package/out/service/vo/index.js +1 -0
- package/out/service/vo/map-data/index.d.ts +2 -0
- package/out/service/vo/map-data/index.d.ts.map +1 -0
- package/out/service/vo/map-data/index.js +1 -0
- package/out/service/vo/map-data/map-data.d.ts +17 -0
- package/out/service/vo/map-data/map-data.d.ts.map +1 -0
- package/out/service/vo/map-data/map-data.js +87 -0
- package/out/utils/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +7 -1
- package/package.json +4 -4
- package/src/controller/common/control/md-control.controller.ts +11 -1
- package/src/controller/control/chart/generator/chart-options-generator.ts +13 -4
- package/src/controller/control/chart/generator/funnel-series-generator.ts +13 -7
- package/src/controller/control/chart/generator/pie-series-generator.ts +13 -7
- package/src/controller/control/chart/generator/radar-series-generator.ts +3 -3
- package/src/controller/control/form/edit-form/edit-form.controller.ts +6 -0
- package/src/controller/control/grid/grid/grid.controller.ts +0 -4
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +5 -1
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/map/index.ts +2 -0
- package/src/controller/control/map/map.controller.ts +126 -0
- package/src/controller/control/map/map.service.ts +79 -0
- package/src/controller/control/panel/panel/panel-item.controller.ts +27 -17
- package/src/controller/control/pickup-view-panel/pickup-view-panel.controller.ts +7 -0
- package/src/interface/common/i-global-config/i-global-config.ts +9 -0
- package/src/interface/controller/controller/control/i-map.controller.ts +15 -0
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/event/control/i-map.event.ts +48 -0
- package/src/interface/controller/event/control/index.ts +1 -0
- package/src/interface/controller/state/control/i-map.state.ts +124 -0
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/service/mqtt/mqtt.service.ts +3 -2
- package/src/service/vo/control.vo.ts +2 -2
- package/src/service/vo/index.ts +1 -0
- package/src/service/vo/map-data/index.ts +1 -0
- package/src/service/vo/map-data/map-data.ts +123 -0
- package/src/utils/script/script-function.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@ibiz-template/core": "^0.2.6",
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
33
|
+
"@ibiz/model-core": "^0.0.20",
|
|
34
34
|
"@types/path-browserify": "^1.0.0",
|
|
35
35
|
"@types/qs": "^6.9.8",
|
|
36
36
|
"@types/systemjs": "^6.13.3",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.1.0",
|
|
50
|
-
"@ibiz/model-core": "^0.0.
|
|
50
|
+
"@ibiz/model-core": "^0.0.20",
|
|
51
51
|
"async-validator": "^4.2.5",
|
|
52
52
|
"dayjs": "^1.11.7",
|
|
53
53
|
"echarts": "^5.4.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "98917f0e99351acbe3ca6241011ff1da2794e55a"
|
|
63
63
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
2
|
import { isElementSame, RuntimeError } from '@ibiz-template/core';
|
|
3
3
|
import { IAppDataEntity, IMDControl } from '@ibiz/model-core';
|
|
4
|
+
import { debounce } from 'lodash-es';
|
|
4
5
|
import {
|
|
5
6
|
IMDControlController,
|
|
6
7
|
IMDControlEvent,
|
|
@@ -89,7 +90,12 @@ export class MDControlController<
|
|
|
89
90
|
this.dataEntity.appDEFields?.forEach(field => {
|
|
90
91
|
this.fieldIdNameMap.set(field.id!, field.name!);
|
|
91
92
|
});
|
|
92
|
-
|
|
93
|
+
|
|
94
|
+
const fn = this.onDataChange.bind(this);
|
|
95
|
+
this.onDataChange = debounce(msg => {
|
|
96
|
+
fn(msg);
|
|
97
|
+
}, 300);
|
|
98
|
+
|
|
93
99
|
ibiz.mc.command.change.on(this.onDataChange);
|
|
94
100
|
|
|
95
101
|
// 设置默认排序
|
|
@@ -228,6 +234,10 @@ export class MDControlController<
|
|
|
228
234
|
await this.endLoading();
|
|
229
235
|
}
|
|
230
236
|
|
|
237
|
+
this.state.items.forEach((item, index) => {
|
|
238
|
+
item.srfserialnum = index + 1;
|
|
239
|
+
});
|
|
240
|
+
|
|
231
241
|
this.actionNotification('FETCHSUCCESS');
|
|
232
242
|
return this.state.items;
|
|
233
243
|
}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
XAXisComponentOption,
|
|
5
5
|
YAXisComponentOption,
|
|
6
6
|
ECElementEvent,
|
|
7
|
+
LegendComponentOption,
|
|
7
8
|
} from 'echarts';
|
|
8
9
|
import {
|
|
9
10
|
IAppDataEntity,
|
|
@@ -207,10 +208,6 @@ export class ChartOptionsGenerator {
|
|
|
207
208
|
const { showLegend, legendPos } = chartLegend;
|
|
208
209
|
const legendOption: EChartsOption['legend'] = {};
|
|
209
210
|
legendOption.show = showLegend;
|
|
210
|
-
// 图表单序列不应出图例
|
|
211
|
-
if (this.model.dechartSerieses?.length === 1) {
|
|
212
|
-
legendOption.show = false;
|
|
213
|
-
}
|
|
214
211
|
const position = legendPos?.toLowerCase();
|
|
215
212
|
if (position === 'left' || position === 'right') {
|
|
216
213
|
legendOption.left = position;
|
|
@@ -365,6 +362,18 @@ export class ChartOptionsGenerator {
|
|
|
365
362
|
});
|
|
366
363
|
this.options.series = seriesOption;
|
|
367
364
|
|
|
365
|
+
// 柱状图、折线图、散点图单个序列并且该序列分组数据只有一条时,不用显示图例
|
|
366
|
+
if (
|
|
367
|
+
this.seriesGenerators.length === 1 &&
|
|
368
|
+
this.seriesGenerators[0].groupData &&
|
|
369
|
+
Object.keys(this.seriesGenerators[0].groupData).length === 1 &&
|
|
370
|
+
seriesOption[0].type &&
|
|
371
|
+
['bar', 'line', 'scatter'].includes(seriesOption[0].type) &&
|
|
372
|
+
this.staticOptions.legend
|
|
373
|
+
) {
|
|
374
|
+
(this.staticOptions.legend as LegendComponentOption).show = false;
|
|
375
|
+
}
|
|
376
|
+
|
|
368
377
|
// 合并静态和动态的options
|
|
369
378
|
this.options = mergeDeepRight(
|
|
370
379
|
this.staticOptions,
|
|
@@ -2,6 +2,11 @@ import { IChartSeriesFunnel } from '@ibiz/model-core';
|
|
|
2
2
|
import type { ECElementEvent, FunnelSeriesOption, SeriesOption } from 'echarts';
|
|
3
3
|
import { BaseSeriesGenerator, CatalogData } from './base-series-generator';
|
|
4
4
|
|
|
5
|
+
interface funnelSeriesData {
|
|
6
|
+
name: string;
|
|
7
|
+
value: IData[];
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* 漏斗图序列生成器
|
|
7
12
|
* @author lxm
|
|
@@ -20,14 +25,15 @@ export class FunnelSeriesGenerator extends BaseSeriesGenerator<IChartSeriesFunne
|
|
|
20
25
|
return options;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
protected calcSeriesData(catalogData: CatalogData): {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
protected calcSeriesData(catalogData: CatalogData): funnelSeriesData[] {
|
|
29
|
+
const temData: funnelSeriesData[] = [];
|
|
30
|
+
catalogData.forEach((catalog, key) => {
|
|
31
|
+
temData.push({
|
|
32
|
+
name: key,
|
|
33
|
+
value: [catalog.value, catalog.deData?.srfkey],
|
|
34
|
+
});
|
|
30
35
|
});
|
|
36
|
+
return temData;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
getSrfkeyByParams(params: ECElementEvent): string {
|
|
@@ -2,6 +2,11 @@ import { IChartSeriesPie } from '@ibiz/model-core';
|
|
|
2
2
|
import type { ECElementEvent, PieSeriesOption, SeriesOption } from 'echarts';
|
|
3
3
|
import { BaseSeriesGenerator, CatalogData } from './base-series-generator';
|
|
4
4
|
|
|
5
|
+
interface pieSeriesData {
|
|
6
|
+
name: string;
|
|
7
|
+
value: IData[];
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* 饼图序列生成器
|
|
7
12
|
* @author lxm
|
|
@@ -20,14 +25,15 @@ export class PieSeriesGenerator extends BaseSeriesGenerator<IChartSeriesPie> {
|
|
|
20
25
|
return options;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
protected calcSeriesData(catalogData: CatalogData): {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
protected calcSeriesData(catalogData: CatalogData): pieSeriesData[] {
|
|
29
|
+
const temData: pieSeriesData[] = [];
|
|
30
|
+
catalogData.forEach((catalog, key) => {
|
|
31
|
+
temData.push({
|
|
32
|
+
name: key,
|
|
33
|
+
value: [catalog.value, catalog.deData?.srfkey],
|
|
34
|
+
});
|
|
30
35
|
});
|
|
36
|
+
return temData;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
getSrfkeyByParams(params: ECElementEvent): string {
|
|
@@ -5,7 +5,7 @@ import { BaseSeriesGenerator, DEFAULT_GROUP } from './base-series-generator';
|
|
|
5
5
|
import { RadarCoordSystem } from './radar-coord-system';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 雷达序列生成器
|
|
9
9
|
* @author lxm
|
|
10
10
|
* @date 2023-06-11 06:19:03
|
|
11
11
|
* @export
|
|
@@ -39,8 +39,8 @@ export class RadarSeriesGenerator extends BaseSeriesGenerator<IChartSeriesRadar>
|
|
|
39
39
|
|
|
40
40
|
// 更新雷达坐标系指示器和最大值
|
|
41
41
|
Object.values(groupData).forEach(catalogData => {
|
|
42
|
-
|
|
43
|
-
radar.updateIndicator(
|
|
42
|
+
catalogData.forEach((catalog, key) => {
|
|
43
|
+
radar.updateIndicator(key, catalog.value);
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -428,6 +428,9 @@ export class EditFormController
|
|
|
428
428
|
const { context, params } = this.handlerAbilityParams(args);
|
|
429
429
|
try {
|
|
430
430
|
await this.service.wfStart(context, params, this.data);
|
|
431
|
+
if (this.view.modal.mode === 'ROUTE') {
|
|
432
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
433
|
+
}
|
|
431
434
|
} catch (error) {
|
|
432
435
|
this.actionNotification('WFSTARTERROR', {
|
|
433
436
|
error: error as Error,
|
|
@@ -457,6 +460,9 @@ export class EditFormController
|
|
|
457
460
|
const { context, params } = this.handlerAbilityParams(args);
|
|
458
461
|
try {
|
|
459
462
|
await this.service.wfSubmit(context, params, this.data);
|
|
463
|
+
if (this.view.modal.mode === 'ROUTE') {
|
|
464
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
465
|
+
}
|
|
460
466
|
} catch (error) {
|
|
461
467
|
this.actionNotification('WFSUBMITERROR', {
|
|
462
468
|
error: error as Error,
|
|
@@ -525,10 +525,6 @@ export class GridController
|
|
|
525
525
|
rowState.data = res.data;
|
|
526
526
|
rowState.modified = false;
|
|
527
527
|
|
|
528
|
-
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}SUCCESS`, {
|
|
529
|
-
default: `${res.data.srfmajortext || ''}保存成功`,
|
|
530
|
-
data: res.data,
|
|
531
|
-
});
|
|
532
528
|
this.gridStateNotify(rowState, GridNotifyState.SAVE);
|
|
533
529
|
await this.evt.emit('onSaveSuccess', undefined);
|
|
534
530
|
}
|
package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
CHANGED
|
@@ -308,7 +308,11 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
|
|
|
308
308
|
}
|
|
309
309
|
const isDate = DataTypes.isDate(this.dataType!);
|
|
310
310
|
if (isDate) {
|
|
311
|
-
|
|
311
|
+
const formatVal = dayjs(strVal).format(this.valueFormat);
|
|
312
|
+
if (formatVal !== 'Invalid Date') {
|
|
313
|
+
return formatVal;
|
|
314
|
+
}
|
|
315
|
+
return strVal;
|
|
312
316
|
}
|
|
313
317
|
return ibiz.util.text.format(strVal, this.valueFormat);
|
|
314
318
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
2
|
+
import { MapService } from './map.service';
|
|
3
|
+
import {
|
|
4
|
+
IMapController,
|
|
5
|
+
IMapData,
|
|
6
|
+
IMapEvent,
|
|
7
|
+
IMapState,
|
|
8
|
+
MDCtrlLoadParams,
|
|
9
|
+
} from '../../../interface';
|
|
10
|
+
import { MDControlController } from '../../common';
|
|
11
|
+
|
|
12
|
+
export class MapController
|
|
13
|
+
extends MDControlController<ISysMap, IMapState, IMapEvent>
|
|
14
|
+
implements IMapController
|
|
15
|
+
{
|
|
16
|
+
declare service: MapService;
|
|
17
|
+
|
|
18
|
+
protected initState(): void {
|
|
19
|
+
super.initState();
|
|
20
|
+
this.state.size = 1000;
|
|
21
|
+
this.state.pointData = [];
|
|
22
|
+
this.state.areaData = [];
|
|
23
|
+
this.state.areaCode = 320000;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
protected async onCreated(): Promise<void> {
|
|
27
|
+
await super.onCreated();
|
|
28
|
+
this.service = new MapService(this.model);
|
|
29
|
+
await this.service.init(this.context);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 部件加载数据行为
|
|
34
|
+
*
|
|
35
|
+
* @author lxm
|
|
36
|
+
* @date 2022-08-19 14:08:50
|
|
37
|
+
*/
|
|
38
|
+
async load(args: MDCtrlLoadParams = {}): Promise<IData[]> {
|
|
39
|
+
if (this.state.isSimple) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
await this.startLoading();
|
|
43
|
+
try {
|
|
44
|
+
// *初始加载需要重置分页
|
|
45
|
+
const isInitialLoad = args.isInitialLoad === true;
|
|
46
|
+
|
|
47
|
+
// *查询参数处理
|
|
48
|
+
const { context } = this.handlerAbilityParams(args);
|
|
49
|
+
const params = await this.getFetchParams(args?.viewParam);
|
|
50
|
+
context.srfareacode = this.state.areaCode;
|
|
51
|
+
|
|
52
|
+
const res = await this.service.fetchAll(context, params);
|
|
53
|
+
|
|
54
|
+
this.state.items = res.data;
|
|
55
|
+
|
|
56
|
+
await this.afterLoad(args, res.data);
|
|
57
|
+
|
|
58
|
+
this.state.isLoaded = true;
|
|
59
|
+
await this._evt.emit('onLoadSuccess', {
|
|
60
|
+
isInitialLoad,
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
await this._evt.emit('onLoadError', undefined);
|
|
64
|
+
this.actionNotification('FETCHERROR', {
|
|
65
|
+
error: error as Error,
|
|
66
|
+
});
|
|
67
|
+
throw error;
|
|
68
|
+
} finally {
|
|
69
|
+
await this.endLoading();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.actionNotification('FETCHSUCCESS');
|
|
73
|
+
return this.state.items;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async afterLoad(args: MDCtrlLoadParams, items: IData[]): Promise<IData[]> {
|
|
77
|
+
const result = (await super.afterLoad(args, items)) as IMapData[];
|
|
78
|
+
|
|
79
|
+
const tempareaData: IMapData[] = [];
|
|
80
|
+
const temppointData: IMapData[] = [];
|
|
81
|
+
result.forEach(item => {
|
|
82
|
+
if (item._type === 'area') {
|
|
83
|
+
tempareaData.push(item);
|
|
84
|
+
} else if (item._type === 'point') {
|
|
85
|
+
temppointData.push(item);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.state.pointData = temppointData;
|
|
89
|
+
this.state.areaData = tempareaData;
|
|
90
|
+
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 地图变更事件处理
|
|
96
|
+
* @author lxm
|
|
97
|
+
* @date 2023-10-31 05:28:36
|
|
98
|
+
* @param {(string | number)} areaCode
|
|
99
|
+
*/
|
|
100
|
+
onMapChange(areaCode: string | number): void {
|
|
101
|
+
// 修改预置视图参数,然后加载
|
|
102
|
+
this.state.areaCode = areaCode;
|
|
103
|
+
this.load({});
|
|
104
|
+
this.evt.emit('onMapChange', { areaCode });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 地图区域点击事件处理
|
|
109
|
+
* @author lxm
|
|
110
|
+
* @date 2023-10-31 05:30:54
|
|
111
|
+
* @param {IMapData} mapData
|
|
112
|
+
*/
|
|
113
|
+
onAreaClick(mapData: IMapData): void {
|
|
114
|
+
this.evt.emit('onAreaClick', { data: [mapData] });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 地图散点点击事件处理
|
|
119
|
+
* @author lxm
|
|
120
|
+
* @date 2023-10-31 05:30:58
|
|
121
|
+
* @param {IMapData} mapData
|
|
122
|
+
*/
|
|
123
|
+
onPointClick(mapData: IMapData): void {
|
|
124
|
+
this.evt.emit('onPointClick', { data: [mapData] });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { HttpResponse, IHttpResponse } from '@ibiz-template/core';
|
|
2
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
3
|
+
import { IMapData } from '../../../interface';
|
|
4
|
+
import { parseUserParams } from '../../../model';
|
|
5
|
+
import { MapData, MDControlService } from '../../../service';
|
|
6
|
+
import { convertNavData, ScriptFactory } from '../../../utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 地图部件服务
|
|
10
|
+
* @author lxm
|
|
11
|
+
* @date 2023-05-15 09:53:35
|
|
12
|
+
* @export
|
|
13
|
+
* @class GridService
|
|
14
|
+
* @extends {MDControlService<ISysMap>}
|
|
15
|
+
*/
|
|
16
|
+
export class MapService extends MDControlService<ISysMap> {
|
|
17
|
+
async init(context?: IContext | undefined): Promise<void> {
|
|
18
|
+
await super.init(context);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 加载所有地图项的数据
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2023-10-30 06:27:32
|
|
25
|
+
* @param {IParams} context
|
|
26
|
+
* @param {IParams} [params={}]
|
|
27
|
+
* @return {*} {Promise<IHttpResponse<IMapData[]>>}
|
|
28
|
+
*/
|
|
29
|
+
async fetchAll(
|
|
30
|
+
context: IContext,
|
|
31
|
+
params: IParams = {},
|
|
32
|
+
): Promise<IHttpResponse<IMapData[]>> {
|
|
33
|
+
const allData: IMapData[] = [];
|
|
34
|
+
// 没有面板项返回空数组
|
|
35
|
+
if (this.model.sysMapItems?.length) {
|
|
36
|
+
const app = ibiz.hub.getApp(context.srfappid);
|
|
37
|
+
await Promise.all(
|
|
38
|
+
this.model.sysMapItems.map(async mapItem => {
|
|
39
|
+
const { appDataEntityId, appDEDataSetId, customCond } = mapItem;
|
|
40
|
+
const _context = context.clone();
|
|
41
|
+
const _params = { ...params };
|
|
42
|
+
|
|
43
|
+
if (customCond) {
|
|
44
|
+
const customParams = ScriptFactory.execSingleLine(
|
|
45
|
+
customCond,
|
|
46
|
+
) as IData;
|
|
47
|
+
if (customParams) {
|
|
48
|
+
const { navigateContexts, navigateParams } =
|
|
49
|
+
parseUserParams(customParams);
|
|
50
|
+
if (navigateContexts) {
|
|
51
|
+
Object.assign(
|
|
52
|
+
_context,
|
|
53
|
+
convertNavData(navigateContexts, params, context),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
if (navigateParams) {
|
|
57
|
+
Object.assign(
|
|
58
|
+
_params,
|
|
59
|
+
convertNavData(navigateContexts, params, context),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const res = (await app.deService.exec(
|
|
66
|
+
appDataEntityId!,
|
|
67
|
+
appDEDataSetId!,
|
|
68
|
+
_context,
|
|
69
|
+
_params,
|
|
70
|
+
)) as IHttpResponse<IData[]>;
|
|
71
|
+
if (res.data) {
|
|
72
|
+
allData.push(...res.data.map(item => new MapData(item, mapItem)));
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return new HttpResponse<IMapData[]>(allData, 200);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -172,10 +172,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
172
172
|
* @param {IData} data
|
|
173
173
|
*/
|
|
174
174
|
calcItemDisabled(data: IData): void {
|
|
175
|
-
let
|
|
175
|
+
let { disabled } = this.dynaLogicResult;
|
|
176
176
|
|
|
177
177
|
// 上层计算为启用时计算预定义项启用逻辑
|
|
178
|
-
if (
|
|
178
|
+
if (disabled !== true && this.panel.scheduler) {
|
|
179
179
|
const itemEnable = this.panel.scheduler.triggerItemEnable(
|
|
180
180
|
this.model.id!,
|
|
181
181
|
{
|
|
@@ -183,12 +183,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
183
183
|
},
|
|
184
184
|
);
|
|
185
185
|
if (itemEnable !== undefined) {
|
|
186
|
-
|
|
186
|
+
disabled = !itemEnable;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
//
|
|
191
|
-
|
|
190
|
+
// 有值的时候才会去修改state
|
|
191
|
+
if (disabled !== undefined) {
|
|
192
|
+
this.state.disabled = disabled;
|
|
193
|
+
}
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
/**
|
|
@@ -201,7 +203,7 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
201
203
|
let { visible } = this.dynaLogicResult;
|
|
202
204
|
|
|
203
205
|
// 上层计算为显示时计算预定义项显示逻辑
|
|
204
|
-
if (visible && this.panel.scheduler) {
|
|
206
|
+
if (visible !== false && this.panel.scheduler) {
|
|
205
207
|
const itemVIsible = this.panel.scheduler.triggerItemVisible(
|
|
206
208
|
this.model.id!,
|
|
207
209
|
{
|
|
@@ -213,8 +215,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
+
// 有值的时候才会去修改state
|
|
219
|
+
if (visible !== undefined) {
|
|
220
|
+
this.state.visible = visible;
|
|
221
|
+
}
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
/**
|
|
@@ -224,10 +228,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
224
228
|
* @param {IData} data
|
|
225
229
|
*/
|
|
226
230
|
calcItemRequired(data: IData): void {
|
|
227
|
-
let
|
|
231
|
+
let { required } = this.dynaLogicResult;
|
|
228
232
|
|
|
229
233
|
// 上层计算为启用时计算预定义项启用逻辑
|
|
230
|
-
if (
|
|
234
|
+
if (required !== true && this.panel.scheduler) {
|
|
231
235
|
const itemAllowEmpty = this.panel.scheduler.triggerItemBlank(
|
|
232
236
|
this.model.id!,
|
|
233
237
|
{
|
|
@@ -235,12 +239,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
235
239
|
},
|
|
236
240
|
);
|
|
237
241
|
if (itemAllowEmpty !== undefined) {
|
|
238
|
-
|
|
242
|
+
required = !itemAllowEmpty;
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
//
|
|
243
|
-
|
|
246
|
+
// 有值的时候才会去修改state
|
|
247
|
+
if (required !== undefined) {
|
|
248
|
+
this.state.required = required;
|
|
249
|
+
}
|
|
244
250
|
}
|
|
245
251
|
|
|
246
252
|
/**
|
|
@@ -249,10 +255,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
249
255
|
* @date 2023-09-21 03:36:37
|
|
250
256
|
* @protected
|
|
251
257
|
*/
|
|
252
|
-
protected dynaLogicResult
|
|
253
|
-
visible
|
|
254
|
-
disabled
|
|
255
|
-
required
|
|
258
|
+
protected dynaLogicResult: {
|
|
259
|
+
visible?: boolean;
|
|
260
|
+
disabled?: boolean;
|
|
261
|
+
required?: boolean;
|
|
262
|
+
} = {
|
|
263
|
+
visible: undefined,
|
|
264
|
+
disabled: undefined,
|
|
265
|
+
required: undefined,
|
|
256
266
|
};
|
|
257
267
|
|
|
258
268
|
/**
|
|
@@ -50,6 +50,13 @@ export class PickupViewPanelController
|
|
|
50
50
|
await super.onCreated();
|
|
51
51
|
// 等待嵌入视图mounted完成,选择视图面板才mounted
|
|
52
52
|
this.mountCounter.enroll(this.model.embeddedAppDEViewId!);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
updateContextParams(opts: {
|
|
56
|
+
context?: IContext | undefined;
|
|
57
|
+
params?: IParams | undefined;
|
|
58
|
+
}): void {
|
|
59
|
+
super.updateContextParams(opts);
|
|
53
60
|
this.initNavParam();
|
|
54
61
|
}
|
|
55
62
|
|
|
@@ -12,6 +12,15 @@ import { IGlobalViewConfig } from './i-global-view-config';
|
|
|
12
12
|
* @interface IGlobalConfig
|
|
13
13
|
*/
|
|
14
14
|
export interface IGlobalConfig {
|
|
15
|
+
/**
|
|
16
|
+
* 设置应用主题
|
|
17
|
+
*
|
|
18
|
+
* @author chitanda
|
|
19
|
+
* @date 2023-10-30 21:10:01
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
theme?: string;
|
|
23
|
+
|
|
15
24
|
/**
|
|
16
25
|
* 全局视图配置
|
|
17
26
|
* @return {*}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
2
|
+
import { IMapEvent } from '../../event';
|
|
3
|
+
import { IMapState } from '../../state';
|
|
4
|
+
import { IMDControlController } from './i-md-control.controller';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 地图控制器
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-05-04 01:47:16
|
|
10
|
+
* @export
|
|
11
|
+
* @interface IChartController
|
|
12
|
+
* @extends {IMDControlController}
|
|
13
|
+
*/
|
|
14
|
+
export interface IMapController
|
|
15
|
+
extends IMDControlController<ISysMap, IMapState, IMapEvent> {}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { EventBase } from '../argument';
|
|
2
|
+
import { IMDControlEvent } from './i-md-control.event';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 地图部件事件
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-08-30 16:08:43
|
|
9
|
+
* @export
|
|
10
|
+
* @interface IMDControlEvent
|
|
11
|
+
*/
|
|
12
|
+
export interface IMapEvent extends IMDControlEvent {
|
|
13
|
+
/**
|
|
14
|
+
* 地图变更事件(下探,返回)
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-03-26 06:15:06
|
|
17
|
+
* @param {emitArgs} undefined
|
|
18
|
+
* @return {*} {Promise<void>}
|
|
19
|
+
*/
|
|
20
|
+
onMapChange: {
|
|
21
|
+
event: EventBase & { areaCode: string | number };
|
|
22
|
+
emitArgs: { areaCode: string | number };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 地图区域点击事件
|
|
27
|
+
* @author lxm
|
|
28
|
+
* @date 2023-03-26 06:15:06
|
|
29
|
+
* @param {emitArgs} undefined
|
|
30
|
+
* @return {*} {Promise<void>}
|
|
31
|
+
*/
|
|
32
|
+
onAreaClick: {
|
|
33
|
+
event: EventBase;
|
|
34
|
+
emitArgs: { data: IData[] };
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 地图散点点击事件
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2023-03-26 06:15:06
|
|
41
|
+
* @param {emitArgs} undefined
|
|
42
|
+
* @return {*} {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
onPointClick: {
|
|
45
|
+
event: EventBase;
|
|
46
|
+
emitArgs: { data: IData[] };
|
|
47
|
+
};
|
|
48
|
+
}
|