@ibiz-template/runtime 0.0.1-alpha.1 → 0.0.1-alpha.2

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/out/command/app/app-func/app-func.d.ts +76 -1
  3. package/out/command/app/app-func/app-func.d.ts.map +1 -1
  4. package/out/command/app/app-func/app-func.js +123 -5
  5. package/out/command/app/open-app-view/open-app-view.d.ts +98 -0
  6. package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -0
  7. package/out/command/app/open-app-view/open-app-view.js +132 -0
  8. package/out/command/index.d.ts +3 -0
  9. package/out/command/index.d.ts.map +1 -1
  10. package/out/command/index.js +3 -0
  11. package/out/constant/index.d.ts +1 -1
  12. package/out/constant/index.d.ts.map +1 -1
  13. package/out/constant/index.js +1 -1
  14. package/out/constant/view-mode.d.ts +31 -0
  15. package/out/constant/view-mode.d.ts.map +1 -0
  16. package/out/constant/view-mode.js +32 -0
  17. package/out/index.d.ts +5 -0
  18. package/out/index.d.ts.map +1 -1
  19. package/out/index.js +5 -0
  20. package/out/install.d.ts.map +1 -1
  21. package/out/install.js +7 -6
  22. package/out/interface/i-modal/i-modal.d.ts +28 -0
  23. package/out/interface/i-modal/i-modal.d.ts.map +1 -0
  24. package/out/interface/i-modal/i-modal.js +1 -0
  25. package/out/interface/i-modal-data/i-modal-data.d.ts +35 -0
  26. package/out/interface/i-modal-data/i-modal-data.d.ts.map +1 -0
  27. package/out/interface/i-modal-data/i-modal-data.js +1 -0
  28. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +27 -0
  29. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -0
  30. package/out/interface/i-ui-action-result/i-ui-action-result.js +1 -0
  31. package/out/interface/index.d.ts +5 -0
  32. package/out/interface/index.d.ts.map +1 -0
  33. package/out/interface/index.js +1 -0
  34. package/out/interface/util/i-loading-util/i-loading-util.d.ts +26 -0
  35. package/out/interface/util/i-loading-util/i-loading-util.d.ts.map +1 -0
  36. package/out/interface/util/i-loading-util/i-loading-util.js +1 -0
  37. package/out/interface/util/i-message-util/i-message-util.d.ts +51 -0
  38. package/out/interface/util/i-message-util/i-message-util.d.ts.map +1 -0
  39. package/out/interface/util/i-message-util/i-message-util.js +1 -0
  40. package/out/interface/util/i-modal-util/i-modal-util.d.ts +83 -0
  41. package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -0
  42. package/out/interface/util/i-modal-util/i-modal-util.js +1 -0
  43. package/out/interface/util/i-notification-util/i-notification-util.d.ts +79 -0
  44. package/out/interface/util/i-notification-util/i-notification-util.d.ts.map +1 -0
  45. package/out/interface/util/i-notification-util/i-notification-util.js +1 -0
  46. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +69 -0
  47. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -0
  48. package/out/interface/util/i-open-view-util/i-open-view-util.js +1 -0
  49. package/out/interface/util/index.d.ts +6 -0
  50. package/out/interface/util/index.d.ts.map +1 -0
  51. package/out/interface/util/index.js +1 -0
  52. package/out/types.d.ts +46 -0
  53. package/out/types.d.ts.map +1 -1
  54. package/out/types.js +1 -1
  55. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +86 -0
  56. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -0
  57. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +257 -0
  58. package/out/utils/index.d.ts +3 -0
  59. package/out/utils/index.d.ts.map +1 -0
  60. package/out/utils/index.js +2 -0
  61. package/out/utils/nav-params/nav-params.d.ts +44 -0
  62. package/out/utils/nav-params/nav-params.d.ts.map +1 -0
  63. package/out/utils/nav-params/nav-params.js +95 -0
  64. package/out/view-logic/index.d.ts +2 -0
  65. package/out/view-logic/index.d.ts.map +1 -0
  66. package/out/view-logic/index.js +1 -0
  67. package/out/view-logic/view-logic.d.ts +42 -0
  68. package/out/view-logic/view-logic.d.ts.map +1 -0
  69. package/out/view-logic/view-logic.js +131 -0
  70. package/package.json +15 -9
  71. package/src/command/app/app-func/app-func.ts +156 -5
  72. package/src/command/app/open-app-view/open-app-view.ts +178 -0
  73. package/src/command/index.ts +4 -0
  74. package/src/constant/index.ts +1 -1
  75. package/src/constant/view-mode.ts +31 -0
  76. package/src/index.ts +5 -0
  77. package/src/install.ts +7 -6
  78. package/src/interface/i-modal/i-modal.ts +29 -0
  79. package/src/interface/i-modal-data/i-modal-data.ts +34 -0
  80. package/src/interface/i-ui-action-result/i-ui-action-result.ts +26 -0
  81. package/src/interface/index.ts +4 -0
  82. package/src/interface/util/i-loading-util/i-loading-util.ts +25 -0
  83. package/src/interface/util/i-message-util/i-message-util.ts +50 -0
  84. package/src/interface/util/i-modal-util/i-modal-util.ts +83 -0
  85. package/src/interface/util/i-notification-util/i-notification-util.ts +79 -0
  86. package/src/interface/util/i-open-view-util/i-open-view-util.ts +89 -0
  87. package/src/interface/util/index.ts +8 -0
  88. package/src/types.ts +52 -0
  89. package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +349 -0
  90. package/src/utils/index.ts +2 -0
  91. package/src/utils/nav-params/nav-params.ts +105 -0
  92. package/src/view-logic/index.ts +1 -0
  93. package/src/view-logic/view-logic.ts +190 -0
  94. package/out/constant/command/app/app.d.ts +0 -7
  95. package/out/constant/command/app/app.d.ts.map +0 -1
  96. package/out/constant/command/app/app.js +0 -7
  97. package/out/constant/command/command.d.ts +0 -20
  98. package/out/constant/command/command.d.ts.map +0 -1
  99. package/out/constant/command/command.js +0 -18
  100. package/src/constant/command/app/app.ts +0 -7
  101. package/src/constant/command/command.ts +0 -19
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 千反田丷
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,4 @@
1
+ import { IBizContext } from '@ibiz-template/core';
1
2
  import { IPSAppFunc } from '@ibiz-template/model';
