@ibiz-template/runtime 0.7.41-alpha.126 → 0.7.41-alpha.128

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 (60) hide show
  1. package/dist/index.esm.js +88 -56
  2. package/dist/index.system.min.js +1 -1
  3. package/out/app-hub.d.ts +8 -0
  4. package/out/app-hub.d.ts.map +1 -1
  5. package/out/app-hub.js +25 -0
  6. package/out/application.d.ts +0 -7
  7. package/out/application.d.ts.map +1 -1
  8. package/out/application.js +0 -21
  9. package/out/config/global-config.d.ts +7 -1
  10. package/out/config/global-config.d.ts.map +1 -1
  11. package/out/config/global-config.js +20 -0
  12. package/out/interface/api/app/i-api-app-hub-service.d.ts +7 -0
  13. package/out/interface/api/app/i-api-app-hub-service.d.ts.map +1 -1
  14. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +8 -0
  15. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
  16. package/out/interface/api/common/global-config/i-api-global-config.d.ts +7 -0
  17. package/out/interface/api/common/global-config/i-api-global-config.d.ts.map +1 -1
  18. package/out/interface/api/common/global-config/i-api-global-img-assets.d.ts +92 -0
  19. package/out/interface/api/common/global-config/i-api-global-img-assets.d.ts.map +1 -0
  20. package/out/interface/api/common/global-config/i-api-global-img-assets.js +1 -0
  21. package/out/interface/api/common/global-config/index.d.ts +1 -0
  22. package/out/interface/api/common/global-config/index.d.ts.map +1 -1
  23. package/out/interface/common/i-global-config/i-global-img-assets.d.ts +10 -0
  24. package/out/interface/common/i-global-config/i-global-img-assets.d.ts.map +1 -0
  25. package/out/interface/common/i-global-config/i-global-img-assets.js +1 -0
  26. package/out/interface/common/i-global-config/index.d.ts +1 -0
  27. package/out/interface/common/i-global-config/index.d.ts.map +1 -1
  28. package/out/interface/common/i-global-config/index.js +1 -0
  29. package/out/interface/common/index.d.ts +1 -1
  30. package/out/interface/common/index.d.ts.map +1 -1
  31. package/out/locale/en/index.d.ts +1 -3
  32. package/out/locale/en/index.d.ts.map +1 -1
  33. package/out/locale/en/index.js +1 -3
  34. package/out/locale/zh-CN/index.d.ts +1 -3
  35. package/out/locale/zh-CN/index.d.ts.map +1 -1
  36. package/out/locale/zh-CN/index.js +1 -3
  37. package/out/register/custom-register.d.ts.map +1 -1
  38. package/out/register/custom-register.js +5 -0
  39. package/out/register/helper/app-menu-item-register.d.ts.map +1 -1
  40. package/out/register/helper/app-menu-item-register.js +14 -11
  41. package/out/utils/theme-util/theme-util.d.ts +9 -1
  42. package/out/utils/theme-util/theme-util.d.ts.map +1 -1
  43. package/out/utils/theme-util/theme-util.js +38 -12
  44. package/package.json +2 -2
  45. package/src/app-hub.ts +28 -0
  46. package/src/application.ts +0 -23
  47. package/src/config/global-config.ts +22 -0
  48. package/src/interface/api/app/i-api-app-hub-service.ts +8 -0
  49. package/src/interface/api/common/global-config/i-api-global-common-config.ts +9 -0
  50. package/src/interface/api/common/global-config/i-api-global-config.ts +8 -0
  51. package/src/interface/api/common/global-config/i-api-global-img-assets.ts +102 -0
  52. package/src/interface/api/common/global-config/index.ts +1 -0
  53. package/src/interface/common/i-global-config/i-global-img-assets.ts +9 -0
  54. package/src/interface/common/i-global-config/index.ts +1 -0
  55. package/src/interface/common/index.ts +1 -0
  56. package/src/locale/en/index.ts +2 -4
  57. package/src/locale/zh-CN/index.ts +1 -3
  58. package/src/register/custom-register.ts +5 -0
  59. package/src/register/helper/app-menu-item-register.ts +15 -15
  60. package/src/utils/theme-util/theme-util.ts +39 -12
