@ibiz-template/runtime 0.4.9 → 0.4.11

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.
Files changed (104) hide show
  1. package/dist/index.esm.js +847 -211
  2. package/dist/index.system.min.js +2 -2
  3. package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
  4. package/out/controller/control/form/edit-form/edit-form.controller.js +27 -16
  5. package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.d.ts +1 -1
  6. package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.js +1 -1
  7. package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +8 -0
  8. package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
  9. package/out/controller/control/form/form-detail/form-item/form-item.controller.js +14 -0
  10. package/out/controller/control/gantt/gantt.controller.d.ts +55 -1
  11. package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
  12. package/out/controller/control/gantt/gantt.controller.js +150 -0
  13. package/out/controller/control/gantt/gantt.service.d.ts +69 -6
  14. package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
  15. package/out/controller/control/gantt/gantt.service.js +196 -5
  16. package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts +8 -1
  17. package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
  18. package/out/controller/control/wizard-panel/wizard-panel.controller.js +22 -7
  19. package/out/interface/controller/controller/control/i-drbar.controller.d.ts +7 -0
  20. package/out/interface/controller/controller/control/i-drbar.controller.d.ts.map +1 -1
  21. package/out/interface/controller/event/view/i-de-index-view.event.d.ts +12 -0
  22. package/out/interface/controller/event/view/i-de-index-view.event.d.ts.map +1 -0
  23. package/out/interface/controller/event/view/i-de-index-view.event.js +1 -0
  24. package/out/interface/controller/event/view/index.d.ts +1 -0
  25. package/out/interface/controller/event/view/index.d.ts.map +1 -1
  26. package/out/interface/controller/event/view/index.js +1 -0
  27. package/out/interface/controller/state/control/i-drbar.state.d.ts +28 -7
  28. package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
  29. package/out/interface/controller/state/control/i-gantt.state.d.ts +94 -3
  30. package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
  31. package/out/interface/controller/state/view/i-de-index-view.state.d.ts +19 -0
  32. package/out/interface/controller/state/view/i-de-index-view.state.d.ts.map +1 -0
  33. package/out/interface/controller/state/view/i-de-index-view.state.js +1 -0
  34. package/out/interface/controller/state/view/i-edit-view2.state.d.ts +8 -0
  35. package/out/interface/controller/state/view/i-edit-view2.state.d.ts.map +1 -1
  36. package/out/interface/controller/state/view/index.d.ts +1 -0
  37. package/out/interface/controller/state/view/index.d.ts.map +1 -1
  38. package/out/interface/controller/state/view/index.js +1 -0
  39. package/out/interface/service/service/i-auth.service.d.ts +8 -0
  40. package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
  41. package/out/register/helper/ui-action-register.d.ts.map +1 -1
  42. package/out/register/helper/ui-action-register.js +6 -1
  43. package/out/service/service/auth/v7-auth.service.d.ts +1 -0
  44. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  45. package/out/service/service/auth/v7-auth.service.js +23 -3
  46. package/out/service/service/entity/de.service.d.ts.map +1 -1
  47. package/out/service/service/entity/de.service.js +1 -8
  48. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  49. package/out/service/service/entity/method/de-action.js +5 -5
  50. package/out/service/utils/de-cache/de-cache.d.ts +19 -0
  51. package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
  52. package/out/service/utils/de-cache/de-cache.js +54 -4
  53. package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +19 -0
  54. package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts.map +1 -0
  55. package/out/service/vo/gantt-node-data/gantt-code-list-node-data.js +14 -0
  56. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +19 -0
  57. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -0
  58. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +14 -0
  59. package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +9 -0
  60. package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -0
  61. package/out/service/vo/gantt-node-data/gantt-node-data-util.js +19 -0
  62. package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts +17 -0
  63. package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -0
  64. package/out/service/vo/gantt-node-data/gantt-static-node-data.js +13 -0
  65. package/out/service/vo/gantt-node-data/index.d.ts +4 -0
  66. package/out/service/vo/gantt-node-data/index.d.ts.map +1 -0
  67. package/out/service/vo/gantt-node-data/index.js +3 -0
  68. package/out/service/vo/index.d.ts +1 -0
  69. package/out/service/vo/index.d.ts.map +1 -1
  70. package/out/service/vo/index.js +1 -0
  71. package/out/ui-action/provider/index.d.ts.map +1 -1
  72. package/out/ui-action/provider/index.js +4 -0
  73. package/out/ui-action/provider/loginout-ui-action-provider.d.ts +16 -0
  74. package/out/ui-action/provider/loginout-ui-action-provider.d.ts.map +1 -0
  75. package/out/ui-action/provider/loginout-ui-action-provider.js +25 -0
  76. package/package.json +5 -5
  77. package/src/controller/control/form/edit-form/edit-form.controller.ts +48 -32
  78. package/src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts +1 -1
  79. package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +15 -0
  80. package/src/controller/control/gantt/gantt.controller.ts +179 -1
  81. package/src/controller/control/gantt/gantt.service.ts +305 -6
  82. package/src/controller/control/wizard-panel/wizard-panel.controller.ts +27 -7
  83. package/src/interface/controller/controller/control/i-drbar.controller.ts +8 -0
  84. package/src/interface/controller/event/view/i-de-index-view.event.ts +12 -0
  85. package/src/interface/controller/event/view/index.ts +1 -0
  86. package/src/interface/controller/state/control/i-drbar.state.ts +32 -8
  87. package/src/interface/controller/state/control/i-gantt.state.ts +106 -4
  88. package/src/interface/controller/state/view/i-de-index-view.state.ts +19 -0
  89. package/src/interface/controller/state/view/i-edit-view2.state.ts +10 -1
  90. package/src/interface/controller/state/view/index.ts +1 -0
  91. package/src/interface/service/service/i-auth.service.ts +9 -0
  92. package/src/register/helper/ui-action-register.ts +7 -1
  93. package/src/service/service/auth/v7-auth.service.ts +30 -3
  94. package/src/service/service/entity/de.service.ts +2 -1
  95. package/src/service/service/entity/method/de-action.ts +5 -4
  96. package/src/service/utils/de-cache/de-cache.ts +64 -3
  97. package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +68 -0
  98. package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +68 -0
  99. package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +26 -0
  100. package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +50 -0
  101. package/src/service/vo/gantt-node-data/index.ts +3 -0
  102. package/src/service/vo/index.ts +1 -0
  103. package/src/ui-action/provider/index.ts +4 -0
  104. package/src/ui-action/provider/loginout-ui-action-provider.ts +31 -0
