@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.8

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 (227) hide show
  1. package/dist/index.esm.min.mjs +4456 -18521
  2. package/dist/index.min.cjs +14 -2
  3. package/dist/index.system.min.js +14 -2
  4. package/es/constants/core.mjs +0 -1
  5. package/es/constants/editor-register/editor-register.mjs +0 -1
  6. package/es/constants/editor-type/editor-type.d.ts +65 -1
  7. package/es/constants/editor-type/editor-type.mjs +14 -1
  8. package/es/constants/form-container-type/form-container-type.mjs +0 -1
  9. package/es/constants/index.d.ts +4 -0
  10. package/es/constants/index.mjs +2 -7
  11. package/es/controller/edit-form/edit-form.controller.mjs +0 -1
  12. package/es/controller/editor/color-editor.controller.mjs +0 -1
  13. package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
  14. package/es/controller/editor-item/editor-item.controller.mjs +0 -1
  15. package/es/controller/form/form.controller.mjs +5 -4
  16. package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
  17. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
  18. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
  19. package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
  20. package/es/controller/form-group/form-group.controller.mjs +4 -3
  21. package/es/controller/form-item/form-item.controller.d.ts +1 -0
  22. package/es/controller/form-item/form-item.controller.mjs +7 -3
  23. package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
  24. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
  25. package/es/controller/form-tab/form-tab.controller.mjs +4 -3
  26. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
  27. package/es/controller/gct-form/gct-form.controller.mjs +5 -4
  28. package/es/create-app-vue.mjs +4 -3
  29. package/es/enums/app-designer/index.d.ts +13 -1
  30. package/es/enums/app-designer/index.mjs +8 -2
  31. package/es/enums/appEnum.d.ts +17 -66
  32. package/es/enums/appEnum.mjs +18 -14
  33. package/es/enums/appStateEnum.mjs +0 -1
  34. package/es/enums/authActionEnum.mjs +0 -1
  35. package/es/enums/breakpointEnum.mjs +0 -1
  36. package/es/enums/cacheEnum.mjs +0 -1
  37. package/es/enums/designEnum.mjs +0 -1
  38. package/es/enums/exceptionEnum.mjs +0 -1
  39. package/es/enums/globalEnum.d.ts +38 -0
  40. package/es/enums/globalEnum.mjs +25 -0
  41. package/es/enums/httpEnum.mjs +0 -1
  42. package/es/enums/index.d.ts +13 -0
  43. package/es/enums/index.mjs +15 -16
  44. package/es/enums/menuEnum.mjs +0 -1
  45. package/es/enums/page-designer/designer.d.ts +17 -3
  46. package/es/enums/page-designer/designer.mjs +85 -6
  47. package/es/enums/page-designer/panel.mjs +0 -1
  48. package/es/enums/page-designer/toolkit.mjs +0 -1
  49. package/es/enums/page-designer/widget.d.ts +2 -1
  50. package/es/enums/page-designer/widget.mjs +3 -3
  51. package/es/enums/pageEnum.mjs +0 -1
  52. package/es/enums/plugin-enum.mjs +0 -1
  53. package/es/enums/processEnum.mjs +0 -1
  54. package/es/enums/roleEnum.mjs +0 -1
  55. package/es/enums/sizeEnum.mjs +0 -1
  56. package/es/global/gct/gct.d.ts +2 -15
  57. package/es/global/gct/gct.mjs +19 -17
  58. package/es/hooks/index.d.ts +2 -0
  59. package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
  60. package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
  61. package/es/hooks/use-form/use-form.mjs +0 -1
  62. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
  63. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
  64. package/es/hooks/use-modal/use-modal.mjs +0 -1
  65. package/es/hooks/use-namespace/use-namespace.mjs +11 -2
  66. package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
  67. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
  68. package/es/hooks/useCopyToClipboard.mjs +0 -1
  69. package/es/index.d.ts +5 -1
  70. package/es/index.mjs +77 -58
  71. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
  72. package/es/interface/controller/index.d.ts +0 -1
  73. package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
  74. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
  75. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
  76. package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
  77. package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
  78. package/es/interface/form/index.d.ts +1 -0
  79. package/es/interface/i-app-context/i-app-context.d.ts +34 -0
  80. package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
  81. package/es/interface/i-global-var/i-global-var.d.ts +15 -0
  82. package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
  83. package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
  84. package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
  85. package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
  86. package/es/interface/index.d.ts +5 -2
  87. package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
  88. package/es/interface/state/index.d.ts +0 -1
  89. package/es/locale/index.mjs +1 -2
  90. package/es/modules/env-manager/env-manager.const.mjs +0 -1
  91. package/es/modules/env-manager/env-manager.interface.mjs +0 -1
  92. package/es/modules/env-manager/env-manager.mjs +7 -8
  93. package/es/modules/error-handler/error-handler.const.mjs +1 -30
  94. package/es/modules/error-handler/error-strategy.mjs +0 -1
  95. package/es/modules/error-handler/index.mjs +0 -1
  96. package/es/modules/platform-config/constants/index.d.ts +7 -0
  97. package/es/modules/platform-config/constants/login.const.d.ts +15 -0
  98. package/es/modules/platform-config/constants/login.const.mjs +50 -0
  99. package/es/modules/platform-config/constants/org.const.d.ts +9 -0
  100. package/es/modules/platform-config/constants/org.const.mjs +54 -0
  101. package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
  102. package/es/modules/platform-config/constants/theme.const.mjs +5 -0
  103. package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
  104. package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
  105. package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
  106. package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
  107. package/es/modules/platform-config/enums/index.d.ts +6 -0
  108. package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
  109. package/es/modules/platform-config/enums/login.enum.mjs +16 -0
  110. package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
  111. package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
  112. package/es/modules/platform-config/index.d.ts +6 -17
  113. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
  114. package/es/modules/platform-config/interfaces/index.d.ts +7 -0
  115. package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
  116. package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
  117. package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
  118. package/es/modules/platform-config/store.d.ts +221 -0
  119. package/es/modules/platform-config/store.mjs +78 -0
  120. package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
  121. package/es/modules/platform-config/useBasicSetting.mjs +39 -0
  122. package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
  123. package/es/modules/platform-config/useDeploySetting.mjs +27 -0
  124. package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
  125. package/es/modules/platform-config/useLoginSetting.mjs +177 -0
  126. package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
  127. package/es/modules/platform-config/useOrgSetting.mjs +66 -0
  128. package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
  129. package/es/modules/platform-config/useProjectSetting.mjs +11 -0
  130. package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
  131. package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
  132. package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
  133. package/es/modules/platform-config/useThemeSetting.mjs +64 -0
  134. package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
  135. package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
  136. package/es/modules/user-stores/index.d.ts +3 -0
  137. package/es/modules/user-stores/store/permission.store.d.ts +21 -0
  138. package/es/modules/user-stores/store/permission.store.mjs +38 -0
  139. package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
  140. package/es/modules/user-stores/store/tenant.store.mjs +24 -0
  141. package/es/modules/user-stores/store/user.store.d.ts +154 -0
  142. package/es/modules/user-stores/store/user.store.mjs +100 -0
  143. package/es/modules/user-stores/types/permission.d.ts +1 -0
  144. package/es/modules/user-stores/types/tenant.d.ts +1 -0
  145. package/es/modules/user-stores/types/user.d.ts +14 -0
  146. package/es/register/editor-register/editor-register.d.ts +5 -13
  147. package/es/register/editor-register/editor-register.mjs +8 -17
  148. package/es/register/form-item-register/form-item-register.d.ts +4 -15
  149. package/es/register/form-item-register/form-item-register.mjs +7 -17
  150. package/es/register/index.d.ts +18 -1
  151. package/es/register/render-register/render-register.mjs +0 -1
  152. package/es/router/index.mjs +0 -1
  153. package/es/state/form/form.state.mjs +0 -1
  154. package/es/state/form-collapse/form-collapse.state.mjs +0 -1
  155. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
  156. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
  157. package/es/state/form-group/form-group.state.mjs +0 -1
  158. package/es/state/form-item/form-item.state.mjs +0 -1
  159. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
  160. package/es/state/form-tab/form-tab.state.mjs +0 -1
  161. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
  162. package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
  163. package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
  164. package/es/store/global-store.d.ts +1 -0
  165. package/es/store/global-store.mjs +34 -37
  166. package/es/store/index.d.ts +2 -3
  167. package/es/store/index.mjs +0 -1
  168. package/es/types/index.d.ts +14 -1
  169. package/es/utils/axios/interceptors.mjs +3 -23
  170. package/es/utils/deviceFingerprint.d.ts +17 -0
  171. package/es/utils/deviceFingerprint.mjs +73 -0
  172. package/es/utils/dictionary/dictionary.mjs +0 -1
  173. package/es/utils/i18n/index.d.ts +2 -1
  174. package/es/utils/i18n/index.mjs +3 -4
  175. package/es/utils/index.d.ts +11 -2
  176. package/es/utils/linked-list/linked-list.d.ts +72 -0
  177. package/es/utils/linked-list/linked-list.mjs +119 -0
  178. package/es/utils/linked-node/linked-node.d.ts +31 -0
  179. package/es/utils/linked-node/linked-node.mjs +32 -0
  180. package/es/utils/mitt/mitt.d.ts +1 -0
  181. package/es/utils/mitt/mitt.mjs +5 -0
  182. package/es/utils/model-loader/model-loader.d.ts +118 -0
  183. package/es/utils/model-loader/model-loader.mjs +326 -0
  184. package/es/utils/namespace/namespace.mjs +0 -1
  185. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
  186. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
  187. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
  188. package/es/utils/props/index.d.ts +1 -0
  189. package/es/utils/style/index.d.ts +16 -0
  190. package/es/utils/style/index.mjs +141 -0
  191. package/es/utils/tools/tools.d.ts +13 -10
  192. package/es/utils/tools/tools.mjs +19 -11
  193. package/es/utils/treeHelper/treeHelper.d.ts +117 -0
  194. package/es/utils/treeHelper/treeHelper.mjs +220 -0
  195. package/es/utils/util.d.ts +39 -0
  196. package/es/utils/util.mjs +40 -0
  197. package/es/utils/value-helper/value-helper.d.ts +49 -0
  198. package/es/utils/value-helper/value-helper.mjs +109 -0
  199. package/es/utils/width-install/width-install.mjs +0 -2
  200. package/package.json +12 -16
  201. package/es/controller/index.mjs +0 -17
  202. package/es/enums/page-designer/index.mjs +0 -6
  203. package/es/global/index.mjs +0 -3
  204. package/es/hooks/index.mjs +0 -7
  205. package/es/interface/controller/i-designer-controller.d.ts +0 -116
  206. package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
  207. package/es/interface/hooks/index.d.ts +0 -1
  208. package/es/interface/index.mjs +0 -1
  209. package/es/interface/low-code-types/index.d.ts +0 -4
  210. package/es/interface/low-code-types/modal-types.d.ts +0 -67
  211. package/es/interface/low-code-types/model/index.d.ts +0 -5338
  212. package/es/interface/low-code-types/schema/index.d.ts +0 -12
  213. package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
  214. package/es/interface/state/i-designer-state.d.ts +0 -27
  215. package/es/modules/env-manager/index.mjs +0 -5
  216. package/es/modules/platform-config/index.mjs +0 -17
  217. package/es/modules/platform-config/types.d.ts +0 -67
  218. package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
  219. package/es/provider/index.d.ts +0 -1
  220. package/es/provider/index.mjs +0 -1
  221. package/es/register/designer-register/designer-register.d.ts +0 -53
  222. package/es/register/designer-register/designer-register.mjs +0 -68
  223. package/es/register/index.mjs +0 -6
  224. package/es/state/index.mjs +0 -12
  225. package/es/utils/index.mjs +0 -10
  226. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
  227. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
