@gct-paas/core 0.1.6-dev.0 → 0.1.6-dev.10
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/create-app-vue.d.ts +1 -1
- package/es/create-app-vue.mjs +1 -1
- package/es/enums/appEnum.mjs +4 -0
- package/es/enums/globalEnum.d.ts +29 -0
- package/es/enums/globalEnum.mjs +33 -1
- package/es/global/gct/gct.mjs +1 -0
- 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 +24 -12
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -2
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -1
- package/es/locale/index.mjs +7 -2
- package/es/modules/env-manager/env-manager.const.d.ts +2 -0
- package/es/modules/env-manager/env-manager.const.mjs +3 -1
- package/es/modules/env-manager/env-manager.d.ts +4 -0
- package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
- package/es/modules/env-manager/env-manager.mjs +11 -3
- package/es/modules/env-manager/index.mjs +3 -0
- package/es/modules/error-handler/error-handler.const.mjs +7 -0
- package/es/modules/mqtt/constants/mqtt.const.mjs +12 -0
- 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.mjs +11 -4
- package/es/state/global-pinia-state/global-pinia-state.mjs +3 -1
- package/es/store/global-store.mjs +9 -4
- package/es/store/index.d.ts +1 -1
- package/es/store/session-store.d.ts +1 -0
- package/es/store/session-store.mjs +5 -2
- package/es/store/storage-store.mjs +3 -0
- package/es/types/index.d.ts +6 -0
- package/es/utils/data-prems/const.mjs +2 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/namespace/namespace.mjs +1 -0
- package/es/utils/openUtil/overlay-container/overlay-container.d.ts +1 -1
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +28 -23
- package/es/utils/tools/tools.d.ts +4 -2
- package/es/utils/tools/tools.mjs +20 -5
- package/es/utils/util.d.ts +10 -1
- package/es/utils/util.mjs +11 -2
- 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/create-app-vue.d.ts
CHANGED
package/es/create-app-vue.mjs
CHANGED
package/es/enums/appEnum.mjs
CHANGED
|
@@ -648,11 +648,15 @@ var UniqueConstraintType = /* @__PURE__ */ function(UniqueConstraintType) {
|
|
|
648
648
|
return UniqueConstraintType;
|
|
649
649
|
}({});
|
|
650
650
|
var MessageType = {
|
|
651
|
+
/**全部 */
|
|
651
652
|
ALL: "all",
|
|
653
|
+
/**未读 */
|
|
652
654
|
UNREAD: "unread"
|
|
653
655
|
};
|
|
654
656
|
var WorkbenchType = {
|
|
657
|
+
/**全部 */
|
|
655
658
|
TEST: "myTestApp",
|
|
659
|
+
/**未读 */
|
|
656
660
|
QUICK: "quickAccess",
|
|
657
661
|
MY: "myApp"
|
|
658
662
|
};
|
package/es/enums/globalEnum.d.ts
CHANGED
|
@@ -51,3 +51,32 @@ export declare enum PlatformSettingEnum {
|
|
|
51
51
|
DEPLOY = "DEPLOY_CFG",
|
|
52
52
|
GLOBAL = "GLOBAL_CFG"
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* logo类型枚举
|
|
56
|
+
* @alias Icon 图标
|
|
57
|
+
* @alias Image 图片
|
|
58
|
+
*/
|
|
59
|
+
export declare enum LogoTypeEnum {
|
|
60
|
+
/** 图标 */
|
|
61
|
+
Icon = "ICON",
|
|
62
|
+
/** 图片 */
|
|
63
|
+
Image = "IMAGE"
|
|
64
|
+
}
|
|
65
|
+
export declare enum UserRoleReqEnum {
|
|
66
|
+
/** 维护人员 */
|
|
67
|
+
MAINTAINER = "MAINTAINER",
|
|
68
|
+
/** 开发人员(协作) */
|
|
69
|
+
DEVELOPER = "DEVELOPER",
|
|
70
|
+
/** 测试人员 */
|
|
71
|
+
TESTER = "TESTER",
|
|
72
|
+
/** 查看人员 */
|
|
73
|
+
VIEWER = "VIEWER"
|
|
74
|
+
}
|
|
75
|
+
export declare enum WorkBenchTabEnum {
|
|
76
|
+
/** 应用 */
|
|
77
|
+
APP = "app",
|
|
78
|
+
/** 菜单 */
|
|
79
|
+
MENU = "menu",
|
|
80
|
+
/** 已选菜单 */
|
|
81
|
+
SELECT_MENU = "select_menu"
|
|
82
|
+
}
|
package/es/enums/globalEnum.mjs
CHANGED
|
@@ -56,5 +56,37 @@ var PlatformSettingEnum = /* @__PURE__ */ function(PlatformSettingEnum) {
|
|
|
56
56
|
PlatformSettingEnum["GLOBAL"] = "GLOBAL_CFG";
|
|
57
57
|
return PlatformSettingEnum;
|
|
58
58
|
}({});
|
|
59
|
+
/**
|
|
60
|
+
* logo类型枚举
|
|
61
|
+
* @alias Icon 图标
|
|
62
|
+
* @alias Image 图片
|
|
63
|
+
*/
|
|
64
|
+
var LogoTypeEnum = /* @__PURE__ */ function(LogoTypeEnum) {
|
|
65
|
+
/** 图标 */
|
|
66
|
+
LogoTypeEnum["Icon"] = "ICON";
|
|
67
|
+
/** 图片 */
|
|
68
|
+
LogoTypeEnum["Image"] = "IMAGE";
|
|
69
|
+
return LogoTypeEnum;
|
|
70
|
+
}({});
|
|
71
|
+
var UserRoleReqEnum = /* @__PURE__ */ function(UserRoleReqEnum) {
|
|
72
|
+
/** 维护人员 */
|
|
73
|
+
UserRoleReqEnum["MAINTAINER"] = "MAINTAINER";
|
|
74
|
+
/** 开发人员(协作) */
|
|
75
|
+
UserRoleReqEnum["DEVELOPER"] = "DEVELOPER";
|
|
76
|
+
/** 测试人员 */
|
|
77
|
+
UserRoleReqEnum["TESTER"] = "TESTER";
|
|
78
|
+
/** 查看人员 */
|
|
79
|
+
UserRoleReqEnum["VIEWER"] = "VIEWER";
|
|
80
|
+
return UserRoleReqEnum;
|
|
81
|
+
}({});
|
|
82
|
+
var WorkBenchTabEnum = /* @__PURE__ */ function(WorkBenchTabEnum) {
|
|
83
|
+
/** 应用 */
|
|
84
|
+
WorkBenchTabEnum["APP"] = "app";
|
|
85
|
+
/** 菜单 */
|
|
86
|
+
WorkBenchTabEnum["MENU"] = "menu";
|
|
87
|
+
/** 已选菜单 */
|
|
88
|
+
WorkBenchTabEnum["SELECT_MENU"] = "select_menu";
|
|
89
|
+
return WorkBenchTabEnum;
|
|
90
|
+
}({});
|
|
59
91
|
//#endregion
|
|
60
|
-
export { DeviceParamsTypeEnum, PlatformSettingEnum, PlatformType, nullDisplayEnum };
|
|
92
|
+
export { DeviceParamsTypeEnum, LogoTypeEnum, PlatformSettingEnum, PlatformType, UserRoleReqEnum, WorkBenchTabEnum, nullDisplayEnum };
|
package/es/global/gct/gct.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { DictionaryUtil } from "../../utils/dictionary/dictionary.mjs";
|
|
|
2
2
|
import "../../utils/index.mjs";
|
|
3
3
|
import { GlobalStoreUtil } from "../../store/index.mjs";
|
|
4
4
|
import { EnvironmentManager } from "../../modules/env-manager/env-manager.mjs";
|
|
5
|
+
import "../../modules/env-manager/index.mjs";
|
|
5
6
|
import { MqttManager } from "../../modules/mqtt/mqtt-manager.mjs";
|
|
6
7
|
import "../../modules/mqtt/index.mjs";
|
|
7
8
|
import { LocaleUtil } from "../../locale/index.mjs";
|
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
|
@@ -13,7 +13,7 @@ import { APP_DARK_MODE_KEY_, APP_LOCAL_CACHE_KEY, APP_SESSION_CACHE_KEY, CacheTy
|
|
|
13
13
|
import { AGLINE_ENUMS, ButtonOpeEnum, RdoButtonOpeEnum, SEARCH_SERVICE, notSingleArr, presetColor } from "./enums/designEnum.mjs";
|
|
14
14
|
import { ErrorTypeEnum, ExceptionEnum } from "./enums/exceptionEnum.mjs";
|
|
15
15
|
import { BizServiceEnum, ContentTypeEnum, RequestEnum, ResultEnum } from "./enums/httpEnum.mjs";
|
|
16
|
-
import { DeviceParamsTypeEnum, PlatformSettingEnum, PlatformType, nullDisplayEnum } from "./enums/globalEnum.mjs";
|
|
16
|
+
import { DeviceParamsTypeEnum, LogoTypeEnum, PlatformSettingEnum, PlatformType, UserRoleReqEnum, WorkBenchTabEnum, nullDisplayEnum } from "./enums/globalEnum.mjs";
|
|
17
17
|
import { MenuModeEnum, MenuSplitTyeEnum, MenuTypeEnum, MixSidebarTriggerEnum, TopMenuAlignEnum, TriggerEnum } from "./enums/menuEnum.mjs";
|
|
18
18
|
import { PageEnum } from "./enums/pageEnum.mjs";
|
|
19
19
|
import { RoleEnum } from "./enums/roleEnum.mjs";
|
|
@@ -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";
|
|
@@ -85,11 +85,12 @@ import { WATERMARK_INIT_DATA } from "./modules/platform-config/constants/waterma
|
|
|
85
85
|
import { usePlatformConfigStore } from "./modules/platform-config/store.mjs";
|
|
86
86
|
import "./modules/platform-config/index.mjs";
|
|
87
87
|
import { globalRefStorage } from "./store/storage-store.mjs";
|
|
88
|
-
import { globalRefSession } from "./store/session-store.mjs";
|
|
88
|
+
import { ENV, globalRefSession } from "./store/session-store.mjs";
|
|
89
89
|
import { GlobalStoreUtil } from "./store/index.mjs";
|
|
90
90
|
import { EnvironmentType } from "./modules/env-manager/env-manager.interface.mjs";
|
|
91
|
-
import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, TEST_SINGLE_PATH_REG } from "./modules/env-manager/env-manager.const.mjs";
|
|
91
|
+
import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, SANDBOX_PATH_REG, TEST_SINGLE_PATH_REG } from "./modules/env-manager/env-manager.const.mjs";
|
|
92
92
|
import { EnvironmentManager } from "./modules/env-manager/env-manager.mjs";
|
|
93
|
+
import "./modules/env-manager/index.mjs";
|
|
93
94
|
import { MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS } from "./modules/mqtt/constants/mqtt.const.mjs";
|
|
94
95
|
import { DEFAULT_MQTT_INSTANCE_ID, MqttConnectionStatus } from "./modules/mqtt/enums/mqtt-status.enum.mjs";
|
|
95
96
|
import { MqttClient } from "./modules/mqtt/mqtt-client.mjs";
|
|
@@ -104,6 +105,7 @@ import { useModal } from "./hooks/use-modal/use-modal.mjs";
|
|
|
104
105
|
import { useIFrameProps, useWuJieBus, useWuJieProps } from "./hooks/use-sub-app-utils/use-sub-app-utils.mjs";
|
|
105
106
|
import { copyTextToClipboard, isDef, useCopyToClipboard } from "./hooks/useCopyToClipboard.mjs";
|
|
106
107
|
import { fileUrlParser, transformUrl } from "./hooks/useFile.mjs";
|
|
108
|
+
import { approvalObserver, parentObserver } from "./hooks/useObserver.mjs";
|
|
107
109
|
import "./hooks/index.mjs";
|
|
108
110
|
import { getSeriesList } from "./interface/model-designer/serial.mjs";
|
|
109
111
|
import "./interface/index.mjs";
|
|
@@ -129,13 +131,23 @@ function onInit() {
|
|
|
129
131
|
}
|
|
130
132
|
console.info("核心包安装成功!");
|
|
131
133
|
window._gct = new GctGlobal();
|
|
132
|
-
Object.defineProperty(window._gct, "api", {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
Object.defineProperty(window._gct, "api", {
|
|
135
|
+
set() {
|
|
136
|
+
throw new TypeError("window._api 是只读属性,不允许修改!");
|
|
137
|
+
},
|
|
138
|
+
get() {
|
|
139
|
+
return api;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(window, "_api", {
|
|
143
|
+
set() {
|
|
144
|
+
throw new TypeError("window._api 是只读属性,不允许修改!");
|
|
145
|
+
},
|
|
146
|
+
get() {
|
|
147
|
+
return api;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
138
150
|
}
|
|
139
151
|
onInit();
|
|
140
152
|
//#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, 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, 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, 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, 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 };
|
|
153
|
+
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, ENV, 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 };
|
package/es/locale/index.mjs
CHANGED
|
@@ -72,11 +72,16 @@ var LocaleUtil = class {
|
|
|
72
72
|
env: _gct.env.getEnv(),
|
|
73
73
|
branch: _gct.store.context.bid
|
|
74
74
|
}) : void 0;
|
|
75
|
-
|
|
75
|
+
try {
|
|
76
|
+
await Promise.all([this.loadMessages(platformUrl), this.loadMessages(app_platformUrl)]);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error("加载国际化资源失败", error);
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
/**加载语言列表 */
|
|
78
82
|
async loadLocales() {
|
|
79
|
-
|
|
83
|
+
const res = await _api.platform.i18NConfig.getList({});
|
|
84
|
+
this.localeList = res.map((i) => {
|
|
80
85
|
return {
|
|
81
86
|
id: i.id,
|
|
82
87
|
configured: i.configured,
|
|
@@ -13,5 +13,7 @@ var APP_PREVIEW_PATH_REG = /\/web-render\//;
|
|
|
13
13
|
var DEV_SINGLE_PATH_REG = /\/dev-single\//;
|
|
14
14
|
/** 测试环境单应用路径正则表达式 */
|
|
15
15
|
var TEST_SINGLE_PATH_REG = /\/test-single\//;
|
|
16
|
+
/** 沙箱环境路径正则表达式 */
|
|
17
|
+
var SANDBOX_PATH_REG = /(mobile|pad)-sandbox/;
|
|
16
18
|
//#endregion
|
|
17
|
-
export { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, TEST_SINGLE_PATH_REG };
|
|
19
|
+
export { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, SANDBOX_PATH_REG, TEST_SINGLE_PATH_REG };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ENV } from "../../store/session-store.mjs";
|
|
1
2
|
import { EnvironmentType } from "./env-manager.interface.mjs";
|
|
2
|
-
import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, TEST_SINGLE_PATH_REG } from "./env-manager.const.mjs";
|
|
3
|
+
import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, SANDBOX_PATH_REG, TEST_SINGLE_PATH_REG } from "./env-manager.const.mjs";
|
|
3
4
|
//#region src/modules/env-manager/env-manager.ts
|
|
4
5
|
/**
|
|
5
6
|
* 环境管理器
|
|
@@ -21,7 +22,7 @@ var EnvironmentManager = class {
|
|
|
21
22
|
}
|
|
22
23
|
/**安卓混合开发模式下 */
|
|
23
24
|
get isAndroid() {
|
|
24
|
-
return window.
|
|
25
|
+
return window.__GCT_ANDROID__ === true;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* 是否为应用前端运行时
|
|
@@ -72,6 +73,12 @@ var EnvironmentManager = class {
|
|
|
72
73
|
return this._testTenantData;
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
76
|
+
* 是否为沙箱环境
|
|
77
|
+
*/
|
|
78
|
+
get isSandbox() {
|
|
79
|
+
return SANDBOX_PATH_REG.test(location.pathname);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
75
82
|
* 检测是否为测试环境
|
|
76
83
|
*/
|
|
77
84
|
async checkIsTestEnv() {
|
|
@@ -100,7 +107,8 @@ var EnvironmentManager = class {
|
|
|
100
107
|
* @returns 环境类型
|
|
101
108
|
*/
|
|
102
109
|
getEnv() {
|
|
103
|
-
if (
|
|
110
|
+
if (ENV.value) return ENV.value;
|
|
111
|
+
else if (this.isTestEnv) return EnvironmentType.TEST;
|
|
104
112
|
else if (this.isAppProd || this.isAndroid) return EnvironmentType.PROD;
|
|
105
113
|
else return EnvironmentType.DEV;
|
|
106
114
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
//#region src/modules/error-handler/error-handler.const.ts
|
|
2
2
|
/** HTTP 状态码常量 */
|
|
3
3
|
var HTTP_STATUS_CODE = {
|
|
4
|
+
/** 未授权 */
|
|
4
5
|
UNAUTHORIZED: 401,
|
|
6
|
+
/** 禁止访问 */
|
|
5
7
|
FORBIDDEN: 403,
|
|
8
|
+
/** 资源未找到 */
|
|
6
9
|
NOT_FOUND: 404,
|
|
10
|
+
/** 内部服务器错误 */
|
|
7
11
|
INTERNAL_SERVER_ERROR: 500,
|
|
12
|
+
/** 网关错误 */
|
|
8
13
|
BAD_GATEWAY: 502,
|
|
14
|
+
/** 服务不可用 */
|
|
9
15
|
SERVICE_UNAVAILABLE: 503,
|
|
16
|
+
/** 网关超时 */
|
|
10
17
|
GATEWAY_TIMEOUT: 504
|
|
11
18
|
};
|
|
12
19
|
//#endregion
|
|
@@ -5,19 +5,31 @@
|
|
|
5
5
|
* @description 连接时未显式指定的选项将使用以下默认值
|
|
6
6
|
*/
|
|
7
7
|
var MQTT_DEFAULT_CONNECT_OPTIONS = {
|
|
8
|
+
/** 心跳保活间隔(秒),0 表示禁用 */
|
|
8
9
|
keepalive: 60,
|
|
10
|
+
/** 连接超时时间(毫秒) */
|
|
9
11
|
connectTimeout: 3e4,
|
|
12
|
+
/**
|
|
13
|
+
* 重连间隔(毫秒),由 mqtt.js 内置重连机制使用
|
|
14
|
+
* 设为 0 可禁用自动重连
|
|
15
|
+
*/
|
|
10
16
|
reconnectPeriod: 5e3,
|
|
17
|
+
/** 是否清除会话,true 表示每次重连后订阅信息不保留 */
|
|
11
18
|
clean: false
|
|
12
19
|
};
|
|
13
20
|
/**
|
|
14
21
|
* MQTT 连接级事件名称常量
|
|
15
22
|
*/
|
|
16
23
|
var MQTT_CLIENT_EVENT = {
|
|
24
|
+
/** 成功建立连接 */
|
|
17
25
|
CONNECT: "connect",
|
|
26
|
+
/** 重连中 */
|
|
18
27
|
RECONNECT: "reconnect",
|
|
28
|
+
/** 连接已断开 */
|
|
19
29
|
DISCONNECT: "disconnect",
|
|
30
|
+
/** 发生错误 */
|
|
20
31
|
ERROR: "error",
|
|
32
|
+
/** 收到消息 */
|
|
21
33
|
MESSAGE: "message"
|
|
22
34
|
};
|
|
23
35
|
//#endregion
|
|
@@ -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 };
|
|
@@ -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";
|
|
@@ -21,8 +21,9 @@ var useUserStore = defineStore("user", {
|
|
|
21
21
|
getUserPermissions(state) {
|
|
22
22
|
return state.userPermissions;
|
|
23
23
|
},
|
|
24
|
+
/**用户信息下的租户信息 */
|
|
24
25
|
getTenantInfo(state) {
|
|
25
|
-
return state.userInfo?.tenantList?.find((i) => i.id ===
|
|
26
|
+
return state.userInfo?.tenantList?.find((i) => i.id === tenantRef.value);
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
actions: {
|
|
@@ -37,7 +38,7 @@ var useUserStore = defineStore("user", {
|
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
async getUserInfoAction(Token) {
|
|
40
|
-
if (!getToken && !Token) return null;
|
|
41
|
+
if (!getToken() && !Token) return null;
|
|
41
42
|
const info = await _api.platform.user.getInfo({ headers: { Token } });
|
|
42
43
|
this.setUserInfo(info);
|
|
43
44
|
this.userPermissions = (info?.platformManagerPermissions ?? []).reduce((map, item) => {
|
|
@@ -46,14 +47,20 @@ var useUserStore = defineStore("user", {
|
|
|
46
47
|
}, {});
|
|
47
48
|
return info;
|
|
48
49
|
},
|
|
50
|
+
/**单应用登录 */
|
|
49
51
|
async afterLoginSingleApp() {},
|
|
52
|
+
/**登录后逻辑 */
|
|
50
53
|
async afterLoginAction() {
|
|
51
|
-
if (!getToken) return null;
|
|
54
|
+
if (!getToken()) return null;
|
|
52
55
|
},
|
|
56
|
+
/**退出登录 接口*/
|
|
53
57
|
async submitLoginOut() {
|
|
54
58
|
await doLogout();
|
|
55
59
|
this.appLoginOut();
|
|
56
60
|
},
|
|
61
|
+
/**
|
|
62
|
+
* 清空对应信息
|
|
63
|
+
*/
|
|
57
64
|
async appLoginOut() {
|
|
58
65
|
setToken();
|
|
59
66
|
this.setUserInfo({});
|