@ibiz-template/runtime 0.2.5 → 0.2.7
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 +155 -47
- 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 +13 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +33 -2
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +3 -0
- 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/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +9 -1
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/actionbar-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/html-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/index.d.ts +4 -0
- package/out/controller/control/dashboard/portlet/index.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/index.js +4 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.js +3 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.d.ts +2 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/index.js +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.d.ts +5 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.d.ts.map +1 -0
- package/out/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.js +3 -0
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts +2 -2
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.js +11 -2
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts +2 -8
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.js +9 -10
- package/out/controller/control/grid/grid/grid.controller.d.ts +17 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +37 -9
- 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/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-control.controller.d.ts +11 -0
- package/out/interface/controller/controller/control/i-control.controller.d.ts.map +1 -1
- package/out/service/utils/res-path/res-path.d.ts.map +1 -1
- package/out/service/utils/res-path/res-path.js +4 -2
- package/out/service/vo/control.vo.js +2 -2
- package/package.json +3 -3
- package/src/controller/common/control/control.controller.ts +50 -3
- package/src/controller/common/control/md-control.controller.ts +4 -0
- 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/dashboard/dashboard.controller.ts +11 -1
- package/src/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/actionbar-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/html-portlet/html-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/html-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/index.ts +4 -0
- package/src/controller/control/dashboard/portlet/list-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.ts +4 -0
- package/src/controller/control/dashboard/portlet/rawitem-portlet/index.ts +1 -0
- package/src/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.ts +4 -0
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +2 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.ts +9 -2
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.ts +12 -11
- package/src/controller/control/grid/grid/grid.controller.ts +46 -15
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +5 -1
- 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-control.controller.ts +9 -0
- package/src/service/utils/res-path/res-path.ts +4 -2
- package/src/service/vo/control.vo.ts +2 -2
package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.ts
CHANGED
|
@@ -114,13 +114,20 @@ export class FormMDCtrlContentTypeController {
|
|
|
114
114
|
const name =
|
|
115
115
|
this.model.appDEFieldId || this.model.fieldName || this.model.id;
|
|
116
116
|
if (name) {
|
|
117
|
+
const data = this.parent.data[name];
|
|
117
118
|
if (
|
|
118
119
|
this.model.contentType === 'REPEATER' &&
|
|
119
120
|
this.model.detailStyle === 'STYLE3'
|
|
120
121
|
) {
|
|
121
|
-
|
|
122
|
+
if (Array.isArray(data)) {
|
|
123
|
+
this.parent.state.contentCtrlData = {};
|
|
124
|
+
} else {
|
|
125
|
+
this.parent.state.contentCtrlData = data || {};
|
|
126
|
+
}
|
|
127
|
+
} else if (!Array.isArray(data)) {
|
|
128
|
+
this.parent.state.contentCtrlData = [];
|
|
122
129
|
} else {
|
|
123
|
-
this.parent.state.contentCtrlData =
|
|
130
|
+
this.parent.state.contentCtrlData = data || [];
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
133
|
}
|
|
@@ -9,6 +9,7 @@ import { FormMDCtrlRepeaterFormOneController } from './form-mdctrl-repeater/form
|
|
|
9
9
|
import { FormMDCtrlRepeaterFormController } from './form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller';
|
|
10
10
|
import { FormMDCtrlRepeaterGridController } from './form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller';
|
|
11
11
|
import { FormMDCtrlState } from './form-mdctrl.state';
|
|
12
|
+
import { EditFormController } from '../../edit-form';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* 表单多数据部件控制器
|
|
@@ -30,6 +31,8 @@ export class FormMDCtrlController extends FormDetailController<IDEFormMDCtrl> {
|
|
|
30
31
|
*/
|
|
31
32
|
declare state: FormMDCtrlState;
|
|
32
33
|
|
|
34
|
+
declare form: EditFormController;
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Creates an instance of FormMDCtrlController.
|
|
35
38
|
*
|
|
@@ -101,6 +104,15 @@ export class FormMDCtrlController extends FormDetailController<IDEFormMDCtrl> {
|
|
|
101
104
|
if (this.mdCtrlContentController) {
|
|
102
105
|
await this.mdCtrlContentController.onInit();
|
|
103
106
|
}
|
|
107
|
+
if (this.form.state.isLoaded) {
|
|
108
|
+
this.mdCtrlContentController.initData();
|
|
109
|
+
}
|
|
110
|
+
this.form.evt.on('onLoadDraftSuccess', () => {
|
|
111
|
+
this.mdCtrlContentController.initData();
|
|
112
|
+
});
|
|
113
|
+
this.form.evt.on('onLoadSuccess', () => {
|
|
114
|
+
this.mdCtrlContentController.initData();
|
|
115
|
+
});
|
|
104
116
|
}
|
|
105
117
|
|
|
106
118
|
/**
|
|
@@ -118,17 +130,6 @@ export class FormMDCtrlController extends FormDetailController<IDEFormMDCtrl> {
|
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
|
|
121
|
-
/**
|
|
122
|
-
* 加载数据,要在表单加载完成之后再去加载
|
|
123
|
-
*
|
|
124
|
-
* @author zk
|
|
125
|
-
* @date 2023-07-28 11:07:09
|
|
126
|
-
* @memberof FormMDCtrlController
|
|
127
|
-
*/
|
|
128
|
-
async loadData(): Promise<void> {
|
|
129
|
-
await this.mdCtrlContentController.initData();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
133
|
/**
|
|
133
134
|
* 表单校验,通知子表单进行校验
|
|
134
135
|
*
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
IGridColumnProvider,
|
|
26
26
|
CodeListItem,
|
|
27
27
|
MDCtrlLoadParams,
|
|
28
|
+
IGridRowState,
|
|
28
29
|
} from '../../../../interface';
|
|
29
30
|
import { calcDeCodeNameById } from '../../../../model';
|
|
30
31
|
import { getGridColumnProvider } from '../../../../register';
|
|
@@ -393,9 +394,7 @@ export class GridController
|
|
|
393
394
|
afterRemove(data: IData): void {
|
|
394
395
|
super.afterRemove(data);
|
|
395
396
|
// 删除this.state.rows里的表格行数据
|
|
396
|
-
const index = this.
|
|
397
|
-
item => item.data.srfkey === data.srfkey,
|
|
398
|
-
);
|
|
397
|
+
const index = this.findRowStateIndex(data);
|
|
399
398
|
this.state.rows.splice(index, 1);
|
|
400
399
|
|
|
401
400
|
// 删除分组里的那条数据
|
|
@@ -419,18 +418,21 @@ export class GridController
|
|
|
419
418
|
*/
|
|
420
419
|
async newRow(): Promise<void> {
|
|
421
420
|
const { enableRowEdit, enableRowNew } = this.model;
|
|
421
|
+
const { editShowMode } = ibiz.config.grid;
|
|
422
422
|
if (
|
|
423
423
|
!enableRowEdit ||
|
|
424
424
|
!enableRowNew ||
|
|
425
|
-
|
|
425
|
+
!['row', 'all'].includes(editShowMode)
|
|
426
426
|
) {
|
|
427
427
|
ibiz.log.error('不支持新建行');
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
if (editShowMode === 'row') {
|
|
432
|
+
const editingRow = this.state.rows.find(item => item.showRowEdit);
|
|
433
|
+
if (editingRow) {
|
|
434
|
+
throw new RuntimeError('请先完成当前行编辑中的行的操作');
|
|
435
|
+
}
|
|
434
436
|
}
|
|
435
437
|
|
|
436
438
|
const queryParams = { ...this.params };
|
|
@@ -456,7 +458,11 @@ export class GridController
|
|
|
456
458
|
const newRow = new GridRowState(draftData, this);
|
|
457
459
|
this.state.rows.unshift(newRow);
|
|
458
460
|
this.gridStateNotify(newRow, GridNotifyState.DRAFT);
|
|
459
|
-
|
|
461
|
+
|
|
462
|
+
if (editShowMode === 'row') {
|
|
463
|
+
this.switchRowEdit(this.state.rows[0], true);
|
|
464
|
+
}
|
|
465
|
+
|
|
460
466
|
this.actionNotification('GETDRAFTSUCCESS', { data: draftData });
|
|
461
467
|
}
|
|
462
468
|
|
|
@@ -472,9 +478,10 @@ export class GridController
|
|
|
472
478
|
if (this.state.isSimple) {
|
|
473
479
|
return;
|
|
474
480
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
481
|
+
|
|
482
|
+
const isCreate = data.srfuf === Srfuf.CREATE;
|
|
483
|
+
|
|
484
|
+
const rowState = this.findRowState(data);
|
|
478
485
|
if (!rowState) {
|
|
479
486
|
throw new RuntimeError('行数据不存在');
|
|
480
487
|
}
|
|
@@ -495,7 +502,6 @@ export class GridController
|
|
|
495
502
|
}
|
|
496
503
|
await this.startLoading();
|
|
497
504
|
let res;
|
|
498
|
-
const isCreate = data.srfuf === Srfuf.CREATE;
|
|
499
505
|
const deName = calcDeCodeNameById(this.model.appDataEntityId!);
|
|
500
506
|
const tempContext = this.context.clone();
|
|
501
507
|
tempContext[deName] = data.srfkey;
|
|
@@ -514,9 +520,7 @@ export class GridController
|
|
|
514
520
|
await this.endLoading();
|
|
515
521
|
}
|
|
516
522
|
// 后续处理
|
|
517
|
-
const index = this.
|
|
518
|
-
item => item.srfkey === data.srfkey,
|
|
519
|
-
);
|
|
523
|
+
const index = this.findRowStateIndex(data);
|
|
520
524
|
this.state.items.splice(index, 1, res.data);
|
|
521
525
|
rowState.data = res.data;
|
|
522
526
|
rowState.modified = false;
|
|
@@ -1035,4 +1039,31 @@ export class GridController
|
|
|
1035
1039
|
});
|
|
1036
1040
|
return result;
|
|
1037
1041
|
}
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* 查找rowState
|
|
1045
|
+
* @author lxm
|
|
1046
|
+
* @date 2023-10-27 07:27:48
|
|
1047
|
+
* @param {IData} data
|
|
1048
|
+
* @return {*} {(IGridRowState)}
|
|
1049
|
+
*/
|
|
1050
|
+
findRowStateIndex(data: IData): number {
|
|
1051
|
+
const isCreate = data.srfuf === Srfuf.CREATE;
|
|
1052
|
+
const compareKey = isCreate ? 'tempsrfkey' : 'srfkey';
|
|
1053
|
+
return this.state.rows.findIndex(
|
|
1054
|
+
item => item.data[compareKey] === data[compareKey],
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* 查找rowState
|
|
1060
|
+
* @author lxm
|
|
1061
|
+
* @date 2023-10-27 07:27:48
|
|
1062
|
+
* @param {IData} data
|
|
1063
|
+
* @return {*} {(IGridRowState | undefined)}
|
|
1064
|
+
*/
|
|
1065
|
+
findRowState(data: IData): IGridRowState | undefined {
|
|
1066
|
+
const index = this.findRowStateIndex(data);
|
|
1067
|
+
return index !== -1 ? this.state.rows[index] : undefined;
|
|
1068
|
+
}
|
|
1038
1069
|
}
|
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
|
}
|
|
@@ -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 {*}
|
|
@@ -49,4 +49,13 @@ export interface IControlController<
|
|
|
49
49
|
* @date 2022-09-19 14:09:09
|
|
50
50
|
*/
|
|
51
51
|
endLoading(): Promise<void>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 在不改变引用的前提下,更新上下文和导航参数
|
|
55
|
+
* 并处理如自定义导航参数的后续处理
|
|
56
|
+
* @author lxm
|
|
57
|
+
* @date 2023-10-27 01:47:59
|
|
58
|
+
* @param {{ context?: IContext; params?: IParams }} opts
|
|
59
|
+
*/
|
|
60
|
+
updateContextParams(opts: { context?: IContext; params?: IParams }): void;
|
|
52
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAppDataEntity } from '@ibiz/model-core';
|
|
2
2
|
|
|
3
3
|
// 匹配 ${} 中间的内容
|
|
4
|
-
const reg =
|
|
4
|
+
const reg = /\$\{(.*?)\}/g;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 获取匹配的资源路径
|
|
@@ -23,9 +23,11 @@ export function getMatchResPath(
|
|
|
23
23
|
const pathItems = entity.requestPaths || [];
|
|
24
24
|
// 获取所有的路径需要匹配的参数
|
|
25
25
|
const items: { path: string; keys: string[] }[] = pathItems.map(str => {
|
|
26
|
+
const match = str.match(reg);
|
|
27
|
+
const keys = match?.map(item => item.substring(2, item.length - 1)) || [];
|
|
26
28
|
return {
|
|
27
29
|
path: str,
|
|
28
|
-
keys
|
|
30
|
+
keys,
|
|
29
31
|
};
|
|
30
32
|
});
|
|
31
33
|
// 过滤掉所有不能满足填充的路径, 并且按照填充参数个数排序,填充参数最多的优先依次递减排序
|
|
@@ -147,10 +147,10 @@ export class ControlVO {
|
|
|
147
147
|
if (Object.prototype.hasOwnProperty.call(this.$origin, key)) {
|
|
148
148
|
Object.defineProperty(this, key, {
|
|
149
149
|
get() {
|
|
150
|
-
return this.$origin
|
|
150
|
+
return this.$origin[key];
|
|
151
151
|
},
|
|
152
152
|
set(val: unknown) {
|
|
153
|
-
this.$origin
|
|
153
|
+
this.$origin[key] = val;
|
|
154
154
|
},
|
|
155
155
|
enumerable: false,
|
|
156
156
|
configurable: true,
|