@@ -1,12 +1,114 @@
1
1
  import { IMDControlState } from './i-md-control.state';
2
+ import { ITreeNodeData } from './i-tree.state';
2
3
 
3
4
  /**
4
5
  * 甘特图状态
5
6
  *
6
- * @author zhanghengfeng
7
- * @date 2023-12-08 15:12:40
7
+ * @author tony001
8
+ * @date 2023-12-11 17:12:57
8
9
  * @export
9
10
  * @interface IGanttState
10
- * @extends {IMDControlState}
11
+ * @extends {ITreeState}
11
12
  */
12
- export interface IGanttState extends IMDControlState {}
13
+ export interface IGanttState extends IMDControlState {
14
+ items: IGanttNodeData[];
15
+
16
+ /**
17
+ * 树的根节点
18
+ *
19
+ * @type {IGanttNodeData}
20
+ * @memberof IGanttState
21
+ */
22
+ rootNodes: IGanttNodeData[];
23
+
24
+ /**
25
+ * 查询条件
26
+ *
27
+ * @author tony001
28
+ * @date 2023-12-11 18:12:20
29
+ * @type {string}
30
+ */
31
+ query: string;
32
+
33
+ /**
34
+ * 快速搜索占位符
35
+ *
36
+ * @author tony001
37
+ * @date 2023-12-11 18:12:29
38
+ * @type {string}
39
+ */
40
+ placeHolder: string;
41
+ }
42
+
43
+ /**
44
+ * 甘特图节点数据格式
45
+ *
46
+ * @author tony001
47
+ * @date 2023-12-11 17:12:51
48
+ * @export
49
+ * @interface IGanttNodeData
50
+ */
51
+ export interface IGanttNodeData extends ITreeNodeData {
52
+ /**
53
+ * 编号
54
+ *
55
+ * @author tony001
56
+ * @date 2023-12-11 17:12:39
57
+ * @type {string}
58
+ */
59
+ sndataIteValue: string;
60
+
61
+ /**
62
+ * 开始时间
63
+ *
64
+ * @author tony001
65
+ * @date 2023-12-11 17:12:12
66
+ * @type {string}
67
+ */
68
+ beginDataItemValue: string;
69
+
70
+ /**
71
+ * 结束时间
72
+ *
73
+ * @author tony001
74
+ * @date 2023-12-11 17:12:52
75
+ * @type {string}
76
+ */
77
+ endDataItemValue: string;
78
+
79
+ /**
80
+ * 前置数据
81
+ *
82
+ * @author tony001
83
+ * @date 2023-12-11 17:12:13
84
+ * @type {(string | number)}
85
+ */
86
+ prevDataItemValue: string | number;
87
+
88
+ /**
89
+ * 完成量数据
90
+ *
91
+ * @author tony001
92
+ * @date 2023-12-11 17:12:26
93
+ * @type {(string | number)}
94
+ */
95
+ finishDataItemValue: string | number;
96
+
97
+ /**
98
+ * 总量数据项
99
+ *
100
+ * @author tony001
101
+ * @date 2023-12-11 17:12:43
102
+ * @type {(string | number)}
103
+ */
104
+ totalDataItemValue: string | number;
105
+
106
+ /**
107
+ * 子数据
108
+ *
109
+ * @author tony001
110
+ * @date 2023-12-11 18:12:16
111
+ * @type {(IGanttNodeData[] | undefined)}
112
+ */
113
+ children?: IGanttNodeData[] | undefined;
114
+ }
@@ -0,0 +1,19 @@
1
+ import { IViewState } from './i-view.state';
2
+
3
+ /**
4
+ * 实体首页视图UI状态
5
+ *
6
+ * @export
7
+ * @class IDEIndexViewState
8
+ * @extends {IViewState}
9
+ */
10
+ export interface IDEIndexViewState extends IViewState {
11
+ /**
12
+ * 导航数据
13
+ *
14
+ * @author lxm
15
+ * @date 2023-12-11 06:23:55
16
+ * @type {string}
17
+ */
18
+ srfnav: string;
19
+ }
@@ -7,4 +7,13 @@ import { IEditViewState } from './i-edit-view.state';
7
7
  * @interface IEditView2State
