@gct-paas/core 0.1.4-dev.11 → 0.1.4-dev.13
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 +4522 -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.d.ts +1 -0
- package/es/constants/index.mjs +31 -10
- package/es/constants/page-designer/model.mjs +15 -5
- package/es/constants/page-designer/regex.d.ts +2 -0
- package/es/constants/page-designer/regex.mjs +5 -0
- 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 +44 -14
- package/es/enums/menuEnum.mjs +42 -38
- package/es/enums/page-designer/designer.mjs +403 -407
- package/es/enums/page-designer/index.d.ts +1 -0
- package/es/enums/page-designer/index.mjs +5 -0
- package/es/enums/page-designer/layout.d.ts +12 -0
- package/es/enums/page-designer/layout.mjs +17 -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 +125 -114
- package/es/interface/i-pinia-state/i-global-state.d.ts +0 -11
- package/es/locale/index.mjs +50 -57
- package/es/modules/env-manager/env-manager.const.mjs +16 -8
- package/es/modules/env-manager/env-manager.d.ts +2 -0
- package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
- package/es/modules/env-manager/env-manager.interface.mjs +14 -7
- package/es/modules/env-manager/env-manager.mjs +108 -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.d.ts +0 -6
- package/es/state/global-pinia-state/global-pinia-state.mjs +43 -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/css-loader/css-loader.d.ts +36 -0
- package/es/utils/css-loader/css-loader.mjs +82 -0
- package/es/utils/design/design.mjs +18 -12
- package/es/utils/deviceFingerprint.mjs +77 -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 +3 -1
- package/es/utils/index.mjs +32 -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 +2 -0
- package/es/utils/uuid/uuid.mjs +33 -43
- package/es/utils/validate.mjs +15 -19
- package/es/utils/value-helper/value-helper.mjs +113 -98
- package/package.json +9 -18
- package/dist/index.esm.min.mjs +0 -18322
- package/dist/index.min.cjs +0 -393
- package/dist/index.system.min.js +0 -393
|
@@ -1,108 +1,122 @@
|
|
|
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
|
-
|
|
1
|
+
import { ErrorTypeEnum } from "../../enums/exceptionEnum.mjs";
|
|
2
|
+
import { ErrorStrategyFactory } from "./error-strategy.mjs";
|
|
3
|
+
//#region src/modules/error-handler/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* 全局异常处理器
|
|
6
|
+
* 负责捕获和处理各种类型的异常,包括 Vue 组件异常、JavaScript 异常、
|
|
7
|
+
* 资源加载异常、Ajax 请求异常、Promise 异常等
|
|
8
|
+
*
|
|
9
|
+
* 采用策略模式和单例模式设计,支持扩展和配置
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @class ErrorHandler
|
|
13
|
+
*/
|
|
14
|
+
var ErrorHandler = class ErrorHandler {
|
|
15
|
+
static _instance;
|
|
16
|
+
/**
|
|
17
|
+
* 私有构造函数,实现单例模式
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
constructor() {
|
|
22
|
+
this._initializeStrategies();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 获取单例实例
|
|
26
|
+
*
|
|
27
|
+
* @static
|
|
28
|
+
* @return {ErrorHandler} 错误处理器实例
|
|
29
|
+
*/
|
|
30
|
+
static getInstance() {
|
|
31
|
+
if (!ErrorHandler._instance) ErrorHandler._instance = new ErrorHandler();
|
|
32
|
+
return ErrorHandler._instance;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 初始化全局异常处理
|
|
36
|
+
* 设置全局异常监听器和处理策略
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
*/
|
|
40
|
+
static init() {
|
|
41
|
+
ErrorHandler.getInstance();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 处理 Vue 组件异常
|
|
45
|
+
*
|
|
46
|
+
* @static
|
|
47
|
+
* @param {Error} error 错误对象
|
|
48
|
+
* @param {unknown} _vm Vue 组件实例
|
|
49
|
+
* @param {string} info 错误信息
|
|
50
|
+
*/
|
|
51
|
+
static handleVueError(error, _vm, info) {
|
|
52
|
+
const errorInfo = {
|
|
53
|
+
type: ErrorTypeEnum.VUE,
|
|
54
|
+
message: `Vue Error: ${error.message} | Info: ${info}`,
|
|
55
|
+
stack: error.stack,
|
|
56
|
+
timestamp: Date.now(),
|
|
57
|
+
userAgent: navigator.userAgent
|
|
58
|
+
};
|
|
59
|
+
this._instance._processError(errorInfo);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 手动报告错误
|
|
63
|
+
*
|
|
64
|
+
* @static
|
|
65
|
+
* @param {Error} error 错误对象
|
|
66
|
+
* @param {ErrorTypeEnum} [type=ErrorTypeEnum.SCRIPT] 错误类型
|
|
67
|
+
*/
|
|
68
|
+
static reportError(error, type = ErrorTypeEnum.SCRIPT) {
|
|
69
|
+
const errorInfo = {
|
|
70
|
+
type,
|
|
71
|
+
message: error.message,
|
|
72
|
+
stack: error.stack,
|
|
73
|
+
timestamp: Date.now(),
|
|
74
|
+
userAgent: navigator.userAgent
|
|
75
|
+
};
|
|
76
|
+
this._instance._processError(errorInfo);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 初始化错误处理策略
|
|
80
|
+
*
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
_initializeStrategies() {
|
|
84
|
+
ErrorStrategyFactory.init();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 处理错误信息
|
|
88
|
+
*
|
|
89
|
+
* @private
|
|
90
|
+
* @param {IErrorInfo} errorInfo 错误信息
|
|
91
|
+
*/
|
|
92
|
+
_processError(errorInfo) {
|
|
93
|
+
ErrorStrategyFactory.getStrategy(errorInfo.type)?.handle(errorInfo);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 设置全局错误处理器
|
|
98
|
+
*
|
|
99
|
+
* @author chitanda
|
|
100
|
+
* @date 2025-08-20 13:08:23
|
|
101
|
+
* @export
|
|
102
|
+
* @param {App} app
|
|
103
|
+
* @returns {*} {Promise<void>}
|
|
104
|
+
*/
|
|
89
105
|
async function setupErrorHandler(app) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ErrorHandler.reportError(event.reason, ErrorTypeEnum.PROMISE);
|
|
105
|
-
});
|
|
106
|
+
ErrorHandler.init();
|
|
107
|
+
app.config.errorHandler = (error, vm, info) => {
|
|
108
|
+
ErrorHandler.handleVueError(error, vm, info);
|
|
109
|
+
};
|
|
110
|
+
app.config.warnHandler = (msg, _vm, trace) => {
|
|
111
|
+
console.warn(`Vue Warning: ${msg}`);
|
|
112
|
+
if (trace) console.warn("Trace:", trace);
|
|
113
|
+
};
|
|
114
|
+
window.addEventListener("error", (event) => {
|
|
115
|
+
ErrorHandler.reportError(new Error(event.message), ErrorTypeEnum.SCRIPT);
|
|
116
|
+
});
|
|
117
|
+
window.addEventListener("unhandledrejection", (event) => {
|
|
118
|
+
ErrorHandler.reportError(event.reason, ErrorTypeEnum.PROMISE);
|
|
119
|
+
});
|
|
106
120
|
}
|
|
107
|
-
|
|
108
|
-
export { ErrorHandler,
|
|
121
|
+
//#endregion
|
|
122
|
+
export { ErrorHandler, setupErrorHandler };
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
clean: false
|
|
1
|
+
//#region src/modules/mqtt/constants/mqtt.const.ts
|
|
2
|
+
/**
|
|
3
|
+
* MQTT 默认连接选项
|
|
4
|
+
*
|
|
5
|
+
* @description 连接时未显式指定的选项将使用以下默认值
|
|
6
|
+
*/
|
|
7
|
+
var MQTT_DEFAULT_CONNECT_OPTIONS = {
|
|
8
|
+
keepalive: 60,
|
|
9
|
+
connectTimeout: 3e4,
|
|
10
|
+
reconnectPeriod: 5e3,
|
|
11
|
+
clean: false
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** 收到消息 */
|
|
24
|
-
MESSAGE: "message"
|
|
13
|
+
/**
|
|
14
|
+
* MQTT 连接级事件名称常量
|
|
15
|
+
*/
|
|
16
|
+
var MQTT_CLIENT_EVENT = {
|
|
17
|
+
CONNECT: "connect",
|
|
18
|
+
RECONNECT: "reconnect",
|
|
19
|
+
DISCONNECT: "disconnect",
|
|
20
|
+
ERROR: "error",
|
|
21
|
+
MESSAGE: "message"
|
|
25
22
|
};
|
|
26
|
-
|
|
23
|
+
//#endregion
|
|
27
24
|
export { MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS };
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region src/modules/mqtt/enums/mqtt-status.enum.ts
|
|
2
|
+
/**
|
|
3
|
+
* MQTT 连接状态枚举
|
|
4
|
+
*
|
|
5
|
+
* @description 描述 MQTT 客户端当前的连接生命周期状态
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var MqttConnectionStatus = /* @__PURE__ */ function(MqttConnectionStatus) {
|
|
11
|
+
/** 正在连接中 */
|
|
12
|
+
MqttConnectionStatus["CONNECTING"] = "connecting";
|
|
13
|
+
/** 已成功连接 */
|
|
14
|
+
MqttConnectionStatus["CONNECTED"] = "connected";
|
|
15
|
+
/** 正在断开连接中 */
|
|
16
|
+
MqttConnectionStatus["DISCONNECTING"] = "disconnecting";
|
|
17
|
+
/** 已断开连接 */
|
|
18
|
+
MqttConnectionStatus["DISCONNECTED"] = "disconnected";
|
|
19
|
+
/** 正在重连中 */
|
|
20
|
+
MqttConnectionStatus["RECONNECTING"] = "reconnecting";
|
|
21
|
+
return MqttConnectionStatus;
|
|
22
|
+
}({});
|
|
23
|
+
//#endregion
|
|
10
24
|
export { MqttConnectionStatus };
|