@ibiz-template/runtime 0.7.41-alpha.117 → 0.7.41-alpha.118
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 +84 -41
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/control/md-control.controller.d.ts +4 -3
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +22 -5
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +22 -5
- package/out/controller/control/toolbar/toolbar.controller.js +22 -22
- package/out/interface/api/common/i-api-export-params.d.ts +24 -0
- package/out/interface/api/common/i-api-export-params.d.ts.map +1 -1
- package/out/interface/api/controller/control/i-api-tree-grid.controller.d.ts +3 -3
- package/out/interface/api/controller/control/i-api-tree-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts +3 -3
- package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-md-control.controller.d.ts +4 -3
- package/out/interface/controller/controller/control/i-md-control.controller.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +22 -6
- package/package.json +2 -2
- package/src/controller/common/control/md-control.controller.ts +6 -2
- package/src/controller/control/grid/grid/grid.controller.ts +26 -5
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +24 -4
- package/src/controller/control/toolbar/toolbar.controller.ts +27 -27
- package/src/interface/api/common/i-api-export-params.ts +28 -0
- package/src/interface/api/controller/control/i-api-tree-grid.controller.ts +2 -2
- package/src/interface/controller/controller/control/i-grid.controller.ts +3 -3
- package/src/interface/controller/controller/control/i-md-control.controller.ts +6 -2
- package/src/ui-action/provider/front-ui-action-provider.ts +21 -6
|
@@ -698,7 +698,10 @@ export class MDCtrlController
|
|
|
698
698
|
// 识别用户定义的视图参数导出数据集合
|
|
699
699
|
data = await this.loadData(
|
|
700
700
|
{ viewParam },
|
|
701
|
-
{
|
|
701
|
+
{
|
|
702
|
+
srfexportdataset:
|
|
703
|
+
params.srfexportdataset || this.params.srfexportdataset,
|
|
704
|
+
},
|
|
702
705
|
);
|
|
703
706
|
} else if (type === 'selectedRows') {
|
|
704
707
|
data = this.getData();
|
|
@@ -768,6 +771,11 @@ export class MDCtrlController
|
|
|
768
771
|
* @memberof MDCtrlController
|
|
769
772
|
*/
|
|
770
773
|
async excuteBackendExport(params: IApiExportParams): Promise<void> {
|
|
774
|
+
// 构建导出模型
|
|
775
|
+
let tempDataExport = this.dataExport;
|
|
776
|
+
if (params.srfdataexport) {
|
|
777
|
+
tempDataExport = params.srfdataexport as IAppDEDataExport;
|
|
778
|
+
}
|
|
771
779
|
// 准备参数
|
|
772
780
|
const fetchParams = await this.getFetchParams({ ...this.params });
|
|
773
781
|
let tempParams: IParams = {};
|
|
@@ -786,7 +794,8 @@ export class MDCtrlController
|
|
|
786
794
|
);
|
|
787
795
|
}
|
|
788
796
|
// 用户通过视图参数srfexportdatakey指定导出选中数据的数据主键属性
|
|
789
|
-
const srfexportdatakey =
|
|
797
|
+
const srfexportdatakey =
|
|
798
|
+
params.srfexportdatakey || this.params.srfexportdatakey || 'srfkey';
|
|
790
799
|
tempParams = {
|
|
791
800
|
page: 0,
|
|
792
801
|
srfkeys: selectedData.map(data => data[srfexportdatakey]).join(','),
|
|
@@ -803,14 +812,25 @@ export class MDCtrlController
|
|
|
803
812
|
}
|
|
804
813
|
: {
|
|
805
814
|
size:
|
|
806
|
-
|
|
815
|
+
tempDataExport?.maxRowCount ||
|
|
807
816
|
ibiz.config.common.maxExportRowsDefault,
|
|
808
817
|
page: 0,
|
|
809
818
|
};
|
|
810
819
|
}
|
|
820
|
+
// 自定义导出数据集,优先使用外部传入,避免被上面分支的整体赋值覆盖
|
|
821
|
+
if (params.srfexportdataset) {
|
|
822
|
+
tempParams.srfexportdataset = params.srfexportdataset;
|
|
823
|
+
}
|
|
811
824
|
Object.assign(fetchParams, tempParams);
|
|
825
|
+
// 构建上下文
|
|
826
|
+
const tempContext = clone(this.context);
|
|
827
|
+
if (params.srfdatatype) {
|
|
828
|
+
Object.assign(tempContext, {
|
|
829
|
+
srfdatatype: params.srfdatatype,
|
|
830
|
+
});
|
|
831
|
+
}
|
|
812
832
|
// 执行导出
|
|
813
|
-
await this.service.exportData(
|
|
833
|
+
await this.service.exportData(tempDataExport!, tempContext, fetchParams);
|
|
814
834
|
}
|
|
815
835
|
|
|
816
836
|
/**
|
|
@@ -489,23 +489,23 @@ export class ToolbarController<
|
|
|
489
489
|
itemState.visible = false;
|
|
490
490
|
}
|
|
491
491
|
});
|
|
492
|
-
|
|
493
|
-
if (
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
this.
|
|
504
|
-
(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
492
|
+
const logicParams: IData = {};
|
|
493
|
+
if (_params) {
|
|
494
|
+
Object.assign(logicParams, { ..._params });
|
|
495
|
+
}
|
|
496
|
+
if (_data) {
|
|
497
|
+
logicParams.data = [_data];
|
|
498
|
+
}
|
|
499
|
+
// 遍历所有的项
|
|
500
|
+
recursiveIterate(
|
|
501
|
+
this.model,
|
|
502
|
+
(item: IDEToolbarItem) => {
|
|
503
|
+
const itemState = this.state.buttonsState[item.id!] as IButtonState;
|
|
504
|
+
if (!itemState) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
// 计算菜单项逻辑的预置逻辑
|
|
508
|
+
if (this.scheduler) {
|
|
509
509
|
// 计算项显示逻辑
|
|
510
510
|
if (itemState.visible) {
|
|
511
511
|
const dynaVisible = this.scheduler!.triggerItemVisible(
|
|
@@ -527,18 +527,18 @@ export class ToolbarController<
|
|
|
527
527
|
itemState.disabled = !dynaEnable;
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
+
}
|
|
530
531
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
532
|
+
// 如果有统一资源且当前项显示,无权限则隐藏
|
|
533
|
+
if (item.accessKey && itemState.visible) {
|
|
534
|
+
const permitted = app.authority.calcByResCode(item.accessKey);
|
|
535
|
+
if (!permitted) {
|
|
536
|
+
itemState.visible = false;
|
|
537
537
|
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{ childrenFields: ['detoolbarItems'] },
|
|
541
|
+
);
|
|
542
542
|
this.state.hideSeparator = formatSeparator(
|
|
543
543
|
'TOOLBAR',
|
|
544
544
|
this.model.detoolbarItems,
|
|
@@ -24,4 +24,32 @@ export interface IApiExportParams {
|
|
|
24
24
|
* @memberof IApiExportParams
|
|
25
25
|
*/
|
|
26
26
|
endPage?: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @description 自定义导出数据主键属性
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof IApiExportParams
|
|
32
|
+
*/
|
|
33
|
+
srfexportdatakey?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @description 自定义导出数据集
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof IApiExportParams
|
|
39
|
+
*/
|
|
40
|
+
srfexportdataset?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @description 自定义导出模型对象
|
|
44
|
+
* @type {IData}
|
|
45
|
+
* @memberof IApiExportParams
|
|
46
|
+
*/
|
|
47
|
+
srfdataexport?: IData;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @description 自定义导出数据类型
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof IApiExportParams
|
|
53
|
+
*/
|
|
54
|
+
srfdatatype?: string;
|
|
27
55
|
}
|
|
@@ -37,9 +37,9 @@ export interface IApiTreeGridController<
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @description 数据导出
|
|
40
|
-
* @param {{ event
|
|
40
|
+
* @param {{ event?: MouseEvent; params?: IApiExportParams }} _args 导出参数
|
|
41
41
|
* @returns {*} {Promise<void>}
|
|
42
42
|
* @memberof IApiTreeGridController
|
|
43
43
|
*/
|
|
44
|
-
exportData(_args: {event
|
|
44
|
+
exportData(_args: {event?: MouseEvent;params?: IApiExportParams}): Promise<void>;
|
|
45
45
|
}
|
|
@@ -58,13 +58,13 @@ export interface IGridController<
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* @description 导出数据
|
|
61
|
-
* @param {{ event
|
|
61
|
+
* @param {{ event?: MouseEvent; params: IApiExportParams }} args
|
|
62
62
|
* @returns {*} {Promise<void>}
|
|
63
63
|
* @memberof IGridController
|
|
64
64
|
*/
|
|
65
65
|
exportData(args: {
|
|
66
|
-
event
|
|
67
|
-
params
|
|
66
|
+
event?: MouseEvent;
|
|
67
|
+
params?: IApiExportParams;
|
|
68
68
|
}): Promise<void>;
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
IApiMDControlController,
|
|
8
8
|
IApiMDCtrlLoadParams,
|
|
9
9
|
IApiMDCtrlRemoveParams,
|
|
10
|
+
IApiExportParams,
|
|
10
11
|
} from '../../../api';
|
|
11
12
|
import { IViewController } from '../view';
|
|
12
13
|
/**
|
|
@@ -69,9 +70,12 @@ export interface IMDControlController<
|
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* @description 导出数据
|
|
72
|
-
* @param {{ event
|
|
73
|
+
* @param {{ event?: MouseEvent; params?: IApiExportParams }} _args
|
|
73
74
|
* @returns {*} {Promise<void>}
|
|
74
75
|
* @memberof IMDControlController
|
|
75
76
|
*/
|
|
76
|
-
exportData(_args: {
|
|
77
|
+
exportData(_args: {
|
|
78
|
+
event?: MouseEvent;
|
|
79
|
+
params?: IApiExportParams;
|
|
80
|
+
}): Promise<void>;
|
|
77
81
|
}
|
|
@@ -361,16 +361,31 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
361
361
|
const { actionTarget } = action;
|
|
362
362
|
if (
|
|
363
363
|
(actionTarget === 'MULTIDATA' || actionTarget === 'MULTIKEY') &&
|
|
364
|
-
|
|
364
|
+
args.view
|
|
365
365
|
) {
|
|
366
366
|
const srfexportdatakey = presetParams.srfexportdatakey || 'srfkey';
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
if (!args.params.srfallselected) {
|
|
368
|
+
await args.view.call(SysUIActionTag.EXPORT_EXCEL, {
|
|
369
|
+
params: {
|
|
370
|
+
type: 'selectedRows',
|
|
371
|
+
srfexportdatakey,
|
|
372
|
+
srfexportdataset: exportDatasetCodeName,
|
|
373
|
+
srfdataexport: appDEDataExport,
|
|
374
|
+
srfdatatype: resultContext.srfdatatype,
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
} else {
|
|
378
|
+
await args.view.call(SysUIActionTag.EXPORT_EXCEL, {
|
|
379
|
+
params: {
|
|
380
|
+
type: 'maxRowCount',
|
|
381
|
+
srfexportdatakey,
|
|
382
|
+
srfexportdataset: exportDatasetCodeName,
|
|
383
|
+
srfdataexport: appDEDataExport,
|
|
384
|
+
srfdatatype: resultContext.srfdatatype,
|
|
385
|
+
},
|
|
371
386
|
});
|
|
372
387
|
}
|
|
373
|
-
|
|
388
|
+
return;
|
|
374
389
|
}
|
|
375
390
|
// 如果srfallselected存在需要删除,规范化参数
|
|
376
391
|
if (
|