@ibiz-template/full-code-template 0.7.41-rc.1 → 0.7.41-rc.10

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.
@@ -6,7 +6,7 @@ export { IBizViewShell };
6
6
 
7
7
  export default {
8
8
  install(v: App): void {
9
- v.component(IBizViewShell.name, IBizViewShell);
10
- v.component(IBizSpecialView.name, IBizSpecialView);
9
+ v.component(IBizViewShell.name!, IBizViewShell);
10
+ v.component(IBizSpecialView.name!, IBizSpecialView);
11
11
  },
12
12
  };
@@ -1,13 +1,23 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
  /* eslint-disable vue/no-mutating-props */
3
3
  import {
4
+ CTX,
4
5
  EventBase,
5
6
  IModal,
6
7
  IViewProvider,
7
8
  IViewShellHooks,
8
9
  RedrawViewEvent,
9
10
  } from '@ibiz-template/runtime';
10
- import { defineComponent, h, PropType, ref, Component, Ref, watch } from 'vue';
11
+ import {
12
+ defineComponent,
13
+ h,
14
+ PropType,
15
+ ref,
16
+ Component,
17
+ Ref,
18
+ watch,
19
+ provide,
20
+ } from 'vue';
11
21
  import { IAppView } from '@ibiz/model-core';
12
22
  import './view-shell.scss';
13
23
  import { useNamespace } from '@ibiz-template/vue3-util';
@@ -20,6 +30,8 @@ export const IBizViewShell = defineComponent({
20
30
  params: { type: Object as PropType<IParams> },
21
31
  modelData: { type: Object as PropType<IAppView> },
22
32
  viewId: { type: String },
33
+ // 解决打开浮动容器(模态、抽屉、弹出框)ctx丢失问题
34
+ ctx: { type: Object as PropType<CTX> },
23
35
  viewShellHooks: { type: Object as PropType<IViewShellHooks> },
24
36
  },
25
37
  setup(props, { attrs }) {
@@ -29,7 +41,9 @@ export const IBizViewShell = defineComponent({
29
41
  const provider = ref<IViewProvider>();
30
42
  const viewComponent = ref<Component>();
31
43
  const viewModel = ref<IModel>();
32
-
44
+ if (props.ctx) {
45
+ provide('ctx', props.ctx);
46
+ }
33
47
  // 当前视图上下文
34
48
  const context: Ref<IContext> = ref(props.context);
35
49
  // 当前视图参数
@@ -4,6 +4,7 @@ import {
4
4
  IAppBIScheme,
5
5
  IAppCodeList,
6
6
  IAppDataEntity,
7
+ IAppLan,
7
8
  IAppView,
8
9
  IApplication,
9
10
  ISubAppRef,
@@ -23,6 +24,7 @@ import {
23
24
  getAppModel,
24
25
  registerCodeList,
25
26
  } from '@/publish/model';
27
+ import locale from '@/publish/locale';
26
28
  import { mergeUIActions } from './merge-ui-action';
27
29
 
28
30
  /**
@@ -411,7 +413,9 @@ export class ModelLoader implements ModelLoaderProvider {
411
413
  */
412
414
  async getAppDataEntity(appId: string, id: string): Promise<IAppDataEntity> {
413
415
  if (!appId || appId === ibiz.env.appId) {
414
- return getAppDataEntityModel(id);
416
+ const appDataEntity = await getAppDataEntityModel(id);
417
+ this.deepFillSubAppId(appDataEntity, ibiz.env.appId);
418
+ return appDataEntity;
415
419
  }
416
420
  const microAppConfig = ibiz.hub.microAppConfigCenter.getMicroApp(appId);
417
421
  const module = await System.import(
@@ -449,6 +453,16 @@ export class ModelLoader implements ModelLoaderProvider {
449
453
  throw new Error('Method not implemented.');
450
454
  }
451
455
 
456
+ async getPSAppLang(
457
+ language: string,
458
+ appId: string | IObject | undefined,
459
+ ): Promise<IAppLan | null> {
460
+ if ((!appId || appId === ibiz.env.appId) && (locale as IData)[language]) {
461
+ return (locale as IData)[language];
462
+ }
463
+ return null;
464
+ }
465
+
452
466
  async translationModelToDsl(
453
467
  data: IData,
454
468
  type: 'APP' | 'VIEW' | 'CTRL' | 'APPENTITY' | 'APPBIREPORT',
@@ -0,0 +1,6 @@
1
+ /* eslint-disable prettier/prettier */
2
+ {{#each app.appLans as |appLan|}}
3
+ import {{appLan.language}} from './{{spinalCase appLan.language}}';
4
+ {{/each}}
5
+
6
+ export default { {{#each app.appLans as |appLan|}}{{appLan.language}}{{#unless @last}},{{/unless}} {{/each}} };
@@ -0,0 +1,2 @@
1
+ /* eslint-disable prettier/prettier */
2
+ export default {{jsonStringify appLan.DSL 2}}
@@ -3,8 +3,8 @@ export default {
3
3
  codeName: '{{page.codeName}}',
4
4
  openMode: {{#if page.openMode }}'{{page.openMode}}'{{else}}'INDEXVIEWTAB'{{/if}},
5
5
  viewType: '{{page.viewType}}',
6
- width: {{page.width}},
7
- height: {{page.height}},
6
+ width: {{#if page.width }}{{page.width}}{{else}}undefined{{/if}},
7
+ height: {{#if page.height }}{{page.height}}{{else}}undefined{{/if}},
8
8
  appDataEntityId: {{#if page.appEntity }}'{{page.appEntity.DSL.id}}'{{else}}undefined{{/if}},
9
9
  redirectView: {{page.redirectView}},
10
10
  modalOption:{{jsonStringify page.modalOption 2}},