8
8
  * @extends {IViewState}
9
9
  */
10
- export interface IEditView2State extends IEditViewState {}
10
+ export interface IEditView2State extends IEditViewState {
11
+ /**
12
+ * 导航数据
13
+ *
14
+ * @author lxm
15
+ * @date 2023-12-11 06:23:55
16
+ * @type {string}
17
+ */
18
+ srfnav: string;
19
+ }
@@ -45,3 +45,4 @@ export * from './i-chart-exp-view.state';
45
45
  export * from './i-map-view.state';
46
46
  export * from './i-report-view.state';
47
47
  export * from './i-gantt-view.state';
48
+ export * from './i-de-index-view.state';
@@ -30,4 +30,13 @@ export interface IAuthService {
30
30
  * @return {*} {Promise<boolean>}
31
31
  */
32
32
  logout(): Promise<boolean>;
33
+
34
+ /**
35
+ * 页面未关闭情况下,自动延长登录时间
36
+ *
37
+ * @author chitanda
38
+ * @date 2023-12-11 11:12:54
39
+ * @return {*} {Promise<void>}
40
+ */
41
+ extendLogin(): Promise<void>;
33
42
  }
@@ -39,7 +39,7 @@ export async function getUIActionProvider(
39
39
  model: IAppUIAction,
40
40
  ): Promise<IUIActionProvider> {
41
41
  let provider: IUIActionProvider | undefined;
42
- const { uiactionMode, sysPFPluginId, appId } =
42
+ const { uiactionMode, sysPFPluginId, appId, uiactionTag } =
43
43
  model as Required<IAppUIAction>;
44
44
 
45
45
  // 找插件适配器
@@ -55,6 +55,12 @@ export async function getUIActionProvider(
55
55
  }
56
56
  }