2
3
  /**
3
4
  * 执行应用功能
@@ -8,7 +9,81 @@ import { IPSAppFunc } from '@ibiz-template/model';
8
9
  * @class AppFuncCommand
9
10
  */
10
11
  export declare class AppFuncCommand {
12
+ /**
13
+ * 指令标识
14
+ *
15
+ * @author chitanda
16
+ * @date 2022-07-25 17:07:20
17
+ * @see 具体实现 {@link AppFuncCommand.exec}
18
+ * @static
19
+ */
20
+ static readonly TAG = "ibiz.app-func.exec";
11
21
  constructor();
12
- exec(appFunc: IPSAppFunc): Promise<void>;
22
+ /**
23
+ * 执行应用功能
24
+ *
25
+ * @author chitanda
26
+ * @date 2022-07-25 17:07:35
27
+ * @param {IPSAppFunc} appFunc 应用功能模型
28
+ * @param {IBizContext} [context] 执行上下文
29
+ * @param {IParams} [params={}] 参数
30
+ * @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
31
+ * @return {*} {Promise<void>}
32
+ */
33
+ exec(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams, opts?: IData): Promise<void>;
34
+ /**
35
+ * 打开应用视图
36
+ *
37
+ * @author chitanda
38
+ * @date 2022-07-25 18:07:49
39
+ * @protected
40
+ * @param {IPSAppFunc} appFunc
41
+ * @param {IBizContext} [context]
42
+ * @param {IParams} [params]
43
+ * @return {*} {Promise<void>}
44
+ */
45
+ protected openAppView(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams, opts?: IData): Promise<void>;
46
+ /**
47
+ * 打开HTML页面
48
+ *
49
+ * @author chitanda
50
+ * @date 2022-07-25 18:07:56
51
+ * @protected
52
+ * @param {IPSAppFunc} appFunc
53
+ */
54
+ protected openHtmlPage(appFunc: IPSAppFunc): void;
55
+ /**
56
+ * 应用预置功能
57
+ *
58
+ * @author chitanda
59
+ * @date 2022-07-25 18:07:22
60
+ * @protected
61
+ * @param {IPSAppFunc} appFunc
62
+ * @param {IBizContext} [context]
63
+ * @param {IParams} [params]
64
+ */
65
+ protected openPdAppFunc(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
66
+ /**
67
+ * 执行 JavaScript 脚本
68
+ *
69
+ * @author chitanda
70
+ * @date 2022-07-25 18:07:09
71
+ * @protected
72
+ * @param {IPSAppFunc} appFunc
73
+ * @param {IBizContext} [context]
74
+ * @param {IParams} [params]
75
+ */
76
+ protected executeJavaScript(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
77
+ /**
78
+ * 自定义应用功能
79
+ *
80
+ * @author chitanda
81
+ * @date 2022-07-25 18:07:51
82
+ * @protected
83
+ * @param {IPSAppFunc} appFunc
84
+ * @param {IBizContext} [context]
85
+ * @param {IParams} [params]
86
+ */
87
+ protected custom(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
13
88
  }
14
89
  //# sourceMappingURL=app-func.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-func.d.ts","sourceRoot":"","sources":["../../../../src/command/app/app-func/app-func.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,cAAc;;IAKnB,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
1
+ {"version":3,"file":"app-func.d.ts","sourceRoot":"","sources":["../../../../src/command/app/app-func/app-func.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,wBAAwB;;IAM3C;;;;;;;;;;OAUG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,IAAI,CAAC;IA6BhB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,WAAW,CACnB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,GACX,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAKjD;;;;;;;;;OASG;IACH,SAAS,CAAC,aAAa,CACrB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;IAKP;;;;;;;;;OASG;IACH,SAAS,CAAC,iBAAiB,CACzB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;IAKP;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAM,CACd,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;CAIR"}
@@ -1,5 +1,5 @@
1
- import { commands } from '@ibiz-template/command';
2
- import { CommandConst } from '../../../constant';
1
+ import { IBizContext } from '@ibiz-template/core';
2
+ import { OpenAppViewCommand } from '../open-app-view/open-app-view';
3
3
  /**
4
4
  * 执行应用功能
5
5
  *
@@ -10,9 +10,127 @@ import { CommandConst } from '../../../constant';
10
10
  */
11
11
  export class AppFuncCommand {
12
12
  constructor() {
13
- commands.register(CommandConst.app.APP_FUNC_EXEC, this.exec.bind(this));
13
+ ibiz.commands.register(AppFuncCommand.TAG, this.exec.bind(this));
14
14
  }
15
- async exec(appFunc) {
16
- console.log(appFunc);
15
+ /**
16
+ * 执行应用功能
17
+ *
18
+ * @author chitanda
19
+ * @date 2022-07-25 17:07:35
20
+ * @param {IPSAppFunc} appFunc 应用功能模型
21
+ * @param {IBizContext} [context] 执行上下文
22
+ * @param {IParams} [params={}] 参数
23
+ * @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
24
+ * @return {*} {Promise<void>}
25
+ */
26
+ async exec(appFunc, context, params = {}, opts = {}) {
27
+ const navContext = appFunc.getPSNavigateContexts();
28
+ if (navContext) {
29
+ if (context) {
30
+ Object.assign(context, navContext);
31
+ }
32
+ else {
33
+ context = new IBizContext(navContext);
34
+ }
35
+ }
36
+ const navParams = appFunc.getPSNavigateParams();
37
+ if (navParams) {
38
+ Object.assign(params, navParams);
39
+ }
40
+ switch (appFunc.appFuncType) {
41
+ case 'APPVIEW':
42
+ return this.openAppView(appFunc, context, params, opts);
43
+ case 'OPENHTMLPAGE':
44
+ return this.openHtmlPage(appFunc);
45
+ case 'PDTAPPFUNC':
46
+ return this.openPdAppFunc(appFunc, context, params);
47
+ case 'JAVASCRIPT':
48
+ return this.executeJavaScript(appFunc, context, params);
49
+ case 'CUSTOM':
50
+ return this.custom(appFunc, context, params);
51
+ default:
52
+ throw new Error(`未知的应用功能类型: ${appFunc.appFuncType}`);
53
+ }
54
+ }
55
+ /**
56
+ * 打开应用视图
57
+ *
58
+ * @author chitanda
59
+ * @date 2022-07-25 18:07:49
60
+ * @protected
61
+ * @param {IPSAppFunc} appFunc
62
+ * @param {IBizContext} [context]
63
+ * @param {IParams} [params]
64
+ * @return {*} {Promise<void>}
65
+ */
66
+ openAppView(appFunc, context, params, opts) {
67
+ const view = appFunc.getPSAppView();
68
+ if (!view) {
69
+ throw new Error('应用视图不存在');
70
+ }
71
+ return ibiz.commands.execute(OpenAppViewCommand.TAG, view, context, params, opts);
72
+ }
73
+ /**
74
+ * 打开HTML页面
75
+ *
76
+ * @author chitanda
77
+ * @date 2022-07-25 18:07:56
78
+ * @protected
79
+ * @param {IPSAppFunc} appFunc
80
+ */
81
+ openHtmlPage(appFunc) {
82
+ const url = appFunc.htmlPageUrl;
83
+ window.open(url, '_blank');
84
+ }
85
+ /**
86
+ * 应用预置功能
87
+ *
88
+ * @author chitanda
89
+ * @date 2022-07-25 18:07:22
90
+ * @protected
91
+ * @param {IPSAppFunc} appFunc
92
+ * @param {IBizContext} [context]
93
+ * @param {IParams} [params]
94
+ */
95
+ openPdAppFunc(appFunc, context, params) {
96
+ console.log('openPdAppFunc', appFunc, context, params);
97
+ throw new Error('未实现');
98
+ }
99
+ /**
100
+ * 执行 JavaScript 脚本
101
+ *
102
+ * @author chitanda
103
+ * @date 2022-07-25 18:07:09
104
+ * @protected
105
+ * @param {IPSAppFunc} appFunc
106
+ * @param {IBizContext} [context]
107
+ * @param {IParams} [params]
108
+ */
109
+ executeJavaScript(appFunc, context, params) {
110
+ console.log('executeJavaScript', appFunc, context, params);
111
+ throw new Error('未实现');
112
+ }
113
+ /**
114
+ * 自定义应用功能
115
+ *
116
+ * @author chitanda
117
+ * @date 2022-07-25 18:07:51
118
+ * @protected
119
+ * @param {IPSAppFunc} appFunc
120
+ * @param {IBizContext} [context]
121
+ * @param {IParams} [params]
122
+ */
123
+ custom(appFunc, context, params) {
124
+ console.log('custom', appFunc, context, params);
125
+ throw new Error('未实现');
17
126
  }
18
127
  }
128
+ /**
129
+ * 指令标识
130
+ *
131
+ * @author chitanda
132
+ * @date 2022-07-25 17:07:20
133
+ * @see 具体实现 {@link AppFuncCommand.exec}
134
+ * @static
135
+ */
136
+ AppFuncCommand.TAG = 'ibiz.app-func.exec';
@@ -0,0 +1,98 @@
1
+ import { IBizContext } from '@ibiz-template/core';
2
+ import { IPSAppView } from '@ibiz-template/model';
3
+ import { IModalData } from '../../../interface';
4
+ /**
5
+ * 打开应用视图
6
+ *
7
+ * @author chitanda
8
+ * @date 2022-07-25 18:07:20
9
+ * @export
10
+ * @class OpenAppViewCommand
11
+ */
12
+ export declare class OpenAppViewCommand {
13
+ static readonly TAG = "ibiz.app-view.open";
14
+ constructor();
15
+ /**
16
+ * xhr模式打开
17
+ *
18
+ * @author chitanda
19
+ * @date 2022-08-25 23:08:08
20
+ * @param {IPSAppView} appView
21
+ * @param {IBizContext} [context]
22
+ * @param {IParams} [params={}]
23
+ * @param {IData} [_opts={}]
24
+ * @return {*} {(Promise<IModalData | void>)}
25
+ */
26
+ exec(appView: IPSAppView, context?: IBizContext, params?: IParams, _opts?: IData): Promise<IModalData | void>;
27
+ /**
28
+ * 打开重定向视图
29
+ *
30
+ * @author chitanda
31
+ * @date 2022-07-25 20:07:24
32
+ * @protected
33
+ * @param {IPSAppView} appView
34
+ * @param {IBizContext} [context]
35
+ * @param {IParams} [params={}]
36
+ */
37
+ protected openRedirectView(appView: IPSAppView, context?: IBizContext, params?: IParams): void;
38
+ /**
39
+ * 首页导航模式打开
40
+ *
41
+ * @author chitanda
42
+ * @date 2022-07-25 20:07:43
43
+ * @protected
44
+ * @param {IPSAppView} appView
45
+ * @param {IBizContext} [context]
46
+ * @param {IParams} [params={}]
47
+ */
48
+ protected openIndexViewTab(appView: IPSAppView, context?: IBizContext, params?: IParams): void;
49
+ /**
50
+ * 模态窗口打开
51
+ *
52
+ * @author chitanda
53
+ * @date 2022-07-25 20:07:55
54
+ * @protected
55
+ * @param {IPSAppView} appView
56
+ * @param {IBizContext} [context]
57
+ * @param {IParams} [params={}]
58
+ * @return {*} {Promise<IModalData>}
59
+ */
60
+ protected openModal(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
61
+ /**
62
+ * 气泡模式打开
63
+ *
64
+ * @author chitanda
65
+ * @date 2022-07-25 20:07:17
66
+ * @protected
67
+ * @param {IPSAppView} appView
68
+ * @param {IBizContext} [context]
69
+ * @param {IParams} [params={}]
70
+ * @return {*} {Promise<IModalData>}
71
+ */
72
+ protected openPopover(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
73
+ /**
74
+ * 抽屉模式打开
75
+ *
76
+ * @author chitanda
77
+ * @date 2022-07-25 20:07:08
78
+ * @protected
79
+ * @param {IPSAppView} appView
80
+ * @param {IBizContext} [context]
81
+ * @param {IParams} [params={}]
82
+ * @return {*} {Promise<void>}
83
+ */
84
+ protected openDrawer(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
85
+ /**
86
+ * 用户自定义
87
+ *
88
+ * @author chitanda
89
+ * @date 2022-07-25 20:07:41
90
+ * @protected
91
+ * @param {IPSAppView} appView
92
+ * @param {IBizContext} [context]
93
+ * @param {IParams} [params={}]
94
+ * @return {*} {Promise<void>}
95
+ */
96
+ protected openUserCustom(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
97
+ }
98
+ //# sourceMappingURL=open-app-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-app-view.d.ts","sourceRoot":"","sources":["../../../../src/command/app/open-app-view/open-app-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,GAAG,wBAAwB;;IAM3C;;;;;;;;;;OAUG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,EACpB,KAAK,GAAE,KAAU,GAChB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IA0B7B;;;;;;;;;OASG;IACH,SAAS,CAAC,gBAAgB,CACxB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,IAAI;IASP;;;;;;;;;OASG;IACH,SAAS,CAAC,gBAAgB,CACxB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,IAAI;IAIP;;;;;;;;;;OAUG;cACa,SAAS,CACvB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,WAAW,CACzB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,UAAU,CACxB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;CAGvB"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * 打开应用视图
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-07-25 18:07:20
6
+ * @export
7
+ * @class OpenAppViewCommand
8
+ */
9
+ export class OpenAppViewCommand {
10
+ constructor() {
11
+ ibiz.commands.register(OpenAppViewCommand.TAG, this.exec.bind(this));
12
+ }
13
+ /**
14
+ * xhr模式打开
15
+ *
16
+ * @author chitanda
17
+ * @date 2022-08-25 23:08:08
18
+ * @param {IPSAppView} appView
19
+ * @param {IBizContext} [context]
20
+ * @param {IParams} [params={}]
21
+ * @param {IData} [_opts={}]
22
+ * @return {*} {(Promise<IModalData | void>)}
23
+ */
24
+ async exec(appView, context, params = {}, _opts = {}) {
25
+ await appView.fill(true);
26
+ if (appView.redirectView) {
27
+ return this.openRedirectView(appView);
28
+ }
29
+ const { openMode = 'INDEXVIEWTAB' } = appView;
30
+ switch (openMode) {
31
+ case 'INDEXVIEWTAB':
32
+ return this.openIndexViewTab(appView, context, params);
33
+ case 'POPUP':
34
+ throw new Error('未支持的视图打开模式: POPUP');
35
+ case 'POPUPMODAL':
36
+ return this.openModal(appView, context, params);
37
+ case 'POPUPAPP':
38
+ throw new Error('未支持的视图打开模式: POPUPAPP');
39
+ case 'POPOVER':
40
+ return this.openPopover(appView, context, params);
41
+ case 'DRAWER':
42
+ return this.openDrawer(appView, context, params);
43
+ case 'USER':
44
+ return this.openUserCustom(appView, context, params);
45
+ default:
46
+ return this.openIndexViewTab(appView, context, params);
47
+ }
48
+ }
49
+ /**
50
+ * 打开重定向视图
51
+ *
52
+ * @author chitanda
53
+ * @date 2022-07-25 20:07:24
54
+ * @protected
55
+ * @param {IPSAppView} appView
56
+ * @param {IBizContext} [context]
57
+ * @param {IParams} [params={}]
58
+ */
59
+ openRedirectView(appView, context, params = {}) {
60
+ console.log('OpenAppViewCommand.openRedirectView', appView, context, params);
61
+ }
62
+ /**
63
+ * 首页导航模式打开
64
+ *
65
+ * @author chitanda
66
+ * @date 2022-07-25 20:07:43
67
+ * @protected
68
+ * @param {IPSAppView} appView
69
+ * @param {IBizContext} [context]
70
+ * @param {IParams} [params={}]
71
+ */
72
+ openIndexViewTab(appView, context, params = {}) {
73
+ return ibiz.openView.root(appView, context, params);
74
+ }
75
+ /**
76
+ * 模态窗口打开
77
+ *
78
+ * @author chitanda
79
+ * @date 2022-07-25 20:07:55
80
+ * @protected
81
+ * @param {IPSAppView} appView
82
+ * @param {IBizContext} [context]
83
+ * @param {IParams} [params={}]
84
+ * @return {*} {Promise<IModalData>}
85
+ */
86
+ async openModal(appView, context, params = {}) {
87
+ return ibiz.openView.modal(appView, context, params);
88
+ }
89
+ /**
90
+ * 气泡模式打开
91
+ *
92
+ * @author chitanda
93
+ * @date 2022-07-25 20:07:17
94
+ * @protected
95
+ * @param {IPSAppView} appView
96
+ * @param {IBizContext} [context]
97
+ * @param {IParams} [params={}]
98
+ * @return {*} {Promise<IModalData>}
99
+ */
100
+ async openPopover(appView, context, params = {}) {
101
+ return ibiz.openView.popover(appView, context, params);
102
+ }
103
+ /**
104
+ * 抽屉模式打开
105
+ *
106
+ * @author chitanda
107
+ * @date 2022-07-25 20:07:08
108
+ * @protected
109
+ * @param {IPSAppView} appView
110
+ * @param {IBizContext} [context]
111
+ * @param {IParams} [params={}]
112
+ * @return {*} {Promise<void>}
113
+ */
114
+ async openDrawer(appView, context, params = {}) {
115
+ return ibiz.openView.drawer(appView, context, params);
116
+ }
117
+ /**
118
+ * 用户自定义
119
+ *
120
+ * @author chitanda
121
+ * @date 2022-07-25 20:07:41
122
+ * @protected
123
+ * @param {IPSAppView} appView
124
+ * @param {IBizContext} [context]
125
+ * @param {IParams} [params={}]
126
+ * @return {*} {Promise<void>}
127
+ */
128
+ async openUserCustom(appView, context, params = {}) {
129
+ return ibiz.openView.custom(appView, context, params);
130
+ }
131
+ }
132
+ OpenAppViewCommand.TAG = 'ibiz.app-view.open';
@@ -1,3 +1,5 @@
1
+ import { AppFuncCommand } from './app/app-func/app-func';
2
+ import { OpenAppViewCommand } from './app/open-app-view/open-app-view';
1
3
  /**
2
4
  * 安装指令
3
5
  *
@@ -6,4 +8,5 @@
6
8
  * @export
7
9
  */
8
10
  export declare function installCommand(): void;
11
+ export { AppFuncCommand, OpenAppViewCommand };
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { AppFuncCommand } from './app/app-func/app-func';
2
+ import { OpenAppViewCommand } from './app/open-app-view/open-app-view';
2
3
  /**
3
4
  * 安装指令
4
5
  *
@@ -8,4 +9,6 @@ import { AppFuncCommand } from './app/app-func/app-func';
8
9
  */
9
10
  export function installCommand() {
10
11
  new AppFuncCommand();
12
+ new OpenAppViewCommand();
11
13
  }
14
+ export { AppFuncCommand, OpenAppViewCommand };
@@ -1,2 +1,2 @@
1
- export { CommandConst } from './command/command';
1
+ export * from './view-mode';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- export { CommandConst } from './command/command';
1
+ export * from './view-mode';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 视图打开方式
3
+ *
4
+ * @author lxm
5
+ * @date 2022-09-01 10:09:04
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum ViewMode {
10
+ /**
11
+ * 路由(默认)
12
+ */
13
+ ROUTE = "ROUTE",
14
+ /**
15
+ * 模态
16
+ */
17
+ MODAL = "MODAL",
18
+ /**
19
+ * 抽屉
20
+ */
21
+ DRAWER = "DRAWER",
22
+ /**
23
+ * 嵌入
24
+ */
25
+ EMBED = "EMBED",
26
+ /**
27
+ * 气泡
28
+ */
29
+ POPOVER = "POPOVER"
30
+ }
31
+ //# sourceMappingURL=view-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../src/constant/view-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,OAAO,YAAY;CACpB"}
@@ -0,0 +1,32 @@
1
+ /* eslint-disable no-shadow */
2
+ /**
3
+ * 视图打开方式
4
+ *
5
+ * @author lxm
6
+ * @date 2022-09-01 10:09:04
7
+ * @export
8
+ * @enum {number}
9
+ */
10
+ export var ViewMode;
11
+ (function (ViewMode) {
12
+ /**
13
+ * 路由(默认)
14
+ */
15
+ ViewMode["ROUTE"] = "ROUTE";
16
+ /**
17
+ * 模态
18
+ */
19
+ ViewMode["MODAL"] = "MODAL";
20
+ /**
21
+ * 抽屉
22
+ */
23
+ ViewMode["DRAWER"] = "DRAWER";
24
+ /**
25
+ * 嵌入
26
+ */
27
+ ViewMode["EMBED"] = "EMBED";
28
+ /**
29
+ * 气泡
30
+ */
31
+ ViewMode["POPOVER"] = "POPOVER";
32
+ })(ViewMode || (ViewMode = {}));
package/out/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  import './types';
2
2
  export { install } from './install';
3
+ export * from './command';
4
+ export * from './constant';
5
+ export * from './interface';
6
+ export * from './utils';
7
+ export * from './view-logic';
3
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/out/index.js CHANGED
@@ -1,2 +1,7 @@
1
1
  import './types';
2
2
  export { install } from './install';
3
+ export * from './command';
4
+ export * from './constant';
5
+ export * from './interface';
6
+ export * from './utils';
7
+ export * from './view-logic';
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAI9B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAM9B"}
package/out/install.js CHANGED
@@ -1,6 +1,5 @@
1
- import { install as useCore } from '@ibiz-template/core';
2
- import { install as useService } from '@ibiz-template/service';
3
- import { install as useController } from '@ibiz-template/controller';
1
+ import { commands } from '@ibiz-template/command';
2
+ import { installCommand } from './command';
4
3
  /**
5
4
  * 安装运行时
6
5
  *
@@ -9,7 +8,9 @@ import { install as useController } from '@ibiz-template/controller';
9
8
  * @export
10
9
  */
11
10
  export function install() {
12
- useCore();
13
- useService();
14
- useController();
11
+ const { ibiz } = window;
12
+ // 挂载指令控制器
13
+ ibiz.commands = commands;
14
+ // 安装默认指令
15
+ installCommand();
15
16
  }