@@ -37,11 +37,19 @@ export declare class ThemeUtil implements IApiThemeUtil {
37
37
  /**
38
38
  * @description 加载主题插件
39
39
  * @param {IAppUITheme} theme
40
- * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题
40
+ * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题,颜色主题包含远程插件和主题变量共存的情况,主题变量的优先级大于远程插件的优先级
41
41
  * @returns {*} {Promise<void>}
42
42
  * @memberof ThemeUtil
43
43
  */
44
44
  loadTheme(theme: IAppUITheme, type?: 'COLOR' | 'ICON'): Promise<void>;
45
+ /**
46
+ * @description 设置主题变量
47
+ * @protected
48
+ * @param {IAppUITheme} theme
49
+ * @returns {*} {void}
50
+ * @memberof ThemeUtil
51
+ */
52
+ protected setThemeCssStyle(theme: IAppUITheme): void;
45
53
  /**
46
54
  * @description 设置额外修改的主题参数
47
55
  * @protected
@@ -1 +1 @@
1
- {"version":3,"file":"theme-util.d.ts","sourceRoot":"","sources":["../../../src/utils/theme-util/theme-util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,aAAa;IAC7C;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,WAAW,CAA4C;IAEvE;;;;;OAKG;IACH,SAAS,CAAC,UAAU,EAAE,eAAe,CAAyB;IAE9D;;;OAGG;IACH,QAAQ,CAAC,GAAG,yBAAgC;IAE5C;;;;OAIG;IACI,WAAW,EAAE,WAAW,EAAE,CAAM;IAEvC;;;;;;OAMG;IACG,SAAS,CACb,KAAK,EAAE,WAAW,EAClB,IAAI,GAAE,OAAO,GAAG,MAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC;IAoBhB;;;;;;;OAOG;IACH,SAAS,CAAC,cAAc,CACtB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,IAAI;IAoBP;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ3B;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IA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C,KAAK,CAAC;IAKjB;;;;;OAKG;IACG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D;;;;;;OAMG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC;IAI1E;;;;;;;OAOG;IACG,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,KAAK,CAAC;IAKjB;;;;;;OAMG;IACG,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9B;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;CAGrE"}
@@ -38,7 +38,7 @@ export class ThemeUtil {
38
38
  /**
39
39
  * @description 加载主题插件
40
40
  * @param {IAppUITheme} theme
41
- * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题
41
+ * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题,颜色主题包含远程插件和主题变量共存的情况,主题变量的优先级大于远程插件的优先级
42
42
  * @returns {*} {Promise<void>}
43
43
  * @memberof ThemeUtil
44
44
  */
@@ -47,21 +47,47 @@ export class ThemeUtil {
47
47
  const path = data['theme-package-path'] || theme.themeUrl;
48
48
  delete data.appId;
49
49
  delete data['theme-package-path'];
50
- await ibiz.plugin.loadPlugin({
51
- runtimeObject: true,
52
- rtobjectName: theme.themeTag,
53
- rtobjectRepo: path,
54
- });
50
+ // 远程主题插件
51
+ if (path) {
52
+ await ibiz.plugin.loadPlugin({
53
+ runtimeObject: true,
54
+ rtobjectName: theme.themeTag,
55
+ rtobjectRepo: path,
56
+ });
57
+ }
55
58
  if (type === 'COLOR') {
56
59
  this.setThemeParams(theme, data);
60
+ // 内置样式变量主题
61
+ if (theme.cssStyle) {
62
+ this.setThemeCssStyle(theme);
63
+ }
57
64
  this.setTheme(theme.themeTag);
58
- // 只计算颜色主题插件
59
65
  this.pluginTheme.push(theme);
60
66
  }
61
67
  else {
62
68
  this.html.classList.add(theme.themeTag);
63
69
  }
64
70
  }
71
+ /**
72
+ * @description 设置主题变量
73
+ * @protected
74
+ * @param {IAppUITheme} theme
75
+ * @returns {*} {void}
76
+ * @memberof ThemeUtil
77
+ */
78
+ setThemeCssStyle(theme) {
79
+ // 加上 var-css 后缀,避免与 setThemeParams 生成的主题参数 style 标签 id 冲突
80
+ const styleId = `${theme.themeTag}-var-css`;
81
+ const themeStyle = document.getElementById(styleId);
82
+ if (themeStyle) {
83
+ return;
84
+ }
85
+ const style = document.createElement('style');
86
+ style.id = styleId;
87
+ style.type = 'text/css';
88
+ style.innerHTML = theme.cssStyle;
89
+ document.head.appendChild(style);
90
+ }
65
91
  /**
66
92
  * @description 设置额外修改的主题参数
67
93
  * @protected
@@ -83,11 +109,11 @@ export class ThemeUtil {
83
109
  }
84
110
  }
85
111
  content += '}';
86
- const script = document.createElement('style');
87
- script.id = theme.themeTag;
88
- script.type = 'text/css';
89
- script.innerHTML = content;
90
- document.head.appendChild(script);
112
+ const style = document.createElement('style');
113
+ style.id = theme.themeTag;
114
+ style.type = 'text/css';
115
+ style.innerHTML = content;
116
+ document.head.appendChild(style);
91
117
  }
92
118
  /**
93
119
  * @description 设置主题
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.7.41-alpha.126",
3
+ "version": "0.7.41-alpha.128",
4
4
  "description": "运行时逻辑库",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -70,5 +70,5 @@
70
70
  "qx-util": "^0.4.8",
71
71
  "ramda": "^0.29.0"
72
72
  },
73
- "gitHead": "1dc811502125ae2ca520bc1ad303a1a8d5b63b66"
73
+ "gitHead": "88c0bcdd210b21bf5c15ff46cada35d2d211e47c"
74
74
  }
package/src/app-hub.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  IAppCodeList,
6
6
  IAppDataEntity,
7
7
  IAppLan,
8
+ IAppPFPluginRef,
8
9
  IAppView,
9
10
  IApplication,
10
11
  ISubAppRef,
@@ -848,6 +849,29 @@ export class AppHub implements IAppHubService {
848
849
  return targetCodeListMap?.get(id);
849
850
  }
850
851
 
852
+ /**
853
+ * @description 加载扩展插件
854
+ * @public
855
+ * @param {string} appId
856
+ * @returns {*} {Promise<void>}
857
+ * @memberof AppHub
858
+ */
859
+ public async loadExtensionPlugin(appId: string): Promise<void> {
860
+ try {
861
+ await ibiz.plugin.loadPlugin({
862
+ runtimeObject: true,
863
+ rtobjectName: 'ExtensionPlugin',
864
+ rtobjectRepo: `${ibiz.env.baseUrl}/${appId}${ibiz.env.remoteModelUrl}/ext`,
865
+ } as IAppPFPluginRef);
866
+ } catch (error) {
867
+ ibiz.log.warn(
868
+ ibiz.i18n.t('runtime.application.noExtensionPlugin', {
869
+ appId: ibiz.env.appId,
870
+ }),
871
+ );
872
+ }
873
+ }
874
+
851
875
  /**
852
876
  * 新建 hub 应用
853
877
  *
@@ -863,6 +887,10 @@ export class AppHub implements IAppHubService {
863
887
  if (!this.modelLoaderProvider) {
864
888
  throw new RuntimeError(ibiz.i18n.t('runtime.utils.firstregister'));
865
889
  }
890
+ // 加载子应用扩展插件
891
+ if (id !== ibiz.env.appId) {
892
+ await this.loadExtensionPlugin(id);
893
+ }
866
894
  const appModel: IApplication = await this.modelLoaderProvider.getApp(id);
867
895
  const subAppRef: ISubAppRef | undefined =
868
896
  await this.modelLoaderProvider.getSubAppRef(id);
@@ -169,7 +169,6 @@ export class Application implements IAppService {
169
169
  await this.loadAppModelStyle();
170
170
  await this.loadAppLang();
171
171
  await this.loadGlobalAppUtil();
172
- await this.loadExtensionPlugin();
173
172
  await this.loadReplaceDefaultPlugin();
174
173
  }
175
174
 
@@ -237,28 +236,6 @@ export class Application implements IAppService {
237
236
  await ibiz.plugin.loadPlugin(globalAppUtilPlugin as ISysPFPlugin);
238
237
  }
239
238
 
240
- /**
241
- * @description 加载扩展插件
242
- * @protected
243
- * @returns {*} {Promise<void>}
244
- * @memberof Application
245
- */
246
- protected async loadExtensionPlugin(): Promise<void> {
247
- try {
248
- await ibiz.plugin.loadPlugin({
249
- runtimeObject: true,
250
- rtobjectName: 'ExtensionPlugin',
251
- rtobjectRepo: `${ibiz.env.baseUrl}/${this.appId}${ibiz.env.remoteModelUrl}/ext`,
252
- } as IAppPFPluginRef);
253
- } catch (error) {
254
- ibiz.log.warn(
255
- ibiz.i18n.t('runtime.application.noExtensionPlugin', {
256
- appId: this.appId,
257
- }),
258
- );
259
- }
260
- }
261
-
262
239
  /**
263
240
  * @description 加载替换默认插件(仅主应用执行)
264
241
  * @protected
@@ -15,6 +15,7 @@ import {
15
15
  IApiGlobalWaterMarkConfig,
16
16
  IGlobalMobConfig,
17
17
  IGlobalImgCompressConfig,
18
+ IGlobalImgAssets,
18
19
  } from '../interface';
19
20
 
20
21
  /**
@@ -115,6 +116,7 @@ export class GlobalConfig implements IGlobalConfig {
115
116
  mergeAppMenu: 'default',
116
117
  enableAIMinimize: true,
117
118
  aiChatTopicCaptionMode: 'default',
119
+ aiChatTopicCaptionComputedMode: 'question',
118
120
  aiResourceMode: undefined,
119
121
  enableAIAgentChange: true,
120
122
  globalDownloadPrifix: false,
@@ -208,4 +210,24 @@ export class GlobalConfig implements IGlobalConfig {
208
210
  quality: 0,
209
211
  maxWidth: 1280,
210
212
  };
213
+
214
+ /**
215
+ * @description 静态图片资源
216
+ * @type {IGlobalImgAssets}
217
+ * @memberof GlobalConfig
218
+ */
219
+ imageAssets: IGlobalImgAssets = {
220
+ noPermission: `${ibiz.env.assetsUrl}/images/403.png`,
221
+ noFind: `${ibiz.env.assetsUrl}/images/404.png`,
222
+ loginAvatar: `${ibiz.env.assetsUrl}/images/login-avatar.png`,
223
+ loginHeader: `${ibiz.env.assetsUrl}/images/login-header.png`,
224
+ poiMarker: `${ibiz.env.assetsUrl}/images/poi-marker-default.png`,
225
+ userAvatar: `${ibiz.env.assetsUrl}/images/user-avatar.png`,
226
+ chat: `${ibiz.env.assetsUrl}/images/svg/chat.svg`,
227
+ customWorkbench: `${ibiz.env.assetsUrl}/images/svg/custom-workbench.svg`,
228
+ helper: `${ibiz.env.assetsUrl}/images/svg/helper.svg`,
229
+ iconImport: `${ibiz.env.assetsUrl}/images/svg/icon-import.svg`,
230
+ message: `${ibiz.env.assetsUrl}/images/svg/message.svg`,
231
+ setting: `${ibiz.env.assetsUrl}/images/svg/setting.svg`,
232
+ };
211
233
  }
