@gct-paas/core 0.1.6-dev.3 → 0.1.6-dev.5
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/constants/core.d.ts +1 -0
- package/es/constants/core.mjs +27 -1
- package/es/constants/index.d.ts +1 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useObserver.d.ts +13 -0
- package/es/hooks/useObserver.mjs +46 -0
- package/es/index.mjs +4 -3
- package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
- package/es/modules/env-manager/env-manager.mjs +1 -1
- package/es/modules/user-stores/store/tenant.store.d.ts +3 -5
- package/es/modules/user-stores/store/tenant.store.mjs +10 -12
- package/es/modules/user-stores/store/user.store.d.ts +0 -4
- package/es/modules/user-stores/store/user.store.mjs +4 -4
- package/es/store/global-store.mjs +3 -3
- package/es/utils/index.d.ts +1 -1
- package/es/utils/tools/tools.d.ts +4 -2
- package/es/utils/tools/tools.mjs +20 -5
- package/package.json +3 -3
package/es/constants/core.d.ts
CHANGED
package/es/constants/core.mjs
CHANGED
|
@@ -3,5 +3,31 @@ var CoreConst = {
|
|
|
3
3
|
TOKEN: "gct-token",
|
|
4
4
|
TENANT: "gct-tenant"
|
|
5
5
|
};
|
|
6
|
+
var TimezoneOptions = [
|
|
7
|
+
"UTC+00:00",
|
|
8
|
+
"UTC+01:00",
|
|
9
|
+
"UTC+02:00",
|
|
10
|
+
"UTC+03:00",
|
|
11
|
+
"UTC+04:00",
|
|
12
|
+
"UTC+05:00",
|
|
13
|
+
"UTC+06:00",
|
|
14
|
+
"UTC+07:00",
|
|
15
|
+
"UTC+08:00",
|
|
16
|
+
"UTC+09:00",
|
|
17
|
+
"UTC+10:00",
|
|
18
|
+
"UTC+11:00",
|
|
19
|
+
"UTC+12:00",
|
|
20
|
+
"UTC-01:00",
|
|
21
|
+
"UTC-02:00",
|
|
22
|
+
"UTC-03:00",
|
|
23
|
+
"UTC-04:00",
|
|
24
|
+
"UTC-05:00",
|
|
25
|
+
"UTC-06:00",
|
|
26
|
+
"UTC-07:00",
|
|
27
|
+
"UTC-08:00",
|
|
28
|
+
"UTC-09:00",
|
|
29
|
+
"UTC-10:00",
|
|
30
|
+
"UTC-11:00"
|
|
31
|
+
];
|
|
6
32
|
//#endregion
|
|
7
|
-
export { CoreConst };
|
|
33
|
+
export { CoreConst, TimezoneOptions };
|
package/es/constants/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export * from './expression-type';
|
|
|
18
18
|
export { EditorRegisterConst } from './editor-register/editor-register';
|
|
19
19
|
export { FormContainerType } from './form-container-type/form-container-type';
|
|
20
20
|
export { DefaultDateTypeConst } from './default-date-type/default-date-type';
|
|
21
|
-
export { CoreConst } from './core';
|
|
21
|
+
export { CoreConst, TimezoneOptions } from './core';
|
|
22
22
|
export { ModelTypeOptions } from './page-designer/model';
|
|
23
23
|
export * from './page-designer/regex';
|
package/es/hooks/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { useModal } from './use-modal/use-modal';
|
|
|
3
3
|
export { useIFrameProps, useWuJieBus, useWuJieProps, } from './use-sub-app-utils/use-sub-app-utils';
|
|
4
4
|
export { copyTextToClipboard, isDef, useCopyToClipboard, } from './useCopyToClipboard';
|
|
5
5
|
export { transformUrl, fileUrlParser } from './useFile';
|
|
6
|
+
export { parentObserver, approvalObserver } from './useObserver';
|
package/es/hooks/index.mjs
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 监听最近一个出现滚动条的父盒子高度
|
|
4
|
+
* html HTMLDivElement
|
|
5
|
+
* callback 获取到高度后的回调
|
|
6
|
+
*/
|
|
7
|
+
export declare function parentObserver(html: Ref<HTMLDivElement>, callback: (needSticky: boolean, parentHeight: number, height: number) => void): void;
|
|
8
|
+
/**
|
|
9
|
+
* 监听审批节点的高度
|
|
10
|
+
* html HTMLDivElement
|
|
11
|
+
* callback 获取到高度后的回调
|
|
12
|
+
*/
|
|
13
|
+
export declare function approvalObserver(html: Ref<HTMLDivElement>, callback: (needSticky: boolean, parentHeight: number, height: number) => void): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { onBeforeUnmount, ref } from "vue";
|
|
2
|
+
import { useResizeObserver } from "@vueuse/core";
|
|
3
|
+
//#region src/hooks/useObserver.ts
|
|
4
|
+
var parentHeight = ref();
|
|
5
|
+
var observeMap = ref({});
|
|
6
|
+
function getParentHeight(ele) {
|
|
7
|
+
const p1 = ele?.parentElement;
|
|
8
|
+
const sH = p1?.scrollHeight;
|
|
9
|
+
const pH = p1?.clientHeight;
|
|
10
|
+
if (sH && pH && sH > pH) return p1.clientHeight;
|
|
11
|
+
if (p1) return getParentHeight(p1);
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
onBeforeUnmount(() => {
|
|
15
|
+
for (const k in observeMap.value) {
|
|
16
|
+
observeMap.value[k]?.unobserve(k);
|
|
17
|
+
observeMap.value[k]?.disconnect();
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* 监听最近一个出现滚动条的父盒子高度
|
|
22
|
+
* html HTMLDivElement
|
|
23
|
+
* callback 获取到高度后的回调
|
|
24
|
+
*/
|
|
25
|
+
function parentObserver(html, callback) {
|
|
26
|
+
observeMap.value[html.value.toString()] = useResizeObserver(html.value, (entries) => {
|
|
27
|
+
const height = entries[0].target.clientHeight;
|
|
28
|
+
if (!height) return;
|
|
29
|
+
parentHeight.value = getParentHeight(html.value);
|
|
30
|
+
if (callback && typeof callback === "function") callback(height && parentHeight.value && height > parentHeight.value, parentHeight.value, height);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 监听审批节点的高度
|
|
35
|
+
* html HTMLDivElement
|
|
36
|
+
* callback 获取到高度后的回调
|
|
37
|
+
*/
|
|
38
|
+
function approvalObserver(html, callback) {
|
|
39
|
+
observeMap.value[html.value.toString()] = useResizeObserver(html.value, (entries) => {
|
|
40
|
+
const height = entries[0].target.clientHeight;
|
|
41
|
+
if (!height) return;
|
|
42
|
+
if (callback && typeof callback === "function") callback(height && parentHeight.value && height > parentHeight.value, parentHeight.value, height);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { approvalObserver, parentObserver };
|
package/es/index.mjs
CHANGED
|
@@ -42,7 +42,7 @@ import { ARRAY_TYPE, BOOLEAN_TYPE, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TY
|
|
|
42
42
|
import { EditorRegisterConst } from "./constants/editor-register/editor-register.mjs";
|
|
43
43
|
import { FormContainerType } from "./constants/form-container-type/form-container-type.mjs";
|
|
44
44
|
import { DefaultDateTypeConst } from "./constants/default-date-type/default-date-type.mjs";
|
|
45
|
-
import { CoreConst } from "./constants/core.mjs";
|
|
45
|
+
import { CoreConst, TimezoneOptions } from "./constants/core.mjs";
|
|
46
46
|
import { ModelTypeOptions } from "./constants/page-designer/model.mjs";
|
|
47
47
|
import { timeReg, urlReg } from "./constants/page-designer/regex.mjs";
|
|
48
48
|
import { APP_INST, PLUGIN_BASE_URL, STYLE_NAMESPACE_TAG, VITE_MINIO_PATH } from "./constants/index.mjs";
|
|
@@ -53,7 +53,7 @@ import { OverlayPopoverContainer } from "./utils/openUtil/overlay-popover-contai
|
|
|
53
53
|
import { KitPkgUtil } from "./utils/kit-pkg-util/kit-pkg-util.mjs";
|
|
54
54
|
import { PluginPgkUtil } from "./utils/plugin-pkg-util/plugin-pkg-util.mjs";
|
|
55
55
|
import { PluginStaticResource } from "./utils/plugin-static-resource/plugin-static-resource.mjs";
|
|
56
|
-
import { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams } from "./utils/tools/tools.mjs";
|
|
56
|
+
import { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams, tenantRef } from "./utils/tools/tools.mjs";
|
|
57
57
|
import { buildShortUUID, buildUUID, sha256, uuid2 } from "./utils/uuid/uuid.mjs";
|
|
58
58
|
import { afterFieldSet, afterValueSet, cacheFnReturn, computedEx, emitFieldSet, parseValueUnit } from "./utils/value-helper/value-helper.mjs";
|
|
59
59
|
import { interceptors } from "./utils/axios/interceptors.mjs";
|
|
@@ -104,6 +104,7 @@ import { useModal } from "./hooks/use-modal/use-modal.mjs";
|
|
|
104
104
|
import { useIFrameProps, useWuJieBus, useWuJieProps } from "./hooks/use-sub-app-utils/use-sub-app-utils.mjs";
|
|
105
105
|
import { copyTextToClipboard, isDef, useCopyToClipboard } from "./hooks/useCopyToClipboard.mjs";
|
|
106
106
|
import { fileUrlParser, transformUrl } from "./hooks/useFile.mjs";
|
|
107
|
+
import { approvalObserver, parentObserver } from "./hooks/useObserver.mjs";
|
|
107
108
|
import "./hooks/index.mjs";
|
|
108
109
|
import { getSeriesList } from "./interface/model-designer/serial.mjs";
|
|
109
110
|
import "./interface/index.mjs";
|
|
@@ -138,4 +139,4 @@ function onInit() {
|
|
|
138
139
|
}
|
|
139
140
|
onInit();
|
|
140
141
|
//#endregion
|
|
141
|
-
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, CategoryModuleEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, CoreConst, CreateType, CustomAction, DEFAULT_MQTT_INSTANCE_ID, 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, LogoTypeEnum, 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, ModelFieldEnum, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, OverlayPopoverContainer, 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, REDIRECT_NAME, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetConditionEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SANDBOX_PATH_REG, 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_FIELD_KEY, 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, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, TextMeasureUtil, ThemeEnum, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserRoleReqEnum, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkBenchTabEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, calcStylePX, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, createWhiteImageWithText, cssLoader, dataURLtoBlob, deepMerge, deleteAndInsertArr, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, emitFieldSet, fileUrlParser, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getDeviceFingerprint, getInterfaceApi, getLoginTypeOptions, getMaxTextWidth, getMinTextWidth, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getSeriesList, getTenant, getToken, getTotalTextWidth, getVueComponentByCode, globalRefSession, globalRefStorage, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isSortFiled, measureText, measureTexts, mitt, mobileSearchListByFieldType, modelLoader, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptLoader, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, timeReg, transformBindCmp2CmpType, transformUrl, truncateText, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useCopyToClipboard, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
|
142
|
+
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, CategoryModuleEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, CoreConst, CreateType, CustomAction, DEFAULT_MQTT_INSTANCE_ID, 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, LogoTypeEnum, 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, ModelFieldEnum, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, OverlayPopoverContainer, 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, REDIRECT_NAME, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetConditionEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SANDBOX_PATH_REG, 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_FIELD_KEY, 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, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, TextMeasureUtil, ThemeEnum, TimezoneOptions, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserRoleReqEnum, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkBenchTabEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, approvalObserver, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, calcStylePX, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, createWhiteImageWithText, cssLoader, dataURLtoBlob, deepMerge, deleteAndInsertArr, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, emitFieldSet, fileUrlParser, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getDeviceFingerprint, getInterfaceApi, getLoginTypeOptions, getMaxTextWidth, getMinTextWidth, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getSeriesList, getTenant, getToken, getTotalTextWidth, getVueComponentByCode, globalRefSession, globalRefStorage, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isSortFiled, measureText, measureTexts, mitt, mobileSearchListByFieldType, modelLoader, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parentObserver, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptLoader, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, tenantRef, timeReg, transformBindCmp2CmpType, transformUrl, truncateText, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useCopyToClipboard, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { UserOfTenantDTO } from '@gct-paas/api/platform';
|
|
2
2
|
import { tenantState } from '../types/tenant';
|
|
3
|
-
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {
|
|
4
|
-
getTenantUserInfoAction(
|
|
5
|
-
|
|
6
|
-
} & import('pinia').PiniaCustomStateProperties<tenantState>): () => Promise<UserOfTenantDTO>;
|
|
7
|
-
}, {}>;
|
|
3
|
+
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {}, {
|
|
4
|
+
getTenantUserInfoAction(): Promise<UserOfTenantDTO>;
|
|
5
|
+
}>;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tenantRef } from "../../../utils/tools/tools.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { defineStore } from "pinia";
|
|
4
4
|
//#region src/modules/user-stores/store/tenant.store.ts
|
|
5
5
|
var useTenantStore = defineStore("tenant", {
|
|
6
6
|
state: () => ({ tenantUserInfo: {} }),
|
|
7
|
-
getters: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} },
|
|
17
|
-
actions: {}
|
|
7
|
+
getters: {},
|
|
8
|
+
actions: { async getTenantUserInfoAction() {
|
|
9
|
+
const tenantId = tenantRef.value;
|
|
10
|
+
if (!tenantId) return Promise.reject(null);
|
|
11
|
+
if (this.tenantUserInfo[tenantId]) return this.tenantUserInfo[tenantId];
|
|
12
|
+
const info = await _api.platform.tenant.getUserInfo();
|
|
13
|
+
this.tenantUserInfo[tenantId] = info;
|
|
14
|
+
return info;
|
|
15
|
+
} }
|
|
18
16
|
});
|
|
19
17
|
//#endregion
|
|
20
18
|
export { useTenantStore };
|
|
@@ -44,7 +44,6 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
44
44
|
duty?: string | undefined;
|
|
45
45
|
enabled?: number | undefined;
|
|
46
46
|
id?: string | undefined;
|
|
47
|
-
latestLogin?: number | undefined;
|
|
48
47
|
managerId?: string | undefined;
|
|
49
48
|
managerName?: string | undefined;
|
|
50
49
|
name?: string | undefined;
|
|
@@ -116,7 +115,6 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
116
115
|
duty?: string | undefined;
|
|
117
116
|
enabled?: number | undefined;
|
|
118
117
|
id?: string | undefined;
|
|
119
|
-
latestLogin?: number | undefined;
|
|
120
118
|
managerId?: string | undefined;
|
|
121
119
|
managerName?: string | undefined;
|
|
122
120
|
name?: string | undefined;
|
|
@@ -185,7 +183,6 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
185
183
|
duty?: string | undefined;
|
|
186
184
|
enabled?: number | undefined;
|
|
187
185
|
id?: string | undefined;
|
|
188
|
-
latestLogin?: number | undefined;
|
|
189
186
|
managerId?: string | undefined;
|
|
190
187
|
managerName?: string | undefined;
|
|
191
188
|
name?: string | undefined;
|
|
@@ -260,7 +257,6 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
260
257
|
duty?: string | undefined;
|
|
261
258
|
enabled?: number | undefined;
|
|
262
259
|
id?: string | undefined;
|
|
263
|
-
latestLogin?: number | undefined;
|
|
264
260
|
managerId?: string | undefined;
|
|
265
261
|
managerName?: string | undefined;
|
|
266
262
|
name?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getToken, setToken, tenantRef } from "../../../utils/tools/tools.mjs";
|
|
2
2
|
import { sha256 } from "../../../utils/uuid/uuid.mjs";
|
|
3
3
|
import { getDeviceFingerprint, getPageIdentification } from "../../../utils/deviceFingerprint.mjs";
|
|
4
4
|
import "../../../utils/index.mjs";
|
|
@@ -23,7 +23,7 @@ var useUserStore = defineStore("user", {
|
|
|
23
23
|
},
|
|
24
24
|
/**用户信息下的租户信息 */
|
|
25
25
|
getTenantInfo(state) {
|
|
26
|
-
return state.userInfo?.tenantList?.find((i) => i.id ===
|
|
26
|
+
return state.userInfo?.tenantList?.find((i) => i.id === tenantRef.value);
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
actions: {
|
|
@@ -38,7 +38,7 @@ var useUserStore = defineStore("user", {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
async getUserInfoAction(Token) {
|
|
41
|
-
if (!getToken && !Token) return null;
|
|
41
|
+
if (!getToken() && !Token) return null;
|
|
42
42
|
const info = await _api.platform.user.getInfo({ headers: { Token } });
|
|
43
43
|
this.setUserInfo(info);
|
|
44
44
|
this.userPermissions = (info?.platformManagerPermissions ?? []).reduce((map, item) => {
|
|
@@ -51,7 +51,7 @@ var useUserStore = defineStore("user", {
|
|
|
51
51
|
async afterLoginSingleApp() {},
|
|
52
52
|
/**登录后逻辑 */
|
|
53
53
|
async afterLoginAction() {
|
|
54
|
-
if (!getToken) return null;
|
|
54
|
+
if (!getToken()) return null;
|
|
55
55
|
},
|
|
56
56
|
/**退出登录 接口*/
|
|
57
57
|
async submitLoginOut() {
|
|
@@ -41,9 +41,9 @@ var useGlobalStore = defineStore("global-store", {
|
|
|
41
41
|
},
|
|
42
42
|
/**加載运行时全局常量显示 */
|
|
43
43
|
async loadEmptySetting() {
|
|
44
|
-
const
|
|
45
|
-
if (!value) return;
|
|
46
|
-
Object.assign(this.globalSetting, JSON.parse(value));
|
|
44
|
+
const res = await _gct.api.apaas.basicConfig.getDetail({ configEnum: PlatformSettingEnum.GLOBAL });
|
|
45
|
+
if (!res?.value) return;
|
|
46
|
+
Object.assign(this.globalSetting, JSON.parse(res.value));
|
|
47
47
|
},
|
|
48
48
|
setProjectName(name) {
|
|
49
49
|
this.projectName = name;
|
package/es/utils/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './openUtil';
|
|
|
13
13
|
export { KitPkgUtil } from './kit-pkg-util/kit-pkg-util';
|
|
14
14
|
export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
|
|
15
15
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
16
|
-
export { getToken, setToken, getTenant, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
16
|
+
export { getToken, setToken, getTenant, tenantRef, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
17
17
|
export * from './uuid/uuid';
|
|
18
18
|
export * from './value-helper/value-helper';
|
|
19
19
|
export { interceptors } from './axios/interceptors';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare const tenantRef: Readonly<Ref<string>>;
|
|
1
3
|
/**
|
|
2
4
|
* 获取认证令牌
|
|
3
5
|
*
|
|
@@ -23,9 +25,9 @@ export declare function getTenant(): string | null;
|
|
|
23
25
|
* 设置租户标识至 cookie
|
|
24
26
|
*
|
|
25
27
|
* @export
|
|
26
|
-
* @param {string} tenant
|
|
28
|
+
* @param {string} [tenant]
|
|
27
29
|
*/
|
|
28
|
-
export declare function setTenant(tenant
|
|
30
|
+
export declare function setTenant(tenant?: string): void;
|
|
29
31
|
/**
|
|
30
32
|
* 是否为移动端设备
|
|
31
33
|
*/
|
package/es/utils/tools/tools.mjs
CHANGED
|
@@ -2,9 +2,25 @@ import { CoreConst } from "../../constants/core.mjs";
|
|
|
2
2
|
import "../../constants/index.mjs";
|
|
3
3
|
import qs from "qs";
|
|
4
4
|
import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
|
|
5
|
+
import { customRef, readonly } from "vue";
|
|
5
6
|
import { clearCookie, getCookie, setCookie } from "qx-util";
|
|
6
7
|
//#region src/utils/tools/tools.ts
|
|
7
8
|
/**
|
|
9
|
+
* 租户 cookie 双向绑定响应式引用:get 直接读 cookie,set 直接写 cookie
|
|
10
|
+
*/
|
|
11
|
+
var _tenantRef = customRef((track, trigger) => ({
|
|
12
|
+
get() {
|
|
13
|
+
track();
|
|
14
|
+
return getCookie(CoreConst.TENANT) || "";
|
|
15
|
+
},
|
|
16
|
+
set(value) {
|
|
17
|
+
if (value) setCookie(CoreConst.TENANT, value, 7, true);
|
|
18
|
+
else clearCookie(CoreConst.TENANT, true);
|
|
19
|
+
trigger();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
var tenantRef = readonly(_tenantRef);
|
|
23
|
+
/**
|
|
8
24
|
* 获取认证令牌
|
|
9
25
|
*
|
|
10
26
|
* @export
|
|
@@ -30,17 +46,16 @@ function setToken(token) {
|
|
|
30
46
|
* @returns {*} {(string | null)}
|
|
31
47
|
*/
|
|
32
48
|
function getTenant() {
|
|
33
|
-
return
|
|
49
|
+
return _tenantRef.value || null;
|
|
34
50
|
}
|
|
35
51
|
/**
|
|
36
52
|
* 设置租户标识至 cookie
|
|
37
53
|
*
|
|
38
54
|
* @export
|
|
39
|
-
* @param {string} tenant
|
|
55
|
+
* @param {string} [tenant]
|
|
40
56
|
*/
|
|
41
57
|
function setTenant(tenant) {
|
|
42
|
-
|
|
43
|
-
else clearCookie(CoreConst.TENANT, true);
|
|
58
|
+
_tenantRef.value = tenant || "";
|
|
44
59
|
}
|
|
45
60
|
/**
|
|
46
61
|
* 是否为移动端设备
|
|
@@ -140,4 +155,4 @@ function createWhiteImageWithText(name, width, height) {
|
|
|
140
155
|
return canvas.toDataURL("image/png");
|
|
141
156
|
}
|
|
142
157
|
//#endregion
|
|
143
|
-
export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams };
|
|
158
|
+
export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams, tenantRef };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.1.6-dev.
|
|
3
|
+
"version": "0.1.6-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"loader": "dist/index.esm.min.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fingerprintjs/fingerprintjs": "^5.1.0",
|
|
35
35
|
"@floating-ui/dom": "^1.7.6",
|
|
36
|
-
"@gct-paas/api": "^0.1.4-dev.
|
|
36
|
+
"@gct-paas/api": "^0.1.4-dev.5",
|
|
37
37
|
"@module-federation/runtime": "^2.2.3",
|
|
38
38
|
"@vueuse/core": "^14.1.0",
|
|
39
39
|
"async-validator": "^4.2.5",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"playwright": "^1.58.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@gct-paas/api": "^0.1.4-dev.
|
|
61
|
+
"@gct-paas/api": "^0.1.4-dev.5",
|
|
62
62
|
"vue": ">=3",
|
|
63
63
|
"vue-i18n": ">=11",
|
|
64
64
|
"vue-router": ">=4"
|