@gct-paas/core 0.1.4-dev.14 → 0.1.4-dev.16
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/plugin-enum.d.ts +8 -4
- package/es/enums/plugin-enum.mjs +8 -4
- package/es/index.mjs +3 -1
- package/es/interface/i-kit-info/i-kit-info.d.ts +20 -0
- package/es/interface/index.d.ts +2 -1
- package/es/utils/css-loader/css-loader.mjs +3 -3
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.mjs +2 -0
- package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +32 -0
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +70 -0
- package/es/utils/model-loader/model-loader.mjs +8 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +63 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +116 -0
- package/package.json +11 -8
- /package/es/interface/{model-desginer → model-designer}/entity.d.ts +0 -0
|
@@ -10,11 +10,15 @@ export declare enum PluginModeEnum {
|
|
|
10
10
|
*/
|
|
11
11
|
DESIGN = "design",
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 移动端绘制模式
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
MOBILE = "mobile",
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 平板端绘制模式
|
|
18
|
+
*/
|
|
19
|
+
PAD = "pad",
|
|
20
|
+
/**
|
|
21
|
+
* 网页端绘制模式
|
|
18
22
|
*/
|
|
19
|
-
|
|
23
|
+
WEB = "web"
|
|
20
24
|
}
|
package/es/enums/plugin-enum.mjs
CHANGED
|
@@ -11,13 +11,17 @@ var PluginModeEnum = /* @__PURE__ */ function(PluginModeEnum) {
|
|
|
11
11
|
*/
|
|
12
12
|
PluginModeEnum["DESIGN"] = "design";
|
|
13
13
|
/**
|
|
14
|
-
* 网页端绘制模式
|
|
15
|
-
*/
|
|
16
|
-
PluginModeEnum["WEB"] = "web";
|
|
17
|
-
/**
|
|
18
14
|
* 移动端绘制模式
|
|
19
15
|
*/
|
|
20
16
|
PluginModeEnum["MOBILE"] = "mobile";
|
|
17
|
+
/**
|
|
18
|
+
* 平板端绘制模式
|
|
19
|
+
*/
|
|
20
|
+
PluginModeEnum["PAD"] = "pad";
|
|
21
|
+
/**
|
|
22
|
+
* 网页端绘制模式
|
|
23
|
+
*/
|
|
24
|
+
PluginModeEnum["WEB"] = "web";
|
|
21
25
|
return PluginModeEnum;
|
|
22
26
|
}({});
|
|
23
27
|
//#endregion
|
package/es/index.mjs
CHANGED
|
@@ -49,6 +49,8 @@ import { APP_INST, PLUGIN_BASE_URL, STYLE_NAMESPACE_TAG, VITE_MINIO_PATH } from
|
|
|
49
49
|
import { Namespace, useNamespace } from "./utils/namespace/namespace.mjs";
|
|
50
50
|
import { Modal } from "./utils/openUtil/modal/modal.mjs";
|
|
51
51
|
import { OverlayContainer } from "./utils/openUtil/overlay-container/overlay-container.mjs";
|
|
52
|
+
import { KitPkgUtil } from "./utils/kit-pkg-util/kit-pkg-util.mjs";
|
|
53
|
+
import { PluginPgkUtil } from "./utils/plugin-pkg-util/plugin-pkg-util.mjs";
|
|
52
54
|
import { PluginStaticResource } from "./utils/plugin-static-resource/plugin-static-resource.mjs";
|
|
53
55
|
import { deepMerge, getTenant, getTimezone, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams } from "./utils/tools/tools.mjs";
|
|
54
56
|
import { buildShortUUID, buildUUID, sha256, uuid2 } from "./utils/uuid/uuid.mjs";
|
|
@@ -125,4 +127,4 @@ function onInit() {
|
|
|
125
127
|
}
|
|
126
128
|
onInit();
|
|
127
129
|
//#endregion
|
|
128
|
-
export { AGLINE_ENUMS, APP_DARK_MODE_KEY_, APP_INST, APP_LOCAL_CACHE_KEY, APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, APP_SESSION_CACHE_KEY, ARRAY_TYPE, ASSIGNMENTSTRATEGY_ENUM, AggTypes, AppPublishStateEnum, BOOLEAN_TYPE, BasicAction, BindCmpStyleEnum, BindCmpStyleTypeEnum, BizServiceEnum, BorderStyle, BpmnNodeTypeEnum, BuiltOperators, BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonOpeEnum, ButtonSize, ButtonStyle, ButtonType, ButtonTypeEnum, ButtonTypeGroup, ButtonType_vant, CARD_TRIGGER_ENUM, COLUMNS_TYPE, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CUSTOM_LANGUAGE, CUSTOM_THEME, CacheTypeEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, CoreConst, CreateType, CustomAction, DESIGNER_SESSION_CACHE_KEY, DEV_SINGLE_PATH_REG, DataSetReturnTypeEnum, DatasourceTypeEnum, DateRangeEnums, DefaultActions, DefaultDateTypeConst, Dependency_ENUM, DeployModeEnum, DeviceParamsTypeEnum, DictionaryUtil, DisplayEnums, DisplayTagTypeEnum, DisplayType, EditorRegisterConst, EntityFormulaReturnTypeEnum, EntityModelCategoryEnum, EntityModelTypeEnum, EnvironmentManager, EnvironmentType, ErrorHandler, ErrorStrategyFactory, ErrorTypeEnum, EventCategory, ExamineAndApproveStateEnum, ExceptionEnum, ExpressionModeEnum, ExpressionTabEnum, FIELD_TYPE, FIELD_TYPE_BASIC, FIELD_TYPE_CATEGORY, FIELD_TYPE_LOGIC, FIELD_TYPE_TRACE, FUNC_KEYS, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TYPE, FUN_STR_TYPE, FieldDefaultValueTypeEnum, FieldIconMap, FieldSysVarDefaultValueEnum, FieldTypeToJs, FormComponents, FormContainerType, FormDesignEnum, GENDER_TYPE, GLOBAL_TYPE, GLOBAL_VAR_TYPE, GctGlobal, GctMqttTopsEnum, GlobalParamEnum, GlobalStoreUtil, HOST_REG, INNER_EVENT, IP_REG, IdentifierAddon, KeyMode, KickRuleEnum, LOCALE_KEY, LOCALE_LIST_KEY, LOCAL_I18N_TRANSLATE, LOCK_INFO_KEY, LinkedList, LinkedNode, ListTreeSearchTypeEnum, LocaleUtil, LoginSortTypeEnum, LoginTypeEnum, MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS, MULTIPLE_TABS_KEY, MaterialEnum, MenuModeEnum, MenuSplitTyeEnum, MenuType, MenuTypeEnum, MessageType, MixSidebarTriggerEnum, Modal, ModeFnMap, ModeTabDict, ModeTabMap, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, PLUGIN_BASE_URL, PROJ_CFG_KEY, PageEnum, PanelEnum, PassRule, PatternEnum, PermissionModeEnum, PersonalCenterType, Platform, PlatformSettingActions, PlatformSettingEnum, PlatformType, PluginModeEnum, PluginStaticResource, Postion, PrintModeEnums, PrintResourceEnum, PrintTypeEnum, ProcessStatusEnum, ProgressTypeEnum, ProjectName, PropGroup, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SCOPE, SCOPEINFO, SEARCH_SERVICE, SHOW_FIELDTYPES, SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH, STRING_TYPE, STYLE_NAMESPACE_TAG, SUB_TABLE_EDIT_MODE, SUB_TABLE_OPE_EVENT_TYPE, SUB_TABLE_OPE_EVENT_TYPE_INLINE, SYSTEM_LOGIN_KEYS, SYSTEM_VAR_PREFIX, SearchComponents, SelectPickerEnums, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, SignatureStyleEnum, SignatureTypeEnum, SizeEnum, StatisticalMethodEnums, StyleGroup, TENANT_KEY, TEST_SINGLE_PATH_REG, THEME_COLORS, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TIMEZONE_KEY, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, ThemeEnum, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, cssLoader, dataURLtoBlob, deepMerge, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, emitFieldSet, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getDeviceFingerprint, getLoginTypeOptions, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getTenant, getTimezone, getToken, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isSortFiled, mitt, mobileSearchListByFieldType, modelLoader, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, timeReg, transformBindCmp2CmpType, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useCopyToClipboard, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
|
130
|
+
export { AGLINE_ENUMS, APP_DARK_MODE_KEY_, APP_INST, APP_LOCAL_CACHE_KEY, APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, APP_SESSION_CACHE_KEY, ARRAY_TYPE, ASSIGNMENTSTRATEGY_ENUM, AggTypes, AppPublishStateEnum, BOOLEAN_TYPE, BasicAction, BindCmpStyleEnum, BindCmpStyleTypeEnum, BizServiceEnum, BorderStyle, BpmnNodeTypeEnum, BuiltOperators, BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonOpeEnum, ButtonSize, ButtonStyle, ButtonType, ButtonTypeEnum, ButtonTypeGroup, ButtonType_vant, CARD_TRIGGER_ENUM, COLUMNS_TYPE, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CUSTOM_LANGUAGE, CUSTOM_THEME, CacheTypeEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, CoreConst, CreateType, CustomAction, DESIGNER_SESSION_CACHE_KEY, DEV_SINGLE_PATH_REG, DataSetReturnTypeEnum, DatasourceTypeEnum, DateRangeEnums, DefaultActions, DefaultDateTypeConst, Dependency_ENUM, DeployModeEnum, DeviceParamsTypeEnum, DictionaryUtil, DisplayEnums, DisplayTagTypeEnum, DisplayType, EditorRegisterConst, EntityFormulaReturnTypeEnum, EntityModelCategoryEnum, EntityModelTypeEnum, EnvironmentManager, EnvironmentType, ErrorHandler, ErrorStrategyFactory, ErrorTypeEnum, EventCategory, ExamineAndApproveStateEnum, ExceptionEnum, ExpressionModeEnum, ExpressionTabEnum, FIELD_TYPE, FIELD_TYPE_BASIC, FIELD_TYPE_CATEGORY, FIELD_TYPE_LOGIC, FIELD_TYPE_TRACE, FUNC_KEYS, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TYPE, FUN_STR_TYPE, FieldDefaultValueTypeEnum, FieldIconMap, FieldSysVarDefaultValueEnum, FieldTypeToJs, FormComponents, FormContainerType, FormDesignEnum, GENDER_TYPE, GLOBAL_TYPE, GLOBAL_VAR_TYPE, GctGlobal, GctMqttTopsEnum, GlobalParamEnum, GlobalStoreUtil, HOST_REG, INNER_EVENT, IP_REG, IdentifierAddon, KeyMode, KickRuleEnum, KitPkgUtil, LOCALE_KEY, LOCALE_LIST_KEY, LOCAL_I18N_TRANSLATE, LOCK_INFO_KEY, LinkedList, LinkedNode, ListTreeSearchTypeEnum, LocaleUtil, LoginSortTypeEnum, LoginTypeEnum, MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS, MULTIPLE_TABS_KEY, MaterialEnum, MenuModeEnum, MenuSplitTyeEnum, MenuType, MenuTypeEnum, MessageType, MixSidebarTriggerEnum, Modal, ModeFnMap, ModeTabDict, ModeTabMap, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, PLUGIN_BASE_URL, PROJ_CFG_KEY, PageEnum, PanelEnum, PassRule, PatternEnum, PermissionModeEnum, PersonalCenterType, Platform, PlatformSettingActions, PlatformSettingEnum, PlatformType, PluginModeEnum, PluginPgkUtil, PluginStaticResource, Postion, PrintModeEnums, PrintResourceEnum, PrintTypeEnum, ProcessStatusEnum, ProgressTypeEnum, ProjectName, PropGroup, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SCOPE, SCOPEINFO, SEARCH_SERVICE, SHOW_FIELDTYPES, SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH, STRING_TYPE, STYLE_NAMESPACE_TAG, SUB_TABLE_EDIT_MODE, SUB_TABLE_OPE_EVENT_TYPE, SUB_TABLE_OPE_EVENT_TYPE_INLINE, SYSTEM_LOGIN_KEYS, SYSTEM_VAR_PREFIX, SearchComponents, SelectPickerEnums, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, SignatureStyleEnum, SignatureTypeEnum, SizeEnum, StatisticalMethodEnums, StyleGroup, TENANT_KEY, TEST_SINGLE_PATH_REG, THEME_COLORS, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TIMEZONE_KEY, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, ThemeEnum, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, cssLoader, dataURLtoBlob, deepMerge, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, emitFieldSet, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getDeviceFingerprint, getLoginTypeOptions, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getTenant, getTimezone, getToken, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isSortFiled, mitt, mobileSearchListByFieldType, modelLoader, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, timeReg, transformBindCmp2CmpType, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useCopyToClipboard, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
package/es/interface/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type * from './i-app-context/i-app-context';
|
|
2
|
-
export type * from './model-desginer/entity';
|
|
3
2
|
export type { IGlobalRegister } from './i-global-register/i-global-register';
|
|
4
3
|
export type { IDictionary } from './i-dictionary/i-dictionary';
|
|
5
4
|
export type { IDictionaryItem } from './i-dictionary/i-dictionary-item';
|
|
@@ -7,9 +6,11 @@ export type { IFieldCodeChain } from './i-field-code-chain/i-field-code-chain';
|
|
|
7
6
|
export type { GlobalVar } from './i-global-var/i-global-var';
|
|
8
7
|
export type { IMobileHomeMenuItem } from './i-mobile-home-menu-item/i-mobile-home-menu-item';
|
|
9
8
|
export type { IStyleIMportMap } from './i-import-style-map/i-import-style-map';
|
|
9
|
+
export type { IKitInfo } from './i-kit-info/i-kit-info';
|
|
10
10
|
export type { IGlobalActions } from './i-pinia-action/i-global-actions';
|
|
11
11
|
export type { IGlobalGetters } from './i-pinia-getter/i-global-getters';
|
|
12
12
|
export type { IGlobalState, emptyDisplayType, } from './i-pinia-state/i-global-state';
|
|
13
|
+
export type * from './model-designer/entity';
|
|
13
14
|
export type * from './open-util';
|
|
14
15
|
export type * from './provider';
|
|
15
16
|
export type * from './style';
|
|
@@ -32,9 +32,9 @@ var CssLoader = class {
|
|
|
32
32
|
return Promise.resolve();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const promise = new Promise((resolve
|
|
35
|
+
const promise = new Promise((resolve) => {
|
|
36
36
|
if (typeof document === "undefined") {
|
|
37
|
-
|
|
37
|
+
console.error(`[CssLoader] 当前环境不支持 DOM,无法加载 CSS: ${url}`);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
const link = document.createElement("link");
|
|
@@ -52,7 +52,7 @@ var CssLoader = class {
|
|
|
52
52
|
const onError = () => {
|
|
53
53
|
cleanup();
|
|
54
54
|
this._pendingMap.delete(url);
|
|
55
|
-
|
|
55
|
+
console.error(`[CssLoader] CSS 文件加载失败: ${url}`);
|
|
56
56
|
};
|
|
57
57
|
/** 移除事件监听,防止内存泄漏 */
|
|
58
58
|
const cleanup = () => {
|
package/es/utils/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { mitt } from './mitt/mitt';
|
|
|
10
10
|
export { modelLoader } from './model-loader/model-loader';
|
|
11
11
|
export { Namespace, useNamespace } from './namespace/namespace';
|
|
12
12
|
export * from './openUtil';
|
|
13
|
+
export { KitPkgUtil } from './kit-pkg-util/kit-pkg-util';
|
|
14
|
+
export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
|
|
13
15
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
14
16
|
export { getToken, setToken, getTenant, getTimezone, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, } from './tools/tools';
|
|
15
17
|
export * from './uuid/uuid';
|
package/es/utils/index.mjs
CHANGED
|
@@ -12,6 +12,8 @@ import "./namespace/namespace.mjs";
|
|
|
12
12
|
import "./openUtil/modal/modal.mjs";
|
|
13
13
|
import "./openUtil/overlay-container/overlay-container.mjs";
|
|
14
14
|
import "./openUtil/index.mjs";
|
|
15
|
+
import "./kit-pkg-util/kit-pkg-util.mjs";
|
|
16
|
+
import "./plugin-pkg-util/plugin-pkg-util.mjs";
|
|
15
17
|
import "./plugin-static-resource/plugin-static-resource.mjs";
|
|
16
18
|
import "./tools/tools.mjs";
|
|
17
19
|
import "./uuid/uuid.mjs";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PluginModeEnum } from '../../enums';
|
|
2
|
+
import { IKitInfo } from '../../interface';
|
|
3
|
+
import { App } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* 用于加载套件包的工具类
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class KitPkgUtil
|
|
9
|
+
*/
|
|
10
|
+
export declare class KitPkgUtil {
|
|
11
|
+
protected static readonly KIT_PKG_BASE_PATH = "/kits";
|
|
12
|
+
protected static cache: Map<string, IKitInfo>;
|
|
13
|
+
protected static joinPaths(...paths: string[]): string;
|
|
14
|
+
/**
|
|
15
|
+
* 加载套件包配置
|
|
16
|
+
*
|
|
17
|
+
* @static
|
|
18
|
+
* @param {string} kit
|
|
19
|
+
* @return {*} {(Promise<IKitInfo | undefined>)}
|
|
20
|
+
*/
|
|
21
|
+
static loadKitPkgInfo(kit: string): Promise<IKitInfo | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* 加载套件包内的插件
|
|
24
|
+
*
|
|
25
|
+
* @static
|
|
26
|
+
* @param {App} app
|
|
27
|
+
* @param {(string | string[])} kit
|
|
28
|
+
* @param {PluginModeEnum} mode
|
|
29
|
+
* @return {*} {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
static loadKits(app: App, kit: string | string[], mode: PluginModeEnum): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/utils/kit-pkg-util/kit-pkg-util.ts
|
|
2
|
+
/**
|
|
3
|
+
* 用于加载套件包的工具类
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @class KitPkgUtil
|
|
7
|
+
*/
|
|
8
|
+
var KitPkgUtil = class {
|
|
9
|
+
static KIT_PKG_BASE_PATH = "/kits";
|
|
10
|
+
static cache = /* @__PURE__ */ new Map();
|
|
11
|
+
static joinPaths(...paths) {
|
|
12
|
+
return paths.filter((p) => p && p.length > 0).map((p, index) => {
|
|
13
|
+
let normalized = p;
|
|
14
|
+
if (normalized.startsWith("./")) normalized = normalized.slice(2);
|
|
15
|
+
if (normalized.endsWith("/") && index < paths.length - 1) normalized = normalized.slice(0, -1);
|
|
16
|
+
return normalized;
|
|
17
|
+
}).join("/");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 加载套件包配置
|
|
21
|
+
*
|
|
22
|
+
* @static
|
|
23
|
+
* @param {string} kit
|
|
24
|
+
* @return {*} {(Promise<IKitInfo | undefined>)}
|
|
25
|
+
*/
|
|
26
|
+
static async loadKitPkgInfo(kit) {
|
|
27
|
+
if (this.cache.has(kit)) return this.cache.get(kit);
|
|
28
|
+
try {
|
|
29
|
+
const url = this.joinPaths(this.KIT_PKG_BASE_PATH, kit.toUpperCase(), "kit-info.json");
|
|
30
|
+
const response = await fetch(url);
|
|
31
|
+
if (!response.ok) throw new Error(`Failed to load kit package from ${url}`);
|
|
32
|
+
const config = await response.json();
|
|
33
|
+
this.cache.set(kit, config);
|
|
34
|
+
return config;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`Error loading kit package ${kit}:`, error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 加载套件包内的插件
|
|
41
|
+
*
|
|
42
|
+
* @static
|
|
43
|
+
* @param {App} app
|
|
44
|
+
* @param {(string | string[])} kit
|
|
45
|
+
* @param {PluginModeEnum} mode
|
|
46
|
+
* @return {*} {Promise<void>}
|
|
47
|
+
*/
|
|
48
|
+
static async loadKits(app, kit, mode) {
|
|
49
|
+
const kits = Array.isArray(kit) ? kit : [kit];
|
|
50
|
+
for (const k of kits) {
|
|
51
|
+
if (this.cache.has(k)) {
|
|
52
|
+
console.warn(`Kit package ${k} is already loaded, skipping.`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const config = await this.loadKitPkgInfo(k);
|
|
56
|
+
if (config) {
|
|
57
|
+
const loaderUrl = this.joinPaths(this.KIT_PKG_BASE_PATH, config.kit.toUpperCase(), mode, `loader.esm.min.js?version=${config.version || "0.0.0"}`);
|
|
58
|
+
try {
|
|
59
|
+
const module = await import(loaderUrl);
|
|
60
|
+
if (module && module.default) app.use(module.default);
|
|
61
|
+
else console.warn(`Kit ${config.kit} does not export a default function`);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(`Error loading kit ${config.kit} from ${loaderUrl}:`, error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { KitPkgUtil };
|
|
@@ -167,6 +167,14 @@ var ModelLoader = class {
|
|
|
167
167
|
if (this.enumLoadingCache.has(cacheKey)) return this.enumLoadingCache.get(cacheKey);
|
|
168
168
|
const loadPromise = (async () => {
|
|
169
169
|
try {
|
|
170
|
+
const items = await _api.apaas.modelComprehensive.getEnumInfoModelCategory({ modelCategory }, {
|
|
171
|
+
modelKey,
|
|
172
|
+
fieldKey
|
|
173
|
+
});
|
|
174
|
+
if (items) {
|
|
175
|
+
this.enumCache.set(cacheKey, this.createCacheEntry(items));
|
|
176
|
+
return cloneDeep(items);
|
|
177
|
+
}
|
|
170
178
|
return [];
|
|
171
179
|
} finally {
|
|
172
180
|
this.enumLoadingCache.delete(cacheKey);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Platform, PluginModeEnum } from '@gct-paas/core';
|
|
2
|
+
import { PluginTenant } from '@gct-paas/api/platform';
|
|
3
|
+
export type IModuleMap = Record<string, System.Module>;
|
|
4
|
+
export type LoadPluginResult = [IObject, IModuleMap];
|
|
5
|
+
/**
|
|
6
|
+
* 插件包处理工具类
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class PluginPgkUtil
|
|
10
|
+
*/
|
|
11
|
+
export declare class PluginPgkUtil {
|
|
12
|
+
/**
|
|
13
|
+
* 插件配置缓存
|
|
14
|
+
*
|
|
15
|
+
* @protected
|
|
16
|
+
* @type {Map<string, IObject[]>}
|
|
17
|
+
*/
|
|
18
|
+
protected static cache: Map<string, IObject[]>;
|
|
19
|
+
/**
|
|
20
|
+
* 模块缓存
|
|
21
|
+
*
|
|
22
|
+
* @protected
|
|
23
|
+
* @static
|
|
24
|
+
*/
|
|
25
|
+
protected static cacheModules: Map<string, IModuleMap>;
|
|
26
|
+
/**
|
|
27
|
+
* 已经加载的插件与模块的映射
|
|
28
|
+
*
|
|
29
|
+
* @static
|
|
30
|
+
*/
|
|
31
|
+
static readonly module: Map<string, System.Module>;
|
|
32
|
+
protected static joinPaths(...paths: string[]): string;
|
|
33
|
+
/**
|
|
34
|
+
* 加载插件包配置
|
|
35
|
+
*
|
|
36
|
+
* @protected
|
|
37
|
+
* @static
|
|
38
|
+
* @param {PluginModeEnum} mode 插件模式
|
|
39
|
+
* @param {Platform} platform
|
|
40
|
+
* @param {string[]} [kit]
|
|
41
|
+
* @returns {*} {Promise<IStyleIMportMap[]>}
|
|
42
|
+
*/
|
|
43
|
+
protected static loadPluginConfig(mode: PluginModeEnum, platform: Platform, kit?: string[]): Promise<PluginTenant[]>;
|
|
44
|
+
/**
|
|
45
|
+
* 批量加载平台界面 system js 插件包
|
|
46
|
+
*
|
|
47
|
+
* @protected
|
|
48
|
+
* @static
|
|
49
|
+
* @param {IStyleIMportMap[]} plugins
|
|
50
|
+
* @returns {*} {Promise<System.Module[]>}
|
|
51
|
+
*/
|
|
52
|
+
protected static loadPlugins(mode: PluginModeEnum, configs?: PluginTenant['plugins']): Promise<IModuleMap>;
|
|
53
|
+
/**
|
|
54
|
+
* 加载插件包
|
|
55
|
+
*
|
|
56
|
+
* @protected
|
|
57
|
+
* @static
|
|
58
|
+
* @param {PluginModeEnum} mode
|
|
59
|
+
* @param {Platform} platform
|
|
60
|
+
* @returns {*}
|
|
61
|
+
*/
|
|
62
|
+
protected static loadPlugin(mode: PluginModeEnum, platform: Platform, kit: string[]): Promise<[PluginTenant[], IModuleMap]>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { PLUGIN_BASE_URL } from "@gct-paas/core";
|
|
2
|
+
//#region src/utils/plugin-pkg-util/plugin-pkg-util.ts
|
|
3
|
+
/**
|
|
4
|
+
* 插件包处理工具类
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class PluginPgkUtil
|
|
8
|
+
*/
|
|
9
|
+
var PluginPgkUtil = class {
|
|
10
|
+
/**
|
|
11
|
+
* 插件配置缓存
|
|
12
|
+
*
|
|
13
|
+
* @protected
|
|
14
|
+
* @type {Map<string, IObject[]>}
|
|
15
|
+
*/
|
|
16
|
+
static cache = /* @__PURE__ */ new Map();
|
|
17
|
+
/**
|
|
18
|
+
* 模块缓存
|
|
19
|
+
*
|
|
20
|
+
* @protected
|
|
21
|
+
* @static
|
|
22
|
+
*/
|
|
23
|
+
static cacheModules = /* @__PURE__ */ new Map();
|
|
24
|
+
/**
|
|
25
|
+
* 已经加载的插件与模块的映射
|
|
26
|
+
*
|
|
27
|
+
* @static
|
|
28
|
+
*/
|
|
29
|
+
static module = /* @__PURE__ */ new Map();
|
|
30
|
+
static joinPaths(...paths) {
|
|
31
|
+
return paths.filter((p) => p && p.length > 0).map((p, index) => {
|
|
32
|
+
let normalized = p;
|
|
33
|
+
if (normalized.startsWith("./")) normalized = normalized.slice(2);
|
|
34
|
+
if (normalized.endsWith("/") && index < paths.length - 1) normalized = normalized.slice(0, -1);
|
|
35
|
+
return normalized;
|
|
36
|
+
}).join("/");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 加载插件包配置
|
|
40
|
+
*
|
|
41
|
+
* @protected
|
|
42
|
+
* @static
|
|
43
|
+
* @param {PluginModeEnum} mode 插件模式
|
|
44
|
+
* @param {Platform} platform
|
|
45
|
+
* @param {string[]} [kit]
|
|
46
|
+
* @returns {*} {Promise<IStyleIMportMap[]>}
|
|
47
|
+
*/
|
|
48
|
+
static async loadPluginConfig(mode, platform, kit = []) {
|
|
49
|
+
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
50
|
+
if (this.cache.has(tag)) return this.cache.get(tag);
|
|
51
|
+
const cfg = { client: platform.toUpperCase() };
|
|
52
|
+
if (kit.length > 0) cfg.tag = kit.join(",");
|
|
53
|
+
const data = await _api.platform.plugin.postGetTenantCompList(cfg);
|
|
54
|
+
if (data.length > 0) this.cache.set(tag, data);
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 批量加载平台界面 system js 插件包
|
|
59
|
+
*
|
|
60
|
+
* @protected
|
|
61
|
+
* @static
|
|
62
|
+
* @param {IStyleIMportMap[]} plugins
|
|
63
|
+
* @returns {*} {Promise<System.Module[]>}
|
|
64
|
+
*/
|
|
65
|
+
static async loadPlugins(mode, configs = []) {
|
|
66
|
+
const moduleMap = {};
|
|
67
|
+
if (configs.length > 0) {
|
|
68
|
+
const all = [];
|
|
69
|
+
configs.forEach((plugin) => {
|
|
70
|
+
const baseUrl = this.joinPaths(PLUGIN_BASE_URL, plugin.url, "dist");
|
|
71
|
+
const load = async () => {
|
|
72
|
+
try {
|
|
73
|
+
const module = await import(`${baseUrl}/${mode}/loader.esm.min.js?version=${plugin.version}`);
|
|
74
|
+
moduleMap[plugin.key] = module;
|
|
75
|
+
this.module.set(plugin.key, module);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(error);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
all.push(load());
|
|
81
|
+
});
|
|
82
|
+
await Promise.all(all);
|
|
83
|
+
}
|
|
84
|
+
return moduleMap;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 加载插件包
|
|
88
|
+
*
|
|
89
|
+
* @protected
|
|
90
|
+
* @static
|
|
91
|
+
* @param {PluginModeEnum} mode
|
|
92
|
+
* @param {Platform} platform
|
|
93
|
+
* @returns {*}
|
|
94
|
+
*/
|
|
95
|
+
static async loadPlugin(mode, platform, kit) {
|
|
96
|
+
kit = ["common", ...kit];
|
|
97
|
+
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
98
|
+
try {
|
|
99
|
+
const configs = await this.loadPluginConfig(mode, platform, kit);
|
|
100
|
+
if (!this.cacheModules.has(tag)) {
|
|
101
|
+
const plugins = [];
|
|
102
|
+
configs.forEach((cfg) => {
|
|
103
|
+
if (cfg.plugins) plugins.push(...cfg.plugins);
|
|
104
|
+
});
|
|
105
|
+
const moduleMap = await this.loadPlugins(mode, plugins);
|
|
106
|
+
this.cacheModules.set(tag, moduleMap);
|
|
107
|
+
}
|
|
108
|
+
return [configs, this.cacheModules.get(tag)];
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(error);
|
|
111
|
+
}
|
|
112
|
+
return [[], {}];
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
//#endregion
|
|
116
|
+
export { PluginPgkUtil };
|
package/package.json
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
|
-
"
|
|
7
|
-
"module": "es/index.mjs",
|
|
6
|
+
"loader": "dist/index.esm.min.js",
|
|
8
7
|
"types": "es/index.d.ts",
|
|
9
|
-
"system": "dist/index.system.min.js",
|
|
10
8
|
"exports": {
|
|
11
9
|
".": {
|
|
12
10
|
"types": "./es/index.d.ts",
|
|
13
|
-
"import": "./es/index.mjs"
|
|
14
|
-
"require": "./dist/index.min.cjs"
|
|
11
|
+
"import": "./es/index.mjs"
|
|
15
12
|
},
|
|
16
13
|
"./types": {
|
|
17
14
|
"types": "./es/types/index.d.ts"
|
|
@@ -49,7 +46,7 @@
|
|
|
49
46
|
},
|
|
50
47
|
"dependencies": {
|
|
51
48
|
"@fingerprintjs/fingerprintjs": "^5.1.0",
|
|
52
|
-
"@gct-paas/api": "^0.1.1",
|
|
49
|
+
"@gct-paas/api": "^0.1.2-dev.1",
|
|
53
50
|
"@module-federation/runtime": "^2.2.3",
|
|
54
51
|
"@vueuse/core": "^14.1.0",
|
|
55
52
|
"async-validator": "^4.2.5",
|
|
@@ -73,5 +70,11 @@
|
|
|
73
70
|
"fs-extra": "^11.3.3",
|
|
74
71
|
"playwright": "^1.58.0"
|
|
75
72
|
},
|
|
76
|
-
"
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"@gct-paas/api": "*",
|
|
75
|
+
"vue": ">=3",
|
|
76
|
+
"vue-i18n": ">=11",
|
|
77
|
+
"vue-router": ">=4"
|
|
78
|
+
},
|
|
79
|
+
"gitHead": "cee8da739039182f4df08a2c0126cdd578fbc33b"
|
|
77
80
|
}
|
|
File without changes
|