@@ -101,6 +101,14 @@ export interface IApiAppHubService {
101
101
  context: IApiContext,
102
102
  ): Promise<IApiAppDEService>;
103
103
 
104
+ /**
105
+ * @description 加载指定应用扩展插件
106
+ * @param {string} appId 应用标识
107
+ * @returns {*} {Promise<void>}
108
+ * @memberof IApiAppHubService
109
+ */
110
+ loadExtensionPlugin(appId: string): Promise<void>;
111
+
104
112
  /**
105
113
  * @description 重置清空应用中心
106
114
  * @memberof IApiAppHubService
@@ -114,6 +114,15 @@ export interface IApiGlobalCommonConfig {
114
114
  */
115
115
  aiChatTopicCaptionMode: 'default' | 'snippet' | 'summary';
116
116
 
117
+ /**
118
+ * @description AI聊天话题标题计算模式
119
+ * @type {('history' | 'question' | 'none')} history:如果获取到的history内容中包含user信息,则取最后一条user信息截取用作标题;question:默认值,等待用户输入第一个user消息后截取作为标题;none:不进行计算,由外部传入标题决定
120
+ * @default question
121
+ * @platform web
122
+ * @memberof IApiGlobalCommonConfig
123
+ */
124
+ aiChatTopicCaptionComputedMode: 'history' | 'question' | 'none';
125
+
117
126
  /**
118
127
  * @description AI资源模式,LOCAL:默认值,会话基于config存储、消息内容均存储客户端; REMOTE:远程,会话基于config和远程session存储、消息内容基于远程消息存储
119
128
  * @type {'LOCAL' | 'REMOTE'}
@@ -13,6 +13,7 @@ import { IApiGlobalFlowDrtabConfig } from './i-api-global-flow-drtab-config';
13
13
  import { IApiGlobalWaterMarkConfig } from './i-api-global-water-mark-config';
14
14
  import { IApiGlobalMobConfig } from './i-api-global-mob-config';
15
15
  import { IApiGlobalImgCompressConfig } from './i-api-global-img-compress-config';
16
+ import { IApiGlobalImgAssets } from './i-api-global-img-assets';
16
17
 
17
18
  /**
18
19
  * 全局配置
@@ -178,4 +179,11 @@ export interface IApiGlobalConfig {
178
179
  * @memberof IApiGlobalConfig
179
180
  */