@@ -0,0 +1,17 @@
1
+ /** 客户端平台信息 */
2
+ export interface ClientPlatform {
3
+ type: 'web' | 'mobile' | 'unknown';
4
+ name: string;
5
+ }
6
+ /** 获取客户端平台(浏览器 / 移动系统) */
7
+ export declare function getClientPlatform(): ClientPlatform;
8
+ /** 获取浏览器指纹对象 */
9
+ export declare function getFingerprint(): Promise<import('@fingerprintjs/fingerprintjs').GetResult>;
10
+ /** 获取设备指纹标识(统一入口) */
11
+ export declare function getDeviceFingerprint(): Promise<string>;
12
+ /** web 端指纹(语义兼容) */
13
+ export declare function getBrowserFingerprint(): Promise<string>;
14
+ /** mobile 端指纹(语义兼容) */
15
+ export declare function getMobileBrowserFingerprint(): Promise<string>;
16
+ /** 页签唯一标识 */
17
+ export declare function getPageIdentification(): string;
@@ -0,0 +1,73 @@
1
+ import FingerprintJS from '@fingerprintjs/fingerprintjs';
2
+
3
+ const FINGERPRINT_KEY = "FINGERPRINT";
4
+ function isBrowserEnv() {
5
+ return typeof window !== "undefined" && typeof navigator !== "undefined";
6
+ }
7
+ function getClientPlatform() {
8
+ if (!isBrowserEnv()) {
9
+ return { type: "unknown", name: "unknown" };
10
+ }
11
+ const ua = navigator.userAgent;
12
+ if (/iPad|iPhone|iPod/i.test(ua)) {
13
+ return { type: "mobile", name: "iOS" };
14
+ }
15
+ if (/Android/i.test(ua)) {
16
+ return { type: "mobile", name: "Android" };
17
+ }
18
+ if (/Windows Phone/i.test(ua)) {
19
+ return { type: "mobile", name: "Windows Phone" };
20
+ }
21
+ if (/BlackBerry/i.test(ua)) {
22
+ return { type: "mobile", name: "BlackBerry" };
23
+ }
24
+ if (/Edg/i.test(ua)) {
25
+ return { type: "web", name: "Edge" };
26
+ }
27
+ if (/OPR|Opera/i.test(ua)) {
28
+ return { type: "web", name: "Opera" };
29
+ }
30
+ if (/Firefox/i.test(ua)) {
31
+ return { type: "web", name: "Firefox" };
32
+ }
33
+ if (/Chrome/i.test(ua)) {
34
+ return { type: "web", name: "Chrome" };
35
+ }
36
+ if (/Safari/i.test(ua)) {
37
+ return { type: "web", name: "Safari" };
38
+ }
39
+ return { type: "unknown", name: "unknown" };
40
+ }
41
+ async function getFingerprint() {
42
+ const agent = await FingerprintJS.load();
43
+ return agent.get();
44
+ }
45
+ async function getDeviceFingerprint() {
46
+ if (!isBrowserEnv()) {
47
+ return "unknown/unknown";
48
+ }
49
+ const { type, name } = getClientPlatform();
50
+ const isWeb = type === "web";
51
+ if (isWeb) {
52
+ const cached = localStorage.getItem(FINGERPRINT_KEY);
53
+ if (cached) {
54
+ return `${name}/${cached}`;
55
+ }
56
+ }
57
+ const fingerprint = await getFingerprint();
58
+ const visitorId = fingerprint.visitorId;
59
+ if (isWeb) {
60
+ localStorage.setItem(FINGERPRINT_KEY, visitorId);
61
+ }
62
+ return `${name}/${visitorId}`;
63
+ }
64
+ function getPageIdentification() {
65
+ let pageTag = sessionStorage.getItem("currentPageTag");
66
+ if (!pageTag) {
67
+ pageTag = Date.now().toString();
68
+ sessionStorage.setItem("currentPageTag", pageTag);
69
+ }
70
+ return pageTag;
71
+ }
72
+
73
+ export { getClientPlatform, getDeviceFingerprint, getFingerprint, getPageIdentification };
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  class DictionaryUtil {
3
2
  /**
4
3
  * 代码表配置
@@ -1,3 +1,4 @@
1
+ import { Composer } from 'vue-i18n';
1
2
  /**
2
3
  * 多语言转换
3
4
  *
@@ -8,4 +9,4 @@
8
9
  * @param {string} [def]
9
10
  * @returns {*} {string}
10
11
  */
11
- export declare function t(key: string, def?: string): string;
12
+ export declare const t: Composer['t'];
@@ -1,6 +1,5 @@
1
- "use strict";
2
- function t(key, def) {
3
- return _gct.i18n.global.t(key, def);
4
- }
1
+ const t = (...args) => {
2
+ return _gct.i18n.global.t(...args);
3
+ };
5
4
 
6
5
  export { t };
@@ -1,8 +1,17 @@
1
1
  export { DictionaryUtil } from './dictionary/dictionary';
2
2
  export { t } from './i18n';
3
+ export { LinkedList } from './linked-list/linked-list';
4
+ export { LinkedNode } from './linked-node/linked-node';
5
+ export { mitt } from './mitt/mitt';
6
+ export { modelLoader } from './model-loader/model-loader';
3
7
  export { Namespace } from './namespace/namespace';
4
- export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
5
8
  export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
6
- export { getToken, setToken, getPathQuery, getTenant, getTimezone, isMobile, setTenant, deepMerge, } from './tools/tools';
9
+ export { gctFormItemEditorProps } from './props';
10
+ export { getToken, setToken, getTenant, getTimezone, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, } from './tools/tools';
11
+ export * from './value-helper/value-helper';
7
12
  export { widthEditorInstall } from './width-install/width-install';
8
13
  export { interceptors } from './axios/interceptors';
14
+ export { getDeviceFingerprint, getPageIdentification, } from './deviceFingerprint';
15
+ export { TreeHelper } from './treeHelper/treeHelper';
16
+ export * from './style';
17
+ export * from './util';
@@ -0,0 +1,72 @@
1
+ import { LinkedNode } from '../linked-node/linked-node';
2
+ /**
3
+ * 链表列表
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-07-31 15:07:37
7
+ * @export
8
+ * @class LinkedList
9
+ */
10
+ export declare class LinkedList<T = any> {
11
+ /**
12
+ * 当前激活节点
13
+ *
14
+ * @author zhanghanrui
15
+ * @date 2024-07-31 15:07:02
16
+ * @type {(LinkedNode<T> | null)}
17
+ */
18
+ active: LinkedNode<T> | null;
19
+ /**
20
+ * 新增节点
21
+ *
22
+ * @author zhanghanrui
23
+ * @date 2024-07-31 15:07:45
24
+ * @param {T} data
25
+ */
26
+ add(data: T): void;
27
+ /**
28
+ * 删除节点
29
+ *
30
+ * @author zhanghanrui
31
+ * @date 2024-07-31 15:07:11
32
+ * @param {LinkedNode<T>} node
33
+ */
34
+ delete(node: LinkedNode<T>): void;
35
+ /**
36
+ * 上一个节点
37
+ *
38
+ * @author zhanghanrui
39
+ * @date 2024-07-31 16:07:41
40
+ */
41
+ prev(): void;
42
+ /**
43
+ * 下一个节点
44
+ *
45
+ * @author zhanghanrui
46
+ * @date 2024-07-31 16:07:57
47
+ */
48
+ next(): void;
49
+ /**
50
+ * 清理所有缓存
51
+ *
52
+ * @author zhanghanrui
53
+ * @date 2024-07-31 16:07:43
54
+ */
55
+ clearAll(): void;
56
+ /**
57
+ * 是否可以撤销
58
+ *
59
+ * @author zhanghanrui
60
+ * @date 2024-08-21 15:08:57
61
+ * @return {*} {boolean}
62
+ */
63
+ canUndo(): boolean;
64
+ /**
65
+ * 是否可以重做
66
+ *
67
+ * @author zhanghanrui
68
+ * @date 2024-08-21 15:08:33
69
+ * @return {*} {boolean}
70
+ */
71
+ canRedo(): boolean;
72
+ }
@@ -0,0 +1,119 @@
1
+ import { LinkedNode } from '../linked-node/linked-node.mjs';
2
+
3
+ class LinkedList {
4
+ /**
5
+ * 当前激活节点
6
+ *
7
+ * @author zhanghanrui
8
+ * @date 2024-07-31 15:07:02
9
+ * @type {(LinkedNode<T> | null)}
10
+ */
11
+ active = null;
12
+ /**
13
+ * 新增节点
14
+ *
15
+ * @author zhanghanrui
16
+ * @date 2024-07-31 15:07:45
17
+ * @param {T} data
18
+ */
19
+ add(data) {
20
+ if (!this.active) {
21
+ this.active = new LinkedNode(data);
22
+ } else {
23
+ if (this.active.next) {
24
+ let next = this.active.next;
25
+ while (next) {
26
+ next = next.next;
27
+ if (next) {
28
+ next.clear();
29
+ }
30
+ }
31
+ }
32
+ const node = new LinkedNode(data, null, this.active);
33
+ this.active.next = node;
34
+ this.active = node;
35
+ }
36
+ }
37
+ /**
38
+ * 删除节点
39
+ *
40
+ * @author zhanghanrui
41
+ * @date 2024-07-31 15:07:11
42
+ * @param {LinkedNode<T>} node
43
+ */
44
+ delete(node) {
45
+ const { prev, next } = node;
46
+ if (prev) {
47
+ prev.next = next;
48
+ }
49
+ if (next) {
50
+ next.prev = prev;
51
+ }
52
+ node.clear();
53
+ }
54
+ /**
55
+ * 上一个节点
56
+ *
57
+ * @author zhanghanrui
58
+ * @date 2024-07-31 16:07:41
59
+ */
60
+ prev() {
61
+ if (this.active && this.active.prev) {
62
+ this.active = this.active.prev;
63
+ }
64
+ }
65
+ /**
66
+ * 下一个节点
67
+ *
68
+ * @author zhanghanrui
69
+ * @date 2024-07-31 16:07:57
70
+ */
71
+ next() {
72
+ if (this.active && this.active.next) {
73
+ this.active = this.active.next;
74
+ }
75
+ }
76
+ /**
77
+ * 清理所有缓存
78
+ *
79
+ * @author zhanghanrui
80
+ * @date 2024-07-31 16:07:43
81
+ */
82
+ clearAll() {
83
+ if (this.active) {
84
+ let prev = this.active.prev;
85
+ let next = this.active.next;
86
+ while (prev) {
87
+ prev.clear();
88
+ prev = prev.prev;
89
+ }
90
+ while (next) {
91
+ next.clear();
92
+ next = next.next;
93
+ }
94
+ this.active.clear();
95
+ }
96
+ }
97
+ /**
98
+ * 是否可以撤销
99
+ *
100
+ * @author zhanghanrui
101
+ * @date 2024-08-21 15:08:57
102
+ * @return {*} {boolean}
103
+ */
104
+ canUndo() {
105
+ return !!this.active && !!this.active.prev;
106
+ }
107
+ /**
108
+ * 是否可以重做
109
+ *
110
+ * @author zhanghanrui
111
+ * @date 2024-08-21 15:08:33
112
+ * @return {*} {boolean}
113
+ */
114
+ canRedo() {
115
+ return !!this.active && !!this.active.next;
116
+ }
117
+ }
118
+
119
+ export { LinkedList };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 链表节点
3
+ *
4
+ * @author zhanghanrui
5
+ * @date 2024-07-31 15:07:21
6
+ * @export
7
+ * @class LinkedNode
8
+ * @template T
9
+ */
10
+ export declare class LinkedNode<T = any> {
11
+ data: T;
12
+ next: LinkedNode | null;
13
+ prev: LinkedNode | null;
14
+ /**
15
+ * Creates an instance of LinkedNode.
16
+ *
17
+ * @author zhanghanrui
18
+ * @date 2024-07-31 15:07:43
19
+ * @param {T} data 当前节点数据
20
+ * @param {(LinkedNode | null)} [next=null] 下一个节点
21
+ * @param {(LinkedNode | null)} [prev=null] 上一个节点
22
+ */
23
+ constructor(data: T, next?: LinkedNode | null, prev?: LinkedNode | null);
24
+ /**
25
+ * 清理链表,避免内存泄漏
26
+ *
27
+ * @author zhanghanrui
28
+ * @date 2024-07-31 15:07:34
29
+ */
30
+ clear(): void;
31
+ }
@@ -0,0 +1,32 @@
1
+ class LinkedNode {
2
+ data;
3
+ next;
4
+ prev;
5
+ /**
6
+ * Creates an instance of LinkedNode.
7
+ *
8
+ * @author zhanghanrui
9
+ * @date 2024-07-31 15:07:43
10
+ * @param {T} data 当前节点数据
11
+ * @param {(LinkedNode | null)} [next=null] 下一个节点
12
+ * @param {(LinkedNode | null)} [prev=null] 上一个节点
13
+ */
14
+ constructor(data, next = null, prev = null) {
15
+ this.data = data;
16
+ this.next = next;
17
+ this.prev = prev;
18
+ }
19
+ /**
20
+ * 清理链表,避免内存泄漏
21
+ *
22
+ * @author zhanghanrui
23
+ * @date 2024-07-31 15:07:34
24
+ */
25
+ clear() {
26
+ this.data = null;
27
+ this.next = null;
28
+ this.prev = null;
29
+ }
30
+ }
31
+
32
+ export { LinkedNode };
@@ -0,0 +1 @@
1
+ export declare const mitt: import('mitt').Emitter<Record<import('mitt').EventType, unknown>>;
@@ -0,0 +1,5 @@
1
+ import Mitt from 'mitt';
2
+
3
+ const mitt = Mitt();
4
+
5
+ export { mitt };
@@ -0,0 +1,118 @@
1
+ import { IFieldCodeChain } from '../../interface';
2
+ import { FieldMetaDTO, ModelMetaDTO, ModelPageableRow, QueryRefDataRequest } from '@gct-paas/api/apaas';
3
+ /**
4
+ * 模型加载器,提供模型缓存和请求去重功能
5
+ *
6
+ * @author chitanda
7
+ * @date 2025-06-20 16:06:12
8
+ * @class ModelLoader
9
+ */
10
+ declare class ModelLoader {
11
+ private readonly CACHE_EXPIRATION_TIME;
12
+ private modelCache;
13
+ private modelLoadingCache;
14
+ private modelsLoadingCache;
15
+ private enumCache;
16
+ private enumLoadingCache;
17
+ private queryRefDataCache;
18
+ private queryRefDataLoadingCache;
19
+ /**
20
+ * 检查缓存条目是否过期
21
+ *
22
+ * @param {CacheEntry<any>} entry
23
+ * @returns {*} {boolean}
24
+ */
25
+ private isExpired;
26
+ /**
27
+ * 创建缓存条目
28
+ *
29
+ * @param {T} data
30
+ * @returns {*} {CacheEntry<T>}
31
+ */
32
+ private createCacheEntry;
33
+ /**
34
+ * 加载模型信息,具有缓存和请求去重功能
35
+ *
36
+ * @author chitanda
37
+ * @date 2025-06-20 16:06:05
38
+ * @param {string} modelKey
39
+ * @returns {*} {Promise<ModelMetaDTO>}
40
+ */
41
+ loadModel(modelKey: string): Promise<ModelMetaDTO>;
42
+ /**
43
+ * 加载多个模型信息
44
+ *
45
+ * @author chitanda
46
+ * @date 2025-06-22 15:06:54
47
+ * @param {string[]} modelKeys
48
+ * @returns {*} {Promise<ModelMetaDTO[]>}
49
+ */
50
+ loadModels(modelKeys: string[]): Promise<ModelMetaDTO[]>;
51
+ /**
52
+ * 加载指定模型的字段信息
53
+ *
54
+ * @author chitanda
55
+ * @date 2025-06-22 14:06:37
56
+ * @param {string} modelKey
57
+ * @param {string} fieldKey
58
+ * @returns {*} {(Promise<FieldMetaDTO | undefined>)}
59
+ */
60
+ loadField(modelKey: string, fieldKey: string): Promise<FieldMetaDTO | undefined>;
61
+ /**
62
+ * 加载指定模型的字段路径信息
63
+ *
64
+ * @author chitanda
65
+ * @date 2025-06-22 14:06:11
66
+ * @param {string} modelKey
67
+ * @param {string} fieldKey
68
+ * @returns {*} {Promise<string[]>}
69
+ */
70
+ loadFieldPaths(modelKey: string, fieldKey: string, fieldCodeChain: IFieldCodeChain): Promise<string[]>;
71
+ /**
72
+ * 加载指定模型的枚举列表
73
+ *
74
+ * @param {string} modelKey
75
+ * @param {string} fieldKey
76
+ * @param {string} [modelCategory=EntityModelCategoryEnum.ENTITY]
77
+ * @returns {*} {Promise<IObject[]>}
78
+ */
79
+ loadEnumList(modelKey: string, fieldKey: string, modelCategory?: string): Promise<IObject[]>;
80
+ /**
81
+ * 加载关联数据查询(QueryRef)
82
+ *
83
+ * @param {QueryRefDataRequest} request
84
+ * @returns {*} {Promise<ModelPageableRow>}
85
+ */
86
+ loadQueryRefData(request: QueryRefDataRequest): Promise<ModelPageableRow>;
87
+ /**
88
+ * 获取已缓存的模型
89
+ * @param modelKey 模型键
90
+ * @returns ModelMetaDTO | undefined
91
+ */
92
+ getCachedModel(modelKey: string): ModelMetaDTO | undefined;
93
+ /**
94
+ * 清除指定模型的缓存
95
+ *
96
+ * @author chitanda
97
+ * @date 2025-06-20 16:06:41
98
+ * @param {string} modelKey
99
+ */
100
+ clear(modelKey: string): void;
101
+ /**
102
+ * 清除所有模型缓存
103
+ *
104
+ * @author chitanda
105
+ * @date 2025-06-20 16:06:35
106
+ */
107
+ clearAll(): void;
108
+ /**
109
+ * 获取所有已缓存的模型键
110
+ *
111
+ * @author chitanda
112
+ * @date 2025-06-20 16:06:55
113
+ * @returns {*} {string[]}
114
+ */
115
+ keys(): string[];
116
+ }
117
+ export declare const modelLoader: ModelLoader;
118
+ export {};