@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.
Files changed (142) hide show
  1. package/dist/index.esm.min.js +4522 -0
  2. package/es/constants/core.mjs +5 -4
  3. package/es/constants/default-date-type/default-date-type.mjs +73 -21
  4. package/es/constants/editor-register/editor-register.mjs +17 -5
  5. package/es/constants/expression-type/BuiltOperators.mjs +152 -147
  6. package/es/constants/expression-type/FunctionKeys.mjs +75 -79
  7. package/es/constants/expression-type/editor.mjs +10 -3
  8. package/es/constants/expression-type/function.mjs +602 -613
  9. package/es/constants/expression-type/index.mjs +111 -113
  10. package/es/constants/expression-type/modeCfg.mjs +256 -263
  11. package/es/constants/expression-type/variable.mjs +43 -39
  12. package/es/constants/form-container-type/form-container-type.mjs +17 -5
  13. package/es/constants/index.d.ts +1 -0
  14. package/es/constants/index.mjs +31 -10
  15. package/es/constants/page-designer/model.mjs +15 -5
  16. package/es/constants/page-designer/regex.d.ts +2 -0
  17. package/es/constants/page-designer/regex.mjs +5 -0
  18. package/es/create-app-vue.mjs +15 -9
  19. package/es/enums/app-designer/index.d.ts +19 -0
  20. package/es/enums/app-designer/index.mjs +131 -63
  21. package/es/enums/appEnum.mjs +681 -360
  22. package/es/enums/appStateEnum.mjs +17 -10
  23. package/es/enums/authActionEnum.mjs +63 -51
  24. package/es/enums/breakpointEnum.mjs +27 -26
  25. package/es/enums/cacheEnum.mjs +22 -21
  26. package/es/enums/designEnum.mjs +110 -71
  27. package/es/enums/developer-center/integration.mjs +7 -6
  28. package/es/enums/exceptionEnum.mjs +21 -17
  29. package/es/enums/expressionEnum.d.ts +1 -1
  30. package/es/enums/expressionEnum.mjs +81 -74
  31. package/es/enums/globalEnum.mjs +59 -36
  32. package/es/enums/httpEnum.mjs +71 -61
  33. package/es/enums/index.mjs +44 -14
  34. package/es/enums/menuEnum.mjs +42 -38
  35. package/es/enums/page-designer/designer.mjs +403 -407
  36. package/es/enums/page-designer/index.d.ts +1 -0
  37. package/es/enums/page-designer/index.mjs +5 -0
  38. package/es/enums/page-designer/layout.d.ts +12 -0
  39. package/es/enums/page-designer/layout.mjs +17 -0
  40. package/es/enums/page-designer/panel.mjs +341 -213
  41. package/es/enums/page-designer/toolkit.mjs +13 -12
  42. package/es/enums/page-designer/widget.mjs +425 -338
  43. package/es/enums/pageEnum.mjs +14 -13
  44. package/es/enums/plugin-enum.mjs +23 -7
  45. package/es/enums/processEnum.mjs +95 -60
  46. package/es/enums/roleEnum.mjs +7 -6
  47. package/es/enums/sizeEnum.d.ts +18 -0
  48. package/es/enums/sizeEnum.mjs +28 -8
  49. package/es/global/gct/gct.mjs +84 -96
  50. package/es/global/index.mjs +1 -0
  51. package/es/hooks/index.mjs +4 -0
  52. package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
  53. package/es/hooks/use-modal/use-modal.mjs +16 -10
  54. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
  55. package/es/hooks/useCopyToClipboard.mjs +50 -50
  56. package/es/index.mjs +125 -114
  57. package/es/interface/i-pinia-state/i-global-state.d.ts +0 -11
  58. package/es/locale/index.mjs +50 -57
  59. package/es/modules/env-manager/env-manager.const.mjs +16 -8
  60. package/es/modules/env-manager/env-manager.d.ts +2 -0
  61. package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
  62. package/es/modules/env-manager/env-manager.interface.mjs +14 -7
  63. package/es/modules/env-manager/env-manager.mjs +108 -107
  64. package/es/modules/error-handler/error-handler.const.mjs +11 -16
  65. package/es/modules/error-handler/error-strategy.mjs +199 -175
  66. package/es/modules/error-handler/index.mjs +120 -106
  67. package/es/modules/mqtt/constants/mqtt.const.mjs +21 -24
  68. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +23 -9
  69. package/es/modules/mqtt/index.mjs +4 -0
  70. package/es/modules/mqtt/mqtt-client.mjs +228 -261
  71. package/es/modules/mqtt/mqtt-manager.mjs +117 -77
  72. package/es/modules/platform-config/constants/index.mjs +4 -0
  73. package/es/modules/platform-config/constants/login.const.mjs +48 -45
  74. package/es/modules/platform-config/constants/org.const.mjs +57 -52
  75. package/es/modules/platform-config/constants/theme.const.mjs +11 -4
  76. package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
  77. package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
  78. package/es/modules/platform-config/enums/login.enum.mjs +29 -15
  79. package/es/modules/platform-config/enums/platform.enum.mjs +16 -13
  80. package/es/modules/platform-config/index.mjs +9 -0
  81. package/es/modules/platform-config/store.mjs +68 -79
  82. package/es/modules/platform-config/useBasicSetting.mjs +47 -35
  83. package/es/modules/platform-config/useDeploySetting.mjs +29 -21
  84. package/es/modules/platform-config/useLoginSetting.mjs +151 -173
  85. package/es/modules/platform-config/useOrgSetting.mjs +63 -62
  86. package/es/modules/platform-config/useProjectSetting.mjs +14 -6
  87. package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
  88. package/es/modules/platform-config/useThemeSetting.mjs +78 -59
  89. package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
  90. package/es/modules/user-stores/index.mjs +3 -0
  91. package/es/modules/user-stores/store/permission.store.mjs +27 -36
  92. package/es/modules/user-stores/store/tenant.store.mjs +20 -22
  93. package/es/modules/user-stores/store/user.store.mjs +94 -117
  94. package/es/router/index.mjs +25 -28
  95. package/es/setup-app.mjs +23 -39
  96. package/es/state/global-pinia-state/global-pinia-state.d.ts +0 -6
  97. package/es/state/global-pinia-state/global-pinia-state.mjs +43 -71
  98. package/es/state/index.mjs +1 -0
  99. package/es/store/global-store.mjs +50 -72
  100. package/es/store/index.mjs +25 -19
  101. package/es/types/index.d.ts +7 -0
  102. package/es/utils/axios/interceptors.mjs +21 -17
  103. package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
  104. package/es/utils/css-loader/css-loader.d.ts +36 -0
  105. package/es/utils/css-loader/css-loader.mjs +82 -0
  106. package/es/utils/design/design.mjs +18 -12
  107. package/es/utils/deviceFingerprint.mjs +77 -63
  108. package/es/utils/dictionary/dictionary.mjs +142 -145
  109. package/es/utils/file/base64Conver.mjs +35 -30
  110. package/es/utils/file/download.mjs +94 -98
  111. package/es/utils/file/parser.d.ts +3 -0
  112. package/es/utils/file/parser.mjs +29 -0
  113. package/es/utils/i18n/index.mjs +14 -3
  114. package/es/utils/index.d.ts +3 -1
  115. package/es/utils/index.mjs +32 -0
  116. package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
  117. package/es/utils/linked-list/linked-list.mjs +115 -118
  118. package/es/utils/linked-node/linked-node.mjs +41 -31
  119. package/es/utils/lowcode/utils.mjs +13 -18
  120. package/es/utils/lowcode/validate.mjs +20 -26
  121. package/es/utils/mitt/mitt.mjs +4 -4
  122. package/es/utils/model-loader/model-loader.mjs +280 -325
  123. package/es/utils/namespace/namespace.mjs +178 -164
  124. package/es/utils/openUtil/index.mjs +2 -0
  125. package/es/utils/openUtil/modal/modal.mjs +72 -79
  126. package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
  127. package/es/utils/permission.mjs +33 -37
  128. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
  129. package/es/utils/style/index.mjs +94 -138
  130. package/es/utils/tools/tools.mjs +86 -54
  131. package/es/utils/treeHelper/treeHelper.mjs +205 -233
  132. package/es/utils/uploader/uploader.mjs +81 -115
  133. package/es/utils/useUUid.mjs +79 -87
  134. package/es/utils/util.mjs +55 -35
  135. package/es/utils/uuid/uuid.d.ts +2 -0
  136. package/es/utils/uuid/uuid.mjs +33 -43
  137. package/es/utils/validate.mjs +15 -19
  138. package/es/utils/value-helper/value-helper.mjs +113 -98
  139. package/package.json +9 -18
  140. package/dist/index.esm.min.mjs +0 -18322
  141. package/dist/index.min.cjs +0 -393
  142. package/dist/index.system.min.js +0 -393
