@gct-paas/core 0.1.5-dev.2 → 0.1.5-dev.4
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/index.esm.min.js +1 -1
- package/es/enums/page-designer/widget.d.ts +2 -2
- package/es/global/gct/gct.d.ts +108 -107
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useFile.d.ts +4 -0
- package/es/hooks/useFile.mjs +22 -0
- package/es/index.mjs +2 -1
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +23 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
- package/es/interface/index.d.ts +1 -1
- package/es/locale/index.d.ts +3 -1
- package/es/locale/index.mjs +13 -2
- package/es/modules/platform-config/store.d.ts +106 -106
- package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
- package/es/modules/user-stores/store/tenant.store.d.ts +6 -8
- package/es/modules/user-stores/store/tenant.store.mjs +12 -14
- package/es/modules/user-stores/types/tenant.d.ts +7 -1
- package/es/setup-app.mjs +1 -0
- package/es/store/global-store.mjs +3 -0
- package/es/utils/file/download.d.ts +1 -1
- package/es/utils/file/parser.d.ts +1 -1
- package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +34 -13
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +51 -40
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +2 -2
- package/package.json +18 -19
- package/es/interface/i-kit-info/i-kit-info.d.ts +0 -20
|
@@ -3,39 +3,22 @@ import { SysConfigResponse } from '@gct-paas/api/platform';
|
|
|
3
3
|
* 平台配置 Store
|
|
4
4
|
*/
|
|
5
5
|
export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"platform-config", Pick<{
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
|
|
7
|
+
setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
|
|
8
|
+
postBasicSetting: () => Promise<string>;
|
|
8
9
|
deploySetting: {
|
|
9
10
|
deployMode: import('./enums').DeployModeEnum;
|
|
10
11
|
};
|
|
11
12
|
setDeploySetting: (data: SysConfigResponse) => void;
|
|
12
13
|
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
transparent: number;
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
postWatermarkSetting: () => Promise<void>;
|
|
26
|
-
setWatermarkSetting: (data: SysConfigResponse) => void;
|
|
27
|
-
themeSetting: import('./interfaces').IThemeSetting;
|
|
28
|
-
setThemeSetting: (data: SysConfigResponse) => void;
|
|
29
|
-
postThemeSetting: () => Promise<void>;
|
|
30
|
-
menuCollapsed: import('vue').Ref<boolean, boolean>;
|
|
31
|
-
toggleMenuCollapsed: () => void;
|
|
32
|
-
menuCollapsedWidth: number;
|
|
33
|
-
menuWidthRange: number[];
|
|
34
|
-
themeColors: string[];
|
|
35
|
-
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
36
|
-
postSecuritySetting: () => Promise<void>;
|
|
37
|
-
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
38
|
-
getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
|
|
14
|
+
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
15
|
+
postLoginSetting: () => Promise<void>;
|
|
16
|
+
setLoginSetting: (config: SysConfigResponse | undefined) => void;
|
|
17
|
+
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
18
|
+
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
19
|
+
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
20
|
+
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
21
|
+
loginModeConfig: Map<string, IObject>;
|
|
39
22
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
40
23
|
setOrgSetting: (data: SysConfigResponse) => void;
|
|
41
24
|
postOrgSetting: () => Promise<void>;
|
|
@@ -62,27 +45,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
62
45
|
label: string;
|
|
63
46
|
value: string;
|
|
64
47
|
}[]>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
renderInit: () => Promise<void>;
|
|
78
|
-
}, "projectSetting" | "deploySetting" | "watermarkSetting" | "themeSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "themeColors" | "securitySetting" | "orgSetting" | "relationFields" | "relationFiledsCopy" | "loginSetting" | "loginModeAuthTypes" | "openIDOAuthAuthTypes" | "sysLoginSort" | "openIDOAuthAuthSort" | "loginModeConfig" | "basicSetting">, Pick<{
|
|
79
|
-
projectSetting: {};
|
|
80
|
-
setProjectConfig: (config: {}) => void;
|
|
81
|
-
deploySetting: {
|
|
82
|
-
deployMode: import('./enums').DeployModeEnum;
|
|
83
|
-
};
|
|
84
|
-
setDeploySetting: (data: SysConfigResponse) => void;
|
|
85
|
-
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
48
|
+
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
49
|
+
postSecuritySetting: () => Promise<void>;
|
|
50
|
+
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
51
|
+
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
52
|
+
themeSetting: import('./interfaces').IThemeSetting;
|
|
53
|
+
setThemeSetting: (data: SysConfigResponse) => void;
|
|
54
|
+
postThemeSetting: () => Promise<void>;
|
|
55
|
+
menuCollapsed: import('vue').Ref<boolean, boolean>;
|
|
56
|
+
toggleMenuCollapsed: () => void;
|
|
57
|
+
menuCollapsedWidth: number;
|
|
58
|
+
menuWidthRange: number[];
|
|
59
|
+
themeColors: string[];
|
|
86
60
|
watermarkSetting: {
|
|
87
61
|
openWatermark: boolean;
|
|
88
62
|
watermarkContent: string;
|
|
@@ -97,18 +71,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
97
71
|
};
|
|
98
72
|
postWatermarkSetting: () => Promise<void>;
|
|
99
73
|
setWatermarkSetting: (data: SysConfigResponse) => void;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
74
|
+
projectSetting: {};
|
|
75
|
+
setProjectConfig: (config: {}) => void;
|
|
76
|
+
init: () => Promise<void>;
|
|
77
|
+
renderInit: () => Promise<void>;
|
|
78
|
+
}, "basicSetting" | "deploySetting" | "loginModeAuthTypes" | "loginModeConfig" | "loginSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "openIDOAuthAuthSort" | "openIDOAuthAuthTypes" | "orgSetting" | "projectSetting" | "relationFields" | "relationFiledsCopy" | "securitySetting" | "sysLoginSort" | "themeColors" | "themeSetting" | "watermarkSetting">, Pick<{
|
|
79
|
+
basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
|
|
80
|
+
setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
|
|
81
|
+
postBasicSetting: () => Promise<string>;
|
|
82
|
+
deploySetting: {
|
|
83
|
+
deployMode: import('./enums').DeployModeEnum;
|
|
84
|
+
};
|
|
85
|
+
setDeploySetting: (data: SysConfigResponse) => void;
|
|
86
|
+
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
87
|
+
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
88
|
+
postLoginSetting: () => Promise<void>;
|
|
89
|
+
setLoginSetting: (config: SysConfigResponse | undefined) => void;
|
|
90
|
+
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
91
|
+
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
92
|
+
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
93
|
+
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
94
|
+
loginModeConfig: Map<string, IObject>;
|
|
112
95
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
113
96
|
setOrgSetting: (data: SysConfigResponse) => void;
|
|
114
97
|
postOrgSetting: () => Promise<void>;
|
|
@@ -135,27 +118,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
135
118
|
label: string;
|
|
136
119
|
value: string;
|
|
137
120
|
}[]>;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
renderInit: () => Promise<void>;
|
|
151
|
-
}, "isIndependentApp">, Pick<{
|
|
152
|
-
projectSetting: {};
|
|
153
|
-
setProjectConfig: (config: {}) => void;
|
|
154
|
-
deploySetting: {
|
|
155
|
-
deployMode: import('./enums').DeployModeEnum;
|
|
156
|
-
};
|
|
157
|
-
setDeploySetting: (data: SysConfigResponse) => void;
|
|
158
|
-
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
121
|
+
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
122
|
+
postSecuritySetting: () => Promise<void>;
|
|
123
|
+
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
124
|
+
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
125
|
+
themeSetting: import('./interfaces').IThemeSetting;
|
|
126
|
+
setThemeSetting: (data: SysConfigResponse) => void;
|
|
127
|
+
postThemeSetting: () => Promise<void>;
|
|
128
|
+
menuCollapsed: import('vue').Ref<boolean, boolean>;
|
|
129
|
+
toggleMenuCollapsed: () => void;
|
|
130
|
+
menuCollapsedWidth: number;
|
|
131
|
+
menuWidthRange: number[];
|
|
132
|
+
themeColors: string[];
|
|
159
133
|
watermarkSetting: {
|
|
160
134
|
openWatermark: boolean;
|
|
161
135
|
watermarkContent: string;
|
|
@@ -170,18 +144,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
170
144
|
};
|
|
171
145
|
postWatermarkSetting: () => Promise<void>;
|
|
172
146
|
setWatermarkSetting: (data: SysConfigResponse) => void;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
147
|
+
projectSetting: {};
|
|
148
|
+
setProjectConfig: (config: {}) => void;
|
|
149
|
+
init: () => Promise<void>;
|
|
150
|
+
renderInit: () => Promise<void>;
|
|
151
|
+
}, "isIndependentApp">, Pick<{
|
|
152
|
+
basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
|
|
153
|
+
setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
|
|
154
|
+
postBasicSetting: () => Promise<string>;
|
|
155
|
+
deploySetting: {
|
|
156
|
+
deployMode: import('./enums').DeployModeEnum;
|
|
157
|
+
};
|
|
158
|
+
setDeploySetting: (data: SysConfigResponse) => void;
|
|
159
|
+
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
160
|
+
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
161
|
+
postLoginSetting: () => Promise<void>;
|
|
162
|
+
setLoginSetting: (config: SysConfigResponse | undefined) => void;
|
|
163
|
+
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
164
|
+
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
165
|
+
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
166
|
+
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
167
|
+
loginModeConfig: Map<string, IObject>;
|
|
185
168
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
186
169
|
setOrgSetting: (data: SysConfigResponse) => void;
|
|
187
170
|
postOrgSetting: () => Promise<void>;
|
|
@@ -208,18 +191,35 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
208
191
|
label: string;
|
|
209
192
|
value: string;
|
|
210
193
|
}[]>;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
194
|
+
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
195
|
+
postSecuritySetting: () => Promise<void>;
|
|
196
|
+
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
197
|
+
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
198
|
+
themeSetting: import('./interfaces').IThemeSetting;
|
|
199
|
+
setThemeSetting: (data: SysConfigResponse) => void;
|
|
200
|
+
postThemeSetting: () => Promise<void>;
|
|
201
|
+
menuCollapsed: import('vue').Ref<boolean, boolean>;
|
|
202
|
+
toggleMenuCollapsed: () => void;
|
|
203
|
+
menuCollapsedWidth: number;
|
|
204
|
+
menuWidthRange: number[];
|
|
205
|
+
themeColors: string[];
|
|
206
|
+
watermarkSetting: {
|
|
207
|
+
openWatermark: boolean;
|
|
208
|
+
watermarkContent: string;
|
|
209
|
+
fontSize: number;
|
|
210
|
+
color: string;
|
|
211
|
+
verticalAlign: string;
|
|
212
|
+
textAlign: string;
|
|
213
|
+
text: string;
|
|
214
|
+
transparent: number;
|
|
215
|
+
width: number;
|
|
216
|
+
height: number;
|
|
217
|
+
};
|
|
218
|
+
postWatermarkSetting: () => Promise<void>;
|
|
219
|
+
setWatermarkSetting: (data: SysConfigResponse) => void;
|
|
220
|
+
projectSetting: {};
|
|
221
|
+
setProjectConfig: (config: {}) => void;
|
|
222
222
|
init: () => Promise<void>;
|
|
223
223
|
renderInit: () => Promise<void>;
|
|
224
|
-
}, "
|
|
224
|
+
}, "getSignWay" | "init" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
|
|
225
225
|
export type IPlatformConfigStore = ReturnType<typeof usePlatformConfigStore>;
|
|
@@ -8,5 +8,5 @@ export declare function useSecuritySetting(isPlatform?: boolean): {
|
|
|
8
8
|
securitySetting: SecurityConfig;
|
|
9
9
|
postSecuritySetting: () => Promise<void>;
|
|
10
10
|
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
11
|
-
getSignWay: () => "
|
|
11
|
+
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
12
12
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { UserOfTenantDTO } from '@gct-paas/api/platform';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
getTenantUserInfoAction(): Promise<UserOfTenantDTO | undefined>;
|
|
9
|
-
}>;
|
|
2
|
+
import { tenantState } from '../types/tenant';
|
|
3
|
+
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {
|
|
4
|
+
getTenantUserInfoAction(state: {
|
|
5
|
+
tenantUserInfo: Record<string, UserOfTenantDTO>;
|
|
6
|
+
} & import('pinia').PiniaCustomStateProperties<tenantState>): () => Promise<UserOfTenantDTO>;
|
|
7
|
+
}, {}>;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
+
import { getTenant } from "../../../utils/tools/tools.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
1
3
|
import { defineStore } from "pinia";
|
|
2
4
|
//#region src/modules/user-stores/store/tenant.store.ts
|
|
3
5
|
var useTenantStore = defineStore("tenant", {
|
|
4
|
-
state: () => ({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
setTenant(tenantId) {
|
|
11
|
-
this.tenantId = tenantId;
|
|
12
|
-
},
|
|
13
|
-
async getTenantUserInfoAction() {
|
|
14
|
-
if (!this.tenantId) return;
|
|
6
|
+
state: () => ({ tenantUserInfo: {} }),
|
|
7
|
+
getters: { getTenantUserInfoAction(state) {
|
|
8
|
+
return async () => {
|
|
9
|
+
const tenantId = getTenant();
|
|
10
|
+
if (!tenantId) return Promise.reject(null);
|
|
11
|
+
if (state.tenantUserInfo[tenantId]) return state.tenantUserInfo[tenantId];
|
|
15
12
|
const info = await _api.platform.tenant.getUserInfo();
|
|
16
|
-
|
|
13
|
+
state.tenantUserInfo[tenantId] = info;
|
|
17
14
|
return info;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
15
|
+
};
|
|
16
|
+
} },
|
|
17
|
+
actions: {}
|
|
20
18
|
});
|
|
21
19
|
//#endregion
|
|
22
20
|
export { useTenantStore };
|
package/es/setup-app.mjs
CHANGED
|
@@ -15,8 +15,8 @@ export declare function downloadByOnlineUrl(url: string, filename: string, mime?
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart): void;
|
|
17
17
|
export declare function uploaderFiles({ multiple, accept }?: {
|
|
18
|
-
multiple?: boolean | undefined;
|
|
19
18
|
accept?: string | undefined;
|
|
19
|
+
multiple?: boolean | undefined;
|
|
20
20
|
}): Promise<File[]>;
|
|
21
21
|
/**
|
|
22
22
|
* Download according to the background interface file stream
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UploadTypeEnum } from '../../enums';
|
|
2
2
|
export declare const sizeParser: (size: number) => string;
|
|
3
|
-
export declare const typeParser: (fileName: string) => "attachment" | "img" | UploadTypeEnum.JPG | UploadTypeEnum.JPEG | UploadTypeEnum.PNG | UploadTypeEnum.BMP | UploadTypeEnum.DOCX | UploadTypeEnum.XLSX | UploadTypeEnum.DOC | UploadTypeEnum.MP4 | UploadTypeEnum.AVI | UploadTypeEnum.PPT | UploadTypeEnum.GIF
|
|
3
|
+
export declare const typeParser: (fileName: string) => "MP4" | "PDF" | "attachment" | "img" | "ssl" | UploadTypeEnum.JPG | UploadTypeEnum.JPEG | UploadTypeEnum.PNG | UploadTypeEnum.BMP | UploadTypeEnum.DOCX | UploadTypeEnum.XLSX | UploadTypeEnum.DOC | UploadTypeEnum.MP4 | UploadTypeEnum.AVI | UploadTypeEnum.PPT | UploadTypeEnum.GIF;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginModeEnum } from '../../enums';
|
|
2
|
-
import {
|
|
3
|
-
import { App } from 'vue';
|
|
2
|
+
import { IPluginKitModule } from '../../interface';
|
|
4
3
|
/**
|
|
5
4
|
* 用于加载套件包的工具类
|
|
6
5
|
*
|
|
@@ -8,25 +7,47 @@ import { App } from 'vue';
|
|
|
8
7
|
* @class KitPkgUtil
|
|
9
8
|
*/
|
|
10
9
|
export declare class KitPkgUtil {
|
|
11
|
-
protected static readonly KIT_PKG_BASE_PATH = "/
|
|
12
|
-
protected static cache: Map<string, IKitInfo>;
|
|
10
|
+
protected static readonly KIT_PKG_BASE_PATH = "/plugin-kit";
|
|
13
11
|
protected static joinPaths(...paths: string[]): string;
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* 加载套件包,返回套件包入口实例
|
|
16
14
|
*
|
|
17
15
|
* @static
|
|
18
16
|
* @param {string} kit
|
|
19
|
-
* @
|
|
17
|
+
* @param {PluginModeEnum} mode
|
|
18
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
20
19
|
*/
|
|
21
|
-
static
|
|
20
|
+
static loadKit(kit: string, mode: PluginModeEnum): Promise<IPluginKitModule | null>;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* 加载设计模式套件包
|
|
24
23
|
*
|
|
25
24
|
* @static
|
|
26
|
-
* @param {
|
|
27
|
-
* @
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
* @param {string} kit
|
|
26
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
27
|
+
*/
|
|
28
|
+
static loadDesign(kit: string): Promise<IPluginKitModule | null>;
|
|
29
|
+
/**
|
|
30
|
+
* 加载移动端绘制模式套件包
|
|
31
|
+
*
|
|
32
|
+
* @static
|
|
33
|
+
* @param {string} kit
|
|
34
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
35
|
+
*/
|
|
36
|
+
static loadMobile(kit: string): Promise<IPluginKitModule | null>;
|
|
37
|
+
/**
|
|
38
|
+
* 加载平板端绘制模式套件包
|
|
39
|
+
*
|
|
40
|
+
* @static
|
|
41
|
+
* @param {string} kit
|
|
42
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
43
|
+
*/
|
|
44
|
+
static loadPad(kit: string): Promise<IPluginKitModule | null>;
|
|
45
|
+
/**
|
|
46
|
+
* 加载网页端绘制模式套件包
|
|
47
|
+
*
|
|
48
|
+
* @static
|
|
49
|
+
* @param {string} kit
|
|
50
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
30
51
|
*/
|
|
31
|
-
static
|
|
52
|
+
static loadWeb(kit: string): Promise<IPluginKitModule | null>;
|
|
32
53
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PluginModeEnum } from "../../enums/plugin-enum.mjs";
|
|
2
|
+
import "../../enums/index.mjs";
|
|
1
3
|
//#region src/utils/kit-pkg-util/kit-pkg-util.ts
|
|
2
4
|
/**
|
|
3
5
|
* 用于加载套件包的工具类
|
|
@@ -6,8 +8,7 @@
|
|
|
6
8
|
* @class KitPkgUtil
|
|
7
9
|
*/
|
|
8
10
|
var KitPkgUtil = class {
|
|
9
|
-
static KIT_PKG_BASE_PATH = "/
|
|
10
|
-
static cache = /* @__PURE__ */ new Map();
|
|
11
|
+
static KIT_PKG_BASE_PATH = "/plugin-kit";
|
|
11
12
|
static joinPaths(...paths) {
|
|
12
13
|
return paths.filter((p) => p && p.length > 0).map((p, index) => {
|
|
13
14
|
let normalized = p;
|
|
@@ -17,56 +18,66 @@ var KitPkgUtil = class {
|
|
|
17
18
|
}).join("/");
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* 加载套件包,返回套件包入口实例
|
|
21
22
|
*
|
|
22
23
|
* @static
|
|
23
24
|
* @param {string} kit
|
|
24
|
-
* @
|
|
25
|
+
* @param {PluginModeEnum} mode
|
|
26
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
25
27
|
*/
|
|
26
|
-
static async
|
|
27
|
-
|
|
28
|
+
static async loadKit(kit, mode) {
|
|
29
|
+
const loaderUrl = this.joinPaths(this.KIT_PKG_BASE_PATH, kit, mode, `loader.esm.min.js`);
|
|
28
30
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const module = await import(
|
|
32
|
+
/* @vite-ignore */
|
|
33
|
+
loaderUrl
|
|
34
|
+
);
|
|
35
|
+
if (module && module.default) return module.default;
|
|
36
|
+
else console.warn(`Kit ${kit} does not export a default function`);
|
|
35
37
|
} catch (error) {
|
|
36
|
-
console.error(`Error loading kit
|
|
38
|
+
console.error(`Error loading kit ${kit} from ${loaderUrl}:`, error);
|
|
37
39
|
}
|
|
40
|
+
return null;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
43
|
+
* 加载设计模式套件包
|
|
41
44
|
*
|
|
42
45
|
* @static
|
|
43
|
-
* @param {
|
|
44
|
-
* @
|
|
45
|
-
* @param {PluginModeEnum} mode
|
|
46
|
-
* @return {*} {Promise<void>}
|
|
46
|
+
* @param {string} kit
|
|
47
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
47
48
|
*/
|
|
48
|
-
static
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
static loadDesign(kit) {
|
|
50
|
+
return this.loadKit(kit, PluginModeEnum.DESIGN);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 加载移动端绘制模式套件包
|
|
54
|
+
*
|
|
55
|
+
* @static
|
|
56
|
+
* @param {string} kit
|
|
57
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
58
|
+
*/
|
|
59
|
+
static loadMobile(kit) {
|
|
60
|
+
return this.loadKit(kit, PluginModeEnum.MOBILE);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 加载平板端绘制模式套件包
|
|
64
|
+
*
|
|
65
|
+
* @static
|
|
66
|
+
* @param {string} kit
|
|
67
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
68
|
+
*/
|
|
69
|
+
static loadPad(kit) {
|
|
70
|
+
return this.loadKit(kit, PluginModeEnum.PAD);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 加载网页端绘制模式套件包
|
|
74
|
+
*
|
|
75
|
+
* @static
|
|
76
|
+
* @param {string} kit
|
|
77
|
+
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
78
|
+
*/
|
|
79
|
+
static loadWeb(kit) {
|
|
80
|
+
return this.loadKit(kit, PluginModeEnum.WEB);
|
|
70
81
|
}
|
|
71
82
|
};
|
|
72
83
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginModeEnum, Platform } from '../../enums';
|
|
2
2
|
import { PluginTenant } from '@gct-paas/api/platform';
|
|
3
|
-
export type IModuleMap = Record<string,
|
|
3
|
+
export type IModuleMap = Record<string, IObject>;
|
|
4
4
|
export type LoadPluginResult = [PluginTenant[], IModuleMap];
|
|
5
5
|
/**
|
|
6
6
|
* 插件包处理工具类
|
|
@@ -28,7 +28,7 @@ export declare class PluginPgkUtil {
|
|
|
28
28
|
*
|
|
29
29
|
* @static
|
|
30
30
|
*/
|
|
31
|
-
static readonly module: Map<string,
|
|
31
|
+
static readonly module: Map<string, IObject>;
|
|
32
32
|
protected static joinPaths(...paths: string[]): string;
|
|
33
33
|
/**
|
|
34
34
|
* 加载插件包配置
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.1.5-dev.
|
|
3
|
+
"version": "0.1.5-dev.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"loader": "dist/index.esm.min.js",
|
|
@@ -30,23 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"author": "gct",
|
|
33
|
-
"scripts": {
|
|
34
|
-
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|
|
35
|
-
"es:build": "vite build --config vite.dev.config.ts",
|
|
36
|
-
"build": "npm run lint && vite build --config vite.dev.config.ts && vite build --config vite.config.ts",
|
|
37
|
-
"lint": "eslint src/",
|
|
38
|
-
"test": "vitest",
|
|
39
|
-
"test:run": "vitest run",
|
|
40
|
-
"test:coverage": "vitest run --coverage",
|
|
41
|
-
"publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
|
|
42
|
-
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
43
|
-
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
44
|
-
"publish:beta": "npm run build && npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
|
|
45
|
-
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
46
|
-
},
|
|
47
33
|
"dependencies": {
|
|
48
34
|
"@fingerprintjs/fingerprintjs": "^5.1.0",
|
|
49
|
-
"@gct-paas/api": "
|
|
35
|
+
"@gct-paas/api": "0.1.4-dev.0",
|
|
50
36
|
"@module-federation/runtime": "^2.2.3",
|
|
51
37
|
"@vueuse/core": "^14.1.0",
|
|
52
38
|
"async-validator": "^4.2.5",
|
|
@@ -71,10 +57,23 @@
|
|
|
71
57
|
"playwright": "^1.58.0"
|
|
72
58
|
},
|
|
73
59
|
"peerDependencies": {
|
|
74
|
-
"@gct-paas/api": "
|
|
60
|
+
"@gct-paas/api": "0.1.4-dev.0",
|
|
75
61
|
"vue": ">=3",
|
|
76
62
|
"vue-i18n": ">=11",
|
|
77
63
|
"vue-router": ">=4"
|
|
78
64
|
},
|
|
79
|
-
"
|
|
80
|
-
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|
|
67
|
+
"es:build": "vite build --config vite.dev.config.ts",
|
|
68
|
+
"build": "npm run lint && vue-tsc --noEmit && vite build --config vite.dev.config.ts && vite build --config vite.config.ts",
|
|
69
|
+
"lint": "eslint src/",
|
|
70
|
+
"test": "vitest",
|
|
71
|
+
"test:run": "vitest run",
|
|
72
|
+
"test:coverage": "vitest run --coverage",
|
|
73
|
+
"publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
|
|
74
|
+
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
75
|
+
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
76
|
+
"publish:beta": "npm run build && npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
|
|
77
|
+
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
78
|
+
}
|
|
79
|
+
}
|