180
181
  imgCompressConfig: IApiGlobalImgCompressConfig;
182
+
183
+ /**
184
+ * @description 图片静态资源
185
+ * @type {IApiGlobalImgAssets}
186
+ * @memberof IApiGlobalConfig
187
+ */
188
+ imageAssets: IApiGlobalImgAssets;
181
189
  }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @description 静态图片资源
3
+ * @export
4
+ * @interface IApiGlobalImgAssets
5
+ */
6
+ export interface IApiGlobalImgAssets {
7
+ /**
8
+ * @description 无权限403图片
9
+ * @type {string}
10
+ * @platform web
11
+ * @memberof IApiGlobalImgAssets
12
+ */
13
+ noPermission: string;
14
+
15
+ /**
16
+ * @description 未找到404图片
17
+ * @type {string}
18
+ * @platform web
19
+ * @memberof IApiGlobalImgAssets
20
+ */
21
+ noFind: string;
22
+
23
+ /**
24
+ * @description 登录页头像图片
25
+ * @type {string}
26
+ * @platform web
27
+ * @memberof IApiGlobalImgAssets
28
+ */
29
+ loginAvatar: string;
30
+
31
+ /**
32
+ * @description 登录页头部背景图
33
+ * @type {string}
34
+ * @platform web
35
+ * @memberof IApiGlobalImgAssets
36
+ */
37
+ loginHeader: string;
38
+
39
+ /**
40
+ * @description 地图位置标记图标
41
+ * @type {string}
42
+ * @platform web
43
+ * @memberof IApiGlobalImgAssets
44
+ */
45
+ poiMarker: string;
46
+
47
+ /**
48
+ * @description 用户头像图片
49
+ * @type {string}
50
+ * @platform web
51
+ * @memberof IApiGlobalImgAssets
52
+ */
53
+ userAvatar: string;
54
+
55
+ /**
56
+ * @description ai对话框按钮图标
57
+ * @type {string}
58
+ * @platform web
59
+ * @memberof IApiGlobalImgAssets
60
+ */
61
+ chat: string;
62
+
63
+ /**
64
+ * @description 自定义用户行为图标
65
+ * @type {string}
66
+ * @platform web
67
+ * @memberof IApiGlobalImgAssets
68
+ */
69
+ customWorkbench: string;
70
+
71
+ /**
72
+ * @description 帮助用户行为图标
73
+ * @type {string}
74
+ * @platform web
75
+ * @memberof IApiGlobalImgAssets
76
+ */
77
+ helper: string;
78
+
79
+ /**
80
+ * @description 数据导入图标
81
+ * @type {string}
82
+ * @platform web
83
+ * @memberof IApiGlobalImgAssets
84
+ */
85
+ iconImport: string;
86
+
87
+ /**
88
+ * @description 用户消息图标
89
+ * @type {string}
90
+ * @platform web
91
+ * @memberof IApiGlobalImgAssets
92
+ */
93
+ message: string;
94
+
95
+ /**
96
+ * @description 用户设置图标
97
+ * @type {string}
98
+ * @platform web
99
+ * @memberof IApiGlobalImgAssets
100
+ */
101
+ setting: string;
102
+ }
@@ -14,3 +14,4 @@ export type { IApiGlobalFlowDrtabConfig } from './i-api-global-flow-drtab-config
14
14
  export type { IApiGlobalWaterMarkConfig } from './i-api-global-water-mark-config';
