@oinone/kunlun-vue-admin-base 6.2.10 → 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.
- package/dist/oinone-kunlun-vue-admin-base.css +1 -1
- package/dist/oinone-kunlun-vue-admin-base.esm.js +9602 -9235
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/action/component/action/ActionWidget.d.ts +10 -1
- package/dist/types/src/action/server-actions/ServerActionWidget.d.ts +1 -5
- package/dist/types/src/action/url-actions/UrlActionWidget.d.ts +1 -3
- package/dist/types/src/basic/field/complex/select/FormSelectComplexFieldWidget.d.ts +8 -2
- package/dist/types/src/basic/table-column/BaseTableColumnWidget.d.ts +3 -0
- package/dist/types/src/components/upload/File.vue.d.ts +0 -9
- package/dist/types/src/field/detail/enum/multi/DetailEnumMultiFieldWidget.d.ts +2 -1
- package/dist/types/src/field/detail/enum/single/DetailEnumFieldWidget.d.ts +2 -1
- package/dist/types/src/field/detail/index.d.ts +0 -1
- package/dist/types/src/field/detail/m2m/select/DetailM2MSelectFieldWidget.d.ts +1 -1
- package/dist/types/src/field/detail/o2m/index.d.ts +1 -0
- package/dist/types/src/field/detail/o2m/{DetailO2MSelectFieldWidget.d.ts → select/DetailO2MSelectFieldWidget.d.ts} +1 -1
- package/dist/types/src/field/form/abstract/FormInputAbstractFieldWidget.d.ts +22 -18
- package/dist/types/src/field/form/abstract/checkbox/FormCheckboxWidget.d.ts +1 -1
- package/dist/types/src/field/form/{enum/radio → boolean}/FormBooleanRadioFieldWidget.d.ts +4 -2
- package/dist/types/src/field/form/{enum/select/bool → boolean}/FormBooleanSelectFieldWidget.d.ts +2 -2
- package/dist/types/src/field/form/boolean/index.d.ts +2 -0
- package/dist/types/src/field/form/enum/FormEnumFieldAbstractWidget.d.ts +17 -5
- package/dist/types/src/field/form/enum/checkbox/FormEnumMultiCheckboxFieldWidget.d.ts +1 -0
- package/dist/types/src/field/form/enum/index.d.ts +1 -0
- package/dist/types/src/field/form/enum/radio/FormEnumRadioWidget.d.ts +4 -1
- package/dist/types/src/field/form/enum/radio/index.d.ts +0 -1
- package/dist/types/src/field/form/enum/select/index.d.ts +0 -1
- package/dist/types/src/field/form/enum/select/multi/FormEnumMultiSelectFieldWidget.d.ts +2 -1
- package/dist/types/src/field/form/enum/select/single/FormEnumFieldWidget.d.ts +2 -1
- package/dist/types/src/field/form/float/Plat.vue.d.ts +2 -2
- package/dist/types/src/field/form/index.d.ts +1 -2
- package/dist/types/src/field/form/integer/FormIntegerFieldWidget.d.ts +0 -1
- package/dist/types/src/field/form/m2o/upload/FormM2OUploadFieldWidget.d.ts +0 -1
- package/dist/types/src/field/form/o2o/index.d.ts +1 -0
- package/dist/types/src/field/form/o2o/upload/AbstractFormO2OUploadFieldWidget.d.ts +5 -0
- package/dist/types/src/field/form/o2o/upload/FormO2OUploadDraggableFieldWidget.d.ts +8 -0
- package/dist/types/src/field/form/o2o/upload/FormO2OUploadFieldWidget.d.ts +7 -0
- package/dist/types/src/field/form/o2o/upload/FormO2OUploadImgFieldWidget.d.ts +8 -0
- package/dist/types/src/field/form/o2o/upload/index.d.ts +4 -0
- package/dist/types/src/field/form/string/FormStringFieldWidget.d.ts +12 -3
- package/dist/types/src/field/form/string/iframe/FormStringIframeFieldWidget.d.ts +1 -0
- package/dist/types/src/field/form/string/media/FormStringMediaPlayerFieldWidget.d.ts +1 -0
- package/dist/types/src/field/form/string/tag/Tag.vue.d.ts +6 -6
- package/dist/types/src/field/form/string/upload/FormStringUploadFieldWidget.d.ts +11 -2
- package/dist/types/src/field/form/text/DefaultTextarea.vue.d.ts +4 -6
- package/dist/types/src/field/form/text/FormTextFieldWidget.d.ts +3 -1
- package/dist/types/src/field/form/text/index.d.ts +1 -0
- package/dist/types/src/field/form/text/typing.d.ts +4 -0
- package/dist/types/src/field/table/boolean/TableBooleanRadioFieldWidget.d.ts +3 -0
- package/dist/types/src/field/table/boolean/index.d.ts +1 -0
- package/dist/types/src/field/table/string/upload/TableStringMultiUploadWidget.d.ts +1 -1
- package/dist/types/src/provider/RootWidget.d.ts +2 -2
- 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/widget-names.d.ts +1 -0
- package/package.json +8 -8
- package/src/action/component/action/ActionWidget.ts +203 -28
- package/src/action/server-actions/ServerActionWidget.ts +6 -104
- package/src/action/url-actions/UrlActionWidget.ts +2 -37
- package/src/basic/element/BaseElementViewWidget.ts +11 -2
- package/src/basic/field/complex/select/FormSelectComplexFieldWidget.ts +24 -32
- package/src/basic/form-item/BaseFormItemWidget.ts +4 -0
- package/src/basic/gallery-item/DefaultGalleryItem.vue +6 -1
- package/src/basic/table-column/BaseTableColumnWidget.ts +5 -2
- package/src/components/upload/File.vue +0 -45
- package/src/field/detail/boolean/Boolean.vue +2 -3
- package/src/field/detail/boolean/DetailBooleanFieldWidget.ts +1 -1
- package/src/field/detail/boolean/DetailBooleanSelectFieldWidget.ts +1 -1
- package/src/field/detail/enum/multi/DetailEnumMultiFieldWidget.ts +9 -5
- package/src/field/detail/enum/single/DetailEnumFieldWidget.ts +8 -2
- package/src/field/detail/html/DetailHtmlFieldWidget.ts +1 -1
- package/src/field/detail/index.ts +0 -1
- package/src/field/detail/m2m/select/DetailM2MSelectFieldWidget.ts +3 -5
- package/src/field/detail/m2m/table/DetailM2MTableFieldWidget.ts +3 -1
- package/src/field/detail/m2o/DetailM2OSelectFieldWidget.ts +1 -1
- package/src/field/detail/m2o/upload/DetailM2OUploadWidget.ts +2 -3
- package/src/field/detail/number/DetailNumberWidget.ts +1 -1
- package/src/field/detail/o2m/index.ts +1 -0
- package/src/field/detail/o2m/{DetailO2MSelectFieldWidget.ts → select/DetailO2MSelectFieldWidget.ts} +4 -5
- package/src/field/detail/o2m/{Select.vue → select/Select.vue} +1 -1
- package/src/field/detail/o2m/table/DetailO2MTableFieldWidget.ts +3 -1
- package/src/field/detail/o2o/DetailO2OSelectFieldWidget.ts +1 -1
- package/src/field/detail/string/hyperlinks/DetailStringHyperlinksFieldWidget.ts +1 -1
- package/src/field/detail/string/iframe/DetailStringIframeFieldWidget.ts +2 -2
- package/src/field/detail/string/media/DetailStringMediaPlayerFieldWidget.ts +1 -1
- package/src/field/detail/string/string-with-copy/DetailStringWithCopyFieldWidget.ts +1 -1
- package/src/field/detail/string/tag/DetailStringTagFieldWidget.ts +1 -1
- package/src/field/detail/string/upload/DetailStringUploadFieldWidget.ts +1 -1
- package/src/field/detail/string/upload/DetailStringUploadImgFieldWidget.ts +1 -1
- package/src/field/form/abstract/FormInputAbstractFieldWidget.ts +54 -50
- package/src/field/form/abstract/checkbox/FormCheckboxWidget.ts +1 -3
- package/src/field/form/{enum/radio → boolean}/FormBooleanRadioFieldWidget.ts +22 -4
- package/src/field/form/{enum/select/bool → boolean}/FormBooleanSelectFieldWidget.ts +4 -5
- package/src/field/form/boolean/index.ts +2 -0
- package/src/field/form/enum/FormEnumFieldAbstractWidget.ts +42 -33
- package/src/field/form/enum/checkbox/FormEnumMultiCheckboxFieldWidget.ts +9 -1
- package/src/field/form/enum/index.ts +2 -1
- package/src/field/form/enum/radio/FormEnumRadioWidget.ts +21 -8
- package/src/field/form/enum/radio/index.ts +0 -1
- package/src/field/form/enum/select/index.ts +0 -1
- package/src/field/form/enum/select/multi/FormEnumMultiSelectFieldWidget.ts +2 -1
- package/src/field/form/enum/select/single/FormEnumFieldWidget.ts +2 -1
- package/src/field/form/index.ts +1 -3
- package/src/field/form/integer/FormIntegerFieldWidget.ts +0 -5
- package/src/field/form/integer/FormIntegerSliderFieldWidget.ts +1 -1
- package/src/field/form/integer/FormIntegerTagFieldWidget.ts +1 -0
- package/src/field/form/m2m/select/FormM2MFieldSelectWidget.ts +2 -2
- package/src/field/form/m2m/table/FormM2MTableFieldWidget.ts +2 -0
- package/src/field/form/m2m/upload/FormM2MUploadFieldWidget.ts +3 -3
- package/src/field/form/m2m/upload/FormM2MUploadImgFieldWidget.ts +1 -1
- package/src/field/form/m2o/form/FormM2OFormFieldWidget.ts +1 -1
- package/src/field/form/m2o/upload/FormM2OUploadFieldWidget.ts +2 -9
- package/src/field/form/m2o/upload/FormM2OUploadImgFieldWidget.ts +1 -1
- package/src/field/form/o2m/table/FormO2MTableFieldWidget.ts +2 -0
- package/src/field/form/o2m/upload/FormO2MUploadImgFieldWidget.ts +1 -1
- package/src/field/form/o2o/index.ts +1 -0
- package/src/field/form/o2o/upload/AbstractFormO2OUploadFieldWidget.ts +18 -0
- package/src/field/form/o2o/upload/FormO2OUploadDraggableFieldWidget.ts +47 -0
- package/src/field/form/o2o/upload/FormO2OUploadFieldWidget.ts +42 -0
- package/src/field/form/o2o/upload/FormO2OUploadImgFieldWidget.ts +62 -0
- package/src/field/form/o2o/upload/index.ts +4 -0
- package/src/field/form/string/DefaultString.vue +2 -2
- package/src/field/form/string/FormStringFieldWidget.ts +36 -27
- package/src/field/form/string/download/DefaultDownload.vue +1 -0
- package/src/field/form/string/iframe/FormStringIframeFieldWidget.ts +8 -1
- package/src/field/form/string/input/FormStringInputFieldWidget.ts +0 -4
- package/src/field/form/string/media/FormStringMediaPlayerFieldWidget.ts +7 -2
- package/src/field/form/string/media/FormStringMultiMediaPlayerFieldWidget.ts +1 -1
- package/src/field/form/string/tag/Tag.vue +0 -3
- package/src/field/form/string/upload/FormStringUploadFieldWidget.ts +24 -17
- package/src/field/form/string/upload/FormStringUploadImgFieldWidget.ts +1 -1
- package/src/field/form/text/DefaultTextarea.vue +11 -5
- package/src/field/form/text/FormTextFieldWidget.ts +32 -5
- package/src/field/form/text/index.ts +1 -0
- package/src/field/form/text/typing.ts +1 -0
- package/src/field/gallery/boolean/GalleryBooleanFieldWidget.ts +7 -3
- package/src/field/gallery/boolean/GalleryBooleanSelectFieldWidget.ts +1 -1
- package/src/field/gallery/common/GalleryCommonField.vue +7 -1
- package/src/field/gallery/common/GalleryCommonFieldWidget.ts +2 -8
- package/src/field/gallery/enum/single/GalleryEnumTagFieldWidget.ts +1 -1
- package/src/field/gallery/html/GalleryHtmlFieldWidget.ts +2 -2
- package/src/field/gallery/m2m/GalleryM2MSelectFieldWidget.ts +1 -1
- package/src/field/gallery/m2o/GalleryM2OSelectFieldWidget.ts +1 -1
- package/src/field/gallery/o2m/GalleryO2MSelectFieldWidget.ts +1 -1
- package/src/field/gallery/o2o/GalleryO2OSelectFieldWidget.ts +1 -1
- package/src/field/gallery/string/default/GalleryStringFieldWidget.ts +1 -2
- package/src/field/gallery/string/hyperlinks/GalleryStringHyperlinksFieldWidget.ts +1 -1
- package/src/field/gallery/string/iframe/GalleryStringIframeFieldWidget.ts +2 -2
- package/src/field/gallery/string/media-player/GalleryStringMediaPlayerWidget.ts +1 -1
- package/src/field/gallery/string/string-tag/GalleryStringTagStringFieldWidget.ts +1 -1
- package/src/field/gallery/string/tag/GalleryStringTagFieldWidget.ts +1 -1
- package/src/field/gallery/text-content/number/GalleryNumberTextContentWidget.ts +1 -1
- package/src/field/gallery/text-content/string/GalleryStringTextContentWidget.ts +1 -1
- package/src/field/table/boolean/TableBooleanFieldWidget.ts +7 -2
- package/src/field/table/boolean/TableBooleanRadioFieldWidget.ts +13 -0
- package/src/field/table/boolean/TableBooleanSelectFieldWidget.ts +1 -1
- package/src/field/table/boolean/index.ts +1 -0
- package/src/field/table/string/upload/TableStringMultiUploadWidget.ts +3 -3
- package/src/main-view/DefaultMetadataMainViewWidget.ts +7 -24
- 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/widget-names.ts +2 -0
- package/src/util/utils.ts +2 -1
- package/src/view/application-screen/gallery/AppsGalleryWidget.ts +2 -2
- package/src/view/card/CardWidget.ts +4 -4
- package/src/view/gallery/GalleryWidget.ts +9 -3
- package/src/view/popup/drawer/style/index.scss +3 -1
- package/dist/types/src/field/form/enum/select/bool/index.d.ts +0 -1
- package/src/field/form/enum/select/bool/index.ts +0 -1
- /package/dist/types/src/field/detail/o2m/{Select.vue.d.ts → select/Select.vue.d.ts} +0 -0
|
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
type: StringConstructor;
|
|
10
10
|
};
|
|
11
11
|
rows: {
|
|
12
|
-
type: NumberConstructor;
|
|
12
|
+
type: (BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
15
|
allowClear: {
|
|
@@ -47,9 +47,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
47
|
readonly: import("vue").ComputedRef<boolean | undefined>;
|
|
48
48
|
disabled: import("vue").ComputedRef<boolean | undefined>;
|
|
49
49
|
realValue: import("vue").Ref<string | undefined>;
|
|
50
|
-
autoSize: import("vue").ComputedRef<
|
|
51
|
-
minRows: number;
|
|
52
|
-
}>;
|
|
50
|
+
autoSize: import("vue").ComputedRef<boolean | Record<string, any> | undefined>;
|
|
53
51
|
clearContent: () => void;
|
|
54
52
|
clearStatus: import("vue").ComputedRef<boolean | "" | undefined>;
|
|
55
53
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -63,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
63
61
|
type: StringConstructor;
|
|
64
62
|
};
|
|
65
63
|
rows: {
|
|
66
|
-
type: NumberConstructor;
|
|
64
|
+
type: (BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
67
65
|
default: number;
|
|
68
66
|
};
|
|
69
67
|
allowClear: {
|
|
@@ -96,7 +94,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
94
|
default: boolean;
|
|
97
95
|
};
|
|
98
96
|
}>>, {
|
|
99
|
-
rows: number
|
|
97
|
+
rows: number | boolean | Record<string, any>;
|
|
100
98
|
allowClear: boolean;
|
|
101
99
|
showCount: boolean;
|
|
102
100
|
readonly: string | boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ValidatorInfo } from '../../../typing';
|
|
2
2
|
import { FormStringFieldWidget } from '../string/FormStringFieldWidget';
|
|
3
|
+
import { InputTextareaSize } from './typing';
|
|
3
4
|
export declare class FormTextFieldWidget extends FormStringFieldWidget {
|
|
4
5
|
initialize(props: any): this;
|
|
5
|
-
protected get
|
|
6
|
+
protected get defaultRows(): InputTextareaSize;
|
|
7
|
+
protected get rows(): InputTextareaSize;
|
|
6
8
|
protected get maxLength(): any;
|
|
7
9
|
validator(): Promise<ValidatorInfo>;
|
|
8
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TableStringTagFieldWidget } from '../tag/TableStringTagFieldWidget';
|
|
2
1
|
import { VNode } from 'vue';
|
|
2
|
+
import { TableStringTagFieldWidget } from '../tag';
|
|
3
3
|
export declare class TableStringMultiUploadWidget extends TableStringTagFieldWidget {
|
|
4
4
|
protected get cdnKey(): any;
|
|
5
5
|
protected get privateLink(): boolean | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { VueWidget } from '@oinone/kunlun-vue-widget';
|
|
2
2
|
import { DefaultMetadataMainViewWidget } from '../main-view';
|
|
3
|
-
import { FirstResetPasswordWidget, ForgetPasswordWidget
|
|
3
|
+
import { FirstResetPasswordWidget, ForgetPasswordWidget } from '../view';
|
|
4
4
|
export declare class RootWidget extends VueWidget {
|
|
5
5
|
root: string;
|
|
6
6
|
widgets: {
|
|
7
|
-
login: typeof
|
|
7
|
+
login: typeof import("../view").LoginWidget;
|
|
8
8
|
page: typeof DefaultMetadataMainViewWidget;
|
|
9
9
|
forget: typeof ForgetPasswordWidget;
|
|
10
10
|
first: typeof FirstResetPasswordWidget;
|
|
@@ -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;
|
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.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.
|
|
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.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",
|
|
@@ -2,26 +2,42 @@ import {
|
|
|
2
2
|
ActiveRecord,
|
|
3
3
|
ActiveRecords,
|
|
4
4
|
buildQueryCondition,
|
|
5
|
+
ConfirmModal,
|
|
6
|
+
FunctionCache,
|
|
7
|
+
FunctionService,
|
|
8
|
+
GetRequestModelFieldsOptions,
|
|
9
|
+
ModelCache,
|
|
5
10
|
parseConfigs,
|
|
11
|
+
RequestModelField,
|
|
6
12
|
resolveDynamicDomain,
|
|
7
13
|
resolveDynamicExpression,
|
|
8
14
|
RuntimeAction,
|
|
9
15
|
RuntimeContext,
|
|
10
16
|
RuntimeContextManager,
|
|
17
|
+
RuntimeFunctionDefinition,
|
|
18
|
+
RuntimeServerAction,
|
|
19
|
+
SubmitRelationValue,
|
|
20
|
+
SubmitValue,
|
|
11
21
|
translate,
|
|
12
22
|
translateValueByKey,
|
|
13
23
|
ValidatorCallChainingParameters
|
|
14
24
|
} from '@oinone/kunlun-engine';
|
|
15
25
|
import { EventBus, EventConsumer, KeyboardEventMessage } from '@oinone/kunlun-event';
|
|
16
26
|
import { Expression, ExpressionRunParam } from '@oinone/kunlun-expression';
|
|
17
|
-
import { ActionContextType, ActionElement, IAction, ViewType } from '@oinone/kunlun-meta';
|
|
27
|
+
import { ActionContextType, ActionElement, IAction, ModelFieldType, ViewType } from '@oinone/kunlun-meta';
|
|
18
28
|
import { Condition } from '@oinone/kunlun-request';
|
|
19
29
|
import { DEFAULT_TRUE_CONDITION } from '@oinone/kunlun-service';
|
|
20
30
|
import { BooleanHelper, debugConsole, GraphqlHelper, ReturnPromise } from '@oinone/kunlun-shared';
|
|
21
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
ButtonBizStyle,
|
|
33
|
+
ButtonType,
|
|
34
|
+
ConfirmType,
|
|
35
|
+
PopconfirmPlacement,
|
|
36
|
+
StyleHelper
|
|
37
|
+
} from '@oinone/kunlun-vue-ui-common';
|
|
22
38
|
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
23
39
|
import { isBoolean, isNil, isString, set as setData } from 'lodash-es';
|
|
24
|
-
import { Component, toRaw } from 'vue';
|
|
40
|
+
import { Component, createVNode, toRaw } from 'vue';
|
|
25
41
|
import { BaseActionWidget, BaseActionWidgetProps, BaseView, QueryExpression } from '../../../basic';
|
|
26
42
|
import { ActionKeyboardConfig, ClickResult, fetchPopconfirmPlacement } from '../../../typing';
|
|
27
43
|
import { executeConfirm } from '../../../util';
|
|
@@ -310,9 +326,8 @@ export class ActionWidget<
|
|
|
310
326
|
|
|
311
327
|
if (length) {
|
|
312
328
|
return GraphqlHelper.serializableObject(queryData);
|
|
313
|
-
} else {
|
|
314
|
-
return '{}';
|
|
315
329
|
}
|
|
330
|
+
return '{}';
|
|
316
331
|
};
|
|
317
332
|
|
|
318
333
|
return { rsql, queryData, condition, queryDataToString };
|
|
@@ -471,26 +486,28 @@ export class ActionWidget<
|
|
|
471
486
|
@Widget.Reactive()
|
|
472
487
|
protected get enableConfirm(): boolean {
|
|
473
488
|
const enableConfirm = this.getDsl().enableConfirm;
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
if (enableConfirm != null) {
|
|
490
|
+
const rst = BooleanHelper.toBoolean(enableConfirm);
|
|
491
|
+
if (isNil(rst)) {
|
|
492
|
+
const scene = this.scene;
|
|
493
|
+
|
|
494
|
+
return Expression.run(
|
|
495
|
+
{
|
|
496
|
+
activeRecords: this.activeRecords,
|
|
497
|
+
rootRecord: this.rootData?.[0] || {},
|
|
498
|
+
openerRecord: this.openerActiveRecords?.[0] || {},
|
|
499
|
+
scene,
|
|
500
|
+
activeRecord: this.activeRecords?.[0] || {},
|
|
501
|
+
parentRecord: this.parentViewActiveRecords?.[0] || {}
|
|
502
|
+
} as ExpressionRunParam,
|
|
503
|
+
enableConfirm,
|
|
504
|
+
enableConfirm
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
return rst;
|
|
492
508
|
}
|
|
493
|
-
|
|
509
|
+
const { confirmText, confirmFun } = this;
|
|
510
|
+
return !!confirmText || !!confirmFun;
|
|
494
511
|
}
|
|
495
512
|
|
|
496
513
|
/**
|
|
@@ -510,7 +527,7 @@ export class ActionWidget<
|
|
|
510
527
|
protected get confirmType(): ConfirmType | undefined {
|
|
511
528
|
const { confirmType } = this.getDsl();
|
|
512
529
|
if (confirmType) {
|
|
513
|
-
const realConfirmType = ConfirmType[confirmType];
|
|
530
|
+
const realConfirmType = ConfirmType[confirmType.toUpperCase()];
|
|
514
531
|
if (realConfirmType) {
|
|
515
532
|
return realConfirmType;
|
|
516
533
|
}
|
|
@@ -536,6 +553,16 @@ export class ActionWidget<
|
|
|
536
553
|
return undefined;
|
|
537
554
|
}
|
|
538
555
|
|
|
556
|
+
@Widget.Reactive()
|
|
557
|
+
protected get confirmHtml(): boolean | undefined {
|
|
558
|
+
return BooleanHelper.toBoolean(this.getDsl().confirmHtml);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
@Widget.Reactive()
|
|
562
|
+
protected get confirmFun(): string | undefined {
|
|
563
|
+
return this.getDsl().confirmFun;
|
|
564
|
+
}
|
|
565
|
+
|
|
539
566
|
@Widget.Reactive()
|
|
540
567
|
protected get confirmPosition(): PopconfirmPlacement {
|
|
541
568
|
return fetchPopconfirmPlacement(this.getDsl().confirmPosition) || PopconfirmPlacement.BM;
|
|
@@ -550,6 +577,11 @@ export class ActionWidget<
|
|
|
550
577
|
return translate('kunlun.common.prompt');
|
|
551
578
|
}
|
|
552
579
|
|
|
580
|
+
@Widget.Reactive()
|
|
581
|
+
protected get confirmWidth(): string | undefined {
|
|
582
|
+
return StyleHelper.px(this.getDsl().confirmWidth);
|
|
583
|
+
}
|
|
584
|
+
|
|
553
585
|
@Widget.Reactive()
|
|
554
586
|
protected get enterText(): string | undefined {
|
|
555
587
|
const { enterText } = this.getDsl();
|
|
@@ -760,12 +792,70 @@ export class ActionWidget<
|
|
|
760
792
|
* 二次弹窗校验
|
|
761
793
|
*/
|
|
762
794
|
@Widget.Method()
|
|
763
|
-
public validateConfirm(): Promise<boolean> {
|
|
795
|
+
public async validateConfirm(): Promise<boolean> {
|
|
764
796
|
if (this.enableConfirm && this.confirmType === ConfirmType.MODAL) {
|
|
765
|
-
const { confirmText } = this;
|
|
797
|
+
const { confirmText, confirmFun } = this;
|
|
766
798
|
if (confirmText) {
|
|
799
|
+
return this.validateConfirmByText();
|
|
800
|
+
}
|
|
801
|
+
if (confirmFun) {
|
|
802
|
+
return this.validateConfirmByFun();
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return Promise.resolve(true);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
protected async validateConfirmByText(): Promise<boolean> {
|
|
809
|
+
const { confirmTitle, confirmWidth, confirmHtml, confirmText } = this;
|
|
810
|
+
let confirm: string | Function = confirmText!;
|
|
811
|
+
if (confirmHtml) {
|
|
812
|
+
confirm = () => createVNode('span', { innerHTML: confirmText });
|
|
813
|
+
}
|
|
814
|
+
return executeConfirm({
|
|
815
|
+
title: confirmTitle,
|
|
816
|
+
width: confirmWidth,
|
|
817
|
+
confirm: confirm as unknown as string,
|
|
818
|
+
enterText: this.enterText,
|
|
819
|
+
cancelText: this.cancelText
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
protected async validateConfirmByFun(): Promise<boolean> {
|
|
824
|
+
const { confirmTitle, confirmWidth, confirmHtml, confirmFun } = this;
|
|
825
|
+
const functionDefinition = await FunctionCache.get(this.model.model, confirmFun!);
|
|
826
|
+
if (functionDefinition) {
|
|
827
|
+
const requestFields = await this.getRequestModelFields();
|
|
828
|
+
const submitValue = await this.submit(this.action);
|
|
829
|
+
const message = await this.executeFunction<string | ConfirmModal>(
|
|
830
|
+
functionDefinition,
|
|
831
|
+
requestFields,
|
|
832
|
+
submitValue.records
|
|
833
|
+
);
|
|
834
|
+
if (message) {
|
|
835
|
+
let title: string = confirmTitle!;
|
|
836
|
+
let confirm: string | Function;
|
|
837
|
+
if (typeof message === 'string') {
|
|
838
|
+
confirm = message;
|
|
839
|
+
} else {
|
|
840
|
+
const expressionParam: ExpressionRunParam = {
|
|
841
|
+
activeRecords: [message.context || {}],
|
|
842
|
+
rootRecord: this.rootData?.[0] || {},
|
|
843
|
+
activeRecord: message.context || {},
|
|
844
|
+
scene: this.scene,
|
|
845
|
+
openerRecord: this.openerActiveRecords?.[0] || {},
|
|
846
|
+
parentRecord: this.parentViewActiveRecords?.[0] || {}
|
|
847
|
+
};
|
|
848
|
+
title = Expression.replaceRun(expressionParam, message.title || title || '');
|
|
849
|
+
confirm = Expression.replaceRun(expressionParam, translateValueByKey(message.content || ''));
|
|
850
|
+
}
|
|
851
|
+
if (confirmHtml) {
|
|
852
|
+
const finalMessage = confirm;
|
|
853
|
+
confirm = () => createVNode('span', { innerHTML: finalMessage });
|
|
854
|
+
}
|
|
767
855
|
return executeConfirm({
|
|
768
|
-
|
|
856
|
+
title,
|
|
857
|
+
width: confirmWidth,
|
|
858
|
+
confirm: confirm as unknown as string,
|
|
769
859
|
enterText: this.enterText,
|
|
770
860
|
cancelText: this.cancelText
|
|
771
861
|
});
|
|
@@ -947,6 +1037,91 @@ export class ActionWidget<
|
|
|
947
1037
|
return result;
|
|
948
1038
|
}
|
|
949
1039
|
|
|
1040
|
+
protected async getRequestModelFields(options?: GetRequestModelFieldsOptions): Promise<RequestModelField[]> {
|
|
1041
|
+
const { viewType } = this;
|
|
1042
|
+
if (viewType === ViewType.Tree) {
|
|
1043
|
+
const runtimeModel = await ModelCache.get(this.model.model);
|
|
1044
|
+
if (runtimeModel) {
|
|
1045
|
+
return runtimeModel.modelFields.map((field) => ({ field }));
|
|
1046
|
+
}
|
|
1047
|
+
return [];
|
|
1048
|
+
}
|
|
1049
|
+
if (this.popupScene) {
|
|
1050
|
+
return this.seekPopupMainRuntimeContext().getRequestModelFields(options);
|
|
1051
|
+
}
|
|
1052
|
+
return this.rootRuntimeContext.getRequestModelFields(options);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
protected seekPopupMainRuntimeContext(): RuntimeContext {
|
|
1056
|
+
if (this.metadataHandle === this.rootHandle) {
|
|
1057
|
+
const modelModel = this.model.model;
|
|
1058
|
+
if (modelModel) {
|
|
1059
|
+
const popupMainRuntimeContext = RuntimeContextManager.getOthers(this.rootHandle)?.find(
|
|
1060
|
+
(v) => v.model.model === modelModel
|
|
1061
|
+
);
|
|
1062
|
+
if (popupMainRuntimeContext) {
|
|
1063
|
+
return popupMainRuntimeContext;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return this.rootRuntimeContext;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
protected async submit(action: RuntimeServerAction): Promise<SubmitValue> {
|
|
1071
|
+
let records: ActiveRecords | undefined;
|
|
1072
|
+
let relationRecords: SubmitRelationValue[] | undefined;
|
|
1073
|
+
if (!this.inline && this.submitCallChaining) {
|
|
1074
|
+
const callResult = await this.submitCallChaining?.syncCall();
|
|
1075
|
+
if (callResult != null) {
|
|
1076
|
+
records = callResult.records;
|
|
1077
|
+
relationRecords = callResult.relationRecords;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
if (records == null) {
|
|
1081
|
+
records = this.activeRecords || [];
|
|
1082
|
+
}
|
|
1083
|
+
if (action.contextType === ActionContextType.Batch || action.contextType === ActionContextType.SingleAndBatch) {
|
|
1084
|
+
// do nothing.
|
|
1085
|
+
} else if (action.contextType === ActionContextType.Single) {
|
|
1086
|
+
if (Array.isArray(records)) {
|
|
1087
|
+
[records] = records;
|
|
1088
|
+
}
|
|
1089
|
+
} else {
|
|
1090
|
+
const ttype = action.functionDefinition?.argumentList?.[0]?.ttype;
|
|
1091
|
+
if (ttype && [ModelFieldType.ManyToOne, ModelFieldType.OneToOne].includes(ttype as ModelFieldType)) {
|
|
1092
|
+
if (Array.isArray(records)) {
|
|
1093
|
+
[records] = records;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
if (!records) {
|
|
1098
|
+
if (action.contextType !== ActionContextType.ContextFree) {
|
|
1099
|
+
const name = this.action?.displayName || this.action?.label;
|
|
1100
|
+
throw new Error(`${name} action not params`);
|
|
1101
|
+
}
|
|
1102
|
+
records = {};
|
|
1103
|
+
}
|
|
1104
|
+
return new SubmitValue(records, relationRecords);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
protected executeFunction<T>(
|
|
1108
|
+
functionDefinition: RuntimeFunctionDefinition,
|
|
1109
|
+
requestFields: RequestModelField[],
|
|
1110
|
+
activeRecords: ActiveRecords | undefined
|
|
1111
|
+
): Promise<T> {
|
|
1112
|
+
activeRecords = this.mergeContext(activeRecords);
|
|
1113
|
+
return FunctionService.INSTANCE.simpleExecute(
|
|
1114
|
+
this.model,
|
|
1115
|
+
functionDefinition,
|
|
1116
|
+
{
|
|
1117
|
+
requestModels: FunctionService.usingStaticModels(),
|
|
1118
|
+
requestFields,
|
|
1119
|
+
variables: this.rootRuntimeContext.generatorVariables({ path: this.action.sessionPath })
|
|
1120
|
+
},
|
|
1121
|
+
activeRecords
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
950
1125
|
private validatorByExpression(expression: string) {
|
|
951
1126
|
Expression.getInstance().initExpressionContext(
|
|
952
1127
|
this.activeRecords,
|