@@ -1,108 +1,122 @@
1
- import { ErrorStrategyFactory } from './error-strategy.mjs';
2
- import { ErrorTypeEnum } from '../../enums/exceptionEnum.mjs';
3
-
4
- class ErrorHandler {
5
- static _instance;
6
- /**
7
- * 私有构造函数,实现单例模式
8
- *
9
- * @private
10
- */
11
- constructor() {
12
- this._initializeStrategies();
13
- }
14
- /**
15
- * 获取单例实例
16
- *
17
- * @static
18
- * @return {ErrorHandler} 错误处理器实例
19
- */
20
- static getInstance() {
21
- if (!ErrorHandler._instance) {
22
- ErrorHandler._instance = new ErrorHandler();
23
- }
24
- return ErrorHandler._instance;
25
- }
26
- /**
27
- * 初始化全局异常处理
28
- * 设置全局异常监听器和处理策略
29
- *
30
- * @static
31
- */
32
- static init() {
33
- ErrorHandler.getInstance();
34
- }
35
- /**
36
- * 处理 Vue 组件异常
37
- *
38
- * @static
39
- * @param {Error} error 错误对象
40
- * @param {unknown} _vm Vue 组件实例
41
- * @param {string} info 错误信息
42
- */
43
- static handleVueError(error, _vm, info) {
44
- const errorInfo = {
45
- type: ErrorTypeEnum.VUE,
46
- message: `Vue Error: ${error.message} | Info: ${info}`,
47
- stack: error.stack,
48
- timestamp: Date.now(),
49
- userAgent: navigator.userAgent
50
- };
51
- this._instance._processError(errorInfo);
52
- }
53
- /**
54
- * 手动报告错误
55
- *
56
- * @static
57
- * @param {Error} error 错误对象
58
- * @param {ErrorTypeEnum} [type=ErrorTypeEnum.SCRIPT] 错误类型
59
- */
60
- static reportError(error, type = ErrorTypeEnum.SCRIPT) {
61
- const errorInfo = {
62
- type,
63
- message: error.message,
64
- stack: error.stack,
65
- timestamp: Date.now(),
66
- userAgent: navigator.userAgent
67
- };
68
- this._instance._processError(errorInfo);
69
- }
70
- /**
71
- * 初始化错误处理策略
72
- *
73
- * @private
74
- */
75
- _initializeStrategies() {
76
- ErrorStrategyFactory.init();
77
- }
78
- /**
79
- * 处理错误信息
80
- *
81
- * @private
82
- * @param {IErrorInfo} errorInfo 错误信息
83
- */
84
- _processError(errorInfo) {
85
- const strategy = ErrorStrategyFactory.getStrategy(errorInfo.type);
86
- strategy?.handle(errorInfo);
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
- ErrorHandler.init();
91
- app.config.errorHandler = (error, vm, info) => {
92
- ErrorHandler.handleVueError(error, vm, info);
93
- };
94
- app.config.warnHandler = (msg, _vm, trace) => {
95
- console.warn(`Vue Warning: ${msg}`);
96
- if (trace) {
97
- console.warn("Trace:", trace);
98
- }
99
- };
100
- window.addEventListener("error", (event) => {
101
- ErrorHandler.reportError(new Error(event.message), ErrorTypeEnum.SCRIPT);
102
- });
103
- window.addEventListener("unhandledrejection", (event) => {
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, ErrorStrategyFactory, setupErrorHandler };
121
+ //#endregion
122
+ export { ErrorHandler, setupErrorHandler };
@@ -1,27 +1,24 @@
1
- const MQTT_DEFAULT_CONNECT_OPTIONS = {
2
- /** 心跳保活间隔(秒),0 表示禁用 */
3
- keepalive: 60,
4
- /** 连接超时时间(毫秒) */
5
- connectTimeout: 3e4,
6
- /**
7
- * 重连间隔(毫秒),由 mqtt.js 内置重连机制使用
8
- * 设为 0 可禁用自动重连
9
- */
10
- reconnectPeriod: 5e3,
11
- /** 是否清除会话,true 表示每次重连后订阅信息不保留 */
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
- const MQTT_CLIENT_EVENT = {
15
- /** 成功建立连接 */
16
- CONNECT: "connect",
17
- /** 重连中 */
18
- RECONNECT: "reconnect",
19
- /** 连接已断开 */
20
- DISCONNECT: "disconnect",
21
- /** 发生错误 */
22
- ERROR: "error",
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
- var MqttConnectionStatus = /* @__PURE__ */ ((MqttConnectionStatus2) => {
2
- MqttConnectionStatus2["CONNECTING"] = "connecting";
3
- MqttConnectionStatus2["CONNECTED"] = "connected";
4
- MqttConnectionStatus2["DISCONNECTING"] = "disconnecting";
5
- MqttConnectionStatus2["DISCONNECTED"] = "disconnected";
6
- MqttConnectionStatus2["RECONNECTING"] = "reconnecting";
7
- return MqttConnectionStatus2;
8
- })(MqttConnectionStatus || {});
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 };
@@ -0,0 +1,4 @@
1
+ import "./constants/mqtt.const.mjs";
2
+ import "./enums/mqtt-status.enum.mjs";
3
+ import "./mqtt-client.mjs";
4
+ import "./mqtt-manager.mjs";