morghulis 1.0.26 → 1.0.28
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/README.md +166 -15
- package/dist/components/cell/MCell.vue.d.ts +11 -0
- package/dist/components/cell/char/CharCell.vue.d.ts +15 -0
- package/dist/components/cell/date/DateCell.vue.d.ts +15 -0
- package/dist/components/cell/refer/SelectCell.vue.d.ts +15 -0
- package/dist/components/cell/simple/BooleanCell.vue.d.ts +15 -0
- package/dist/components/cell/simple/DefaultCell.vue.d.ts +15 -0
- package/dist/components/cell/simple/NumberCell.vue.d.ts +18 -0
- package/dist/components/cell/useCellComponents.d.ts +2 -0
- package/dist/components/common/MCtrlBtn.vue.d.ts +30 -0
- package/dist/components/common/MOption.vue.d.ts +10 -0
- package/dist/components/dialog/MDialog.vue.d.ts +57 -0
- package/dist/components/dialog/MDialogHeader.vue.d.ts +9 -0
- package/dist/components/form/MForm.vue.d.ts +13 -0
- package/dist/components/table/MTable.vue.d.ts +65 -0
- package/dist/components/table/MTableButtons.vue.d.ts +17 -0
- package/dist/components/table/MTableHeader.vue.d.ts +17 -0
- package/dist/components/table/data/DCell.vue.d.ts +18 -0
- package/dist/components/table/data/DForm.vue.d.ts +16 -0
- package/dist/components/table/data/DTable.vue.d.ts +78 -0
- package/dist/components/table/data/DTableController.vue.d.ts +19 -0
- package/dist/components/table/data/DTablePopController.vue.d.ts +13 -0
- package/dist/components/table/data/useDTable.d.ts +77 -0
- package/dist/components/table/data/useDTableCell.d.ts +6 -0
- package/dist/components/table/useMTable.d.ts +25 -0
- package/dist/hooks/authorize.d.ts +13 -0
- package/dist/hooks/channel.d.ts +13 -0
- package/dist/hooks/cookies.d.ts +6 -0
- package/dist/hooks/request.d.ts +5 -0
- package/dist/hooks/socket.d.ts +7 -0
- package/dist/index.d.ts +401 -0
- package/dist/index.js +1252 -1250
- package/dist/index.umd.cjs +19 -19
- package/dist/tools/dao.d.ts +27 -0
- package/dist/tools/feedback.d.ts +4 -0
- package/dist/tools/query.d.ts +20 -0
- package/dist/types/dialog/dialog.types.d.ts +41 -0
- package/dist/types/table/m.table.types.d.ts +55 -0
- package/package.json +7 -4
- package/dist/types.d.ts +0 -731
@@ -0,0 +1,78 @@
|
|
1
|
+
import { DTableProps } from '../../../types/table/m.table.types';
|
2
|
+
import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
3
|
+
import { MetaView } from '../../../types/tool/meta.types';
|
4
|
+
import { DaoTypes, DataItem } from '../../../types/tool/dao.types';
|
5
|
+
declare function __VLS_template(): {
|
6
|
+
attrs: Partial<{}>;
|
7
|
+
slots: {
|
8
|
+
header?(_: {}): any;
|
9
|
+
};
|
10
|
+
refs: {
|
11
|
+
table: unknown;
|
12
|
+
dialog: unknown;
|
13
|
+
form: CreateComponentPublicInstanceWithMixins<Readonly<{
|
14
|
+
selection: any[];
|
15
|
+
view: MetaView;
|
16
|
+
db: DaoTypes;
|
17
|
+
bean: DataItem;
|
18
|
+
}> & Readonly<{}>, {
|
19
|
+
getData: () => any[];
|
20
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
21
|
+
form: unknown;
|
22
|
+
}, any, ComponentProvideOptions, {
|
23
|
+
P: {};
|
24
|
+
B: {};
|
25
|
+
D: {};
|
26
|
+
C: {};
|
27
|
+
M: {};
|
28
|
+
Defaults: {};
|
29
|
+
}, Readonly<{
|
30
|
+
selection: any[];
|
31
|
+
view: MetaView;
|
32
|
+
db: DaoTypes;
|
33
|
+
bean: DataItem;
|
34
|
+
}> & Readonly<{}>, {
|
35
|
+
getData: () => any[];
|
36
|
+
}, {}, {}, {}, {}>;
|
37
|
+
};
|
38
|
+
rootEl: any;
|
39
|
+
};
|
40
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
41
|
+
declare const __VLS_component: DefineComponent<DTableProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DTableProps> & Readonly<{}>, {
|
42
|
+
size: number;
|
43
|
+
page: number;
|
44
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
45
|
+
table: unknown;
|
46
|
+
dialog: unknown;
|
47
|
+
form: CreateComponentPublicInstanceWithMixins<Readonly<{
|
48
|
+
selection: any[];
|
49
|
+
view: MetaView;
|
50
|
+
db: DaoTypes;
|
51
|
+
bean: DataItem;
|
52
|
+
}> & Readonly<{}>, {
|
53
|
+
getData: () => any[];
|
54
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
55
|
+
form: unknown;
|
56
|
+
}, any, ComponentProvideOptions, {
|
57
|
+
P: {};
|
58
|
+
B: {};
|
59
|
+
D: {};
|
60
|
+
C: {};
|
61
|
+
M: {};
|
62
|
+
Defaults: {};
|
63
|
+
}, Readonly<{
|
64
|
+
selection: any[];
|
65
|
+
view: MetaView;
|
66
|
+
db: DaoTypes;
|
67
|
+
bean: DataItem;
|
68
|
+
}> & Readonly<{}>, {
|
69
|
+
getData: () => any[];
|
70
|
+
}, {}, {}, {}, {}>;
|
71
|
+
}, any>;
|
72
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
73
|
+
export default _default;
|
74
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
75
|
+
new (): {
|
76
|
+
$slots: S;
|
77
|
+
};
|
78
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
2
|
+
declare const _default: DefineComponent<{
|
3
|
+
selection?: any;
|
4
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
5
|
+
copy: (...args: any[]) => void;
|
6
|
+
open: (...args: any[]) => void;
|
7
|
+
remove: (...args: any[]) => void;
|
8
|
+
upload: (...args: any[]) => void;
|
9
|
+
download: (...args: any[]) => void;
|
10
|
+
}, string, PublicProps, Readonly<{
|
11
|
+
selection?: any;
|
12
|
+
}> & Readonly<{
|
13
|
+
onCopy?: (...args: any[]) => any;
|
14
|
+
onOpen?: (...args: any[]) => any;
|
15
|
+
onRemove?: (...args: any[]) => any;
|
16
|
+
onUpload?: (...args: any[]) => any;
|
17
|
+
onDownload?: (...args: any[]) => any;
|
18
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
19
|
+
export default _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
2
|
+
declare const _default: DefineComponent<{
|
3
|
+
selection?: any;
|
4
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
5
|
+
open: (...args: any[]) => void;
|
6
|
+
remove: (...args: any[]) => void;
|
7
|
+
}, string, PublicProps, Readonly<{
|
8
|
+
selection?: any;
|
9
|
+
}> & Readonly<{
|
10
|
+
onOpen?: (...args: any[]) => any;
|
11
|
+
onRemove?: (...args: any[]) => any;
|
12
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
13
|
+
export default _default;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
2
|
+
import { Meta, MetaView, MetaField } from '../../../types/tool/meta.types';
|
3
|
+
import { Query } from '../../../tools/query';
|
4
|
+
import { DTableProps } from '../../../types/table/m.table.types';
|
5
|
+
import { DataItem } from '../../../types/tool/dao.types.ts';
|
6
|
+
export declare function useDTable(table: Ref, props: DTableProps): {
|
7
|
+
meta: ComputedRef<Meta>;
|
8
|
+
query: ComputedRef<Query>;
|
9
|
+
view: Ref<{
|
10
|
+
fields?: {
|
11
|
+
[key: string]: MetaField;
|
12
|
+
};
|
13
|
+
path?: string;
|
14
|
+
code?: string;
|
15
|
+
meta_name?: string;
|
16
|
+
view_name?: string;
|
17
|
+
form_width?: number;
|
18
|
+
form_height?: number;
|
19
|
+
table_width?: number;
|
20
|
+
table_height?: number;
|
21
|
+
enable?: boolean;
|
22
|
+
show_header?: boolean;
|
23
|
+
allow_batch?: boolean;
|
24
|
+
allow_search?: boolean;
|
25
|
+
allow_sort?: boolean;
|
26
|
+
allow_pop?: boolean;
|
27
|
+
allow_insert?: boolean;
|
28
|
+
allow_edit?: boolean;
|
29
|
+
allow_remove?: boolean;
|
30
|
+
allow_download?: boolean;
|
31
|
+
allow_upload?: boolean;
|
32
|
+
}, MetaView | {
|
33
|
+
fields?: {
|
34
|
+
[key: string]: MetaField;
|
35
|
+
};
|
36
|
+
path?: string;
|
37
|
+
code?: string;
|
38
|
+
meta_name?: string;
|
39
|
+
view_name?: string;
|
40
|
+
form_width?: number;
|
41
|
+
form_height?: number;
|
42
|
+
table_width?: number;
|
43
|
+
table_height?: number;
|
44
|
+
enable?: boolean;
|
45
|
+
show_header?: boolean;
|
46
|
+
allow_batch?: boolean;
|
47
|
+
allow_search?: boolean;
|
48
|
+
allow_sort?: boolean;
|
49
|
+
allow_pop?: boolean;
|
50
|
+
allow_insert?: boolean;
|
51
|
+
allow_edit?: boolean;
|
52
|
+
allow_remove?: boolean;
|
53
|
+
allow_download?: boolean;
|
54
|
+
allow_upload?: boolean;
|
55
|
+
}>;
|
56
|
+
info: {
|
57
|
+
current: number;
|
58
|
+
total: number;
|
59
|
+
page: number;
|
60
|
+
size: number;
|
61
|
+
};
|
62
|
+
results: Ref<DataItem[], DataItem[]>;
|
63
|
+
selection: ComputedRef<any[]>;
|
64
|
+
status: {
|
65
|
+
loading: boolean;
|
66
|
+
payload?: {
|
67
|
+
length: number | string;
|
68
|
+
index: number | string;
|
69
|
+
percentage: number;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
loading: ComputedRef<boolean>;
|
73
|
+
load: () => void;
|
74
|
+
remove: (id?: number | string) => void;
|
75
|
+
upload: (array: any[]) => void;
|
76
|
+
collect: (callback: (item: DataItem) => void) => void;
|
77
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
2
|
+
import { MorghulisTableProps } from '../../types/table/m.table.types.ts';
|
3
|
+
export declare function useMorghulisTable(table: Ref, props: MorghulisTableProps): {
|
4
|
+
popover: {
|
5
|
+
ref?: any;
|
6
|
+
visible?: boolean;
|
7
|
+
type?: string | null | undefined;
|
8
|
+
data?: any;
|
9
|
+
placement?: "left" | "right" | "top" | "bottom" | null | string;
|
10
|
+
};
|
11
|
+
selection: ComputedRef<any>;
|
12
|
+
tableCellClassName: (data: any) => "m-table-cell" | "m-table-index" | "m-table-custom";
|
13
|
+
tableRowClassName: (payload: any) => "" | "m-table-current" | "m-table-highlight";
|
14
|
+
handleCellClick: (row: object, column: any, cell: any, event: any) => void;
|
15
|
+
handleCellContextMenu: (row: any, column: any, cell: any, event: any) => void;
|
16
|
+
showPopover: (event: {
|
17
|
+
clientX: number;
|
18
|
+
clientY: number;
|
19
|
+
}, type: string, data?: any, placement?: string) => void;
|
20
|
+
closePopover: () => boolean;
|
21
|
+
setSelection: (keys: any[]) => void;
|
22
|
+
hasSearchSlot: ComputedRef<boolean>;
|
23
|
+
hasFieldSlot: ComputedRef<boolean>;
|
24
|
+
hasMetaViewSlot: ComputedRef<boolean>;
|
25
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export declare const SYSTEM_KEY: {
|
2
|
+
CLIENT: string;
|
3
|
+
USER: string;
|
4
|
+
AUTH: string;
|
5
|
+
};
|
6
|
+
export declare function useMorghulisAuthorize(): {
|
7
|
+
$client: string;
|
8
|
+
user: () => any;
|
9
|
+
check: (uid?: any) => boolean;
|
10
|
+
login: (uid: any) => void;
|
11
|
+
logout: () => void;
|
12
|
+
bearer: () => string;
|
13
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { MorghulisChannel } from '../types/tool/channel.types.ts';
|
2
|
+
export declare function useMorghulisChannel(auth?: boolean): {
|
3
|
+
register: (handler: string, channel: MorghulisChannel, url?: string) => void;
|
4
|
+
activate: (body: any) => void;
|
5
|
+
status: {
|
6
|
+
loading: boolean;
|
7
|
+
payload?: {
|
8
|
+
length: number | string;
|
9
|
+
index: number | string;
|
10
|
+
percentage: number;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { MorghulisSockets } from '../types/tool/channel.types';
|
2
|
+
import { Ref } from 'vue';
|
3
|
+
export declare function useMorghulisSockets(): {
|
4
|
+
open: () => void;
|
5
|
+
status: Ref<string, string>;
|
6
|
+
};
|
7
|
+
export declare function loadMorghulisSockets(baseURL: string): MorghulisSockets;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,401 @@
|
|
1
|
+
import type { App } from 'vue';
|
2
|
+
import type { ElDialog, ElButton, ElText, ElDivider, ElSpace } from 'element-plus';
|
3
|
+
|
4
|
+
// 导入Vue组件实例类型
|
5
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, EmitsOptions, Component } from 'vue';
|
6
|
+
|
7
|
+
// 基础类型定义
|
8
|
+
export type UIFeedbackTypes = "success" | "info" | "warning" | "error";
|
9
|
+
export type UITextTypes = "success" | "info" | "warning" | "danger" | 'primary';
|
10
|
+
export type UISizeTypes = 'default' | 'small' | 'large' | "";
|
11
|
+
|
12
|
+
// 直接在类型定义文件中定义MorDialogProps,避免相对路径引用
|
13
|
+
export interface MorDialogProps {
|
14
|
+
modelValue?: boolean,
|
15
|
+
title?: string,
|
16
|
+
subTitle?: string,
|
17
|
+
width?: string | number,
|
18
|
+
fullscreen?: boolean,
|
19
|
+
top?: string,
|
20
|
+
modal?: boolean,
|
21
|
+
modalClass?: string,
|
22
|
+
headerClass?: string,
|
23
|
+
bodyClass?: string,
|
24
|
+
footerClass?: string,
|
25
|
+
appendToBody?: boolean,
|
26
|
+
appendTo?: string,
|
27
|
+
lockScroll?: boolean,
|
28
|
+
openDelay?: number,
|
29
|
+
closeDelay?: number,
|
30
|
+
closeOnClickModal?: boolean,
|
31
|
+
closeOnPressEscape?: boolean,
|
32
|
+
showClose?: boolean,
|
33
|
+
beforeClose?: (done: () => void) => void,
|
34
|
+
draggable?: boolean,
|
35
|
+
overFlow?: boolean,
|
36
|
+
center?: boolean,
|
37
|
+
alignCenter?: boolean,
|
38
|
+
destroyOnClose?: boolean,
|
39
|
+
closeIcon?: string,
|
40
|
+
zIndex?: number,
|
41
|
+
headerAriaLevel?: string,
|
42
|
+
confirm?: (data: any, done: () => void) => void,
|
43
|
+
cancel?: (data: any, done: () => void) => void,
|
44
|
+
confirmButtonText?: string,
|
45
|
+
cancelButtonText?: string,
|
46
|
+
data?: any
|
47
|
+
}
|
48
|
+
|
49
|
+
// 定义MorDialogConfig接口
|
50
|
+
export interface MorDialogConfig {
|
51
|
+
title?: string,
|
52
|
+
subTitle?: string
|
53
|
+
}
|
54
|
+
|
55
|
+
// 定义MorOption接口
|
56
|
+
export interface MorOption {
|
57
|
+
baseURL?: string,
|
58
|
+
minioURL?: string,
|
59
|
+
[key: string]: any
|
60
|
+
}
|
61
|
+
|
62
|
+
// 定义表格相关类型
|
63
|
+
export interface DataItem {
|
64
|
+
[key: string]: any;
|
65
|
+
}
|
66
|
+
|
67
|
+
export type Orders = Array<{
|
68
|
+
column: string;
|
69
|
+
asc?: boolean;
|
70
|
+
}>;
|
71
|
+
|
72
|
+
export interface DaoTypes {
|
73
|
+
add: (entity: string, bean: DataItem) => Promise<any>;
|
74
|
+
update: (entity: string, bean: DataItem) => Promise<any>;
|
75
|
+
delete: (entity: string, id: string | number) => Promise<any>;
|
76
|
+
get: (entity: string, id: string | number, options?: any) => Promise<any>;
|
77
|
+
list: (entity: string, options?: any) => Promise<any>;
|
78
|
+
page: (entity: string, page: number, size: number, options?: any) => Promise<any>;
|
79
|
+
}
|
80
|
+
|
81
|
+
export interface MetaField {
|
82
|
+
code: string;
|
83
|
+
name: string;
|
84
|
+
type: string;
|
85
|
+
options?: any[];
|
86
|
+
required?: boolean;
|
87
|
+
readonly?: boolean;
|
88
|
+
hidden?: boolean;
|
89
|
+
[key: string]: any;
|
90
|
+
}
|
91
|
+
|
92
|
+
export interface MetaView {
|
93
|
+
code: string;
|
94
|
+
name: string;
|
95
|
+
fields: MetaField[];
|
96
|
+
[key: string]: any;
|
97
|
+
}
|
98
|
+
|
99
|
+
export type SortableCallbackFn = (newIndex: number, oldIndex: number) => void;
|
100
|
+
|
101
|
+
export type MTableButton = {
|
102
|
+
size?: UISizeTypes;
|
103
|
+
handler?: (row: any, event?: Event) => void;
|
104
|
+
title?: string | Function;
|
105
|
+
type?: UITextTypes | Function;
|
106
|
+
link?: boolean | Function;
|
107
|
+
plain?: boolean | Function;
|
108
|
+
text?: boolean | Function;
|
109
|
+
round?: boolean | Function;
|
110
|
+
circle?: boolean | Function;
|
111
|
+
disabled?: boolean | Function;
|
112
|
+
dark?: boolean | Function;
|
113
|
+
color?: string | Function;
|
114
|
+
tag?: string | Function;
|
115
|
+
};
|
116
|
+
|
117
|
+
export type MTableColumn = {
|
118
|
+
label: string;
|
119
|
+
component: Component;
|
120
|
+
width?: string | number;
|
121
|
+
};
|
122
|
+
|
123
|
+
export interface TableProps {
|
124
|
+
data?: any[];
|
125
|
+
height?: string | number;
|
126
|
+
maxHeight?: string | number;
|
127
|
+
stripe?: boolean;
|
128
|
+
border?: boolean;
|
129
|
+
size?: string;
|
130
|
+
fit?: boolean;
|
131
|
+
showHeader?: boolean;
|
132
|
+
highlightCurrentRow?: boolean;
|
133
|
+
currentRowKey?: string | number;
|
134
|
+
rowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
|
135
|
+
rowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
|
136
|
+
cellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
|
137
|
+
cellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
|
138
|
+
headerRowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
|
139
|
+
headerRowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
|
140
|
+
headerCellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
|
141
|
+
headerCellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
|
142
|
+
rowKey?: string | ((row: any) => string);
|
143
|
+
emptyText?: string;
|
144
|
+
defaultExpandAll?: boolean;
|
145
|
+
expandRowKeys?: any[];
|
146
|
+
defaultSort?: { prop: string, order: string };
|
147
|
+
tooltipEffect?: string;
|
148
|
+
showSummary?: boolean;
|
149
|
+
sumText?: string;
|
150
|
+
summaryMethod?: (param: { columns: any[], data: any[] }) => any[];
|
151
|
+
spanMethod?: (param: { row: any, column: any, rowIndex: number, columnIndex: number }) => number[] | { rowspan: number, colspan: number };
|
152
|
+
selectOnIndeterminate?: boolean;
|
153
|
+
indent?: number;
|
154
|
+
lazy?: boolean;
|
155
|
+
load?: (row: any, treeNode: any, resolve: (data: any[]) => void) => void;
|
156
|
+
treeProps?: { children: string, hasChildren: string };
|
157
|
+
}
|
158
|
+
|
159
|
+
export interface MorghulisTableProps extends TableProps {
|
160
|
+
loading?: boolean;
|
161
|
+
view: MetaView;
|
162
|
+
buttons?: MTableButton[];
|
163
|
+
columns?: MTableColumn[];
|
164
|
+
sortableCallback?: SortableCallbackFn;
|
165
|
+
}
|
166
|
+
|
167
|
+
export interface DTableProps {
|
168
|
+
auth?: boolean;
|
169
|
+
db: DaoTypes;
|
170
|
+
entity: string;
|
171
|
+
code?: string;
|
172
|
+
size?: number;
|
173
|
+
page?: number;
|
174
|
+
includes?: DataItem;
|
175
|
+
excludes?: DataItem;
|
176
|
+
orders?: Orders;
|
177
|
+
buttons?: MTableButton[];
|
178
|
+
columns?: MTableColumn[];
|
179
|
+
}
|
180
|
+
|
181
|
+
export interface DCellProps {
|
182
|
+
view: MetaView;
|
183
|
+
prop: string;
|
184
|
+
bean: DataItem;
|
185
|
+
db: DaoTypes;
|
186
|
+
disabled?: boolean;
|
187
|
+
}
|
188
|
+
|
189
|
+
export interface DFormProps {
|
190
|
+
selection: any[];
|
191
|
+
view: MetaView;
|
192
|
+
db: DaoTypes;
|
193
|
+
bean: DataItem;
|
194
|
+
}
|
195
|
+
|
196
|
+
// 定义useMorghulisAuthorize函数的返回类型
|
197
|
+
export interface MorghulisAuthorize {
|
198
|
+
$client: string;
|
199
|
+
user: () => any;
|
200
|
+
check: (uid?: any) => boolean;
|
201
|
+
login: (uid: any) => void;
|
202
|
+
logout: () => void;
|
203
|
+
bearer: () => string | null;
|
204
|
+
}
|
205
|
+
|
206
|
+
// 创建库的入口函数
|
207
|
+
export declare function createMorghulis(options?: MorOption): {
|
208
|
+
install: (Vue: App) => void;
|
209
|
+
};
|
210
|
+
|
211
|
+
// 导出MDialog组件
|
212
|
+
export declare const MDialog: DefineComponent<
|
213
|
+
MorDialogProps,
|
214
|
+
{},
|
215
|
+
{},
|
216
|
+
{},
|
217
|
+
{},
|
218
|
+
ComponentOptionsMixin,
|
219
|
+
ComponentOptionsMixin,
|
220
|
+
{
|
221
|
+
'update:modelValue': (value: boolean) => true;
|
222
|
+
'close': () => true;
|
223
|
+
'update:title': (value: string) => true;
|
224
|
+
'update:subTitle': (value: string) => true;
|
225
|
+
},
|
226
|
+
string,
|
227
|
+
VNodeProps & AllowedComponentProps & ComponentCustomProps,
|
228
|
+
Readonly<MorDialogProps> & {
|
229
|
+
onClose?: () => any;
|
230
|
+
'onUpdate:modelValue'?: (value: boolean) => any;
|
231
|
+
'onUpdate:title'?: (value: string) => any;
|
232
|
+
'onUpdate:subTitle'?: (value: string) => any;
|
233
|
+
},
|
234
|
+
{
|
235
|
+
title: string;
|
236
|
+
width: string | number;
|
237
|
+
fullscreen: boolean;
|
238
|
+
top: string;
|
239
|
+
modal: boolean;
|
240
|
+
modalClass: string;
|
241
|
+
headerClass: string;
|
242
|
+
bodyClass: string;
|
243
|
+
footerClass: string;
|
244
|
+
appendToBody: boolean;
|
245
|
+
appendTo: string;
|
246
|
+
lockScroll: boolean;
|
247
|
+
openDelay: number;
|
248
|
+
closeDelay: number;
|
249
|
+
closeOnClickModal: boolean;
|
250
|
+
closeOnPressEscape: boolean;
|
251
|
+
showClose: boolean;
|
252
|
+
draggable: boolean;
|
253
|
+
overFlow: boolean;
|
254
|
+
center: boolean;
|
255
|
+
alignCenter: boolean;
|
256
|
+
destroyOnClose: boolean;
|
257
|
+
closeIcon: string;
|
258
|
+
confirmButtonText: string;
|
259
|
+
cancelButtonText: string;
|
260
|
+
}
|
261
|
+
> & {
|
262
|
+
open: (data?: any, config?: MorDialogConfig) => void;
|
263
|
+
close: () => void;
|
264
|
+
};
|
265
|
+
|
266
|
+
// 导出MCell组件
|
267
|
+
export declare const MCell: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
|
268
|
+
|
269
|
+
// 导出MTable组件
|
270
|
+
export declare const MTable: DefineComponent<
|
271
|
+
MorghulisTableProps,
|
272
|
+
{},
|
273
|
+
{},
|
274
|
+
{},
|
275
|
+
{},
|
276
|
+
ComponentOptionsMixin,
|
277
|
+
ComponentOptionsMixin,
|
278
|
+
{
|
279
|
+
'selection-change': (selection: any[]) => true;
|
280
|
+
'sort': (column: any, prop: string, order: string) => true;
|
281
|
+
},
|
282
|
+
string,
|
283
|
+
VNodeProps & AllowedComponentProps & ComponentCustomProps,
|
284
|
+
Readonly<MorghulisTableProps> & {
|
285
|
+
'onSelection-change'?: (selection: any[]) => any;
|
286
|
+
'onSort'?: (column: any, prop: string, order: string) => any;
|
287
|
+
},
|
288
|
+
{}
|
289
|
+
>;
|
290
|
+
|
291
|
+
// 导出MForm组件
|
292
|
+
export declare const MForm: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
|
293
|
+
|
294
|
+
// 导出数据表格相关组件
|
295
|
+
export declare const DTable: DefineComponent<
|
296
|
+
DTableProps,
|
297
|
+
{},
|
298
|
+
{},
|
299
|
+
{},
|
300
|
+
{},
|
301
|
+
ComponentOptionsMixin,
|
302
|
+
ComponentOptionsMixin,
|
303
|
+
{},
|
304
|
+
string,
|
305
|
+
VNodeProps & AllowedComponentProps & ComponentCustomProps,
|
306
|
+
Readonly<DTableProps>,
|
307
|
+
{
|
308
|
+
size: number;
|
309
|
+
page: number;
|
310
|
+
}
|
311
|
+
> & {
|
312
|
+
refresh: () => void;
|
313
|
+
add: () => void;
|
314
|
+
edit: (row: any) => void;
|
315
|
+
remove: (row: any) => void;
|
316
|
+
handlePageSizeChange: (size: number) => void;
|
317
|
+
handleCurrentPageChange: (page: number) => void;
|
318
|
+
};
|
319
|
+
|
320
|
+
export declare const DCell: DefineComponent<
|
321
|
+
DCellProps,
|
322
|
+
{},
|
323
|
+
{},
|
324
|
+
{},
|
325
|
+
{},
|
326
|
+
ComponentOptionsMixin,
|
327
|
+
ComponentOptionsMixin,
|
328
|
+
{
|
329
|
+
cancel: (...args: any[]) => void;
|
330
|
+
save: (...args: any[]) => void;
|
331
|
+
},
|
332
|
+
string,
|
333
|
+
VNodeProps & AllowedComponentProps & ComponentCustomProps,
|
334
|
+
Readonly<DCellProps> & {
|
335
|
+
onCancel?: (...args: any[]) => any;
|
336
|
+
onSave?: (...args: any[]) => any;
|
337
|
+
},
|
338
|
+
{}
|
339
|
+
>;
|
340
|
+
|
341
|
+
export declare const DForm: DefineComponent<
|
342
|
+
DFormProps,
|
343
|
+
{},
|
344
|
+
{},
|
345
|
+
{},
|
346
|
+
{},
|
347
|
+
ComponentOptionsMixin,
|
348
|
+
ComponentOptionsMixin,
|
349
|
+
{},
|
350
|
+
string,
|
351
|
+
VNodeProps & AllowedComponentProps & ComponentCustomProps,
|
352
|
+
Readonly<DFormProps>,
|
353
|
+
{}
|
354
|
+
> & {
|
355
|
+
getData: () => any[];
|
356
|
+
};
|
357
|
+
|
358
|
+
export declare const DController: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
|
359
|
+
|
360
|
+
// 声明useMorghulisAuthorize函数
|
361
|
+
export declare function useMorghulisAuthorize(): MorghulisAuthorize;
|
362
|
+
|
363
|
+
// 其他hooks
|
364
|
+
export declare function useMorghulisChannel(): any;
|
365
|
+
export declare function useMorghulisSockets(baseURL?: string): any;
|
366
|
+
export declare function loadMorghulisSockets(baseURL?: string): any;
|
367
|
+
export declare function useMorghulisRequest(): {
|
368
|
+
get: <T = any>(url: string, params?: any, config?: any) => Promise<T>;
|
369
|
+
post: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
|
370
|
+
put: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
|
371
|
+
delete: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
|
372
|
+
};
|
373
|
+
export declare function useMorghulisCookies(): {
|
374
|
+
get: (key: string, defaultValue?: any) => any;
|
375
|
+
set: (key: string, value: any, options?: any) => void;
|
376
|
+
remove: (key: string, options?: any) => void;
|
377
|
+
load: (key: string, defaultValue?: any) => any;
|
378
|
+
};
|
379
|
+
|
380
|
+
// 声明全局组件类型
|
381
|
+
declare module '@vue/runtime-core' {
|
382
|
+
export interface GlobalComponents {
|
383
|
+
// Morghulis组件
|
384
|
+
MDialog: typeof MDialog;
|
385
|
+
MTable: typeof MTable;
|
386
|
+
MForm: typeof MForm;
|
387
|
+
MCell: typeof MCell;
|
388
|
+
DTable: typeof DTable;
|
389
|
+
DCell: typeof DCell;
|
390
|
+
DForm: typeof DForm;
|
391
|
+
DController: typeof DController;
|
392
|
+
|
393
|
+
// Element Plus组件
|
394
|
+
ElButton: typeof ElButton;
|
395
|
+
ElDialog: typeof ElDialog;
|
396
|
+
ElText: typeof ElText;
|
397
|
+
ElDivider: typeof ElDivider;
|
398
|
+
ElSpace: typeof ElSpace;
|
399
|
+
// 可以根据需要添加更多Element Plus组件
|
400
|
+
}
|
401
|
+
}
|