morghulis 3.0.13 → 3.0.15
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/morghulis.es.js +1564 -1522
- package/dist/morghulis.es.js.map +1 -1
- package/dist/morghulis.umd.js +19 -19
- package/dist/morghulis.umd.js.map +1 -1
- package/dist/types/hooks/use-auth/index.d.ts +1 -1
- package/dist/types/hooks/use-channel/index.d.ts +4 -8
- package/dist/types/hooks/use-channel/tools.d.ts +2 -3
- package/dist/types/hooks/use-channel/types.d.ts +17 -3
- package/dist/types/hooks/use-cookies/index.d.ts +1 -1
- package/dist/types/hooks/use-dao/index.d.ts +9 -0
- package/dist/types/hooks/use-dao/types.d.ts +20 -0
- package/dist/types/hooks/use-mata/index.d.ts +0 -0
- package/dist/types/hooks/use-mata/types.d.ts +85 -0
- package/dist/types/hooks/use-morghulis/index.d.ts +2 -0
- package/dist/types/hooks/{use-core → use-morghulis}/types.d.ts +1 -8
- package/dist/types/hooks/use-query/index.d.ts +2 -0
- package/dist/types/hooks/use-query/tool.d.ts +0 -0
- package/dist/types/hooks/use-query/types.d.ts +20 -0
- package/dist/types/hooks/use-request/index.d.ts +1 -1
- package/dist/types/hooks/use-socket/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -3
- package/package.json +1 -1
- package/dist/types/hooks/use-core/index.d.ts +0 -2
@@ -1,9 +1,5 @@
|
|
1
|
-
import { MorghulisChannel } from "
|
2
|
-
export declare function
|
3
|
-
register: (handler: string, channel
|
4
|
-
|
5
|
-
status: {
|
6
|
-
loading: boolean;
|
7
|
-
payload?: any;
|
8
|
-
};
|
1
|
+
import type { MorghulisChannel, MorghulisChannelConfig } from "./types";
|
2
|
+
export declare function useMChannel(auth?: boolean): {
|
3
|
+
register: (handler: string, channel?: MorghulisChannelConfig, socketURL?: string) => void;
|
4
|
+
getChannel: (handler: string) => MorghulisChannel | undefined;
|
9
5
|
};
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import { MorghulisChannel } from "
|
2
|
-
|
3
|
-
export declare function getChannel(status: ChannelStatus, channel?: MorghulisChannel): MorghulisChannel;
|
1
|
+
import type { MorghulisChannel, MorghulisChannelConfig } from "./types";
|
2
|
+
export declare function createChannel(url: string, channel?: MorghulisChannelConfig, auth?: boolean): MorghulisChannel;
|
@@ -1,4 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { Ref } from "vue";
|
2
|
+
export type MorghulisChannelConfig = {
|
3
|
+
onStart?: () => void;
|
4
|
+
onStop?: () => void;
|
5
|
+
onProceed?: (payload: any) => void;
|
6
|
+
};
|
7
|
+
export type MorghulisChannel = {
|
8
|
+
payload: Ref<any>;
|
9
|
+
loading: Ref<boolean>;
|
10
|
+
activate: (body: any) => void;
|
11
|
+
$url: string;
|
12
|
+
$start: () => void;
|
13
|
+
$stop: () => void;
|
14
|
+
$proceed?: (payload: any) => void;
|
15
|
+
};
|
16
|
+
export type MorghulisChannels = {
|
17
|
+
[key: string]: MorghulisChannel;
|
4
18
|
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { type Ref } from "vue";
|
2
|
+
import { type Meta } from "../use-mata/types";
|
3
|
+
import { MorghulisChannelConfig } from "../use-channel/types";
|
4
|
+
/**
|
5
|
+
* http和socket的loading冲突问题
|
6
|
+
*/
|
7
|
+
export declare function useMDao(meta: Ref<Meta>, channel?: MorghulisChannelConfig, auth?: boolean): {
|
8
|
+
handler: import("vue").ComputedRef<string>;
|
9
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { DataItem, Query } from "../use-query/types";
|
2
|
+
import { MetaView } from "../use-mata/types";
|
3
|
+
import { ComputedRef } from "vue";
|
4
|
+
import { MorghulisChannelConfig } from "../use-channel/types";
|
5
|
+
export type DaoConfig = {
|
6
|
+
auth?: boolean;
|
7
|
+
channel: MorghulisChannelConfig;
|
8
|
+
};
|
9
|
+
export type DaoPayload = {
|
10
|
+
results: DataItem[];
|
11
|
+
total?: number;
|
12
|
+
};
|
13
|
+
export type DaoCallback = (item: DataItem | DaoPayload | MetaView | null) => void;
|
14
|
+
export interface Dao {
|
15
|
+
handler: ComputedRef<string>;
|
16
|
+
find_many: (query: Query) => Promise<{
|
17
|
+
results: DataItem[];
|
18
|
+
total?: number;
|
19
|
+
}>;
|
20
|
+
}
|
File without changes
|
@@ -0,0 +1,85 @@
|
|
1
|
+
export type MetaDatabase = 'orm' | 'mon';
|
2
|
+
export type Meta = {
|
3
|
+
db: MetaDatabase;
|
4
|
+
entity: string;
|
5
|
+
code?: string;
|
6
|
+
};
|
7
|
+
export type MetaView = {
|
8
|
+
fields?: {
|
9
|
+
[key: string]: MetaField;
|
10
|
+
};
|
11
|
+
path?: string;
|
12
|
+
code?: string;
|
13
|
+
meta_name?: string;
|
14
|
+
view_name?: string;
|
15
|
+
form_width?: number;
|
16
|
+
form_height?: number;
|
17
|
+
table_width?: number;
|
18
|
+
table_height?: number;
|
19
|
+
enable?: boolean;
|
20
|
+
show_header?: boolean;
|
21
|
+
allow_batch?: boolean;
|
22
|
+
allow_search?: boolean;
|
23
|
+
allow_sort?: boolean;
|
24
|
+
allow_pop?: boolean;
|
25
|
+
allow_insert?: boolean;
|
26
|
+
allow_edit?: boolean;
|
27
|
+
allow_remove?: boolean;
|
28
|
+
allow_download?: boolean;
|
29
|
+
allow_upload?: boolean;
|
30
|
+
};
|
31
|
+
export type MetaField = {
|
32
|
+
prop?: string;
|
33
|
+
label?: string;
|
34
|
+
name?: string;
|
35
|
+
domain?: string;
|
36
|
+
tool?: string;
|
37
|
+
refer?: MetaRefer;
|
38
|
+
format?: MetaFormat;
|
39
|
+
unit?: string | null;
|
40
|
+
not_null?: boolean;
|
41
|
+
read_only?: boolean;
|
42
|
+
sortable?: boolean;
|
43
|
+
allow_search?: boolean;
|
44
|
+
allow_download?: boolean;
|
45
|
+
allow_upload?: boolean;
|
46
|
+
allow_update?: boolean;
|
47
|
+
column_width?: number;
|
48
|
+
align?: 'left' | 'center' | 'right';
|
49
|
+
fixed?: '' | 'left' | 'right';
|
50
|
+
header_color?: string | null;
|
51
|
+
cell_color?: string | null;
|
52
|
+
edit_on_table?: boolean;
|
53
|
+
hide_on_table?: boolean;
|
54
|
+
span?: number;
|
55
|
+
hide_on_form?: boolean;
|
56
|
+
hide_on_form_edit?: boolean;
|
57
|
+
hide_on_form_insert?: boolean;
|
58
|
+
hide_on_form_branch?: boolean;
|
59
|
+
hide_on_form_leaf?: boolean;
|
60
|
+
};
|
61
|
+
export type MetaRefer = {
|
62
|
+
entity?: string;
|
63
|
+
value?: string;
|
64
|
+
label?: string;
|
65
|
+
display?: string;
|
66
|
+
multiple?: boolean;
|
67
|
+
strict?: boolean;
|
68
|
+
remote?: boolean;
|
69
|
+
includes?: object;
|
70
|
+
excludes?: object;
|
71
|
+
root?: number;
|
72
|
+
};
|
73
|
+
export type MetaFormat = {
|
74
|
+
maxlength?: number;
|
75
|
+
type?: 'date' | 'datetime';
|
76
|
+
min?: number | null;
|
77
|
+
max?: number | null;
|
78
|
+
step?: number | null;
|
79
|
+
precision?: number | null;
|
80
|
+
step_strictly?: boolean;
|
81
|
+
accept?: string;
|
82
|
+
width?: number | string;
|
83
|
+
height?: number | string;
|
84
|
+
locket?: boolean;
|
85
|
+
};
|
@@ -1,12 +1,5 @@
|
|
1
1
|
import { Ref } from "vue";
|
2
|
-
|
3
|
-
start?: () => void;
|
4
|
-
stop?: () => void;
|
5
|
-
proceed?: (payload: any) => void;
|
6
|
-
};
|
7
|
-
export type MorghulisChannels = {
|
8
|
-
[key: string]: MorghulisChannel;
|
9
|
-
};
|
2
|
+
import { MorghulisChannels } from "../use-channel/types";
|
10
3
|
export type MorghulisOptions = {
|
11
4
|
baseURL?: string;
|
12
5
|
minioURL?: string;
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export type DataItem = {
|
2
|
+
id?: DataItem;
|
3
|
+
[key: string]: any;
|
4
|
+
};
|
5
|
+
export type DataItemId = string | number;
|
6
|
+
export type Orders = {
|
7
|
+
[key: string]: 1 | -1;
|
8
|
+
};
|
9
|
+
export type Condition = {
|
10
|
+
includes: DataItem;
|
11
|
+
excludes: DataItem;
|
12
|
+
};
|
13
|
+
export type QueryTemplate = {
|
14
|
+
includes?: DataItem;
|
15
|
+
excludes?: DataItem;
|
16
|
+
orders?: Orders;
|
17
|
+
page?: number;
|
18
|
+
size?: number;
|
19
|
+
};
|
20
|
+
export type Query = {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import 'nprogress/nprogress.css';
|
2
|
-
export declare function
|
2
|
+
export declare function useMRequest(): {
|
3
3
|
getHttpRequest: (auth?: boolean) => import("axios").AxiosInstance;
|
4
4
|
getMinioRequest: () => import("axios").AxiosInstance;
|
5
5
|
all: () => void;
|
package/dist/types/index.d.ts
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
import './style.css';
|
2
2
|
import { App } from "vue";
|
3
3
|
import MDialog from "./components/dialog/MDialog.vue";
|
4
|
-
import {
|
5
|
-
import {
|
4
|
+
import { useMRequest } from "./hooks/use-request";
|
5
|
+
import { useMChannel } from "./hooks/use-channel";
|
6
|
+
import { useMSockets } from "./hooks/use-socket";
|
7
|
+
import { MorghulisOptions } from "./hooks/use-morghulis/types";
|
8
|
+
import type { MorghulisChannelConfig } from "./hooks/use-channel/types";
|
6
9
|
declare module "vue" {
|
7
10
|
interface GlobalComponents {
|
8
11
|
MDialog: typeof MDialog;
|
@@ -11,4 +14,4 @@ declare module "vue" {
|
|
11
14
|
export declare const createMorghulis: (options?: MorghulisOptions) => {
|
12
15
|
install(Vue: App): void;
|
13
16
|
};
|
14
|
-
export { MDialog,
|
17
|
+
export { MDialog, useMRequest, useMChannel, useMSockets, MorghulisChannelConfig };
|
package/package.json
CHANGED