@oinone/kunlun-vue-admin-base 6.2.11 → 6.2.13
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.
- package/dist/oinone-kunlun-vue-admin-base.css +1 -1
- package/dist/oinone-kunlun-vue-admin-base.esm.js +1149 -1086
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/basic/form-item/DefaultFormItem.vue.d.ts +7 -6
- package/dist/types/src/container/collapse/DefaultCollapse.vue.d.ts +6 -0
- package/dist/types/src/container/collapse/DefaultCollapseWidget.d.ts +5 -1
- package/dist/types/src/field/form/float/Plat.vue.d.ts +2 -2
- package/dist/types/src/permission/permission/field/ActionPermissionWidget.d.ts +1 -1
- package/dist/types/src/spi/LayoutManager.d.ts +20 -17
- package/dist/types/src/spi/MaskManager.d.ts +33 -5
- package/dist/types/src/tags/context/runtime-context-helper.d.ts +1 -0
- package/dist/types/src/typing/tree.d.ts +5 -0
- package/dist/types/src/view/tree/AbstractTreeElementWidget.d.ts +2 -0
- package/dist/types/src/view/tree/DefaultTree.vue.d.ts +15 -3
- package/package.json +8 -8
- package/src/basic/element/BaseElementViewWidget.ts +11 -2
- package/src/basic/form-item/DefaultFormItem.vue +1 -1
- package/src/container/collapse/DefaultCollapse.vue +7 -3
- package/src/container/collapse/DefaultCollapseWidget.ts +19 -1
- package/src/main-view/DefaultMetadataMainViewWidget.ts +7 -24
- package/src/permission/permission/field/ActionPermissionWidget.ts +3 -1
- package/src/spi/LayoutManager.ts +20 -17
- package/src/spi/MaskManager.ts +36 -6
- package/src/tags/context/runtime-context-helper.ts +11 -9
- package/src/typing/tree.ts +6 -0
- package/src/util/tree-utils.ts +24 -17
- package/src/view/tree/AbstractTreeElementWidget.ts +15 -1
- package/src/view/tree/DefaultTree.vue +19 -18
- package/src/view/tree/TreeWidget.ts +9 -2
- package/src/view/tree/style/index.scss +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
itemName: {
|
|
3
4
|
type: StringConstructor;
|
|
@@ -17,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
18
|
default: boolean;
|
|
18
19
|
};
|
|
19
20
|
layout: {
|
|
20
|
-
type:
|
|
21
|
+
type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
|
|
21
22
|
};
|
|
22
23
|
label: {
|
|
23
24
|
type: (BooleanConstructor | StringConstructor)[];
|
|
@@ -34,10 +35,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
35
|
default: undefined;
|
|
35
36
|
};
|
|
36
37
|
validateTrigger: {
|
|
37
|
-
type:
|
|
38
|
+
type: PropType<string | string[]>;
|
|
38
39
|
};
|
|
39
40
|
validatorInfo: {
|
|
40
|
-
type:
|
|
41
|
+
type: PropType<import("../../typing").ValidatorInfo>;
|
|
41
42
|
};
|
|
42
43
|
}, {
|
|
43
44
|
required: import("vue").ComputedRef<boolean>;
|
|
@@ -60,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
61
|
default: boolean;
|
|
61
62
|
};
|
|
62
63
|
layout: {
|
|
63
|
-
type:
|
|
64
|
+
type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
|
|
64
65
|
};
|
|
65
66
|
label: {
|
|
66
67
|
type: (BooleanConstructor | StringConstructor)[];
|
|
@@ -77,10 +78,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
77
78
|
default: undefined;
|
|
78
79
|
};
|
|
79
80
|
validateTrigger: {
|
|
80
|
-
type:
|
|
81
|
+
type: PropType<string | string[]>;
|
|
81
82
|
};
|
|
82
83
|
validatorInfo: {
|
|
83
|
-
type:
|
|
84
|
+
type: PropType<import("../../typing").ValidatorInfo>;
|
|
84
85
|
};
|
|
85
86
|
}>>, {
|
|
86
87
|
required: boolean;
|
|
@@ -11,6 +11,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
onActiveKeyChange: {
|
|
12
12
|
type: PropType<(key: string | string[]) => void>;
|
|
13
13
|
};
|
|
14
|
+
setAllKeys: {
|
|
15
|
+
type: PropType<(keys: string[]) => void>;
|
|
16
|
+
};
|
|
14
17
|
type: {
|
|
15
18
|
type: PropType<OioCollapseType | "bordered" | "stripe" | "simple" | "ghost">;
|
|
16
19
|
default: OioCollapseType;
|
|
@@ -59,6 +62,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
62
|
onActiveKeyChange: {
|
|
60
63
|
type: PropType<(key: string | string[]) => void>;
|
|
61
64
|
};
|
|
65
|
+
setAllKeys: {
|
|
66
|
+
type: PropType<(keys: string[]) => void>;
|
|
67
|
+
};
|
|
62
68
|
type: {
|
|
63
69
|
type: PropType<OioCollapseType | "bordered" | "stripe" | "simple" | "ghost">;
|
|
64
70
|
default: OioCollapseType;
|
|
@@ -2,7 +2,9 @@ import { BasePackWidget } from '../../basic';
|
|
|
2
2
|
export declare class DefaultCollapseWidget extends BasePackWidget {
|
|
3
3
|
protected defaultAllInvisible: boolean;
|
|
4
4
|
initialize(props: any): this;
|
|
5
|
-
|
|
5
|
+
protected allKeys: string[] | undefined;
|
|
6
|
+
setAllKeys(keys: string[]): void;
|
|
7
|
+
protected activeKey: string | string[] | undefined;
|
|
6
8
|
getActiveKey(): string | string[] | undefined;
|
|
7
9
|
setActiveKey(key: string | string[] | undefined): void;
|
|
8
10
|
onActiveKeyChange(key: string | string[]): void;
|
|
@@ -12,4 +14,6 @@ export declare class DefaultCollapseWidget extends BasePackWidget {
|
|
|
12
14
|
protected get collapseMethod(): string;
|
|
13
15
|
get accordion(): boolean | undefined;
|
|
14
16
|
protected get expandIconPosition(): any;
|
|
17
|
+
onExpandAll(): void;
|
|
18
|
+
onCollapseAll(): void;
|
|
15
19
|
}
|
|
@@ -47,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
49
|
layout: {
|
|
50
|
-
type: PropType<import("@oinone/kunlun-vue-ui-
|
|
50
|
+
type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
|
|
51
51
|
};
|
|
52
52
|
label: {
|
|
53
53
|
type: (BooleanConstructor | StringConstructor)[];
|
|
@@ -141,7 +141,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
141
141
|
default: boolean;
|
|
142
142
|
};
|
|
143
143
|
layout: {
|
|
144
|
-
type: PropType<import("@oinone/kunlun-vue-ui-
|
|
144
|
+
type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
|
|
145
145
|
};
|
|
146
146
|
label: {
|
|
147
147
|
type: (BooleanConstructor | StringConstructor)[];
|
|
@@ -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
|
-
*
|
|
13
|
+
* 视图模型所在模块编码,一般是下划线风格的英文 designer_common
|
|
14
14
|
*/
|
|
15
|
-
module?: string;
|
|
15
|
+
module?: string | string[];
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
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:
|
|
69
|
-
export declare function generatorLayout(layoutOption:
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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?:
|
|
16
|
-
export declare function generatorMask(maskOption?:
|
|
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;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DslDefinition } from '@oinone/kunlun-dsl';
|
|
1
2
|
import { ActiveRecord, Pagination, RefreshCallChainingParameters } from '@oinone/kunlun-engine';
|
|
2
3
|
import { TreeNode } from '@oinone/kunlun-shared';
|
|
3
4
|
import { Slot } from 'vue';
|
|
@@ -61,6 +62,10 @@ export interface TreeNodeMetadata {
|
|
|
61
62
|
* 行内按钮插槽
|
|
62
63
|
*/
|
|
63
64
|
rowActionsSlot?: Slot;
|
|
65
|
+
/**
|
|
66
|
+
* 当配置了 nodes 节点时,根元数据节点具有该属性
|
|
67
|
+
*/
|
|
68
|
+
nodes?: DslDefinition;
|
|
64
69
|
/**
|
|
65
70
|
* 图标 iconfont/https
|
|
66
71
|
*/
|
|
@@ -26,6 +26,8 @@ export declare abstract class AbstractTreeElementWidget<V extends TreeData = Tre
|
|
|
26
26
|
get checkAll(): boolean | undefined;
|
|
27
27
|
get checkAllLabel(): any;
|
|
28
28
|
get searchRemote(): any;
|
|
29
|
+
get viewModel(): string | undefined;
|
|
30
|
+
get width(): string | undefined;
|
|
29
31
|
initialize(props: any): this;
|
|
30
32
|
protected runtimeInitialed(): void;
|
|
31
33
|
protected generatorRootNode(metadata: TreeNodeMetadata): OioTreeNode<V>;
|
|
@@ -3,13 +3,19 @@ import { ViewType } from '@oinone/kunlun-meta';
|
|
|
3
3
|
import { OioTreeNode } from '@oinone/kunlun-vue-ui-antd';
|
|
4
4
|
import { PropType } from 'vue';
|
|
5
5
|
import { TreeData } from '../../typing';
|
|
6
|
-
declare const
|
|
6
|
+
declare const __default__: import("vue").DefineComponent<{
|
|
7
7
|
viewType: {
|
|
8
8
|
type: PropType<ViewType>;
|
|
9
9
|
};
|
|
10
|
+
viewModel: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
};
|
|
10
13
|
template: {
|
|
11
14
|
type: PropType<DslDefinition>;
|
|
12
15
|
};
|
|
16
|
+
width: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
};
|
|
13
19
|
autoExpandParent: {
|
|
14
20
|
type: BooleanConstructor;
|
|
15
21
|
};
|
|
@@ -139,7 +145,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
139
145
|
};
|
|
140
146
|
}, {
|
|
141
147
|
treeData: import("vue").ComputedRef<OioTreeNode<TreeData>[]>;
|
|
142
|
-
|
|
148
|
+
width: import("vue").ComputedRef<string>;
|
|
143
149
|
internalExpandedKeys: import("vue").Ref<string[]>;
|
|
144
150
|
selectedKeys: import("vue").WritableComputedRef<string[]>;
|
|
145
151
|
expandedKeys: import("vue").WritableComputedRef<string[]>;
|
|
@@ -161,9 +167,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
161
167
|
viewType: {
|
|
162
168
|
type: PropType<ViewType>;
|
|
163
169
|
};
|
|
170
|
+
viewModel: {
|
|
171
|
+
type: StringConstructor;
|
|
172
|
+
};
|
|
164
173
|
template: {
|
|
165
174
|
type: PropType<DslDefinition>;
|
|
166
175
|
};
|
|
176
|
+
width: {
|
|
177
|
+
type: StringConstructor;
|
|
178
|
+
};
|
|
167
179
|
autoExpandParent: {
|
|
168
180
|
type: BooleanConstructor;
|
|
169
181
|
};
|
|
@@ -309,4 +321,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
309
321
|
enableSearch: boolean;
|
|
310
322
|
searchPlaceHolder: string;
|
|
311
323
|
}>;
|
|
312
|
-
export default
|
|
324
|
+
export default __default__;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oinone/kunlun-vue-admin-base",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.13",
|
|
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.
|
|
18
|
-
"@oinone/kunlun-vue-router": "6.2.
|
|
19
|
-
"@oinone/kunlun-vue-ui": "6.2.
|
|
20
|
-
"@oinone/kunlun-vue-ui-antd": "6.2.
|
|
21
|
-
"@oinone/kunlun-vue-ui-common": "6.2.
|
|
22
|
-
"@oinone/kunlun-vue-ui-el": "6.2.
|
|
23
|
-
"@oinone/kunlun-vue-widget": "6.2.
|
|
17
|
+
"@oinone/kunlun-vue-admin-layout": "6.2.13",
|
|
18
|
+
"@oinone/kunlun-vue-router": "6.2.13",
|
|
19
|
+
"@oinone/kunlun-vue-ui": "6.2.13",
|
|
20
|
+
"@oinone/kunlun-vue-ui-antd": "6.2.13",
|
|
21
|
+
"@oinone/kunlun-vue-ui-common": "6.2.13",
|
|
22
|
+
"@oinone/kunlun-vue-ui-el": "6.2.13",
|
|
23
|
+
"@oinone/kunlun-vue-widget": "6.2.13",
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
@@ -4,7 +4,7 @@ import { translateValueByKey } from '@oinone/kunlun-engine';
|
|
|
4
4
|
import { BooleanHelper } from '@oinone/kunlun-shared';
|
|
5
5
|
import { OioFormItem, PropRecordHelper } from '@oinone/kunlun-vue-ui-antd';
|
|
6
6
|
import { Tooltip as ATooltip } from 'ant-design-vue';
|
|
7
|
-
import { computed, createVNode, defineComponent, Slot, VNode, vShow, withDirectives } from 'vue';
|
|
7
|
+
import { computed, createVNode, defineComponent, PropType, Slot, VNode, vShow, withDirectives } from 'vue';
|
|
8
8
|
import { ValidatorStatus } from '../../typing';
|
|
9
9
|
import { BaseFormItemProps } from './props';
|
|
10
10
|
|
|
@@ -29,6 +29,9 @@ export default defineComponent({
|
|
|
29
29
|
onActiveKeyChange: {
|
|
30
30
|
type: Function as PropType<(key: string | string[]) => void>
|
|
31
31
|
},
|
|
32
|
+
setAllKeys: {
|
|
33
|
+
type: Function as PropType<(keys: string[]) => void>
|
|
34
|
+
},
|
|
32
35
|
type: {
|
|
33
36
|
type: String as PropType<OioCollapseType | keyof typeof OioCollapseType>,
|
|
34
37
|
default: OioCollapseType.bordered
|
|
@@ -58,9 +61,10 @@ export default defineComponent({
|
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
onMounted(() => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
const panelKeys = origin.value?.getPanelKeys();
|
|
65
|
+
if (panelKeys) {
|
|
66
|
+
props.setAllKeys?.(panelKeys);
|
|
67
|
+
if (props.expandAll && !props.accordion) {
|
|
64
68
|
onUpdateActiveKey(panelKeys);
|
|
65
69
|
}
|
|
66
70
|
}
|
|
@@ -17,7 +17,15 @@ export class DefaultCollapseWidget extends BasePackWidget {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@Widget.Reactive()
|
|
20
|
-
|
|
20
|
+
protected allKeys: string[] | undefined;
|
|
21
|
+
|
|
22
|
+
@Widget.Method()
|
|
23
|
+
public setAllKeys(keys: string[]) {
|
|
24
|
+
this.allKeys = keys;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Widget.Reactive()
|
|
28
|
+
protected activeKey: string | string[] | undefined;
|
|
21
29
|
|
|
22
30
|
public getActiveKey() {
|
|
23
31
|
return this.activeKey;
|
|
@@ -69,4 +77,14 @@ export class DefaultCollapseWidget extends BasePackWidget {
|
|
|
69
77
|
protected get expandIconPosition() {
|
|
70
78
|
return this.getDsl()?.expandIconPosition?.toLowerCase() || OioCollapseExpandIconPosition.right;
|
|
71
79
|
}
|
|
80
|
+
|
|
81
|
+
@Widget.Method()
|
|
82
|
+
public onExpandAll() {
|
|
83
|
+
this.setActiveKey(this.allKeys);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@Widget.Method()
|
|
87
|
+
public onCollapseAll() {
|
|
88
|
+
this.setActiveKey([]);
|
|
89
|
+
}
|
|
72
90
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DslDefinition
|
|
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
|
|
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,
|
|
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 {
|
|
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
|
-
|
|
359
|
-
|
|
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
|
* 当前用户没有该视图没有权限
|
|
@@ -57,7 +57,9 @@ let counter = 0;
|
|
|
57
57
|
@SPI.ClassFactory(FormFieldWidget.Token({ widget: 'action-permission' }))
|
|
58
58
|
export class ActionPermissionWidget extends FormFieldWidget<unknown, RuntimeO2MField> {
|
|
59
59
|
@Widget.Reactive()
|
|
60
|
-
|
|
60
|
+
public get class() {
|
|
61
|
+
return 'oio-tree';
|
|
62
|
+
}
|
|
61
63
|
|
|
62
64
|
public initialize(props) {
|
|
63
65
|
super.initialize(props);
|
package/src/spi/LayoutManager.ts
CHANGED
|
@@ -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
|
-
*
|
|
16
|
+
* 视图模型所在模块编码,一般是下划线风格的英文 designer_common
|
|
17
17
|
*/
|
|
18
|
-
module?: string;
|
|
18
|
+
module?: string | string[];
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
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:
|
|
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:
|
|
135
|
+
export function generatorLayout(layoutOption: LayoutRegisterOptions): DslDefinition | undefined {
|
|
133
136
|
return LayoutManager.selector(layoutOption);
|
|
134
137
|
}
|