@ibiz-template/runtime 0.4.10 → 0.4.12
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 +996 -290
- package/dist/index.system.min.js +2 -2
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +1 -0
- package/out/controller/common/control/control.controller.d.ts +14 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +21 -0
- package/out/controller/common/control/md-control.controller.d.ts +9 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +20 -0
- package/out/controller/common/view/view.controller.d.ts +8 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +12 -4
- 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 +36 -38
- package/out/controller/control/form/edit-form/edit-form.service.d.ts +3 -2
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +11 -2
- package/out/controller/control/form/form/form.controller.d.ts +0 -7
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +0 -11
- package/out/controller/control/form/form/form.service.d.ts +24 -0
- package/out/controller/control/form/form/form.service.d.ts.map +1 -0
- package/out/controller/control/form/form/form.service.js +45 -0
- package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.d.ts +1 -1
- package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.js +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +8 -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 +14 -5
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +1 -5
- package/out/controller/control/form/search-form/search-form.service.d.ts +4 -3
- 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 +8 -3
- package/out/controller/control/gantt/gantt.controller.d.ts +55 -1
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +150 -0
- package/out/controller/control/gantt/gantt.service.d.ts +69 -6
- package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.service.js +196 -5
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +10 -6
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts +8 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.js +22 -7
- package/out/interface/common/i-global-config/i-global-view-config.d.ts +7 -0
- package/out/interface/common/i-global-config/i-global-view-config.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-control.controller.d.ts +14 -0
- package/out/interface/controller/controller/control/i-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-drbar.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/i-drbar.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/view/i-view.controller.d.ts +14 -0
- package/out/interface/controller/controller/view/i-view.controller.d.ts.map +1 -1
- package/out/interface/controller/event/view/i-de-index-view.event.d.ts +12 -0
- package/out/interface/controller/event/view/i-de-index-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-de-index-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-control.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drbar.state.d.ts +28 -7
- package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +94 -3
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-de-index-view.state.d.ts +19 -0
- package/out/interface/controller/state/view/i-de-index-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-de-index-view.state.js +1 -0
- package/out/interface/controller/state/view/i-edit-view2.state.d.ts +8 -0
- package/out/interface/controller/state/view/i-edit-view2.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/i-view.state.d.ts +8 -0
- package/out/interface/controller/state/view/i-view.state.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/interface/service/service/i-auth.service.d.ts +3 -2
- package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
- package/out/register/helper/ui-action-register.d.ts.map +1 -1
- package/out/register/helper/ui-action-register.js +6 -1
- package/out/service/service/auth/v7-auth.service.d.ts +1 -1
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +12 -7
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +1 -8
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +5 -5
- package/out/service/utils/de-cache/de-cache.d.ts +19 -0
- package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
- package/out/service/utils/de-cache/de-cache.js +54 -4
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +19 -0
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts.map +1 -0
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.js +14 -0
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +19 -0
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -0
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +14 -0
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +9 -0
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -0
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +19 -0
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts +17 -0
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -0
- package/out/service/vo/gantt-node-data/gantt-static-node-data.js +13 -0
- package/out/service/vo/gantt-node-data/index.d.ts +4 -0
- package/out/service/vo/gantt-node-data/index.d.ts.map +1 -0
- package/out/service/vo/gantt-node-data/index.js +3 -0
- 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/ui-action/provider/index.d.ts.map +1 -1
- package/out/ui-action/provider/index.js +4 -0
- package/out/ui-action/provider/loginout-ui-action-provider.d.ts +16 -0
- package/out/ui-action/provider/loginout-ui-action-provider.d.ts.map +1 -0
- package/out/ui-action/provider/loginout-ui-action-provider.js +25 -0
- package/out/utils/layout-panel-util/layout-panel-util.d.ts.map +1 -1
- package/out/utils/layout-panel-util/layout-panel-util.js +16 -2
- package/package.json +3 -3
- package/src/config/global-config.ts +1 -0
- package/src/controller/common/control/control.controller.ts +23 -0
- package/src/controller/common/control/md-control.controller.ts +21 -0
- package/src/controller/common/view/view.controller.ts +12 -5
- package/src/controller/control/form/edit-form/edit-form.controller.ts +59 -58
- package/src/controller/control/form/edit-form/edit-form.service.ts +11 -2
- package/src/controller/control/form/form/form.controller.ts +0 -14
- package/src/controller/control/form/form/form.service.ts +63 -0
- package/src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts +1 -1
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +15 -5
- package/src/controller/control/form/search-form/search-form.controller.ts +1 -5
- package/src/controller/control/form/search-form/search-form.service.ts +8 -3
- package/src/controller/control/gantt/gantt.controller.ts +179 -1
- package/src/controller/control/gantt/gantt.service.ts +305 -6
- package/src/controller/control/search-bar/search-bar.controller.ts +11 -8
- package/src/controller/control/wizard-panel/wizard-panel.controller.ts +27 -7
- package/src/interface/common/i-global-config/i-global-view-config.ts +8 -0
- package/src/interface/controller/controller/control/i-control.controller.ts +16 -0
- package/src/interface/controller/controller/control/i-drbar.controller.ts +8 -0
- package/src/interface/controller/controller/view/i-view.controller.ts +16 -0
- package/src/interface/controller/event/view/i-de-index-view.event.ts +12 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/control/i-control.state.ts +9 -0
- package/src/interface/controller/state/control/i-drbar.state.ts +32 -8
- package/src/interface/controller/state/control/i-gantt.state.ts +106 -4
- package/src/interface/controller/state/view/i-de-index-view.state.ts +19 -0
- package/src/interface/controller/state/view/i-edit-view2.state.ts +10 -1
- package/src/interface/controller/state/view/i-view.state.ts +9 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/interface/service/service/i-auth.service.ts +3 -2
- package/src/register/helper/ui-action-register.ts +7 -1
- package/src/service/service/auth/v7-auth.service.ts +18 -8
- package/src/service/service/entity/de.service.ts +2 -1
- package/src/service/service/entity/method/de-action.ts +5 -4
- package/src/service/utils/de-cache/de-cache.ts +64 -3
- package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +68 -0
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +68 -0
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +26 -0
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +50 -0
- package/src/service/vo/gantt-node-data/index.ts +3 -0
- package/src/service/vo/index.ts +1 -0
- package/src/ui-action/provider/index.ts +4 -0
- package/src/ui-action/provider/loginout-ui-action-provider.ts +31 -0
- package/src/utils/layout-panel-util/layout-panel-util.ts +17 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDETreeNode } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 计算数据项
|
|
4
|
+
* @param nodeModel
|
|
5
|
+
* @param fieldCodeName
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const calcDataItemValue: (fieldCodeName: string | undefined, nodeModel: IDETreeNode, data?: IData) => string;
|
|
9
|
+
//# sourceMappingURL=gantt-node-data-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gantt-node-data-util.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-node-data-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACb,MAAM,GAAG,SAAS,aACtB,WAAW,SAChB,KAAK,KACV,MAaF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 计算数据项
|
|
3
|
+
* @param nodeModel
|
|
4
|
+
* @param fieldCodeName
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export const calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
8
|
+
let result = '';
|
|
9
|
+
if (!fieldCodeName || !nodeModel.detreeNodeDataItems) {
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
const targetTreeNodeDataItem = nodeModel.detreeNodeDataItems.find((nodeDataItem) => {
|
|
13
|
+
return nodeDataItem.id === fieldCodeName;
|
|
14
|
+
});
|
|
15
|
+
if (targetTreeNodeDataItem && targetTreeNodeDataItem.appDEFieldId) {
|
|
16
|
+
result = data[targetTreeNodeDataItem.appDEFieldId];
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IDEGantt, IDETreeNode } from '@ibiz/model-core';
|
|
2
|
+
import { IGanttNodeData } from '../../../interface';
|
|
3
|
+
import { TreeStaticNodeData } from '../tree-node-data';
|
|
4
|
+
export declare class GanttStaticNodeData extends TreeStaticNodeData implements IGanttNodeData {
|
|
5
|
+
sndataIteValue: string;
|
|
6
|
+
beginDataItemValue: string;
|
|
7
|
+
endDataItemValue: string;
|
|
8
|
+
prevDataItemValue: string | number;
|
|
9
|
+
finishDataItemValue: string | number;
|
|
10
|
+
totalDataItemValue: string | number;
|
|
11
|
+
children?: IGanttNodeData[] | undefined;
|
|
12
|
+
constructor(model: IDEGantt, nodeModel: IDETreeNode, parentNodeData: IGanttNodeData | undefined, opts: {
|
|
13
|
+
parentValueLevel?: number;
|
|
14
|
+
leaf: boolean;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=gantt-static-node-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gantt-static-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-static-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,qBAAa,mBACX,SAAQ,kBACR,YAAW,cAAc;IAEzB,cAAc,EAAE,MAAM,CAAC;IAEvB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,gBAAgB,EAAE,MAAM,CAAC;IAEzB,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEnC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;IAErC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC,QAAQ,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;gBAGtC,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,WAAW,EACtB,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,IAAI,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE;CAsBrD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TreeStaticNodeData } from '../tree-node-data';
|
|
2
|
+
import { calcDataItemValue } from './gantt-node-data-util';
|
|
3
|
+
export class GanttStaticNodeData extends TreeStaticNodeData {
|
|
4
|
+
constructor(model, nodeModel, parentNodeData, opts) {
|
|
5
|
+
super(nodeModel, parentNodeData, opts);
|
|
6
|
+
this.sndataIteValue = calcDataItemValue(model.sndataItemName, nodeModel);
|
|
7
|
+
this.beginDataItemValue = calcDataItemValue(model.beginDataItemName, nodeModel);
|
|
8
|
+
this.endDataItemValue = calcDataItemValue(model.endDataItemName, nodeModel);
|
|
9
|
+
this.prevDataItemValue = calcDataItemValue(model.prevDataItemName, nodeModel);
|
|
10
|
+
this.finishDataItemValue = calcDataItemValue(model.finishDataItemName, nodeModel);
|
|
11
|
+
this.totalDataItemValue = calcDataItemValue(model.totalDataItemName, nodeModel);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/vo/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/vo/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
package/out/service/vo/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAqB7C;AAED,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,GACrB,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { SysUIActionProvider } from './sys-ui-action-provider';
|
|
|
4
4
|
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
5
5
|
import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
|
|
6
6
|
import { UIActionProviderBase } from './ui-action-provider-base';
|
|
7
|
+
import { LoginOutUIActionProvider } from './loginout-ui-action-provider';
|
|
7
8
|
/**
|
|
8
9
|
* 预置默认的界面行为适配器
|
|
9
10
|
*
|
|
@@ -25,5 +26,8 @@ export function presetUIActionProvider() {
|
|
|
25
26
|
// 工作流撤回
|
|
26
27
|
const wfWithdrawUIActionProvider = new WFWithdrawUIActionProvider();
|
|
27
28
|
registerUIActionProvider('DEUIACTION_WFWithdraw', () => wfWithdrawUIActionProvider);
|
|
29
|
+
// 预置登出界面行为适配器
|
|
30
|
+
const loginOutUIActionProvider = new LoginOutUIActionProvider();
|
|
31
|
+
registerUIActionProvider('SYS_Logout', () => loginOutUIActionProvider);
|
|
28
32
|
}
|
|
29
33
|
export { FrontUIActionProvider, SysUIActionProvider, BackendUIActionProvider, WFWithdrawUIActionProvider, UIActionProviderBase, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IAppDEUIAction } from '@ibiz/model-core';
|
|
2
|
+
import { IUIActionResult, IUILogicParams } from '../../interface';
|
|
3
|
+
import { UIActionProviderBase } from './ui-action-provider-base';
|
|
4
|
+
/**
|
|
5
|
+
* 系统登出界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author zk
|
|
8
|
+
* @date 2023-12-11 07:12:49
|
|
9
|
+
* @export
|
|
10
|
+
* @class LoginOutUIActionProvider
|
|
11
|
+
* @extends {UIActionProviderBase}
|
|
12
|
+
*/
|
|
13
|
+
export declare class LoginOutUIActionProvider extends UIActionProviderBase {
|
|
14
|
+
execAction(_action: IAppDEUIAction, _params: IUILogicParams): Promise<IUIActionResult>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=loginout-ui-action-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginout-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/loginout-ui-action-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,wBAAyB,SAAQ,oBAAoB;IAC1D,UAAU,CACd,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;CAa5B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UIActionProviderBase } from './ui-action-provider-base';
|
|
2
|
+
/**
|
|
3
|
+
* 系统登出界面行为适配器
|
|
4
|
+
*
|
|
5
|
+
* @author zk
|
|
6
|
+
* @date 2023-12-11 07:12:49
|
|
7
|
+
* @export
|
|
8
|
+
* @class LoginOutUIActionProvider
|
|
9
|
+
* @extends {UIActionProviderBase}
|
|
10
|
+
*/
|
|
11
|
+
export class LoginOutUIActionProvider extends UIActionProviderBase {
|
|
12
|
+
async execAction(_action, _params) {
|
|
13
|
+
const confirm = await ibiz.confirm.info({
|
|
14
|
+
title: '确认退出登录',
|
|
15
|
+
desc: '您确定要退出登录吗?退出后您将无法继续访问已登录状态的功能和信息,请确保您已保存所有未完成的操作。',
|
|
16
|
+
});
|
|
17
|
+
if (confirm) {
|
|
18
|
+
const bol = await ibiz.auth.logout();
|
|
19
|
+
if (bol) {
|
|
20
|
+
window.location.reload();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-panel-util.d.ts","sourceRoot":"","sources":["../../../src/utils/layout-panel-util/layout-panel-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7E;;;;;;;GAOG;AACH,qBAAa,eAAe;IAC1B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAa;IAE3D;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAIpD;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI9C;;;;;;;OAOG;IACH,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ;IAgCnC;;;;;;;;OAQG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM;IAUpD;;;;;;;;OAQG;IACH,SAAS,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"layout-panel-util.d.ts","sourceRoot":"","sources":["../../../src/utils/layout-panel-util/layout-panel-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7E;;;;;;;GAOG;AACH,qBAAa,eAAe;IAC1B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAa;IAE3D;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAIpD;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI9C;;;;;;;OAOG;IACH,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ;IAgCnC;;;;;;;;OAQG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM;IAUpD;;;;;;;;OAQG;IACH,SAAS,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;CA6BnE"}
|
|
@@ -116,9 +116,23 @@ export class LayoutPanelUtil {
|
|
|
116
116
|
else if (mainMenuAlign) {
|
|
117
117
|
exTag = mainMenuAlign.toUpperCase();
|
|
118
118
|
}
|
|
119
|
+
// 计算面板标识
|
|
120
|
+
let key = '';
|
|
119
121
|
if (exTag !== '') {
|
|
120
|
-
|
|
122
|
+
key = `${viewType}_${viewStyle}_${exTag}`;
|
|
121
123
|
}
|
|
122
|
-
|
|
124
|
+
else {
|
|
125
|
+
key = `${viewType}_${viewStyle}`;
|
|
126
|
+
}
|
|
127
|
+
// 首页不采用分页导航
|
|
128
|
+
if (ibiz.config.view.noNavTabs &&
|
|
129
|
+
[
|
|
130
|
+
'APPINDEXVIEW_DEFAULT',
|
|
131
|
+
'APPINDEXVIEW_DEFAULT_LEFT',
|
|
132
|
+
'APPINDEXVIEW_DEFAULT_TOP',
|
|
133
|
+
].includes(key)) {
|
|
134
|
+
key += '_NO_NAV';
|
|
135
|
+
}
|
|
136
|
+
return key;
|
|
123
137
|
}
|
|
124
138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.4.
|
|
32
|
+
"@ibiz-template/core": "^0.4.12",
|
|
33
33
|
"@ibiz/model-core": "^0.0.27",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.10",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "df161fe8da63b34ffccd27b30e6cd51769b0a51d"
|
|
63
63
|
}
|
|
@@ -149,6 +149,7 @@ export class ControlController<
|
|
|
149
149
|
|
|
150
150
|
protected initState(): void {
|
|
151
151
|
super.initState();
|
|
152
|
+
this.state.activated = true;
|
|
152
153
|
this.state.isLoading = false;
|
|
153
154
|
}
|
|
154
155
|
|
|
@@ -269,6 +270,28 @@ export class ControlController<
|
|
|
269
270
|
this.ctx.endLoading();
|
|
270
271
|
}
|
|
271
272
|
|
|
273
|
+
/**
|
|
274
|
+
* 部件重新激活
|
|
275
|
+
*
|
|
276
|
+
* @author chitanda
|
|
277
|
+
* @date 2023-07-12 17:07:55
|
|
278
|
+
*/
|
|
279
|
+
onActivated(): void {
|
|
280
|
+
this.state.activated = true;
|
|
281
|
+
ibiz.log.debug(`视图[${this.model.name}](${this.model.id})激活`);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* 部件暂时停用
|
|
286
|
+
*
|
|
287
|
+
* @author chitanda
|
|
288
|
+
* @date 2023-07-12 17:07:06
|
|
289
|
+
*/
|
|
290
|
+
onDeactivated(): void {
|
|
291
|
+
this.state.activated = false;
|
|
292
|
+
ibiz.log.debug(`视图[${this.model.name}](${this.model.id})暂停`);
|
|
293
|
+
}
|
|
294
|
+
|
|
272
295
|
/**
|
|
273
296
|
* 处理数据能力方法通用参数,返回能力执行最终使用的参数
|
|
274
297
|
* @author lxm
|
|
@@ -42,6 +42,15 @@ export class MDControlController<
|
|
|
42
42
|
*/
|
|
43
43
|
service!: MDControlService;
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* 在未激活时记录是否有 command 数据变更事件,有就记录。等待激活时刷新
|
|
47
|
+
*
|
|
48
|
+
* @author chitanda
|
|
49
|
+
* @date 2023-12-13 11:12:19
|
|
50
|
+
* @protected
|
|
51
|
+
*/
|
|
52
|
+
protected commandDataChange = false;
|
|
53
|
+
|
|
45
54
|
protected get _evt(): ControllerEvent<IMDControlEvent> {
|
|
46
55
|
return this.evt;
|
|
47
56
|
}
|
|
@@ -127,7 +136,19 @@ export class MDControlController<
|
|
|
127
136
|
*/
|
|
128
137
|
protected onDataChange(msg: IData): void {
|
|
129
138
|
if (msg.data && msg.data.srfdecodename === this.dataEntity.codeName) {
|
|
139
|
+
if (this.state.activated) {
|
|
140
|
+
this.refresh();
|
|
141
|
+
} else {
|
|
142
|
+
this.commandDataChange = true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
onActivated(): void {
|
|
148
|
+
super.onActivated();
|
|
149
|
+
if (this.commandDataChange) {
|
|
130
150
|
this.refresh();
|
|
151
|
+
this.commandDataChange = false;
|
|
131
152
|
}
|
|
132
153
|
}
|
|
133
154
|
|
|
@@ -94,10 +94,16 @@ export class ViewController<
|
|
|
94
94
|
return this.ctx.parent?.view;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
/**
|
|
98
|
+
* 当前是否为激活状态(缓存下的激活状态,一般与框架的生命周期相同)
|
|
99
|
+
*
|
|
100
|
+
* @author chitanda
|
|
101
|
+
* @date 2023-12-13 11:12:48
|
|
102
|
+
* @readonly
|
|
103
|
+
* @type {boolean}
|
|
104
|
+
*/
|
|
99
105
|
get isActive(): boolean {
|
|
100
|
-
return this.
|
|
106
|
+
return this.state.activated;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
/**
|
|
@@ -148,7 +154,7 @@ export class ViewController<
|
|
|
148
154
|
* @date 2023-07-12 17:07:55
|
|
149
155
|
*/
|
|
150
156
|
onActivated(): void {
|
|
151
|
-
this.
|
|
157
|
+
this.state.activated = true;
|
|
152
158
|
ibiz.log.debug(`视图[${this.model.name}](${this.model.id})激活`);
|
|
153
159
|
}
|
|
154
160
|
|
|
@@ -159,7 +165,7 @@ export class ViewController<
|
|
|
159
165
|
* @date 2023-07-12 17:07:06
|
|
160
166
|
*/
|
|
161
167
|
onDeactivated(): void {
|
|
162
|
-
this.
|
|
168
|
+
this.state.activated = false;
|
|
163
169
|
ibiz.log.debug(`视图[${this.model.name}](${this.model.id})暂停`);
|
|
164
170
|
}
|
|
165
171
|
|
|
@@ -224,6 +230,7 @@ export class ViewController<
|
|
|
224
230
|
|
|
225
231
|
protected initState(): void {
|
|
226
232
|
super.initState();
|
|
233
|
+
this.state.activated = true;
|
|
227
234
|
this.state.isLoading = false;
|
|
228
235
|
this.state.caption = this.model.caption!;
|
|
229
236
|
this.state.srfactiveviewdata = null;
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
IHttpResponse,
|
|
4
4
|
mergeInLeft,
|
|
5
5
|
RuntimeError,
|
|
6
|
-
mergeDefaultInLeft,
|
|
7
6
|
} from '@ibiz-template/core';
|
|
8
7
|
import { IAppDEEditView, IDEEditForm } from '@ibiz/model-core';
|
|
9
8
|
import { debounce } from 'lodash-es';
|
|
@@ -92,9 +91,6 @@ export class EditFormController
|
|
|
92
91
|
*/
|
|
93
92
|
async loadDraft(args?: IDataAbilityParams): Promise<IData> {
|
|
94
93
|
const { context, params: queryParams } = this.handlerAbilityParams(args);
|
|
95
|
-
// 新建默认值给到graft接口,接口会回来
|
|
96
|
-
const params = await this.getDraftParams(); // 新建默认值
|
|
97
|
-
Object.assign(queryParams, params);
|
|
98
94
|
|
|
99
95
|
let res;
|
|
100
96
|
try {
|
|
@@ -112,9 +108,6 @@ export class EditFormController
|
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
this.state.data = res.data;
|
|
115
|
-
// 处理后台导致的新建默认值丢失
|
|
116
|
-
mergeDefaultInLeft(this.data, params);
|
|
117
|
-
|
|
118
111
|
this.formStateNotify(FormNotifyState.DRAFT);
|
|
119
112
|
|
|
120
113
|
await this.evt.emit('onLoadDraftSuccess', undefined);
|
|
@@ -293,12 +286,10 @@ export class EditFormController
|
|
|
293
286
|
default: `${this.data.srfmajortext || ''}保存成功`,
|
|
294
287
|
});
|
|
295
288
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
);
|
|
301
|
-
}
|
|
289
|
+
ibiz.mc.command.send(
|
|
290
|
+
this.data.$origin,
|
|
291
|
+
isCreate ? 'OBJECTCREATED' : 'OBJECTUPDATED',
|
|
292
|
+
);
|
|
302
293
|
return this.data;
|
|
303
294
|
}
|
|
304
295
|
|
|
@@ -346,9 +337,7 @@ export class EditFormController
|
|
|
346
337
|
await this.evt.emit('onRemoveSuccess', undefined);
|
|
347
338
|
this.actionNotification('REMOVESUCCESS');
|
|
348
339
|
|
|
349
|
-
|
|
350
|
-
ibiz.mc.command.send(this.data.$origin, 'OBJECTREMOVED');
|
|
351
|
-
}
|
|
340
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTREMOVED');
|
|
352
341
|
|
|
353
342
|
return ok;
|
|
354
343
|
}
|
|
@@ -392,41 +381,57 @@ export class EditFormController
|
|
|
392
381
|
throw new RuntimeError(`没找到${formItemUpdateId}表单项更新`);
|
|
393
382
|
}
|
|
394
383
|
|
|
395
|
-
const {
|
|
396
|
-
|
|
384
|
+
const {
|
|
385
|
+
appDEMethodId,
|
|
386
|
+
defiupdateDetails,
|
|
387
|
+
customCode,
|
|
388
|
+
scriptCode,
|
|
389
|
+
showBusyIndicator,
|
|
390
|
+
} = formItemUpdate;
|
|
397
391
|
const updateItems = defiupdateDetails?.map(item => item.id!);
|
|
398
392
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
params,
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
393
|
+
try {
|
|
394
|
+
if (showBusyIndicator) {
|
|
395
|
+
this.startLoading();
|
|
396
|
+
}
|
|
397
|
+
let updateData: IData; // 要修改的数据
|
|
398
|
+
if (customCode && scriptCode) {
|
|
399
|
+
// 脚本模式获取修改数据
|
|
400
|
+
updateData = ScriptFactory.execScriptFn(
|
|
401
|
+
{
|
|
402
|
+
...this.getEventArgs(),
|
|
403
|
+
data: this.data,
|
|
404
|
+
},
|
|
405
|
+
scriptCode,
|
|
406
|
+
{
|
|
407
|
+
isAsync: false,
|
|
408
|
+
},
|
|
409
|
+
) as IData;
|
|
410
|
+
} else {
|
|
411
|
+
// 后台服务获取修改数据
|
|
412
|
+
const params = { ...this.params, ...this.data.getOrigin() };
|
|
413
|
+
const res = await this.service.updateFormItem(
|
|
414
|
+
appDEMethodId!,
|
|
415
|
+
this.context,
|
|
416
|
+
params,
|
|
417
|
+
);
|
|
418
|
+
updateData = res.data;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// 修改表单项更新的值
|
|
422
|
+
if (updateData && updateItems?.length) {
|
|
423
|
+
await Promise.all(
|
|
424
|
+
updateItems.map(itemName =>
|
|
425
|
+
this.setDataValue(itemName, updateData[itemName]),
|
|
426
|
+
),
|
|
427
|
+
);
|
|
428
|
+
}
|
|
422
429
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
),
|
|
429
|
-
);
|
|
430
|
+
await awaitTimeout(2000);
|
|
431
|
+
} finally {
|
|
432
|
+
if (showBusyIndicator) {
|
|
433
|
+
this.endLoading();
|
|
434
|
+
}
|
|
430
435
|
}
|
|
431
436
|
}
|
|
432
437
|
|
|
@@ -447,11 +452,9 @@ export class EditFormController
|
|
|
447
452
|
const { context, params } = this.handlerAbilityParams(args);
|
|
448
453
|
try {
|
|
449
454
|
await this.service.wfStart(context, params, this.data);
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
ibiz.mc.command.send({ srfdecodename: 'SysTodo' }, 'OBJECTUPDATED');
|
|
454
|
-
}
|
|
455
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
456
|
+
// 刷新预定义todo实体数据
|
|
457
|
+
ibiz.mc.command.send({ srfdecodename: 'SysTodo' }, 'OBJECTUPDATED');
|
|
455
458
|
} catch (error) {
|
|
456
459
|
this.actionNotification('WFSTARTERROR', {
|
|
457
460
|
error: error as Error,
|
|
@@ -481,11 +484,9 @@ export class EditFormController
|
|
|
481
484
|
const { context, params } = this.handlerAbilityParams(args);
|
|
482
485
|
try {
|
|
483
486
|
await this.service.wfSubmit(context, params, this.data);
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
ibiz.mc.command.send({ srfdecodename: 'SysTodo' }, 'OBJECTUPDATED');
|
|
488
|
-
}
|
|
487
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
488
|
+
// 刷新预定义todo实体数据
|
|
489
|
+
ibiz.mc.command.send({ srfdecodename: 'SysTodo' }, 'OBJECTUPDATED');
|
|
489
490
|
} catch (error) {
|
|
490
491
|
this.actionNotification('WFSUBMITERROR', {
|
|
491
492
|
error: error as Error,
|
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
IDEWizardEditForm,
|
|
11
11
|
IWFEditForm,
|
|
12
12
|
} from '@ibiz/model-core';
|
|
13
|
-
import {
|
|
13
|
+
import { ControlVO, UIMapField } from '../../../../service';
|
|
14
|
+
import { FormService } from '../form/form.service';
|
|
14
15
|
|
|
15
16
|
export class EditFormService<
|
|
16
17
|
T extends IDEEditForm = IDEEditForm,
|
|
17
|
-
> extends
|
|
18
|
+
> extends FormService<T> {
|
|
18
19
|
/**
|
|
19
20
|
* 执行获取单条数据方法
|
|
20
21
|
*
|
|
@@ -35,6 +36,10 @@ export class EditFormService<
|
|
|
35
36
|
params,
|
|
36
37
|
);
|
|
37
38
|
res = this.handleResponse(res);
|
|
39
|
+
// 设置默认值
|
|
40
|
+
if (res.ok && res.data) {
|
|
41
|
+
this.setDefault(res.data, context, params, 'update');
|
|
42
|
+
}
|
|
38
43
|
return res as IHttpResponse<ControlVO>;
|
|
39
44
|
}
|
|
40
45
|
|
|
@@ -58,6 +63,10 @@ export class EditFormService<
|
|
|
58
63
|
params,
|
|
59
64
|
);
|
|
60
65
|
res = this.handleResponse(res);
|
|
66
|
+
// 设置默认值
|
|
67
|
+
if (res.ok && res.data) {
|
|
68
|
+
this.setDefault(res.data, context, params, 'create');
|
|
69
|
+
}
|
|
61
70
|
return res as IHttpResponse<ControlVO>;
|
|
62
71
|
}
|
|
63
72
|
|
|
@@ -158,20 +158,6 @@ export abstract class FormController<
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
/**
|
|
162
|
-
* 获取加载草稿额外参数,新建默认值
|
|
163
|
-
* @author lxm
|
|
164
|
-
* @date 2023-04-27 10:32:06
|
|
165
|
-
* @return {*}
|
|
166
|
-
*/
|
|
167
|
-
async getDraftParams(): Promise<IData> {
|
|
168
|
-
const result: IData = {};
|
|
169
|
-
await Promise.all(
|
|
170
|
-
this.formItems.map(item => item.setDefaultValue(true, result)),
|
|
171
|
-
);
|
|
172
|
-
return result;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
161
|
/**
|
|
176
162
|
* 初始化表单成员控制器
|
|
177
163
|
*
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { IDEEditFormItem, IDEForm } from '@ibiz/model-core';
|
|
2
|
+
import { recursiveIterate } from '@ibiz-template/core';
|
|
3
|
+
import { ControlService } from '../../../../service';
|
|
4
|
+
import { getDefaultValue } from '../../../utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 表单的部件服务
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-12-13 03:04:57
|
|
10
|
+
* @export
|
|
11
|
+
* @class FormService
|
|
12
|
+
* @extends {ControlService<T>}
|
|
13
|
+
* @template T
|
|
14
|
+
*/
|
|
15
|
+
export class FormService<
|
|
16
|
+
T extends IDEForm = IDEForm,
|
|
17
|
+
> extends ControlService<T> {
|
|
18
|
+
/**
|
|
19
|
+
* 设置表单项的默认值
|
|
20
|
+
* @author lxm
|
|
21
|
+
* @date 2023-12-13 03:16:19
|
|
22
|
+
* @param {IData} data 表单数据
|
|
23
|
+
* @param {IParams} context 上下文
|
|
24
|
+
* @param {IParams} params 视图参数
|
|
25
|
+
* @param {('create' | 'update')} type 新建还是更新
|
|
26
|
+
*/
|
|
27
|
+
setDefault(
|
|
28
|
+
data: IData,
|
|
29
|
+
context: IParams,
|
|
30
|
+
params: IParams,
|
|
31
|
+
type: 'create' | 'update',
|
|
32
|
+
): void {
|
|
33
|
+
// 递归所有的表单项,设置默认值
|
|
34
|
+
recursiveIterate(
|
|
35
|
+
this.model,
|
|
36
|
+
(item: IDEEditFormItem) => {
|
|
37
|
+
if (item.detailType === 'FORMITEM') {
|
|
38
|
+
const { createDVT, createDV, updateDVT, updateDV, valueFormat } =
|
|
39
|
+
item;
|
|
40
|
+
const valueType = type === 'create' ? createDVT : updateDVT;
|
|
41
|
+
const defaultValue = type === 'create' ? createDV : updateDV;
|
|
42
|
+
const name = item.id!.toLowerCase();
|
|
43
|
+
|
|
44
|
+
const defaultVal = getDefaultValue(
|
|
45
|
+
{
|
|
46
|
+
name,
|
|
47
|
+
valueType,
|
|
48
|
+
defaultValue,
|
|
49
|
+
valueFormat,
|
|
50
|
+
},
|
|
51
|
+
{ data, context, params },
|
|
52
|
+
);
|
|
53
|
+
if (defaultVal !== undefined) {
|
|
54
|
+
data[name] = defaultVal;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
childrenFields: ['deformPages', 'deformTabPages', 'deformDetails'],
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|