57
57
 
58
+ // 先通过uiactionTag找界面行为适配器
59
+ provider = getProvider(`${uiactionMode}_${uiactionTag}`);
60
+ if (provider) {
61
+ return provider;
62
+ }
63
+
58
64
  // 找界面行为类型
59
65
  provider = getProvider(uiactionMode);
60
66
  if (!provider) {
@@ -1,5 +1,5 @@
1
1
  import { CoreConst, HttpError } from '@ibiz-template/core';
2
- import { clearCookie, setCookie } from 'qx-util';
2
+ import { clearCookie, getCookie, setCookie } from 'qx-util';
3
3
  import { IAuthService } from '../../../interface';
4
4
 
5
5
  /**
@@ -25,10 +25,15 @@ export class V7AuthService implements IAuthService {
25
25
  });
26
26
  const { data } = res;
27
27
  if (data && data.token) {
28
- setCookie(CoreConst.TOKEN, data.token, 0, true);
28
+ setCookie(CoreConst.TOKEN, data.token, rememberme ? 7 : 0, true);
29
29
  const expiredDate =
30
30
  new Date().getTime() + (data.expirein || 7199) * 1000;
31
- setCookie(CoreConst.TOKEN_EXPIRES, `${expiredDate}`, 0, true);
31
+ setCookie(
32
+ CoreConst.TOKEN_EXPIRES,
33
+ `${expiredDate}`,
34
+ rememberme ? 7 : 0,
35
+ true,
36
+ );
32
37
  }
33
38
  return true;
34
39
  } catch (err: unknown) {
@@ -54,4 +59,26 @@ export class V7AuthService implements IAuthService {
54
59
  }
55
60
  return false;
56
61
  }
62
+
63
+ async extendLogin(): Promise<void> {
64
+ const token = getCookie(CoreConst.TOKEN);
65
+ const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
66
+ if (token && expirein) {
67
+ // 计算到过期时间所需的延时毫秒数,预留提前量
68
+ let wait = Number(expirein) - new Date().getTime();
69
+ const early = 5 * 60 * 1000;
70
+ wait = wait > early ? wait - early : 0;
71
+ setTimeout(async () => {
72
+ const res = await ibiz.net.get(`/uaa/refreshtoken2`);
73
+ if (res.ok) {
74
+ setCookie(CoreConst.TOKEN, res.data.token, 0, true);
75
+ const expiredDate =
76
+ new Date().getTime() + (res.data.expirein || 7199) * 1000;
77
+ setCookie(CoreConst.TOKEN_EXPIRES, `${expiredDate}`, 0, true);
78
+ }
79
+ // 下一次延时做准备
80
+ this.extendLogin();
81
+ }, wait);
82
+ }
83
+ }
57
84
  }
@@ -67,7 +67,7 @@ export class DEService implements IAppDEService {
67
67
  * @date 2022-08-18 19:08:40
68
68
  * @type {DECache}
69
69
  */
70
- readonly local: DECache = new DECache();
70
+ readonly local: DECache;
71
71
 
72
72
  /**
73
73
  * Creates an instance of EntityService.
@@ -77,6 +77,7 @@ export class DEService implements IAppDEService {
77
77
  * @param {IAppDataEntity} model 应用实体模型
78
78
  */
79
79
  constructor(protected model: IAppDataEntity) {
80
+ this.local = new DECache(model);
80
81
  this.configCache = new ConfigService(
81
82
  model.appId!,
82
83
  'PSAppDataEntity',
@@ -1,4 +1,5 @@
1
1
  import {
2
+ HttpError,
2
3
  HttpResponse,
3
4
  IHttpResponse,
4
5
  RuntimeError,
@@ -300,7 +301,7 @@ export class DEActionMethod extends Method {
300
301
  }
301
302
  return new HttpResponse(resultData);
302
303
  } catch (err) {
303
- return new HttpResponse(err, 500);
304
+ throw new HttpError(err as Error);
304
305
  }
305
306
  }
306
307
 
@@ -357,7 +358,7 @@ export class DEActionMethod extends Method {
357
358
  }
358
359
  return new HttpResponse(data, 500);
359
360
  } catch (err) {
360
- return new HttpResponse(err, 500);
361
+ throw new HttpError(err as Error);
361
362
  }
362
363
  }