15
15
  export type { IApiGlobalMobConfig } from './i-api-global-mob-config';
16
16
  export type { IApiGlobalImgCompressConfig } from './i-api-global-img-compress-config';
17
+ export type { IApiGlobalImgAssets } from './i-api-global-img-assets';
@@ -0,0 +1,9 @@
1
+ import { IApiGlobalImgAssets } from '../../api';
2
+
3
+ /**
4
+ * @description 静态图片资源
5
+ * @export
6
+ * @interface IGlobalImgAssets
7
+ * @extends {IApiGlobalImgAssets}
8
+ */
9
+ export interface IGlobalImgAssets extends IApiGlobalImgAssets {}
@@ -12,3 +12,4 @@ export * from './i-global-common-config';
12
12
  export * from './i-global-flow-drtab-config';
13
13
  export * from './i-global-mob-config';
14
14
  export * from './i-global-img-cpmpress-config';
15
+ export * from './i-global-img-assets';
@@ -29,6 +29,7 @@ export type {
29
29
  IGlobalFlowDrtabConfig,
30
30
  IGlobalMobConfig,
31
31
  IGlobalImgCompressConfig,
32
+ IGlobalImgAssets,
32
33
  } from './i-global-config';
33
34
  export type { IDataAbilityParams } from './i-data-ability-params/i-data-ability-params';
