@gct-paas/core 0.1.4-dev.11 → 0.1.4-dev.12
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 +21679 -0
- package/es/constants/core.mjs +5 -4
- package/es/constants/default-date-type/default-date-type.mjs +73 -21
- package/es/constants/editor-register/editor-register.mjs +17 -5
- package/es/constants/expression-type/BuiltOperators.mjs +152 -147
- package/es/constants/expression-type/FunctionKeys.mjs +75 -79
- package/es/constants/expression-type/editor.mjs +10 -3
- package/es/constants/expression-type/function.mjs +602 -613
- package/es/constants/expression-type/index.mjs +111 -113
- package/es/constants/expression-type/modeCfg.mjs +256 -263
- package/es/constants/expression-type/variable.mjs +43 -39
- package/es/constants/form-container-type/form-container-type.mjs +17 -5
- package/es/constants/index.mjs +30 -10
- package/es/constants/page-designer/model.mjs +15 -5
- package/es/create-app-vue.mjs +15 -9
- package/es/enums/app-designer/index.d.ts +19 -0
- package/es/enums/app-designer/index.mjs +131 -63
- package/es/enums/appEnum.mjs +681 -360
- package/es/enums/appStateEnum.mjs +17 -10
- package/es/enums/authActionEnum.mjs +63 -51
- package/es/enums/breakpointEnum.mjs +27 -26
- package/es/enums/cacheEnum.mjs +22 -21
- package/es/enums/designEnum.mjs +110 -71
- package/es/enums/developer-center/integration.mjs +7 -6
- package/es/enums/exceptionEnum.mjs +21 -17
- package/es/enums/expressionEnum.d.ts +1 -1
- package/es/enums/expressionEnum.mjs +81 -74
- package/es/enums/globalEnum.mjs +59 -36
- package/es/enums/httpEnum.mjs +71 -61
- package/es/enums/index.mjs +43 -14
- package/es/enums/menuEnum.mjs +42 -38
- package/es/enums/page-designer/designer.mjs +403 -407
- package/es/enums/page-designer/index.mjs +4 -0
- package/es/enums/page-designer/panel.mjs +341 -213
- package/es/enums/page-designer/toolkit.mjs +13 -12
- package/es/enums/page-designer/widget.mjs +425 -338
- package/es/enums/pageEnum.mjs +14 -13
- package/es/enums/plugin-enum.mjs +23 -7
- package/es/enums/processEnum.mjs +95 -60
- package/es/enums/roleEnum.mjs +7 -6
- package/es/enums/sizeEnum.d.ts +18 -0
- package/es/enums/sizeEnum.mjs +28 -8
- package/es/global/gct/gct.mjs +84 -96
- package/es/global/index.mjs +1 -0
- package/es/hooks/index.mjs +4 -0
- package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
- package/es/hooks/use-modal/use-modal.mjs +16 -10
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
- package/es/hooks/useCopyToClipboard.mjs +50 -50
- package/es/index.mjs +122 -114
- package/es/locale/index.mjs +43 -57
- package/es/modules/env-manager/env-manager.const.mjs +16 -8
- package/es/modules/env-manager/env-manager.interface.mjs +14 -7
- package/es/modules/env-manager/env-manager.mjs +104 -107
- package/es/modules/error-handler/error-handler.const.mjs +11 -16
- package/es/modules/error-handler/error-strategy.mjs +199 -175
- package/es/modules/error-handler/index.mjs +120 -106
- package/es/modules/mqtt/constants/mqtt.const.mjs +21 -24
- package/es/modules/mqtt/enums/mqtt-status.enum.mjs +23 -9
- package/es/modules/mqtt/index.mjs +4 -0
- package/es/modules/mqtt/mqtt-client.mjs +228 -261
- package/es/modules/mqtt/mqtt-manager.mjs +117 -77
- package/es/modules/platform-config/constants/index.mjs +4 -0
- package/es/modules/platform-config/constants/login.const.mjs +48 -45
- package/es/modules/platform-config/constants/org.const.mjs +57 -52
- package/es/modules/platform-config/constants/theme.const.mjs +11 -4
- package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
- package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
- package/es/modules/platform-config/enums/login.enum.mjs +29 -15
- package/es/modules/platform-config/enums/platform.enum.mjs +16 -13
- package/es/modules/platform-config/index.mjs +9 -0
- package/es/modules/platform-config/store.mjs +68 -79
- package/es/modules/platform-config/useBasicSetting.mjs +47 -35
- package/es/modules/platform-config/useDeploySetting.mjs +29 -21
- package/es/modules/platform-config/useLoginSetting.mjs +151 -173
- package/es/modules/platform-config/useOrgSetting.mjs +63 -62
- package/es/modules/platform-config/useProjectSetting.mjs +14 -6
- package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
- package/es/modules/platform-config/useThemeSetting.mjs +78 -59
- package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
- package/es/modules/user-stores/index.mjs +3 -0
- package/es/modules/user-stores/store/permission.store.mjs +27 -36
- package/es/modules/user-stores/store/tenant.store.mjs +20 -22
- package/es/modules/user-stores/store/user.store.mjs +94 -117
- package/es/router/index.mjs +25 -28
- package/es/setup-app.mjs +23 -39
- package/es/state/global-pinia-state/global-pinia-state.mjs +49 -71
- package/es/state/index.mjs +1 -0
- package/es/store/global-store.mjs +50 -72
- package/es/store/index.mjs +25 -19
- package/es/types/index.d.ts +7 -0
- package/es/utils/axios/interceptors.mjs +21 -17
- package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
- package/es/utils/design/design.mjs +18 -12
- package/es/utils/deviceFingerprint.mjs +74 -63
- package/es/utils/dictionary/dictionary.mjs +142 -145
- package/es/utils/file/base64Conver.mjs +35 -30
- package/es/utils/file/download.mjs +94 -98
- package/es/utils/file/parser.d.ts +3 -0
- package/es/utils/file/parser.mjs +29 -0
- package/es/utils/i18n/index.mjs +14 -3
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +31 -0
- package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
- package/es/utils/linked-list/linked-list.mjs +115 -118
- package/es/utils/linked-node/linked-node.mjs +41 -31
- package/es/utils/lowcode/utils.mjs +13 -18
- package/es/utils/lowcode/validate.mjs +20 -26
- package/es/utils/mitt/mitt.mjs +4 -4
- package/es/utils/model-loader/model-loader.mjs +280 -325
- package/es/utils/namespace/namespace.mjs +178 -164
- package/es/utils/openUtil/index.mjs +2 -0
- package/es/utils/openUtil/modal/modal.mjs +72 -79
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
- package/es/utils/permission.mjs +33 -37
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
- package/es/utils/style/index.mjs +94 -138
- package/es/utils/tools/tools.mjs +86 -54
- package/es/utils/treeHelper/treeHelper.mjs +205 -233
- package/es/utils/uploader/uploader.mjs +81 -115
- package/es/utils/useUUid.mjs +79 -87
- package/es/utils/util.mjs +55 -35
- package/es/utils/uuid/uuid.d.ts +1 -0
- package/es/utils/uuid/uuid.mjs +36 -43
- package/es/utils/validate.mjs +15 -19
- package/es/utils/value-helper/value-helper.mjs +113 -98
- package/package.json +12 -13
- package/dist/index.esm.min.mjs +0 -18322
- package/dist/index.min.cjs +0 -393
- package/dist/index.system.min.js +0 -393
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { ref, watch } from
|
|
2
|
-
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
//#region src/hooks/useCopyToClipboard.ts
|
|
3
3
|
function isDef(val) {
|
|
4
|
-
|
|
4
|
+
return typeof val !== "undefined";
|
|
5
5
|
}
|
|
6
6
|
function useCopyToClipboard(initial) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const clipboardRef = ref(initial || "");
|
|
8
|
+
const isSuccessRef = ref(false);
|
|
9
|
+
const copiedRef = ref(false);
|
|
10
|
+
watch(clipboardRef, (str) => {
|
|
11
|
+
if (isDef(str)) {
|
|
12
|
+
copiedRef.value = true;
|
|
13
|
+
isSuccessRef.value = copyTextToClipboard(str);
|
|
14
|
+
}
|
|
15
|
+
}, {
|
|
16
|
+
immediate: !!initial,
|
|
17
|
+
flush: "sync"
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
clipboardRef,
|
|
21
|
+
isSuccessRef,
|
|
22
|
+
copiedRef
|
|
23
|
+
};
|
|
21
24
|
}
|
|
22
25
|
function copyTextToClipboard(input, { target = document.body } = {}) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
previouslyFocusedElement.focus();
|
|
53
|
-
}
|
|
54
|
-
return isSuccess;
|
|
26
|
+
const element = document.createElement("textarea");
|
|
27
|
+
const previouslyFocusedElement = document.activeElement;
|
|
28
|
+
element.value = input;
|
|
29
|
+
element.setAttribute("readonly", "");
|
|
30
|
+
element.style.contain = "strict";
|
|
31
|
+
element.style.position = "absolute";
|
|
32
|
+
element.style.left = "-9999px";
|
|
33
|
+
element.style.fontSize = "12pt";
|
|
34
|
+
const selection = document.getSelection();
|
|
35
|
+
let originalRange;
|
|
36
|
+
if (selection && selection.rangeCount > 0) originalRange = selection.getRangeAt(0);
|
|
37
|
+
target.append(element);
|
|
38
|
+
element.select();
|
|
39
|
+
element.selectionStart = 0;
|
|
40
|
+
element.selectionEnd = input.length;
|
|
41
|
+
let isSuccess = false;
|
|
42
|
+
try {
|
|
43
|
+
isSuccess = document.execCommand("copy");
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error("Unable to copy.", err);
|
|
46
|
+
isSuccess = false;
|
|
47
|
+
}
|
|
48
|
+
element.remove();
|
|
49
|
+
if (originalRange && selection) {
|
|
50
|
+
selection.removeAllRanges();
|
|
51
|
+
selection.addRange(originalRange);
|
|
52
|
+
}
|
|
53
|
+
if (previouslyFocusedElement) previouslyFocusedElement.focus();
|
|
54
|
+
return isSuccess;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
//#endregion
|
|
57
57
|
export { copyTextToClipboard, isDef, useCopyToClipboard };
|
package/es/index.mjs
CHANGED
|
@@ -1,117 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
import { AggTypes, CARD_TRIGGER_ENUM, ContentEnum, CreateType, FIELD_TYPE, FIELD_TYPE_BASIC, FIELD_TYPE_CATEGORY, FIELD_TYPE_LOGIC, FIELD_TYPE_TRACE, FieldIconMap, FieldTypeToJs, GENDER_TYPE, MaterialEnum, MenuType, MessageType, NodesConfigTypeEnum, OpenMode, PermissionModeEnum, PersonalCenterType, ProjectName, RouterTransitionEnum, SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, TODO_TYPE, ThemeEnum, UniqueConstraintType, WorkbenchType, selectionTypeEnums } from "./enums/appEnum.mjs";
|
|
2
|
+
import { EntityModelCategoryEnum, EntityModelTypeEnum, FieldDefaultValueTypeEnum, FieldSysVarDefaultValueEnum, PatternEnum, SHOW_FIELDTYPES, TypeEnum, UserServiceType, pageLayoutModeEnum, scriptTypeEnum } from "./enums/app-designer/index.mjs";
|
|
3
|
+
import { ASSIGNMENTSTRATEGY_ENUM, BorderStyle, COLUMNS_TYPE, Dependency_ENUM, DisplayTagTypeEnum, DisplayType, EventCategory, GLOBAL_TYPE, GLOBAL_VAR_TYPE, INNER_EVENT, PanelEnum, Postion, ProgressTypeEnum, PropGroup, SUB_TABLE_EDIT_MODE, SUB_TABLE_OPE_EVENT_TYPE, SUB_TABLE_OPE_EVENT_TYPE_INLINE, StyleGroup, TagTypeEnum, TextAlign, TextDecoration, VERIFICATIONCONDITIONS_TYPE, tagEnum } from "./enums/page-designer/panel.mjs";
|
|
4
|
+
import { ToolkitEnum } from "./enums/page-designer/toolkit.mjs";
|
|
5
|
+
import { BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonSize, ButtonStyle, ButtonType, ButtonTypeGroup, ButtonType_vant, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CategoryTypeEnum, DatasourceTypeEnum, DateRangeEnums, DisplayEnums, KeyMode, ListTreeSearchTypeEnum, Platform, PrintModeEnums, ResetRuleType, RowSelectionTypeEnums, SelectPickerEnums, SignatureStyleEnum, SignatureTypeEnum, StatisticalMethodEnums, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TransactionMode, WidgetInScopeEnum, openWindowEnums, operateSysEnums } from "./enums/page-designer/widget.mjs";
|
|
6
|
+
import { BindCmpStyleEnum, BindCmpStyleTypeEnum, Ch_BindCmpStyleEnum, FormComponents, SCOPE, SCOPEINFO, SearchComponents, bindCmpStyleMap, buttonShowType, controlConfigEnum, fixedAlignENUM, mobileSearchListByFieldType, padSearchListByFieldType, searchListByFieldType, sortTypeEnum, statisticalMethodEnum, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, transformBindCmp2CmpType } from "./enums/page-designer/designer.mjs";
|
|
7
|
+
import { PrintResourceEnum } from "./enums/developer-center/integration.mjs";
|
|
8
|
+
import { AppPublishStateEnum } from "./enums/appStateEnum.mjs";
|
|
9
|
+
import { BasicAction, CustomAction, DefaultActions, PlatformSettingActions } from "./enums/authActionEnum.mjs";
|
|
10
|
+
import { screenEnum, screenMap, sizeEnum } from "./enums/breakpointEnum.mjs";
|
|
11
|
+
import { APP_DARK_MODE_KEY_, APP_LOCAL_CACHE_KEY, APP_SESSION_CACHE_KEY, CacheTypeEnum, DESIGNER_SESSION_CACHE_KEY, LOCALE_KEY, LOCALE_LIST_KEY, LOCAL_I18N_TRANSLATE, LOCK_INFO_KEY, MULTIPLE_TABS_KEY, PROJ_CFG_KEY, ROLES_KEY, TENANT_KEY, TIMEZONE_KEY, TOKEN_KEY, USER_INFO_KEY } from "./enums/cacheEnum.mjs";
|
|
12
|
+
import { AGLINE_ENUMS, ButtonOpeEnum, RdoButtonOpeEnum, SEARCH_SERVICE, notSingleArr, presetColor } from "./enums/designEnum.mjs";
|
|
13
|
+
import { ErrorTypeEnum, ExceptionEnum } from "./enums/exceptionEnum.mjs";
|
|
14
|
+
import { BizServiceEnum, ContentTypeEnum, RequestEnum, ResultEnum } from "./enums/httpEnum.mjs";
|
|
15
|
+
import { DeviceParamsTypeEnum, PlatformSettingEnum, PlatformType, nullDisplayEnum } from "./enums/globalEnum.mjs";
|
|
16
|
+
import { MenuModeEnum, MenuSplitTyeEnum, MenuTypeEnum, MixSidebarTriggerEnum, TopMenuAlignEnum, TriggerEnum } from "./enums/menuEnum.mjs";
|
|
17
|
+
import { PageEnum } from "./enums/pageEnum.mjs";
|
|
18
|
+
import { RoleEnum } from "./enums/roleEnum.mjs";
|
|
19
|
+
import { SizeEnum, UploadTypeEnum } from "./enums/sizeEnum.mjs";
|
|
20
|
+
import { BpmnNodeTypeEnum, ButtonTypeEnum, ExamineAndApproveStateEnum, OpinionTypeEnum, ProcessStatusEnum, ch_ProcessStatusMap } from "./enums/processEnum.mjs";
|
|
21
|
+
import { PluginModeEnum } from "./enums/plugin-enum.mjs";
|
|
22
|
+
import { DataSetReturnTypeEnum, EntityFormulaReturnTypeEnum, ExpressionModeEnum, ExpressionTabEnum, IdentifierAddon, OperatorTypeEnum, ReturnTypeEnum, VarTypeEnum, zeroWidthSpace } from "./enums/expressionEnum.mjs";
|
|
23
|
+
import { GctMqttTopsEnum, GlobalParamEnum } from "./enums/index.mjs";
|
|
24
|
+
import { gctMemoizeAsync } from "./utils/cache-adapter/cache-adapter.mjs";
|
|
25
|
+
import { DictionaryUtil } from "./utils/dictionary/dictionary.mjs";
|
|
26
|
+
import { t } from "./utils/i18n/index.mjs";
|
|
27
|
+
import { LinkedNode } from "./utils/linked-node/linked-node.mjs";
|
|
28
|
+
import { LinkedList } from "./utils/linked-list/linked-list.mjs";
|
|
29
|
+
import { insertCustomCssToHead } from "./utils/lowcode/utils.mjs";
|
|
30
|
+
import { buildItemRules } from "./utils/lowcode/validate.mjs";
|
|
31
|
+
import { mitt } from "./utils/mitt/mitt.mjs";
|
|
32
|
+
import { modelLoader } from "./utils/model-loader/model-loader.mjs";
|
|
33
|
+
import { ModeFnMap, ModeTabDict, ModeTabMap, ReturnTypeMaps } from "./constants/expression-type/modeCfg.mjs";
|
|
34
|
+
import { BuiltOperators, allOperator, booleanOperator, getOperatorList, numberOperator, returnBolOperator } from "./constants/expression-type/BuiltOperators.mjs";
|
|
35
|
+
import { CUSTOM_LANGUAGE, CUSTOM_THEME } from "./constants/expression-type/editor.mjs";
|
|
36
|
+
import { biBackFunctionGroup, biBackFunctionMap, functionGroup, functionMap, ipaasBackFunctionGroup, ipaasBackFunctionMap } from "./constants/expression-type/function.mjs";
|
|
37
|
+
import { FUNC_KEYS } from "./constants/expression-type/FunctionKeys.mjs";
|
|
38
|
+
import { SYSTEM_VAR_PREFIX, booleanTypes, innerVarIds, innerVarList, numberTypes } from "./constants/expression-type/variable.mjs";
|
|
39
|
+
import { ARRAY_TYPE, BOOLEAN_TYPE, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TYPE, FUN_STR_TYPE, NUMBER_TYPE, OBJECT_TYPE, RETURN_TYPE_MAP, STRING_TYPE, WinMsgTypeEnum, operator2FuncMap } from "./constants/expression-type/index.mjs";
|
|
40
|
+
import { EditorRegisterConst } from "./constants/editor-register/editor-register.mjs";
|
|
41
|
+
import { FormContainerType } from "./constants/form-container-type/form-container-type.mjs";
|
|
42
|
+
import { DefaultDateTypeConst } from "./constants/default-date-type/default-date-type.mjs";
|
|
43
|
+
import { CoreConst } from "./constants/core.mjs";
|
|
44
|
+
import { ModelTypeOptions } from "./constants/page-designer/model.mjs";
|
|
45
|
+
import { APP_INST, PLUGIN_BASE_URL, STYLE_NAMESPACE_TAG, VITE_MINIO_PATH } from "./constants/index.mjs";
|
|
46
|
+
import { Namespace, useNamespace } from "./utils/namespace/namespace.mjs";
|
|
47
|
+
import { Modal } from "./utils/openUtil/modal/modal.mjs";
|
|
48
|
+
import { OverlayContainer } from "./utils/openUtil/overlay-container/overlay-container.mjs";
|
|
49
|
+
import { PluginStaticResource } from "./utils/plugin-static-resource/plugin-static-resource.mjs";
|
|
50
|
+
import { deepMerge, getTenant, getTimezone, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams } from "./utils/tools/tools.mjs";
|
|
51
|
+
import { buildShortUUID, buildUUID, sha256, uuid2 } from "./utils/uuid/uuid.mjs";
|
|
52
|
+
import { afterFieldSet, afterValueSet, cacheFnReturn, computedEx, emitFieldSet, parseValueUnit } from "./utils/value-helper/value-helper.mjs";
|
|
53
|
+
import { interceptors } from "./utils/axios/interceptors.mjs";
|
|
54
|
+
import { getDeviceFingerprint, getPageIdentification } from "./utils/deviceFingerprint.mjs";
|
|
55
|
+
import { TreeHelper } from "./utils/treeHelper/treeHelper.mjs";
|
|
56
|
+
import { calcFontStyle, calcStyle } from "./utils/style/index.mjs";
|
|
57
|
+
import { genUrl, openWindow } from "./utils/util.mjs";
|
|
58
|
+
import { isSortFiled } from "./utils/is-sort-filed/is-sort-filed.mjs";
|
|
59
|
+
import { randomUUID, useUUid } from "./utils/useUUid.mjs";
|
|
60
|
+
import { hasEmojiAndSpecStr, hasEmojiAndSpecStr1, validateEmoji, validateIsModelName, validateModelName } from "./utils/validate.mjs";
|
|
61
|
+
import { Uploader } from "./utils/uploader/uploader.mjs";
|
|
62
|
+
import { dataURLtoBlob, urlToBase64 } from "./utils/file/base64Conver.mjs";
|
|
63
|
+
import { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, uploaderFiles } from "./utils/file/download.mjs";
|
|
64
|
+
import { sizeParser, typeParser } from "./utils/file/parser.mjs";
|
|
65
|
+
import { isMultipleOperator } from "./utils/design/design.mjs";
|
|
66
|
+
import { permission } from "./utils/permission.mjs";
|
|
67
|
+
import "./utils/index.mjs";
|
|
68
|
+
import { GlobalStoreUtil } from "./store/index.mjs";
|
|
69
|
+
import { EnvironmentType } from "./modules/env-manager/env-manager.interface.mjs";
|
|
70
|
+
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";
|
|
71
|
+
import { EnvironmentManager } from "./modules/env-manager/env-manager.mjs";
|
|
72
|
+
import { MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS } from "./modules/mqtt/constants/mqtt.const.mjs";
|
|
73
|
+
import { MqttConnectionStatus } from "./modules/mqtt/enums/mqtt-status.enum.mjs";
|
|
74
|
+
import { MqttClient } from "./modules/mqtt/mqtt-client.mjs";
|
|
75
|
+
import { MqttManager } from "./modules/mqtt/mqtt-manager.mjs";
|
|
76
|
+
import "./modules/mqtt/index.mjs";
|
|
77
|
+
import { LocaleUtil, setupI18n } from "./locale/index.mjs";
|
|
78
|
+
import { GctGlobal } from "./global/gct/gct.mjs";
|
|
79
|
+
import "./global/index.mjs";
|
|
80
|
+
import { useAppInst } from "./hooks/use-app-inst/use-app-inst.mjs";
|
|
81
|
+
import { useModal } from "./hooks/use-modal/use-modal.mjs";
|
|
82
|
+
import { useIFrameProps, useWuJieBus, useWuJieProps } from "./hooks/use-sub-app-utils/use-sub-app-utils.mjs";
|
|
83
|
+
import { copyTextToClipboard, isDef, useCopyToClipboard } from "./hooks/useCopyToClipboard.mjs";
|
|
84
|
+
import "./hooks/index.mjs";
|
|
85
|
+
import { ErrorStrategyFactory } from "./modules/error-handler/error-strategy.mjs";
|
|
86
|
+
import { ErrorHandler, setupErrorHandler } from "./modules/error-handler/index.mjs";
|
|
87
|
+
import { LoginSortTypeEnum, LoginTypeEnum } from "./modules/platform-config/enums/login.enum.mjs";
|
|
88
|
+
import { KickRuleEnum, PassRule } from "./modules/platform-config/enums/platform.enum.mjs";
|
|
89
|
+
import { DeployModeEnum } from "./modules/platform-config/enums/deploy.enum.mjs";
|
|
90
|
+
import { OTHER_LOGIN_KEYS, SYSTEM_LOGIN_KEYS, getLoginTypeOptions } from "./modules/platform-config/constants/login.const.mjs";
|
|
91
|
+
import { RELATION_FIELDS } from "./modules/platform-config/constants/org.const.mjs";
|
|
92
|
+
import { MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, THEME_COLORS } from "./modules/platform-config/constants/theme.const.mjs";
|
|
93
|
+
import { WATERMARK_INIT_DATA } from "./modules/platform-config/constants/watermark.const.mjs";
|
|
94
|
+
import { usePlatformConfigStore } from "./modules/platform-config/store.mjs";
|
|
95
|
+
import "./modules/platform-config/index.mjs";
|
|
96
|
+
import { useUserStore } from "./modules/user-stores/store/user.store.mjs";
|
|
97
|
+
import { useTenantStore } from "./modules/user-stores/store/tenant.store.mjs";
|
|
98
|
+
import { usePermissionStore } from "./modules/user-stores/store/permission.store.mjs";
|
|
99
|
+
import "./modules/user-stores/index.mjs";
|
|
100
|
+
import { createAppVue } from "./create-app-vue.mjs";
|
|
101
|
+
import { setupApp } from "./setup-app.mjs";
|
|
102
|
+
import { api } from "@gct-paas/api";
|
|
103
|
+
//#region src/index.ts
|
|
104
|
+
/**
|
|
105
|
+
* 核心包全局对象初始化,挂载到 window._gct 上
|
|
106
|
+
*
|
|
107
|
+
* @export
|
|
108
|
+
*/
|
|
97
109
|
function onInit() {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
get() {
|
|
111
|
-
return api;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
110
|
+
if (window._gct) {
|
|
111
|
+
console.warn("核心包已安装,请勿重复安装!");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
console.info("核心包安装成功!");
|
|
115
|
+
window._gct = new GctGlobal();
|
|
116
|
+
Object.defineProperty(window._gct, "api", { get() {
|
|
117
|
+
return api;
|
|
118
|
+
} });
|
|
119
|
+
Object.defineProperty(window, "_api", { get() {
|
|
120
|
+
return api;
|
|
121
|
+
} });
|
|
114
122
|
}
|
|
115
123
|
onInit();
|
|
116
|
-
|
|
117
|
-
export { GctGlobal };
|
|
124
|
+
//#endregion
|
|
125
|
+
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, 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, 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, dataURLtoBlob, deepMerge, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, emitFieldSet, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getDeviceFingerprint, getLoginTypeOptions, 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, transformBindCmp2CmpType, typeParser, uploaderFiles, urlToBase64, useAppInst, useCopyToClipboard, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
package/es/locale/index.mjs
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import { createI18n } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
acc[key] = value.join(":");
|
|
43
|
-
return acc;
|
|
44
|
-
}, {});
|
|
45
|
-
this.i18n.global.mergeLocaleMessage(locale, messages);
|
|
46
|
-
}
|
|
47
|
-
getMessageUrl(payload) {
|
|
48
|
-
if ("app" in payload) {
|
|
49
|
-
const tag = payload.env === "dev" ? `dev_${payload.branch}` : payload.env;
|
|
50
|
-
return `minio/${payload.app}/locale-js/${tag}/${payload.locale}__.json`;
|
|
51
|
-
}
|
|
52
|
-
return `/minio/locale-js/${payload.locale}__platform__.json`;
|
|
53
|
-
}
|
|
54
|
-
// changeLocale(locale: string) {}
|
|
55
|
-
}
|
|
1
|
+
import { createI18n } from "vue-i18n";
|
|
2
|
+
//#region src/locale/index.ts
|
|
3
|
+
var LocaleUtil = class {
|
|
4
|
+
i18n = createI18n({
|
|
5
|
+
legacy: false,
|
|
6
|
+
locale: "zh-CN",
|
|
7
|
+
fallbackLocale: "en",
|
|
8
|
+
messages: {
|
|
9
|
+
en: { message: { hello: "hello world" } },
|
|
10
|
+
ja: { message: { hello: "こんにちは、世界" } }
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
locale = "zh-CN";
|
|
14
|
+
constructor() {
|
|
15
|
+
this.init();
|
|
16
|
+
}
|
|
17
|
+
async init() {
|
|
18
|
+
await this.loadLocales();
|
|
19
|
+
const platformUrl = this.getMessageUrl({ locale: this.locale });
|
|
20
|
+
await this.loadMessages(platformUrl);
|
|
21
|
+
}
|
|
22
|
+
async loadLocales() {
|
|
23
|
+
const res = await (await fetch("/gct-platform/api/i18n-config/list")).json();
|
|
24
|
+
if (res.code === 200) this.locale = res.data.find((item) => item.defaultLanguage).languageTag;
|
|
25
|
+
}
|
|
26
|
+
async loadMessages(url, locale = this.locale) {
|
|
27
|
+
const messages = (await (await fetch(url)).text()).split("\n").reduce((acc, item) => {
|
|
28
|
+
const [key, ...value] = item.split(":");
|
|
29
|
+
acc[key] = value.join(":");
|
|
30
|
+
return acc;
|
|
31
|
+
}, {});
|
|
32
|
+
this.i18n.global.mergeLocaleMessage(locale, messages);
|
|
33
|
+
}
|
|
34
|
+
getMessageUrl(payload) {
|
|
35
|
+
if ("app" in payload) {
|
|
36
|
+
const tag = payload.env === "dev" ? `dev_${payload.branch}` : payload.env;
|
|
37
|
+
return `minio/${payload.app}/locale-js/${tag}/${payload.locale}__.json`;
|
|
38
|
+
}
|
|
39
|
+
return `/minio/locale-js/${payload.locale}__platform__.json`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
56
42
|
function setupI18n(app) {
|
|
57
|
-
|
|
43
|
+
app.use(_gct.i18n);
|
|
58
44
|
}
|
|
59
|
-
|
|
45
|
+
//#endregion
|
|
60
46
|
export { LocaleUtil, setupI18n };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
//#region src/modules/env-manager/env-manager.const.ts
|
|
2
|
+
/** IP地址正则表达式 */
|
|
3
|
+
var IP_REG = /^http:\/\/\d{1,3}(\.\d{1,3}){3}:(\d{1,5})$/;
|
|
4
|
+
/** 域名正则表达式 */
|
|
5
|
+
var HOST_REG = /^https?:\/\/([a-z0-9]+)-test\./;
|
|
6
|
+
/** 应用运行时路径正则表达式 */
|
|
7
|
+
var APP_RUN_PATH_REG = /\/web-render|\/web\/|web-single\/|dev-single\/|test-single\//;
|
|
8
|
+
/** 应用生产环境路径正则表达式 */
|
|
9
|
+
var APP_PROD_PATH_REG = /\/web\/|\/web-single\//;
|
|
10
|
+
/** 应用预览环境路径正则表达式 */
|
|
11
|
+
var APP_PREVIEW_PATH_REG = /\/web-render\//;
|
|
12
|
+
/** dev环境单应用路径正则表达式 */
|
|
13
|
+
var DEV_SINGLE_PATH_REG = /\/dev-single\//;
|
|
14
|
+
/** 测试环境单应用路径正则表达式 */
|
|
15
|
+
var TEST_SINGLE_PATH_REG = /\/test-single\//;
|
|
16
|
+
//#endregion
|
|
9
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 };
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/modules/env-manager/env-manager.interface.ts
|
|
2
|
+
/**
|
|
3
|
+
* 环境类型枚举
|
|
4
|
+
*/
|
|
5
|
+
var EnvironmentType = /* @__PURE__ */ function(EnvironmentType) {
|
|
6
|
+
/** 开发环境 */
|
|
7
|
+
EnvironmentType["DEV"] = "dev";
|
|
8
|
+
/** 测试环境 */
|
|
9
|
+
EnvironmentType["TEST"] = "test";
|
|
10
|
+
/** 生产环境 */
|
|
11
|
+
EnvironmentType["PROD"] = "prod";
|
|
12
|
+
return EnvironmentType;
|
|
13
|
+
}({});
|
|
14
|
+
//#endregion
|
|
8
15
|
export { EnvironmentType };
|