363
364
 
@@ -390,7 +391,7 @@ export class DEActionMethod extends Method {
390
391
  }
391
392
  return new HttpResponse(resultData, 500);
392
393
  } catch (err) {
393
- return new HttpResponse(err, 500);
394
+ throw new HttpError(err as Error);
394
395
  }
395
396
  }
396
397
 
@@ -423,7 +424,7 @@ export class DEActionMethod extends Method {
423
424
  }
424
425
  return new HttpResponse(data, 500);
425
426
  } catch (err) {
426
- return new HttpResponse(err, 500);
427
+ throw new HttpError(err as Error);
427
428
  }
428
429
  }
429
430
 
@@ -1,10 +1,13 @@
1
1
  import { where, equals, clone, isNil, isEmpty } from 'ramda';
2
2
  import { createUUID } from 'qx-util';
3
+ import { IAppDataEntity } from '@ibiz/model-core';
4
+ import { RuntimeError } from '@ibiz-template/core';
3
5
  import {
4
6
  isExistSessionId,
5
7
  isExistSrfKey,
6
8
  } from '../service-exist-util/service-exist-util';
7
9
  import { IDataEntity } from '../../../interface';
10
+ import { findModelChild } from '../../../model';
8
11
 
9
12
  /**
10
13
  * 实体缓存工具类
@@ -15,6 +18,20 @@ import { IDataEntity } from '../../../interface';
15
18
  * @class DECache
16
19
  */