34
35
  export type { IAppConfigService } from './i-app-config-service/i-app-config-service';
@@ -444,13 +444,11 @@ export const en = {
444
444
  noImplementedRouting:
445
445
  'Getting view routing parameter variables is not implemented',
446
446
  },
447
- application: {
448
- noExtensionPlugin:
449
- 'Attempted to load application [{appId}] extension plugin, but no extension plugin was found',
450
- },
451
447
  hub: {
452
448
  failedParse: 'View parameter {paramsName} failed to parse: {error}',
453
449
  noExist: 'View [{id}] does not exist',
450
+ noExtensionPlugin:
451
+ 'Attempted to load application [{appId}] extension plugin, but no extension plugin was found',
454
452
  },
455
453
  logicScheduler: {
456
454
  executor: {
@@ -371,12 +371,10 @@ export const zhCn = {
371
371
  global: {
372
372
  noImplemented: '获取应用全局变量没有实现',
373
373
  },
374
- application: {
375
- noExtensionPlugin: '尝试加载应用[{appId}]扩展插件,暂未找到扩展插件',
376
- },
377
374
  hub: {
378
375
  failedParse: '视图参数 {paramsName} 解析失败:{error}',
379
376
  noExist: '视图[{id}]不存在',
377
+ noExtensionPlugin: '尝试加载应用[{appId}]扩展插件,暂未找到扩展插件',
380
378
  },
381
379
  logicScheduler: {
382
380
  executor: {
@@ -32,6 +32,11 @@ export class CustomRegister {
32
32
  * @memberof CustomRegister
33
33
  */
34
34
  static getRegisterKey(registerType: string, opts: IRegisterParams): string {
35
+ // 如果自定义扩展标记,则直接返回
36
+ const { mainModel } = opts;
37
+ if (mainModel && (mainModel as IData).customExtTag) {
38
+ return (mainModel as IData).customExtTag;
39
+ }
35
40
  switch (registerType) {
36
41
  case VIEW_PROVIDER_PREFIX:
37
42
  return this.calcExtensionViewKey(opts);
@@ -1,7 +1,7 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  import { IAppMenu, IAppMenuItem } from '@ibiz/model-core';
2
3
  import { getPluginRegisterKey } from './common-register';
3
4
  import { IAppMenuItemProvider } from '../../interface';
4
- import { CustomRegister } from '../custom-register';
5
5
 
6
6
  /** 应用菜单项适配器前缀 */
7
7
  export const APPMENUITEM_PROVIDER_PREFIX = 'APPMENUITEM';
@@ -45,20 +45,20 @@ export async function getAppMenuItemProvider(
45
45
  const { sysPFPluginId, appId, itemType } = model as Required<IAppMenuItem>;
46
46
 
47
47
  // 找自定义注册的适配器
48
- const registerKey = CustomRegister.getRegisterKey(
49
- APPMENUITEM_PROVIDER_PREFIX,
50
- {
51
- mainModel: model,
52
- control,
53
- },
54
- );
55
- provider = getProvider(registerKey);
56
- if (provider) return provider;
57
- ibiz.log.debug(
58
- ibiz.i18n.t('runtime.register.helper.menuItemCustomRegistration', {
59
- registerKey,
60
- }),
61
- );
48
+ // const registerKey = CustomRegister.getRegisterKey(
49
+ // APPMENUITEM_PROVIDER_PREFIX,
50
+ // {
51
+ // mainModel: model,
52
+ // control,
53
+ // },
54
+ // );
55
+ // provider = getProvider(registerKey);
56
+ // if (provider) return provider;
57
+ // ibiz.log.debug(
58
+ // ibiz.i18n.t('runtime.register.helper.menuItemCustomRegistration', {
59
+ // registerKey,
60
+ // }),
61
+ // );
62
62
 
63
63
  // 找插件适配器
64
64
  if (sysPFPluginId) {
@@ -44,7 +44,7 @@ export class ThemeUtil implements IApiThemeUtil {
44
44
  /**
45
45
  * @description 加载主题插件
46
46
  * @param {IAppUITheme} theme
47
- * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题
47
+ * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题,颜色主题包含远程插件和主题变量共存的情况,主题变量的优先级大于远程插件的优先级
48
48
  * @returns {*} {Promise<void>}
49
49
  * @memberof ThemeUtil
50
50
  */
@@ -56,21 +56,48 @@ export class ThemeUtil implements IApiThemeUtil {
56
56
  const path = data['theme-package-path'] || theme.themeUrl;
57
57
  delete data.appId;
58
58
  delete data['theme-package-path'];
59
- await ibiz.plugin.loadPlugin({
60
- runtimeObject: true,
61
- rtobjectName: theme.themeTag!,
62
- rtobjectRepo: path,
63
- } as unknown as ISysPFPlugin);
59
+ // 远程主题插件
60
+ if (path) {
61
+ await ibiz.plugin.loadPlugin({
62
+ runtimeObject: true,
63
+ rtobjectName: theme.themeTag!,
64
+ rtobjectRepo: path,
65
+ } as unknown as ISysPFPlugin);
66
+ }
64
67
  if (type === 'COLOR') {
65
68
  this.setThemeParams(theme, data);
69
+ // 内置样式变量主题
70
+ if (theme.cssStyle) {
71
+ this.setThemeCssStyle(theme);
72
+ }
66
73
  this.setTheme(theme.themeTag!);
67
- // 只计算颜色主题插件
68
74
  this.pluginTheme.push(theme);
69
75
  } else {
70
76
  this.html.classList.add(theme.themeTag!);
71
77
  }
72
78
  }
73
79
 
80
+ /**
81
+ * @description 设置主题变量
82
+ * @protected
83
+ * @param {IAppUITheme} theme
84
+ * @returns {*} {void}
85
+ * @memberof ThemeUtil
86
+ */
87
+ protected setThemeCssStyle(theme: IAppUITheme): void {
88
+ // 加上 var-css 后缀,避免与 setThemeParams 生成的主题参数 style 标签 id 冲突
89
+ const styleId = `${theme.themeTag}-var-css`;
90
+ const themeStyle = document.getElementById(styleId);
91
+ if (themeStyle) {
92
+ return;
93
+ }
94
+ const style = document.createElement('style');
95
+ style.id = styleId;
96
+ style.type = 'text/css';
97
+ style.innerHTML = theme.cssStyle!;
98
+ document.head.appendChild(style);
99
+ }
100
+
74
101
  /**
75
102
  * @description 设置额外修改的主题参数
76
103
  * @protected
@@ -95,11 +122,11 @@ export class ThemeUtil implements IApiThemeUtil {
95
122
  }
96
123
  }
97
124
  content += '}';
98
- const script = document.createElement('style');
99
- script.id = theme.themeTag!;
100
- script.type = 'text/css';
101
- script.innerHTML = content;
102
- document.head.appendChild(script);
125
+ const style = document.createElement('style');
126
+ style.id = theme.themeTag!;
127
+ style.type = 'text/css';
128
+ style.innerHTML = content;
129
+ document.head.appendChild(style);
103
130
  }
104
131
 
105
132
  /**