@oinone/kunlun-vue-admin-base 6.2.11 → 6.2.12

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.
@@ -8,31 +8,31 @@ export interface LayoutRegisterOptions extends SPIOptions {
8
8
  /**
9
9
  * 视图类型
10
10
  */
11
- viewType: ViewType;
11
+ viewType: ViewType | ViewType[];
12
12
  /**
13
- * 视图模型所在模块编码,一般是驼峰风格的英文 designerCommon
13
+ * 视图模型所在模块编码,一般是下划线风格的英文 designer_common
14
14
  */
15
- module?: string;
15
+ module?: string | string[];
16
16
  /**
17
- * 视图模型所在模块名称,一般是下划线风格的英文 designer_common
17
+ * 视图模型所在模块名称,一般是驼峰风格的英文 designerCommon
18
18
  */
19
- moduleName?: string;
19
+ moduleName?: string | string[];
20
20
  /**
21
- * 布局名称,对应viewActionQuery.load.resView.baseLayoutName
21
+ * 布局名称,对应 viewActionQuery.load.resView.baseLayoutName
22
22
  */
23
- layoutName?: string;
23
+ layoutName?: string | string[];
24
24
  /**
25
25
  * 视图的模型编码
26
26
  */
27
- model?: string;
27
+ model?: string | string[];
28
28
  /**
29
29
  * 视图的模型名称
30
30
  */
31
- modelName?: string;
31
+ modelName?: string | string[];
32
32
  /**
33
33
  * 视图的名称
34
34
  */
35
- viewName?: string;
35
+ viewName?: string | string[];
36
36
  /**
37
37
  * 是否为内嵌视图(子视图特有),表单页内有个o2m的子表格,该表格的inline为true
38
38
  */
@@ -40,23 +40,23 @@ export interface LayoutRegisterOptions extends SPIOptions {
40
40
  /**
41
41
  * 模型字段类型(子视图特有)
42
42
  */
43
- ttype?: ModelFieldType;
43
+ ttype?: ModelFieldType | ModelFieldType[];
44
44
  /**
45
45
  * 关联模型字段类型(子视图特有)
46
46
  */
47
- relatedTtype?: ModelFieldType;
47
+ relatedTtype?: ModelFieldType | ModelFieldType[];
48
48
  /**
49
49
  * 字段(子视图特有)
50
50
  */
51
- field?: string;
51
+ field?: string | string[];
52
52
  /**
53
53
  * 动作名称
54
54
  */
55
- actionName?: string;
55
+ actionName?: string | string[];
56
56
  /**
57
57
  * 动作使用的组件名称
58
58
  */
59
- actionWidget?: string;
59
+ actionWidget?: string | string[];
60
60
  }
61
61
  export declare class LayoutManager {
62
62
  private static Token;
@@ -64,6 +64,9 @@ export declare class LayoutManager {
64
64
  static register(options: LayoutRegisterOptions, template: string): boolean;
65
65
  static selector(options: LayoutRegisterOptions): DslDefinition | undefined;
66
66
  }
67
+ /**
68
+ * @deprecated please use {@link LayoutRegisterOptions}
69
+ */
67
70
  export declare type ILayoutOption = LayoutRegisterOptions;
68
- export declare function registerLayout(layoutTpl: string, layoutOption: ILayoutOption): boolean;
69
- export declare function generatorLayout(layoutOption: ILayoutOption): DslDefinition | undefined;
71
+ export declare function registerLayout(layoutTpl: string, layoutOption: LayoutRegisterOptions): boolean;
72
+ export declare function generatorLayout(layoutOption: LayoutRegisterOptions): DslDefinition | undefined;
@@ -1,8 +1,33 @@
1
+ import { ViewType } from '@oinone/kunlun-meta';
1
2
  import { SPIOptions } from '@oinone/kunlun-spi';
2
3
  export interface MaskRegisterOptions extends SPIOptions {
3
- module?: string;
4
- moduleName?: string;
5
- model?: string;
4
+ /**
5
+ * 视图类型
6
+ */
7
+ viewType?: ViewType | ViewType[];
8
+ /**
9
+ * 模块编码
10
+ */
11
+ module?: string | string[];
12
+ /**
13
+ * 模块名称
14
+ */
15
+ moduleName?: string | string[];
16
+ /**
17
+ * 模型编码
18
+ */
19
+ model?: string | string[];
20
+ /**
21
+ * 模型名称
22
+ */
23
+ modelName?: string | string[];
24
+ /**
25
+ * 视图名称
26
+ */
27
+ viewName?: string | string[];
28
+ /**
29
+ * 动作名称
30
+ */
6
31
  actionName?: string | string[];
7
32
  }
8
33
  export declare class MaskManager {
@@ -11,6 +36,9 @@ export declare class MaskManager {
11
36
  static register(options: MaskRegisterOptions, template: string): boolean;
12
37
  static selector(options: MaskRegisterOptions): string | undefined;
13
38
  }
39
+ /**
40
+ * @deprecated please use {@link MaskRegisterOptions}
41
+ */
14
42
  export declare type IMaskOption = MaskRegisterOptions;
15
- export declare function registerMask(maskTpl: string, maskOption?: IMaskOption): boolean;
16
- export declare function generatorMask(maskOption?: IMaskOption): string | undefined;
43
+ export declare function registerMask(maskTpl: string, maskOption?: MaskRegisterOptions): boolean;
44
+ export declare function generatorMask(maskOption?: MaskRegisterOptions): string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { DslDefinition } from '@oinone/kunlun-dsl';
2
2
  import { RuntimeContext, RuntimeContextService, RuntimeModelField, RuntimeView, RuntimeViewAction } from '@oinone/kunlun-engine';
3
+ export declare function seekViewMask(viewAction: RuntimeViewAction, moduleName?: string): DslDefinition;
3
4
  export declare function createRuntimeContextByViewAction(viewAction: RuntimeViewAction, inline: boolean, nodeHandle?: string, rootHandle?: string): RuntimeContext | undefined;
4
5
  export declare function createRuntimeContextByView(view: RuntimeView, inline: boolean, nodeHandle?: string, rootHandle?: string): RuntimeContext;
5
6
  export declare function createRuntimeContextByFieldSubview(view: RuntimeView, field: RuntimeModelField, inline: boolean, nodeHandle?: string, rootHandle?: string): RuntimeContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oinone/kunlun-vue-admin-base",
3
- "version": "6.2.11",
3
+ "version": "6.2.12",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf dist",
@@ -14,13 +14,13 @@
14
14
  "doc": "typedoc --out docs src/index.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@oinone/kunlun-vue-admin-layout": "6.2.11",
18
- "@oinone/kunlun-vue-router": "6.2.11",
19
- "@oinone/kunlun-vue-ui": "6.2.11",
20
- "@oinone/kunlun-vue-ui-antd": "6.2.11",
21
- "@oinone/kunlun-vue-ui-common": "6.2.11",
22
- "@oinone/kunlun-vue-ui-el": "6.2.11",
23
- "@oinone/kunlun-vue-widget": "6.2.11",
17
+ "@oinone/kunlun-vue-admin-layout": "6.2.12",
18
+ "@oinone/kunlun-vue-router": "6.2.12",
19
+ "@oinone/kunlun-vue-ui": "6.2.12",
20
+ "@oinone/kunlun-vue-ui-antd": "6.2.12",
21
+ "@oinone/kunlun-vue-ui-common": "6.2.12",
22
+ "@oinone/kunlun-vue-ui-el": "6.2.12",
23
+ "@oinone/kunlun-vue-widget": "6.2.12",
24
24
  "@wangeditor/editor": "5.1.23",
25
25
  "@wangeditor/editor-for-vue": "5.1.11",
26
26
  "@wangeditor/plugin-upload-attachment": "1.1.0",
@@ -1,4 +1,11 @@
1
- import { parseConfigs, RelationUpdateType, ROOT_HANDLE, SubmitType, SubmitValue } from '@oinone/kunlun-engine';
1
+ import {
2
+ ExperimentalConfigManager,
3
+ parseConfigs,
4
+ RelationUpdateType,
5
+ ROOT_HANDLE,
6
+ SubmitType,
7
+ SubmitValue
8
+ } from '@oinone/kunlun-engine';
2
9
  import { LifeCycleHeart, LifeCycleTypes } from '@oinone/kunlun-event';
3
10
  import { ViewMode } from '@oinone/kunlun-meta';
4
11
  import { Router } from '@oinone/kunlun-router';
@@ -228,7 +235,9 @@ export abstract class BaseElementViewWidget<
228
235
  mainViewFilter
229
236
  );
230
237
  this.setViewFilter?.(internalFilter);
231
- this.internalDomain = RSQLHelper.concatByAnd(this.viewAction?.domain, this.getDsl().domain as string | undefined);
238
+ if (!ExperimentalConfigManager.baseElementViewWidgetNext()) {
239
+ this.internalDomain = RSQLHelper.concatByAnd(this.viewAction?.domain, this.getDsl().domain as string | undefined);
240
+ }
232
241
  }
233
242
 
234
243
  protected refreshConditionContext(): Record<string, unknown> | undefined {
@@ -1,4 +1,4 @@
1
- import { DslDefinition, XMLParse } from '@oinone/kunlun-dsl';
1
+ import { DslDefinition } from '@oinone/kunlun-dsl';
2
2
  import {
3
3
  $systemMajorConfig,
4
4
  CurrentLanguage,
@@ -22,21 +22,20 @@ import {
22
22
  import { ViewActionTarget } from '@oinone/kunlun-meta';
23
23
  import { isNotPermission, setSessionPath, useSessionPath } from '@oinone/kunlun-request';
24
24
  import { useMatched } from '@oinone/kunlun-router';
25
- import { CallChaining, debugConsole } from '@oinone/kunlun-shared';
25
+ import { CallChaining } from '@oinone/kunlun-shared';
26
26
  import { distinctUntilChanged, Subscription } from '@oinone/kunlun-state';
27
27
  import { DEFAULT_PREFIX } from '@oinone/kunlun-theme';
28
28
 
29
29
  import {
30
30
  emptyHomepageModelName,
31
- getDefaultMaskTemplate,
32
31
  getUnauthorizedAction,
33
- maskTemplateEdit,
34
32
  MenuService,
35
33
  ModuleService,
36
34
  replaceStanderMainView,
37
35
  RuntimeMenu,
38
36
  TopBarService,
39
- unauthorizedActionName, urlHomepageModelName
37
+ unauthorizedActionName,
38
+ urlHomepageModelName
40
39
  } from '@oinone/kunlun-vue-admin-layout';
41
40
  import { OioNotification } from '@oinone/kunlun-vue-ui-antd';
42
41
  import { ZH_CN_CODE } from '@oinone/kunlun-vue-ui-common';
@@ -44,7 +43,7 @@ import { Widget } from '@oinone/kunlun-vue-widget';
44
43
  import { nextTick, VNode } from 'vue';
45
44
  import { MetadataViewWidget } from '../basic';
46
45
  import { TeleportWidget } from '../components/teleport';
47
- import { MaskManager } from '../spi';
46
+ import { seekViewMask } from '../tags';
48
47
  import { TranslateBox } from '../view/translate';
49
48
  import DefaultMetadataMainView from './DefaultMetadataMainView.vue';
50
49
  import { MetadataMainViewLifecycle } from './lifecycle';
@@ -355,24 +354,8 @@ export class DefaultMetadataMainViewWidget extends MetadataViewWidget {
355
354
  newPage: ViewActionQueryParameter
356
355
  ): Promise<void> {
357
356
  const { module: moduleName, model, action } = newPage;
358
- let maskTemplate: string = MaskManager.selector({
359
- module: viewAction.moduleDefinition?.module || viewAction.resModuleDefinition?.module,
360
- moduleName: viewAction.moduleDefinition?.name || viewAction.resModuleDefinition?.name || moduleName,
361
- model,
362
- actionName: action
363
- })!;
364
- if (!maskTemplate) {
365
- maskTemplate = viewAction.resMaskDefinition?.template as string;
366
- if (maskTemplate) {
367
- debugConsole.log('使用后端mask', maskTemplate);
368
- }
369
- }
370
- let finalMaskTemplate: DslDefinition;
371
- if (maskTemplate) {
372
- finalMaskTemplate = maskTemplateEdit({ isDefault: false }, XMLParse.INSTANCE.parse(maskTemplate));
373
- } else {
374
- finalMaskTemplate = getDefaultMaskTemplate();
375
- }
357
+
358
+ let finalMaskTemplate: DslDefinition = seekViewMask(viewAction, moduleName);
376
359
 
377
360
  /**
378
361
  * 当前用户没有该视图没有权限
@@ -11,31 +11,31 @@ export interface LayoutRegisterOptions extends SPIOptions {
11
11
  /**
12
12
  * 视图类型
13
13
  */
14
- viewType: ViewType;
14
+ viewType: ViewType | ViewType[];
15
15
  /**
16
- * 视图模型所在模块编码,一般是驼峰风格的英文 designerCommon
16
+ * 视图模型所在模块编码,一般是下划线风格的英文 designer_common
17
17
  */
18
- module?: string;
18
+ module?: string | string[];
19
19
  /**
20
- * 视图模型所在模块名称,一般是下划线风格的英文 designer_common
20
+ * 视图模型所在模块名称,一般是驼峰风格的英文 designerCommon
21
21
  */
22
- moduleName?: string;
22
+ moduleName?: string | string[];
23
23
  /**
24
- * 布局名称,对应viewActionQuery.load.resView.baseLayoutName
24
+ * 布局名称,对应 viewActionQuery.load.resView.baseLayoutName
25
25
  */
26
- layoutName?: string;
26
+ layoutName?: string | string[];
27
27
  /**
28
28
  * 视图的模型编码
29
29
  */
30
- model?: string;
30
+ model?: string | string[];
31
31
  /**
32
32
  * 视图的模型名称
33
33
  */
34
- modelName?: string;
34
+ modelName?: string | string[];
35
35
  /**
36
36
  * 视图的名称
37
37
  */
38
- viewName?: string;
38
+ viewName?: string | string[];
39
39
  /**
40
40
  * 是否为内嵌视图(子视图特有),表单页内有个o2m的子表格,该表格的inline为true
41
41
  */
@@ -48,15 +48,15 @@ export interface LayoutRegisterOptions extends SPIOptions {
48
48
  /**
49
49
  * 模型字段类型(子视图特有)
50
50
  */
51
- ttype?: ModelFieldType;
51
+ ttype?: ModelFieldType | ModelFieldType[];
52
52
  /**
53
53
  * 关联模型字段类型(子视图特有)
54
54
  */
55
- relatedTtype?: ModelFieldType;
55
+ relatedTtype?: ModelFieldType | ModelFieldType[];
56
56
  /**
57
57
  * 字段(子视图特有)
58
58
  */
59
- field?: string;
59
+ field?: string | string[];
60
60
 
61
61
  // endregion
62
62
 
@@ -65,11 +65,11 @@ export interface LayoutRegisterOptions extends SPIOptions {
65
65
  /**
66
66
  * 动作名称
67
67
  */
68
- actionName?: string;
68
+ actionName?: string | string[];
69
69
  /**
70
70
  * 动作使用的组件名称
71
71
  */
72
- actionWidget?: string;
72
+ actionWidget?: string | string[];
73
73
 
74
74
  // endregion
75
75
  }
@@ -115,9 +115,12 @@ export class LayoutManager {
115
115
  }
116
116
  }
117
117
 
118
+ /**
119
+ * @deprecated please use {@link LayoutRegisterOptions}
120
+ */
118
121
  export type ILayoutOption = LayoutRegisterOptions;
119
122
 
120
- export function registerLayout(layoutTpl: string, layoutOption: ILayoutOption): boolean {
123
+ export function registerLayout(layoutTpl: string, layoutOption: LayoutRegisterOptions): boolean {
121
124
  if (!layoutOption.viewType) {
122
125
  console.warn('viewType is blank');
123
126
  return false;
@@ -129,6 +132,6 @@ export function registerLayout(layoutTpl: string, layoutOption: ILayoutOption):
129
132
  return LayoutManager.register(layoutOption, layoutTpl);
130
133
  }
131
134
 
132
- export function generatorLayout(layoutOption: ILayoutOption): DslDefinition | undefined {
135
+ export function generatorLayout(layoutOption: LayoutRegisterOptions): DslDefinition | undefined {
133
136
  return LayoutManager.selector(layoutOption);
134
137
  }
@@ -1,13 +1,40 @@
1
+ import { ViewType } from '@oinone/kunlun-meta';
1
2
  import { SPIFactory, SPIOperator, SPIOptions, SPISingleSelector, SPITokenFactory } from '@oinone/kunlun-spi';
2
3
 
3
4
  export interface MaskRegisterOptions extends SPIOptions {
4
- module?: string;
5
- moduleName?: string;
6
- model?: string;
5
+ /**
6
+ * 视图类型
7
+ */
8
+ viewType?: ViewType | ViewType[];
9
+ /**
10
+ * 模块编码
11
+ */
12
+ module?: string | string[];
13
+ /**
14
+ * 模块名称
15
+ */
16
+ moduleName?: string | string[];
17
+ /**
18
+ * 模型编码
19
+ */
20
+ model?: string | string[];
21
+ /**
22
+ * 模型名称
23
+ */
24
+ modelName?: string | string[];
25
+ /**
26
+ * 视图名称
27
+ */
28
+ viewName?: string | string[];
29
+ /**
30
+ * 动作名称
31
+ */
7
32
  actionName?: string | string[];
8
33
  }
9
34
 
10
- @SPIFactory.Storage(['module', 'moduleName', 'model', 'actionName'], { key: Symbol('MaskTpl') })
35
+ @SPIFactory.Storage(['viewType', 'module', 'moduleName', 'model', 'modelName', 'viewName', 'actionName'], {
36
+ key: Symbol('MaskTpl')
37
+ })
11
38
  export class MaskManager {
12
39
  private static Token: SPITokenFactory<MaskRegisterOptions>;
13
40
 
@@ -26,9 +53,12 @@ export class MaskManager {
26
53
  }
27
54
  }
28
55
 
56
+ /**
57
+ * @deprecated please use {@link MaskRegisterOptions}
58
+ */
29
59
  export type IMaskOption = MaskRegisterOptions;
30
60
 
31
- export function registerMask(maskTpl: string, maskOption?: IMaskOption) {
61
+ export function registerMask(maskTpl: string, maskOption?: MaskRegisterOptions) {
32
62
  if (!maskTpl) {
33
63
  console.warn('maskTpl is blank');
34
64
  return false;
@@ -36,6 +66,6 @@ export function registerMask(maskTpl: string, maskOption?: IMaskOption) {
36
66
  return MaskManager.register(maskOption || {}, maskTpl);
37
67
  }
38
68
 
39
- export function generatorMask(maskOption?: IMaskOption): string | undefined {
69
+ export function generatorMask(maskOption?: MaskRegisterOptions): string | undefined {
40
70
  return MaskManager.selector(maskOption || {});
41
71
  }
@@ -19,17 +19,19 @@ import { SPI } from '@oinone/kunlun-spi';
19
19
  import { getDefaultMaskTemplate, maskTemplateEdit } from '@oinone/kunlun-vue-admin-layout';
20
20
  import { isNil, isPlainObject, isString } from 'lodash-es';
21
21
  import { LayoutManager, LayoutRegisterOptions, MaskManager } from '../../spi';
22
- import { useInjectMetaContext } from './context';
23
22
  import { ActiveLayoutEffectOpt } from './active';
23
+ import { useInjectMetaContext } from './context';
24
24
 
25
- function seekViewMask(viewAction: RuntimeViewAction, moduleName?: string): DslDefinition {
26
- let maskTemplate: string =
27
- MaskManager.selector({
28
- module: viewAction.moduleDefinition?.module || viewAction.resModuleDefinition?.module,
29
- moduleName: viewAction.moduleDefinition?.name || viewAction.resModuleDefinition?.name || moduleName,
30
- model: viewAction.model,
31
- actionName: viewAction.name
32
- })!;
25
+ export function seekViewMask(viewAction: RuntimeViewAction, moduleName?: string): DslDefinition {
26
+ let maskTemplate: string | undefined = MaskManager.selector({
27
+ viewType: viewAction.resViewType || viewAction.viewType,
28
+ module: viewAction.moduleDefinition?.module || viewAction.resModuleDefinition?.module,
29
+ moduleName: viewAction.moduleDefinition?.name || viewAction.resModuleDefinition?.name || moduleName,
30
+ model: viewAction.modelDefinition?.model || viewAction.model,
31
+ modelName: viewAction.modelDefinition?.name || viewAction.modelName,
32
+ viewName: viewAction.resViewName || viewAction.viewName,
33
+ actionName: viewAction.name
34
+ });
33
35
  if (!maskTemplate) {
34
36
  maskTemplate = viewAction.resMaskDefinition?.template as string;
35
37
  if (maskTemplate) {