17
20
  export class DECache {
21
+ /**
22
+ * 是否是联合主键
23
+ * @author lxm
24
+ * @date 2023-12-12 02:47:18
25
+ * @readonly
26
+ * @protected
27
+ * @type {boolean}
28
+ */
29
+ protected get isUnionKey(): boolean {
30
+ return !!this.entity.unionKeyValueAppDEFieldIds?.length;
31
+ }
32
+
33
+ constructor(protected entity: IAppDataEntity) {}
34
+
18
35
  /**
19
36
  * 数据缓存
20
37
  *
@@ -78,6 +95,16 @@ export class DECache {
78
95
  * @memberof EntityCache
79
96
  */
80
97
  add(context: IParams, entity: IDataEntity): IDataEntity | null {
98
+ // 联合主键相关数据处理
99
+ if (this.isUnionKey) {
100
+ this.calcUnionKey(entity);
101
+ if (this.checkData(context, entity.srfkey)) {
102
+ throw new RuntimeError(
103
+ `新建联合主键数据失败,已有主键为${entity.srfkey}的数据`,
104
+ );
105
+ }
106
+ }
107
+
81
108
  try {
82
109
  isExistSessionId('add', context);
83
110
  if (isNil(entity.srfkey) || isEmpty(entity.srfkey)) {
@@ -124,16 +151,28 @@ export class DECache {
124
151
  * @memberof EntityCache
125
152
  */
126
153
  update(context: IParams, entity: IDataEntity): IDataEntity | null {
154
+ const oldKey = entity.srfkey!;
155
+ // 联合主键相关数据处理
156
+ if (this.isUnionKey) {
157
+ this.calcUnionKey(entity);
158
+ // 主键改变的时候,检测变更之后的主键是否已经存在
159
+ if (oldKey !== entity.srfkey && this.checkData(context, entity.srfkey)) {
160
+ throw new RuntimeError(
161
+ `更新联合主键数据失败,已有主键为${entity.srfkey}的数据`,
162
+ );
163
+ }
164
+ }
165
+
127
166
  try {
128
167
  isExistSessionId('update', context);
129
168
  isExistSrfKey('update', entity);
130
169
  entity.srftempdate = new Date().getTime();
131
170
  const map = this.getCacheByTag(context);
132
- const data = map.get(entity.srfkey!);
171
+ const data = map.get(oldKey);
133
172
  if (data) {
134
173
  data.assign!(entity);
135
- map.set(entity.srfkey!, data);
136
- ibiz.log.warn('update', entity.srfkey, entity);
174
+ map.set(oldKey, data);
175
+ ibiz.log.warn('update', oldKey, entity);
137
176
  return clone(data);
138
177
  }
139
178
  throw new Error('数据不存在,无法更新!');
@@ -366,4 +405,26 @@ export class DECache {
366
405
  }
367
406
  return this.cacheMap.get(tag)!;
368
407
  }
408
+
409
+ /**
410
+ * 根据联合键值计算主键并赋值
411
+ * @author lxm
412
+ * @date 2023-12-12 03:06:30
413
+ * @param {(IDataEntity | IDataEntity[])} data 需要计算的数据或数据集合
414
+ */
415
+ protected calcUnionKey(data: IDataEntity): void {
416
+ const unionKeys: string[] = this.entity.unionKeyValueAppDEFieldIds!.map(
417
+ id => {
418
+ const appField = findModelChild(this.entity.appDEFields || [], id);
419
+ return appField!.codeName!.toLowerCase();
420
+ },
421
+ );
422
+ const unionValues = unionKeys.map(key => {
423
+ if (isNil(data[key])) {
424
+ throw new RuntimeError(`联合键值计算异常,${key}属性为空值!`);
425
+ }
426
+ return data[key];
427
+ });
428
+ data.srfkey = unionValues.join('');
429
+ }
369
430
  }
@@ -0,0 +1,68 @@
1
+ import { IDEGantt, IDETreeDataSetNode } from '@ibiz/model-core';
2
+ import { CodeListItem, IGanttNodeData } from '../../../interface';
3
+ import { TreeCodeListNodeData } from '../tree-node-data';
4
+ import { calcDataItemValue } from './gantt-node-data-util';
5
+
6
+ export class GanttCodeListNodeData
7
+ extends TreeCodeListNodeData
8
+ implements IGanttNodeData
9
+ {
10
+ sndataIteValue: string;
11
+
12
+ beginDataItemValue: string;
13
+
14
+ endDataItemValue: string;
15
+
16
+ prevDataItemValue: string | number;
17
+
18
+ finishDataItemValue: string | number;
19
+
20
+ totalDataItemValue: string | number;
21
+
22
+ children?: IGanttNodeData[] | undefined;
23
+
24
+ constructor(
25
+ model: IDEGantt,
26
+ nodeModel: IDETreeDataSetNode,
27
+ parentNodeData: IGanttNodeData | undefined,
28
+ opts: {
29
+ data: CodeListItem;
30
+ leaf: boolean;
31
+ navContext?: IParams;
32
+ navParams?: IParams;
33
+ },
34
+ ) {
35
+ super(nodeModel, parentNodeData, opts);
36
+ const { data } = opts;
37
+ this.sndataIteValue = calcDataItemValue(
38
+ model.sndataItemName,
39
+ nodeModel,
40
+ data,
41
+ );
42
+ this.beginDataItemValue = calcDataItemValue(
43
+ model.beginDataItemName,
44
+ nodeModel,
45
+ data,
46
+ );
47
+ this.endDataItemValue = calcDataItemValue(
48
+ model.endDataItemName,
49
+ nodeModel,
50
+ data,
51
+ );
52
+ this.prevDataItemValue = calcDataItemValue(
53
+ model.prevDataItemName,
54
+ nodeModel,
55
+ data,
56
+ );
57
+ this.finishDataItemValue = calcDataItemValue(
58
+ model.finishDataItemName,
59
+ nodeModel,
60
+ data,
61
+ );
62
+ this.totalDataItemValue = calcDataItemValue(
63
+ model.totalDataItemName,
64
+ nodeModel,
65
+ data,
66
+ );
67
+ }
68
+ }
@@ -0,0 +1,68 @@
1
+ import { IDEGantt, IDETreeDataSetNode } from '@ibiz/model-core';
2
+ import { IGanttNodeData } from '../../../interface';
3
+ import { TreeDataSetNodeData } from '../tree-node-data';
4
+ import { calcDataItemValue } from './gantt-node-data-util';
5
+
6
+ export class GanttDataSetNodeData
7
+ extends TreeDataSetNodeData
8
+ implements IGanttNodeData
9
+ {
10
+ sndataIteValue: string;
11
+
12
+ beginDataItemValue: string;
13
+
14
+ endDataItemValue: string;
15
+
16
+ prevDataItemValue: string | number;
17
+
18
+ finishDataItemValue: string | number;
19
+
20
+ totalDataItemValue: string | number;
21
+
22
+ children?: IGanttNodeData[] | undefined;
23
+
24
+ constructor(
25
+ model: IDEGantt,
26
+ nodeModel: IDETreeDataSetNode,
27
+ parentNodeData: IGanttNodeData | undefined,
28
+ opts: {
29
+ data: IData;
30
+ leaf: boolean; // 是否有子节点关系
31
+ navContext?: IParams;
32
+ navParams?: IParams;
33
+ },
34
+ ) {
35
+ super(nodeModel, parentNodeData, opts);
36
+ const { data } = opts;
37
+ this.sndataIteValue = calcDataItemValue(
38
+ model.sndataItemName,
39
+ nodeModel,
40
+ data,
41
+ );
42
+ this.beginDataItemValue = calcDataItemValue(
43
+ model.beginDataItemName,
44
+ nodeModel,
45
+ data,
46
+ );
47
+ this.endDataItemValue = calcDataItemValue(
48
+ model.endDataItemName,
49
+ nodeModel,
50
+ data,
51
+ );
52
+ this.prevDataItemValue = calcDataItemValue(
53
+ model.prevDataItemName,
54
+ nodeModel,
55
+ data,
56
+ );
57
+ this.finishDataItemValue = calcDataItemValue(
58
+ model.finishDataItemName,
59
+ nodeModel,
60
+ data,
61
+ );
62
+ this.totalDataItemValue = calcDataItemValue(
63
+ model.totalDataItemName,
64
+ nodeModel,
65
+ data,
66
+ );
67
+ }
68
+ }
@@ -0,0 +1,26 @@
1
+ import { IDETreeNode, IDETreeNodeDataItem } from '@ibiz/model-core';
2
+
3
+ /**
4
+ * 计算数据项
5
+ * @param nodeModel
6
+ * @param fieldCodeName
7
+ * @returns
8
+ */
9
+ export const calcDataItemValue = (
10
+ fieldCodeName: string | undefined,
11
+ nodeModel: IDETreeNode,
12
+ data: IData = {},
13
+ ): string => {
14
+ let result: string = '';
15
+ if (!fieldCodeName || !nodeModel.detreeNodeDataItems) {
16
+ return result;
17
+ }
18
+ const targetTreeNodeDataItem: IDETreeNodeDataItem | undefined =
19
+ nodeModel.detreeNodeDataItems.find((nodeDataItem: IDETreeNodeDataItem) => {
20
+ return nodeDataItem.id === fieldCodeName;
21
+ });
22
+ if (targetTreeNodeDataItem && targetTreeNodeDataItem.appDEFieldId) {
23
+ result = data[targetTreeNodeDataItem.appDEFieldId];
24
+ }
25
+ return result;
26
+ };
@@ -0,0 +1,50 @@
1
+ import { IDEGantt, IDETreeNode } from '@ibiz/model-core';
2
+ import { IGanttNodeData } from '../../../interface';
3
+ import { TreeStaticNodeData } from '../tree-node-data';
4
+ import { calcDataItemValue } from './gantt-node-data-util';
5
+
6
+ export class GanttStaticNodeData
7
+ extends TreeStaticNodeData
8
+ implements IGanttNodeData
9
+ {
10
+ sndataIteValue: string;
11
+
12
+ beginDataItemValue: string;
13
+
14
+ endDataItemValue: string;
15
+
16
+ prevDataItemValue: string | number;
17
+
18
+ finishDataItemValue: string | number;
19
+
20
+ totalDataItemValue: string | number;
21
+
22
+ children?: IGanttNodeData[] | undefined;
23
+
24
+ constructor(
25
+ model: IDEGantt,
26
+ nodeModel: IDETreeNode,
27
+ parentNodeData: IGanttNodeData | undefined,
28
+ opts: { parentValueLevel?: number; leaf: boolean },
29
+ ) {
30
+ super(nodeModel, parentNodeData, opts);
31
+ this.sndataIteValue = calcDataItemValue(model.sndataItemName, nodeModel);
32
+ this.beginDataItemValue = calcDataItemValue(
33
+ model.beginDataItemName,
34
+ nodeModel,
35
+ );
36
+ this.endDataItemValue = calcDataItemValue(model.endDataItemName, nodeModel);
37
+ this.prevDataItemValue = calcDataItemValue(
38
+ model.prevDataItemName,
39
+ nodeModel,
40
+ );
41
+ this.finishDataItemValue = calcDataItemValue(
42
+ model.finishDataItemName,
43
+ nodeModel,
44
+ );
45
+ this.totalDataItemValue = calcDataItemValue(
46
+ model.totalDataItemName,
47
+ nodeModel,
48
+ );
49
+ }
50
+ }
@@ -0,0 +1,3 @@
1
+ export { GanttStaticNodeData } from './gantt-static-node-data';
2
+ export { GanttDataSetNodeData } from './gantt-data-set-node-data';
3
+ export { GanttCodeListNodeData } from './gantt-code-list-node-data';
@@ -5,3 +5,4 @@ export * from './calendar-item-data';
5
5
  export * from './map-data';
6
6
  export * from './panel-data';
7
7
  export * from './chart-data';
8
+ export * from './gantt-node-data';
@@ -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
  * 预置默认的界面行为适配器
@@ -30,6 +31,9 @@ export function presetUIActionProvider(): void {
30
31
  'DEUIACTION_WFWithdraw',
31
32
  () => wfWithdrawUIActionProvider,
32
33
  );
34
+ // 预置登出界面行为适配器
35
+ const loginOutUIActionProvider = new LoginOutUIActionProvider();
36
+ registerUIActionProvider('SYS_Logout', () => loginOutUIActionProvider);
33
37
  }
34
38
 
35
39
  export {
@@ -0,0 +1,31 @@
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
+ *
8
+ * @author zk
9
+ * @date 2023-12-11 07:12:49
10
+ * @export
11
+ * @class LoginOutUIActionProvider
12
+ * @extends {UIActionProviderBase}
13
+ */
14
+ export class LoginOutUIActionProvider extends UIActionProviderBase {
15
+ async execAction(
16
+ _action: IAppDEUIAction,
17
+ _params: IUILogicParams,
18
+ ): Promise<IUIActionResult> {
19
+ const confirm = await ibiz.confirm.info({
20
+ title: '确认退出登录',
21
+ desc: '您确定要退出登录吗?退出后您将无法继续访问已登录状态的功能和信息,请确保您已保存所有未完成的操作。',
22
+ });
23
+ if (confirm) {
24
+ const bol = await ibiz.auth.logout();
25
+ if (bol) {
26
+ window.location.reload();
27
+ }
28
+ }
29
+ return {};
30
+ }
31
+ }