@ibiz-template/runtime 0.4.11 → 0.4.13
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 +1190 -282
- 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/base.controller.d.ts +7 -0
- package/out/controller/common/base.controller.d.ts.map +1 -1
- package/out/controller/common/base.controller.js +10 -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 +15 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +23 -4
- package/out/controller/control/app-menu/app-menu.controller.d.ts +7 -0
- package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
- package/out/controller/control/app-menu/app-menu.controller.js +22 -0
- package/out/controller/control/caption-bar/caption-bar.controller.d.ts.map +1 -1
- package/out/controller/control/caption-bar/caption-bar.controller.js +1 -6
- 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 +9 -22
- 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-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +5 -1
- 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 +0 -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 +146 -2
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +270 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts +11 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid-row.state.js +13 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts +7 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +27 -0
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +30 -20
- package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +21 -1
- 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 +44 -1
- package/out/controller/control/kanban/kanban.controller.d.ts +13 -0
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +72 -0
- package/out/controller/control/report-panel/generator/user-generator.js +1 -1
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +11 -6
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts +7 -0
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +22 -0
- package/out/controller/control/tree/tree.controller.d.ts +75 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +264 -1
- 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/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/control/i-gantt.event.d.ts +42 -0
- package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-tree.event.d.ts +17 -0
- package/out/interface/controller/event/control/i-tree.event.d.ts.map +1 -1
- 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-gantt.state.d.ts +22 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +11 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +24 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-tree.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/provider/i-grid-column.provider.d.ts +2 -2
- package/out/interface/provider/i-grid-column.provider.d.ts.map +1 -1
- package/out/interface/service/i-data-entity/i-data-entity.d.ts +8 -0
- package/out/interface/service/i-data-entity/i-data-entity.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +11 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- 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/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.js +4 -2
- package/out/register/helper/grid-column-register.d.ts +2 -2
- package/out/register/helper/grid-column-register.d.ts.map +1 -1
- package/out/register/helper/grid-column-register.js +14 -0
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +8 -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 +9 -1
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +69 -0
- package/out/service/service/entity/method/fetch.d.ts +5 -12
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +7 -74
- package/out/service/utils/de-cache/de-cache.js +2 -2
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +1 -0
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +2 -0
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +2 -1
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +7 -0
- package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +18 -0
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts +1 -0
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-code-list-node-data.js +8 -4
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +8 -4
- package/out/service/vo/tree-node-data/tree-node-data.d.ts +1 -0
- package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-node-data.js +2 -0
- package/out/service/vo/tree-node-data/tree-static-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-static-node-data.js +8 -2
- 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/base.controller.ts +11 -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 +27 -5
- package/src/controller/control/app-menu/app-menu.controller.ts +25 -0
- package/src/controller/control/caption-bar/caption-bar.controller.ts +1 -8
- package/src/controller/control/form/edit-form/edit-form.controller.ts +11 -26
- 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-detail/form-detail.controller.ts +9 -1
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +0 -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 +331 -1
- package/src/controller/control/grid/grid/grid-row.state.ts +15 -0
- package/src/controller/control/grid/grid/grid.controller.ts +34 -0
- package/src/controller/control/grid/grid/grid.service.ts +34 -21
- package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +67 -2
- package/src/controller/control/kanban/kanban.controller.ts +81 -0
- package/src/controller/control/report-panel/generator/user-generator.ts +1 -1
- package/src/controller/control/search-bar/search-bar.controller.ts +12 -8
- package/src/controller/control/toolbar/toolbar.controllerr.ts +29 -0
- package/src/controller/control/tree/tree.controller.ts +327 -2
- 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/view/i-view.controller.ts +16 -0
- package/src/interface/controller/event/control/i-gantt.event.ts +37 -1
- package/src/interface/controller/event/control/i-tree.event.ts +14 -0
- package/src/interface/controller/state/control/i-control.state.ts +9 -0
- package/src/interface/controller/state/control/i-gantt.state.ts +25 -0
- package/src/interface/controller/state/control/i-grid.state.ts +10 -0
- package/src/interface/controller/state/control/i-kanban.state.ts +26 -0
- package/src/interface/controller/state/control/i-tree.state.ts +8 -0
- package/src/interface/controller/state/view/i-view.state.ts +9 -0
- package/src/interface/provider/i-grid-column.provider.ts +2 -2
- package/src/interface/service/i-data-entity/i-data-entity.ts +9 -0
- package/src/interface/service/service/i-app-de.service.ts +12 -0
- package/src/interface/service/service/i-auth.service.ts +3 -2
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +8 -2
- package/src/register/helper/grid-column-register.ts +17 -2
- package/src/service/dto/method.dto.ts +8 -1
- package/src/service/service/auth/v7-auth.service.ts +18 -8
- package/src/service/service/entity/de.service.ts +74 -1
- package/src/service/service/entity/method/fetch.ts +8 -79
- package/src/service/utils/de-cache/de-cache.ts +2 -2
- package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +2 -0
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +6 -1
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +21 -0
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +2 -0
- package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +10 -5
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +10 -5
- package/src/service/vo/tree-node-data/tree-node-data.ts +3 -0
- package/src/service/vo/tree-node-data/tree-static-node-data.ts +10 -3
- package/src/utils/layout-panel-util/layout-panel-util.ts +17 -2
|
@@ -70,6 +70,14 @@ export interface ITreeState extends IMDControlState {
|
|
|
70
70
|
* @class ITreeNodeData
|
|
71
71
|
*/
|
|
72
72
|
export interface ITreeNodeData {
|
|
73
|
+
/**
|
|
74
|
+
* 节点数据的唯一标识(创建的时候自动生成)
|
|
75
|
+
* @author lxm
|
|
76
|
+
* @date 2023-12-18 10:24:26
|
|
77
|
+
* @type {string}
|
|
78
|
+
*/
|
|
79
|
+
_uuid: string;
|
|
80
|
+
|
|
73
81
|
/**
|
|
74
82
|
* 节点标识(对应节点模型的id)
|
|
75
83
|
*
|
|
@@ -9,6 +9,15 @@ import { IControllerState } from '../common/i-controller.state';
|
|
|
9
9
|
* @class ViewState
|
|
10
10
|
*/
|
|
11
11
|
export interface IViewState extends IControllerState, IViewSession {
|
|
12
|
+
/**
|
|
13
|
+
* 当前视图是否为激活状态(缓存下的激活状态,一般与框架的生命周期相同)
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-12-13 11:12:20
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
activated: boolean;
|
|
20
|
+
|
|
12
21
|
/**
|
|
13
22
|
* 视图标题
|
|
14
23
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDEGridColumn } from '@ibiz/model-core';
|
|
2
|
-
import { TreeGridExController } from '../../controller';
|
|
2
|
+
import { GanttController, TreeGridExController } from '../../controller';
|
|
3
3
|
import { IGridColumnController, IGridController } from '../controller';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -32,7 +32,7 @@ export interface IGridColumnProvider {
|
|
|
32
32
|
*/
|
|
33
33
|
createController(
|
|
34
34
|
columnModel: IDEGridColumn,
|
|
35
|
-
grid: IGridController | TreeGridExController,
|
|
35
|
+
grid: IGridController | TreeGridExController | GanttController,
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
37
|
): Promise<IGridColumnController>;
|
|
38
38
|
}
|
|
@@ -3,6 +3,7 @@ import { DECache } from '../../../service/utils';
|
|
|
3
3
|
import { IFileService } from './i-file.service';
|
|
4
4
|
import { IWorkFlowService } from './i-wf.service';
|
|
5
5
|
import { IConfigService } from './i-config.service';
|
|
6
|
+
import { IDataEntity } from '../i-data-entity/i-data-entity';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 实体服务
|
|
@@ -243,6 +244,17 @@ export interface IAppDEService {
|
|
|
243
244
|
params2?: IParams,
|
|
244
245
|
): Promise<IHttpResponse>;
|
|
245
246
|
|
|
247
|
+
/**
|
|
248
|
+
* 查询临时数据本地缓存
|
|
249
|
+
*
|
|
250
|
+
* @author chitanda
|
|
251
|
+
* @date 2023-12-18 11:12:11
|
|
252
|
+
* @param {IParams} context
|
|
253
|
+
* @param {IParams} [params]
|
|
254
|
+
* @return {*} {Promise<IDataEntity[]>}
|
|
255
|
+
*/
|
|
256
|
+
selectLocal(context: IParams, params?: IParams): Promise<IDataEntity[]>;
|
|
257
|
+
|
|
246
258
|
/**
|
|
247
259
|
* 获取默认数据集[系统预置](临时数据)
|
|
248
260
|
*
|
|
@@ -11,15 +11,16 @@ export interface IAuthService {
|
|
|
11
11
|
* 登录
|
|
12
12
|
*
|
|
13
13
|
* @author chitanda
|
|
14
|
-
* @date 2023-
|
|
14
|
+
* @date 2023-12-13 15:12:16
|
|
15
15
|
* @param {string} loginName
|
|
16
16
|
* @param {string} password
|
|
17
|
+
* @param {boolean} [remember]
|
|
17
18
|
* @return {*} {Promise<boolean>}
|
|
18
19
|
*/
|
|
19
20
|
login(
|
|
20
21
|
loginName: string,
|
|
21
22
|
password: string,
|
|
22
|
-
|
|
23
|
+
remember?: boolean,
|
|
23
24
|
): Promise<boolean>;
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -32,13 +32,19 @@ export class AppUILogicExecutor extends LogicExecutor {
|
|
|
32
32
|
async execute(executeParams: IUILogicParams): Promise<any> {
|
|
33
33
|
let result;
|
|
34
34
|
try {
|
|
35
|
-
if (
|
|
35
|
+
if (
|
|
36
|
+
this.logic.builtinAppUILogic &&
|
|
37
|
+
this.logic.builtinAppUILogic.viewLogicType === 'APP_OPENDATA'
|
|
38
|
+
) {
|
|
36
39
|
// 执行打开数据界面逻辑
|
|
37
40
|
result = await this.executeOpenDataAppUILogic(
|
|
38
41
|
this.logic.builtinAppUILogic as IAppUIOpenDataLogic,
|
|
39
42
|
executeParams,
|
|
40
43
|
);
|
|
41
|
-
} else if (
|
|
44
|
+
} else if (
|
|
45
|
+
this.logic.builtinAppUILogic &&
|
|
46
|
+
this.logic.builtinAppUILogic.viewLogicType === 'APP_NEWDATA'
|
|
47
|
+
) {
|
|
42
48
|
// 执行新建数据逻辑
|
|
43
49
|
result = await this.executeNewDataAppUILogic(
|
|
44
50
|
this.logic.builtinAppUILogic as IAppUINewDataLogic,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDEGridColumn } from '@ibiz/model-core';
|
|
1
|
+
import { IDEGridColumn, IDETreeColumn } from '@ibiz/model-core';
|
|
2
2
|
import { IGridColumnProvider } from '../../interface';
|
|
3
3
|
import { getPluginRegisterKey } from './common-register';
|
|
4
4
|
|
|
@@ -35,12 +35,14 @@ function getProvider(key: string): IGridColumnProvider | undefined {
|
|
|
35
35
|
* @return {*} {Promise<IGridColumnProvider>}
|
|
36
36
|
*/
|
|
37
37
|
export async function getGridColumnProvider(
|
|
38
|
-
model: IDEGridColumn,
|
|
38
|
+
model: IDEGridColumn | IDETreeColumn,
|
|
39
39
|
): Promise<IGridColumnProvider | undefined> {
|
|
40
40
|
let provider: IGridColumnProvider | undefined;
|
|
41
41
|
const { columnType, enableRowEdit, sysPFPluginId, appId } =
|
|
42
42
|
model as Required<IDEGridColumn>;
|
|
43
43
|
|
|
44
|
+
const { renderSysPFPluginId } = model as Required<IDETreeColumn>;
|
|
45
|
+
|
|
44
46
|
// 找插件适配器
|
|
45
47
|
if (sysPFPluginId) {
|
|
46
48
|
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
@@ -54,6 +56,19 @@ export async function getGridColumnProvider(
|
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
// 树表格列插件
|
|
60
|
+
if (renderSysPFPluginId) {
|
|
61
|
+
const pluginKey = await getPluginRegisterKey(renderSysPFPluginId, appId);
|
|
62
|
+
if (pluginKey) {
|
|
63
|
+
provider = getProvider(pluginKey);
|
|
64
|
+
}
|
|
65
|
+
if (!provider) {
|
|
66
|
+
ibiz.log.error(`找不到树表格列插件${pluginKey}对应的适配器`);
|
|
67
|
+
} else {
|
|
68
|
+
return provider;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
const key = enableRowEdit ? `${columnType!}_EDIT` : columnType!;
|
|
58
73
|
// 找表格列类型
|
|
59
74
|
provider = getProvider(key);
|
|
@@ -111,7 +111,9 @@ export class MethodDto {
|
|
|
111
111
|
const service = await this.app!.deService.getService(
|
|
112
112
|
field.refAppDataEntityId!,
|
|
113
113
|
);
|
|
114
|
-
const items
|
|
114
|
+
const items = await service.selectLocal(context, {
|
|
115
|
+
srfpkey: data[this.entity.keyAppDEFieldId!],
|
|
116
|
+
});
|
|
115
117
|
if (items) {
|
|
116
118
|
const arr = [];
|
|
117
119
|
for (let j = 0; j < items.length; j++) {
|
|
@@ -163,6 +165,11 @@ export class MethodDto {
|
|
|
163
165
|
const dto = await this.getFieldDto(field);
|
|
164
166
|
const items: IData[] = datum[key];
|
|
165
167
|
if (items) {
|
|
168
|
+
const pKey = datum[this.entity.keyAppDEFieldId!];
|
|
169
|
+
// 特殊处理,在子包内设置父对象标识
|
|
170
|
+
items.forEach(item => {
|
|
171
|
+
item.srfpkey = pKey;
|
|
172
|
+
});
|
|
166
173
|
await dto.sets(context, items);
|
|
167
174
|
} else {
|
|
168
175
|
await dto.sets(context, []);
|
|
@@ -12,26 +12,29 @@ import { IAuthService } from '../../../interface';
|
|
|
12
12
|
*/
|
|
13
13
|
export class V7AuthService implements IAuthService {
|
|
14
14
|
async login(
|
|
15
|
-
|
|
15
|
+
loginName: string,
|
|
16
16
|
password: string,
|
|
17
|
-
|
|
17
|
+
remember?: boolean,
|
|
18
18
|
): Promise<boolean> {
|
|
19
19
|
// eslint-disable-next-line no-useless-catch
|
|
20
20
|
try {
|
|
21
21
|
const res = await ibiz.net.post('/v7/login', {
|
|
22
|
-
loginname,
|
|
22
|
+
loginname: loginName,
|
|
23
23
|
password,
|
|
24
|
-
rememberme,
|
|
24
|
+
rememberme: remember,
|
|
25
25
|
});
|
|
26
26
|
const { data } = res;
|
|
27
27
|
if (data && data.token) {
|
|
28
|
-
|
|
28
|
+
if (remember) {
|
|
29
|
+
setCookie(CoreConst.TOKEN_REMEMBER, '1', 7, true);
|
|
30
|
+
}
|
|
31
|
+
setCookie(CoreConst.TOKEN, data.token, remember ? 7 : 0, true);
|
|
29
32
|
const expiredDate =
|
|
30
33
|
new Date().getTime() + (data.expirein || 7199) * 1000;
|
|
31
34
|
setCookie(
|
|
32
35
|
CoreConst.TOKEN_EXPIRES,
|
|
33
36
|
`${expiredDate}`,
|
|
34
|
-
|
|
37
|
+
remember ? 7 : 0,
|
|
35
38
|
true,
|
|
36
39
|
);
|
|
37
40
|
}
|
|
@@ -50,6 +53,7 @@ export class V7AuthService implements IAuthService {
|
|
|
50
53
|
await ibiz.net.get('/v7/logout');
|
|
51
54
|
clearCookie(CoreConst.TOKEN);
|
|
52
55
|
clearCookie(CoreConst.TOKEN_EXPIRES);
|
|
56
|
+
clearCookie(CoreConst.TOKEN_REMEMBER);
|
|
53
57
|
return true;
|
|
54
58
|
} catch (err: unknown) {
|
|
55
59
|
ibiz.notification.error({
|
|
@@ -63,6 +67,7 @@ export class V7AuthService implements IAuthService {
|
|
|
63
67
|
async extendLogin(): Promise<void> {
|
|
64
68
|
const token = getCookie(CoreConst.TOKEN);
|
|
65
69
|
const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
|
|
70
|
+
const remember = getCookie(CoreConst.TOKEN_REMEMBER);
|
|
66
71
|
if (token && expirein) {
|
|
67
72
|
// 计算到过期时间所需的延时毫秒数,预留提前量
|
|
68
73
|
let wait = Number(expirein) - new Date().getTime();
|
|
@@ -71,10 +76,15 @@ export class V7AuthService implements IAuthService {
|
|
|
71
76
|
setTimeout(async () => {
|
|
72
77
|
const res = await ibiz.net.get(`/uaa/refreshtoken2`);
|
|
73
78
|
if (res.ok) {
|
|
74
|
-
setCookie(CoreConst.TOKEN, res.data.token, 0, true);
|
|
79
|
+
setCookie(CoreConst.TOKEN, res.data.token, remember ? 7 : 0, true);
|
|
75
80
|
const expiredDate =
|
|
76
81
|
new Date().getTime() + (res.data.expirein || 7199) * 1000;
|
|
77
|
-
setCookie(
|
|
82
|
+
setCookie(
|
|
83
|
+
CoreConst.TOKEN_EXPIRES,
|
|
84
|
+
`${expiredDate}`,
|
|
85
|
+
remember ? 7 : 0,
|
|
86
|
+
true,
|
|
87
|
+
);
|
|
78
88
|
}
|
|
79
89
|
// 下一次延时做准备
|
|
80
90
|
this.extendLogin();
|
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
ModelError,
|
|
6
6
|
RuntimeError,
|
|
7
7
|
} from '@ibiz-template/core';
|
|
8
|
+
import { equals, isEmpty, where } from 'ramda';
|
|
9
|
+
import { ascSort } from 'qx-util';
|
|
8
10
|
import { DECache, calcResPath } from '../../utils';
|
|
9
11
|
import { WorkFlowService } from '../work-flow/work-flow.service';
|
|
10
12
|
import { Method } from './method/method';
|
|
11
13
|
import { FileService } from '../file/file.service';
|
|
12
14
|
import { findModelChild } from '../../../model';
|
|
13
|
-
import { IAppDEService } from '../../../interface';
|
|
15
|
+
import { IAppDEService, IDataEntity } from '../../../interface';
|
|
14
16
|
import { ConfigService } from '../config/config.service';
|
|
15
17
|
import { getDEMethodProvider } from '../../../register/helper/de-method-register';
|
|
16
18
|
|
|
@@ -237,6 +239,77 @@ export class DEService implements IAppDEService {
|
|
|
237
239
|
return this.exec('FetchTempDefault', context, params, params2);
|
|
238
240
|
}
|
|
239
241
|
|
|
242
|
+
/**
|
|
243
|
+
* 查询本地数据,根据属性
|
|
244
|
+
*
|
|
245
|
+
* @param {IParams} context
|
|
246
|
+
* @param {IParams} params 根据多实体属性查找,例:{ name: '张三', age: 18, parent: null }
|
|
247
|
+
* @return {*} {Promise<IDataEntity[]>}
|
|
248
|
+
*/
|
|
249
|
+
async selectLocal(
|
|
250
|
+
context: IParams,
|
|
251
|
+
params: IParams = {},
|
|
252
|
+
): Promise<IDataEntity[]> {
|
|
253
|
+
let items: IDataEntity[] = this.local.getList(context);
|
|
254
|
+
items = ascSort(items, 'srfordervalue');
|
|
255
|
+
// 查询数据条件集
|
|
256
|
+
const data: IData = {};
|
|
257
|
+
// if (notNilEmpty(context)) {
|
|
258
|
+
// const map = this.entity.majorKeyMap;
|
|
259
|
+
// if (map) {
|
|
260
|
+
// for (const key in map) {
|
|
261
|
+
// if (Object.prototype.hasOwnProperty.call(map, key)) {
|
|
262
|
+
// const val = map[key];
|
|
263
|
+
// if (notNilEmpty(context[key])) {
|
|
264
|
+
// data[val] = equals(context[key]);
|
|
265
|
+
// }
|
|
266
|
+
// }
|
|
267
|
+
// }
|
|
268
|
+
// }
|
|
269
|
+
// }
|
|
270
|
+
const nullData: Record<string, unknown> = {};
|
|
271
|
+
const undefinedData: Record<string, unknown> = {};
|
|
272
|
+
const emptyData: Record<string, unknown> = {};
|
|
273
|
+
if (params.srfkey) {
|
|
274
|
+
data.srfkey = equals(params.srfkey);
|
|
275
|
+
delete params.srfkey;
|
|
276
|
+
}
|
|
277
|
+
for (const key in params) {
|
|
278
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
279
|
+
const val = params[key];
|
|
280
|
+
if (val == null) {
|
|
281
|
+
nullData[key] = equals(null);
|
|
282
|
+
undefinedData[key] = equals(undefined);
|
|
283
|
+
emptyData[key] = equals('');
|
|
284
|
+
} else {
|
|
285
|
+
data[key] = equals(val);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (!isEmpty(data)) {
|
|
290
|
+
// 返回柯里化函数,用于判断数据是否满足要求
|
|
291
|
+
const pred = where(data);
|
|
292
|
+
const nullPred = where(nullData);
|
|
293
|
+
const undefinedPred = where(undefinedData);
|
|
294
|
+
const emptyPred = where(emptyData);
|
|
295
|
+
items = items.filter(obj => {
|
|
296
|
+
if (isEmpty(nullData)) {
|
|
297
|
+
if (pred(obj)) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
} else if (
|
|
301
|
+
pred(obj) &&
|
|
302
|
+
(nullPred(obj) || undefinedPred(obj) || emptyPred(obj))
|
|
303
|
+
) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
return false;
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const list = items.map(obj => obj.clone());
|
|
310
|
+
return list;
|
|
311
|
+
}
|
|
312
|
+
|
|
240
313
|
/**
|
|
241
314
|
* 执行服务方法 ac 模式
|
|
242
315
|
*
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
ModelError,
|
|
4
4
|
RuntimeModelError,
|
|
5
5
|
} from '@ibiz-template/core';
|
|
6
|
-
import { ascSort, descSort } from 'qx-util';
|
|
7
|
-
import { clone, equals, isEmpty, isNil, where } from 'ramda';
|
|
8
6
|
import { IAppDEDataSet } from '@ibiz/model-core';
|
|
9
7
|
import { isArray } from 'lodash-es';
|
|
8
|
+
import { clone, isEmpty, isNil } from 'ramda';
|
|
9
|
+
import { ascSort, descSort } from 'qx-util';
|
|
10
10
|
import { PSDEDQCondEngine, SearchFilter } from '../../../utils';
|
|
11
11
|
import { Method } from './method';
|
|
12
12
|
import { IDataEntity } from '../../../../interface';
|
|
@@ -85,88 +85,17 @@ export class FetchMethod extends Method {
|
|
|
85
85
|
return res as HttpResponse<IDataEntity[]>;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
/**
|
|
89
|
-
* 查询本地数据,根据属性
|
|
90
|
-
*
|
|
91
|
-
* @param {IParams} context
|
|
92
|
-
* @param {IParams} params 根据多实体属性查找,例:{ name: '张三', age: 18, parent: null }
|
|
93
|
-
* @return {*} {Promise<IDataEntity[]>}
|
|
94
|
-
*/
|
|
95
|
-
protected async selectLocal(
|
|
96
|
-
context: IParams,
|
|
97
|
-
params: IParams = {},
|
|
98
|
-
): Promise<IDataEntity[]> {
|
|
99
|
-
const service = await this.getService();
|
|
100
|
-
let items: IDataEntity[] = service.local.getList(context);
|
|
101
|
-
items = ascSort(items, 'srfordervalue');
|
|
102
|
-
// 查询数据条件集
|
|
103
|
-
const data: IData = {};
|
|
104
|
-
// if (notNilEmpty(context)) {
|
|
105
|
-
// const map = this.entity.majorKeyMap;
|
|
106
|
-
// if (map) {
|
|
107
|
-
// for (const key in map) {
|
|
108
|
-
// if (Object.prototype.hasOwnProperty.call(map, key)) {
|
|
109
|
-
// const val = map[key];
|
|
110
|
-
// if (notNilEmpty(context[key])) {
|
|
111
|
-
// data[val] = equals(context[key]);
|
|
112
|
-
// }
|
|
113
|
-
// }
|
|
114
|
-
// }
|
|
115
|
-
// }
|
|
116
|
-
// }
|
|
117
|
-
const nullData: Record<string, unknown> = {};
|
|
118
|
-
const undefinedData: Record<string, unknown> = {};
|
|
119
|
-
const emptyData: Record<string, unknown> = {};
|
|
120
|
-
if (params.srfkey) {
|
|
121
|
-
data.srfkey = equals(params.srfkey);
|
|
122
|
-
delete params.srfkey;
|
|
123
|
-
}
|
|
124
|
-
for (const key in params) {
|
|
125
|
-
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
126
|
-
const val = params[key];
|
|
127
|
-
if (val == null) {
|
|
128
|
-
nullData[key] = equals(null);
|
|
129
|
-
undefinedData[key] = equals(undefined);
|
|
130
|
-
emptyData[key] = equals('');
|
|
131
|
-
} else {
|
|
132
|
-
data[key] = equals(val);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (!isEmpty(data)) {
|
|
137
|
-
// 返回柯里化函数,用于判断数据是否满足要求
|
|
138
|
-
const pred = where(data);
|
|
139
|
-
const nullPred = where(nullData);
|
|
140
|
-
const undefinedPred = where(undefinedData);
|
|
141
|
-
const emptyPred = where(emptyData);
|
|
142
|
-
items = items.filter(obj => {
|
|
143
|
-
if (isEmpty(nullData)) {
|
|
144
|
-
if (pred(obj)) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
} else if (
|
|
148
|
-
pred(obj) &&
|
|
149
|
-
(nullPred(obj) || undefinedPred(obj) || emptyPred(obj))
|
|
150
|
-
) {
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
const list = items.map(obj => obj.clone());
|
|
157
|
-
return list;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
88
|
/**
|
|
161
89
|
* 搜索本地数据
|
|
162
90
|
*
|
|
163
|
-
* @
|
|
164
|
-
* @
|
|
91
|
+
* @author chitanda
|
|
92
|
+
* @date 2023-12-18 11:12:27
|
|
93
|
+
* @param {(PSDEDQCondEngine | null)} cond 查询实例
|
|
165
94
|
* @param {SearchFilter} filter 过滤对象
|
|
166
|
-
* @param {string[]} [queryParamKeys=this.entity.
|
|
95
|
+
* @param {string[]} [queryParamKeys=this.entity.quickSearchAppDEFieldIds!] 当前实体支持快速搜索的属性
|
|
167
96
|
* @return {*} {Promise<IDataEntity[]>}
|
|
168
97
|
*/
|
|
169
|
-
|
|
98
|
+
async searchLocal(
|
|
170
99
|
cond: PSDEDQCondEngine | null,
|
|
171
100
|
filter: SearchFilter,
|
|
172
101
|
queryParamKeys: string[] = this.entity.quickSearchAppDEFieldIds!,
|
|
@@ -180,7 +109,7 @@ export class FetchMethod extends Method {
|
|
|
180
109
|
list = list.filter(obj => cond.test(obj, filter));
|
|
181
110
|
}
|
|
182
111
|
} else {
|
|
183
|
-
list = await
|
|
112
|
+
list = await service.selectLocal(filter.context, filter.data);
|
|
184
113
|
if (list.length > 0) {
|
|
185
114
|
if (filter.query && filter.query !== '') {
|
|
186
115
|
if (queryParamKeys) {
|
|
@@ -421,10 +421,10 @@ export class DECache {
|
|
|
421
421
|
);
|
|
422
422
|
const unionValues = unionKeys.map(key => {
|
|
423
423
|
if (isNil(data[key])) {
|
|
424
|
-
|
|
424
|
+
return `__empty__`;
|
|
425
425
|
}
|
|
426
426
|
return data[key];
|
|
427
427
|
});
|
|
428
|
-
data.srfkey = unionValues.join('');
|
|
428
|
+
data.srfkey = unionValues.join('||');
|
|
429
429
|
}
|
|
430
430
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDEGantt, IDETreeDataSetNode } from '@ibiz/model-core';
|
|
2
2
|
import { IGanttNodeData } from '../../../interface';
|
|
3
3
|
import { TreeDataSetNodeData } from '../tree-node-data';
|
|
4
|
-
import { calcDataItemValue } from './gantt-node-data-util';
|
|
4
|
+
import { calcDataItemValue, calcNodeDataItem } from './gantt-node-data-util';
|
|
5
5
|
|
|
6
6
|
export class GanttDataSetNodeData
|
|
7
7
|
extends TreeDataSetNodeData
|
|
@@ -21,6 +21,10 @@ export class GanttDataSetNodeData
|
|
|
21
21
|
|
|
22
22
|
children?: IGanttNodeData[] | undefined;
|
|
23
23
|
|
|
24
|
+
parent?: IGanttNodeData;
|
|
25
|
+
|
|
26
|
+
nodeDataItem: IData;
|
|
27
|
+
|
|
24
28
|
constructor(
|
|
25
29
|
model: IDEGantt,
|
|
26
30
|
nodeModel: IDETreeDataSetNode,
|
|
@@ -64,5 +68,6 @@ export class GanttDataSetNodeData
|
|
|
64
68
|
nodeModel,
|
|
65
69
|
data,
|
|
66
70
|
);
|
|
71
|
+
this.nodeDataItem = calcNodeDataItem(nodeModel, data);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
@@ -24,3 +24,24 @@ export const calcDataItemValue = (
|
|
|
24
24
|
}
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 计算数据项
|
|
30
|
+
* @param nodeModel 节点模型
|
|
31
|
+
* @param data 数据
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export const calcNodeDataItem = (
|
|
35
|
+
nodeModel: IDETreeNode,
|
|
36
|
+
data: IData,
|
|
37
|
+
): IData => {
|
|
38
|
+
const dataItem: IData = {};
|
|
39
|
+
nodeModel.detreeNodeDataItems?.forEach(item => {
|
|
40
|
+
if (item.id && item.appDEFieldId) {
|
|
41
|
+
Object.assign(dataItem, {
|
|
42
|
+
[item.id.toLowerCase()]: data[item.appDEFieldId.toLowerCase()],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return dataItem;
|
|
47
|
+
};
|
|
@@ -17,7 +17,7 @@ export class TreeCodeListNodeData
|
|
|
17
17
|
{
|
|
18
18
|
text: string;
|
|
19
19
|
|
|
20
|
-
id
|
|
20
|
+
id!: string;
|
|
21
21
|
|
|
22
22
|
value: string;
|
|
23
23
|
|
|
@@ -35,11 +35,16 @@ export class TreeCodeListNodeData
|
|
|
35
35
|
const { data } = opts;
|
|
36
36
|
this.text = data.text;
|
|
37
37
|
this.value = data.value as string;
|
|
38
|
-
|
|
39
|
-
? `${parentNodeData.id}:${model.id}@${this.value}`
|
|
40
|
-
: model.id + this.value;
|
|
38
|
+
|
|
41
39
|
// id小写
|
|
42
|
-
|
|
40
|
+
const selfId = `${model.id}@${this.value}`.toLowerCase();
|
|
41
|
+
Object.defineProperty(this, 'id', {
|
|
42
|
+
get() {
|
|
43
|
+
return this.parent ? `${this.parent.id}:${selfId}` : selfId;
|
|
44
|
+
},
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
});
|
|
43
48
|
|
|
44
49
|
// 实体节点额外添加上自己的实体上下文
|
|
45
50
|
if (model.appDataEntityId) {
|
|
@@ -16,7 +16,7 @@ import { fieldValueToBoolean } from '../../utils';
|
|
|
16
16
|
export class TreeDataSetNodeData extends TreeNodeData implements ITreeNodeData {
|
|
17
17
|
text: string;
|
|
18
18
|
|
|
19
|
-
id
|
|
19
|
+
id!: string;
|
|
20
20
|
|
|
21
21
|
value: string;
|
|
22
22
|
|
|
@@ -41,11 +41,16 @@ export class TreeDataSetNodeData extends TreeNodeData implements ITreeNodeData {
|
|
|
41
41
|
this.value = model.idAppDEFieldId
|
|
42
42
|
? data[model.idAppDEFieldId]
|
|
43
43
|
: data.srfkey;
|
|
44
|
-
|
|
45
|
-
? `${parentNodeData.id}:${model.id}@${data.srfkey}`
|
|
46
|
-
: model.id + data.srfkey;
|
|
44
|
+
|
|
47
45
|
// id小写
|
|
48
|
-
|
|
46
|
+
const selfId = `${model.id}@${data.srfkey}`.toLowerCase();
|
|
47
|
+
Object.defineProperty(this, 'id', {
|
|
48
|
+
get() {
|
|
49
|
+
return this.parent ? `${this.parent.id}:${selfId}` : selfId;
|
|
50
|
+
},
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
});
|
|
49
54
|
|
|
50
55
|
// 实体节点额外添加上自己的实体上下文
|
|
51
56
|
if (model.appDataEntityId) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IDETreeNode } from '@ibiz/model-core';
|
|
2
|
+
import { createUUID } from 'qx-util';
|
|
2
3
|
import { IIcon, ITreeNodeData } from '../../../interface';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -9,6 +10,8 @@ import { IIcon, ITreeNodeData } from '../../../interface';
|
|
|
9
10
|
* @class TreeNodeData
|
|
10
11
|
*/
|
|
11
12
|
export abstract class TreeNodeData implements ITreeNodeData {
|
|
13
|
+
_uuid: string = createUUID();
|
|
14
|
+
|
|
12
15
|
id!: string;
|
|
13
16
|
|
|
14
17
|
value?: string | undefined;
|
|
@@ -13,7 +13,7 @@ import { TreeNodeData } from './tree-node-data';
|
|
|
13
13
|
export class TreeStaticNodeData extends TreeNodeData implements ITreeNodeData {
|
|
14
14
|
text: string;
|
|
15
15
|
|
|
16
|
-
id
|
|
16
|
+
id!: string;
|
|
17
17
|
|
|
18
18
|
value?: string;
|
|
19
19
|
|
|
@@ -28,9 +28,16 @@ export class TreeStaticNodeData extends TreeNodeData implements ITreeNodeData {
|
|
|
28
28
|
// !!根节点的默认节点值root排除掉
|
|
29
29
|
const nodeValue = model.nodeValue === 'root' ? undefined : model.nodeValue;
|
|
30
30
|
|
|
31
|
-
this.id = parentNodeData ? `${parentNodeData.id}:${model.id}` : model.id!;
|
|
32
31
|
// id小写
|
|
33
|
-
|
|
32
|
+
const selfId = `${model.id}`.toLowerCase();
|
|
33
|
+
Object.defineProperty(this, 'id', {
|
|
34
|
+
get() {
|
|
35
|
+
return this.parent ? `${this.parent.id}:${selfId}` : selfId;
|
|
36
|
+
},
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
34
41
|
this.text = model.text!;
|
|
35
42
|
this.value = nodeValue;
|
|
36
43
|
|