@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.
Files changed (130) hide show
  1. package/dist/index.esm.min.js +21679 -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.mjs +30 -10
  14. package/es/constants/page-designer/model.mjs +15 -5
  15. package/es/create-app-vue.mjs +15 -9
  16. package/es/enums/app-designer/index.d.ts +19 -0
  17. package/es/enums/app-designer/index.mjs +131 -63
  18. package/es/enums/appEnum.mjs +681 -360
  19. package/es/enums/appStateEnum.mjs +17 -10
  20. package/es/enums/authActionEnum.mjs +63 -51
  21. package/es/enums/breakpointEnum.mjs +27 -26
  22. package/es/enums/cacheEnum.mjs +22 -21
  23. package/es/enums/designEnum.mjs +110 -71
  24. package/es/enums/developer-center/integration.mjs +7 -6
  25. package/es/enums/exceptionEnum.mjs +21 -17
  26. package/es/enums/expressionEnum.d.ts +1 -1
  27. package/es/enums/expressionEnum.mjs +81 -74
  28. package/es/enums/globalEnum.mjs +59 -36
  29. package/es/enums/httpEnum.mjs +71 -61
  30. package/es/enums/index.mjs +43 -14
  31. package/es/enums/menuEnum.mjs +42 -38
  32. package/es/enums/page-designer/designer.mjs +403 -407
  33. package/es/enums/page-designer/index.mjs +4 -0
  34. package/es/enums/page-designer/panel.mjs +341 -213
  35. package/es/enums/page-designer/toolkit.mjs +13 -12
  36. package/es/enums/page-designer/widget.mjs +425 -338
  37. package/es/enums/pageEnum.mjs +14 -13
  38. package/es/enums/plugin-enum.mjs +23 -7
  39. package/es/enums/processEnum.mjs +95 -60
  40. package/es/enums/roleEnum.mjs +7 -6
  41. package/es/enums/sizeEnum.d.ts +18 -0
  42. package/es/enums/sizeEnum.mjs +28 -8
  43. package/es/global/gct/gct.mjs +84 -96
  44. package/es/global/index.mjs +1 -0
  45. package/es/hooks/index.mjs +4 -0
  46. package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
  47. package/es/hooks/use-modal/use-modal.mjs +16 -10
  48. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
  49. package/es/hooks/useCopyToClipboard.mjs +50 -50
  50. package/es/index.mjs +122 -114
  51. package/es/locale/index.mjs +43 -57
  52. package/es/modules/env-manager/env-manager.const.mjs +16 -8
  53. package/es/modules/env-manager/env-manager.interface.mjs +14 -7
  54. package/es/modules/env-manager/env-manager.mjs +104 -107
  55. package/es/modules/error-handler/error-handler.const.mjs +11 -16
  56. package/es/modules/error-handler/error-strategy.mjs +199 -175
  57. package/es/modules/error-handler/index.mjs +120 -106
  58. package/es/modules/mqtt/constants/mqtt.const.mjs +21 -24
  59. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +23 -9
  60. package/es/modules/mqtt/index.mjs +4 -0
  61. package/es/modules/mqtt/mqtt-client.mjs +228 -261
  62. package/es/modules/mqtt/mqtt-manager.mjs +117 -77
  63. package/es/modules/platform-config/constants/index.mjs +4 -0
  64. package/es/modules/platform-config/constants/login.const.mjs +48 -45
  65. package/es/modules/platform-config/constants/org.const.mjs +57 -52
  66. package/es/modules/platform-config/constants/theme.const.mjs +11 -4
  67. package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
  68. package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
  69. package/es/modules/platform-config/enums/login.enum.mjs +29 -15
  70. package/es/modules/platform-config/enums/platform.enum.mjs +16 -13
  71. package/es/modules/platform-config/index.mjs +9 -0
  72. package/es/modules/platform-config/store.mjs +68 -79
  73. package/es/modules/platform-config/useBasicSetting.mjs +47 -35
  74. package/es/modules/platform-config/useDeploySetting.mjs +29 -21
  75. package/es/modules/platform-config/useLoginSetting.mjs +151 -173
  76. package/es/modules/platform-config/useOrgSetting.mjs +63 -62
  77. package/es/modules/platform-config/useProjectSetting.mjs +14 -6
  78. package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
  79. package/es/modules/platform-config/useThemeSetting.mjs +78 -59
  80. package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
  81. package/es/modules/user-stores/index.mjs +3 -0
  82. package/es/modules/user-stores/store/permission.store.mjs +27 -36
  83. package/es/modules/user-stores/store/tenant.store.mjs +20 -22
  84. package/es/modules/user-stores/store/user.store.mjs +94 -117
  85. package/es/router/index.mjs +25 -28
  86. package/es/setup-app.mjs +23 -39
  87. package/es/state/global-pinia-state/global-pinia-state.mjs +49 -71
  88. package/es/state/index.mjs +1 -0
  89. package/es/store/global-store.mjs +50 -72
  90. package/es/store/index.mjs +25 -19
  91. package/es/types/index.d.ts +7 -0
  92. package/es/utils/axios/interceptors.mjs +21 -17
  93. package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
  94. package/es/utils/design/design.mjs +18 -12
  95. package/es/utils/deviceFingerprint.mjs +74 -63
  96. package/es/utils/dictionary/dictionary.mjs +142 -145
  97. package/es/utils/file/base64Conver.mjs +35 -30
  98. package/es/utils/file/download.mjs +94 -98
  99. package/es/utils/file/parser.d.ts +3 -0
  100. package/es/utils/file/parser.mjs +29 -0
  101. package/es/utils/i18n/index.mjs +14 -3
  102. package/es/utils/index.d.ts +1 -0
  103. package/es/utils/index.mjs +31 -0
  104. package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
  105. package/es/utils/linked-list/linked-list.mjs +115 -118
  106. package/es/utils/linked-node/linked-node.mjs +41 -31
  107. package/es/utils/lowcode/utils.mjs +13 -18
  108. package/es/utils/lowcode/validate.mjs +20 -26
  109. package/es/utils/mitt/mitt.mjs +4 -4
  110. package/es/utils/model-loader/model-loader.mjs +280 -325
  111. package/es/utils/namespace/namespace.mjs +178 -164
  112. package/es/utils/openUtil/index.mjs +2 -0
  113. package/es/utils/openUtil/modal/modal.mjs +72 -79
  114. package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
  115. package/es/utils/permission.mjs +33 -37
  116. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
  117. package/es/utils/style/index.mjs +94 -138
  118. package/es/utils/tools/tools.mjs +86 -54
  119. package/es/utils/treeHelper/treeHelper.mjs +205 -233
  120. package/es/utils/uploader/uploader.mjs +81 -115
  121. package/es/utils/useUUid.mjs +79 -87
  122. package/es/utils/util.mjs +55 -35
  123. package/es/utils/uuid/uuid.d.ts +1 -0
  124. package/es/utils/uuid/uuid.mjs +36 -43
  125. package/es/utils/validate.mjs +15 -19
  126. package/es/utils/value-helper/value-helper.mjs +113 -98
  127. package/package.json +12 -13
  128. package/dist/index.esm.min.mjs +0 -18322
  129. package/dist/index.min.cjs +0 -393
  130. package/dist/index.system.min.js +0 -393
@@ -1,139 +1,145 @@
1
- import { QXEvent } from 'qx-util';
2
- import { createApp, h, nextTick } from 'vue';
3
-
4
- class OverlayContainer {
5
- /**
6
- * 创建全局呈现
7
- *
8
- * @author zhanghanrui
9
- * @date 2024-03-19 19:03:51
10
- * @param {unknown} component
11
- * @param {(...args: any[]) => VNode} render
12
- * @param {O} [opts]
13
- */
14
- constructor(component, render, opts) {
15
- this.component = component;
16
- this.render = render;
17
- this.opts = opts;
18
- this._initPromise = this.init();
19
- }
20
- vm;
21
- /**
22
- * 具体模态组件对象
23
- *
24
- * @author zhanghanrui
25
- * @date 2024-03-19 19:03:45
26
- * @protected
27
- * @type {*}
28
- */
29
- modal;
30
- /**
31
- * 调用dismiss时传的result结果
32
- *
33
- * @author zhanghanrui
34
- * @date 2024-03-19 19:03:30
35
- * @protected
36
- * @type {unknown}
37
- */
38
- result;
39
- /**
40
- * 内部事件
41
- *
42
- * @author zhanghanrui
43
- * @date 2024-03-19 19:03:44
44
- * @protected
45
- */
46
- evt = new QXEvent();
47
- /**
48
- * init 执行完毕的 Promise,用于确保 present/dismiss 调用时 init 已完成
49
- *
50
- * @protected
51
- * @type {Promise<void>}
52
- */
53
- _initPromise;
54
- static async createVueApp(rootComponent, rootProps) {
55
- console.error("没有注入createVueApp方法");
56
- return createApp(rootComponent, rootProps);
57
- }
58
- /**
59
- * 初始化飘窗
60
- *
61
- * @author zhanghanrui
62
- * @date 2024-03-19 19:03:00
63
- * @protected
64
- * @return {*} {void}
65
- */
66
- async init() {
67
- const self = this;
68
- const { render, opts } = this;
69
- const container = document.createElement("div");
70
- document.body.appendChild(container);
71
- const vm = await OverlayContainer.createVueApp({
72
- mounted() {
73
- self.modal = this.$refs.root;
74
- },
75
- unmounted() {
76
- document.body.removeChild(container);
77
- self.evt.emit("dismiss", self.result);
78
- },
79
- render() {
80
- return h(
81
- self.component,
82
- {
83
- ref: "root",
84
- opts,
85
- onDismiss(data) {
86
- self.result = data;
87
- vm.unmount();
88
- }
89
- },
90
- { default: render }
91
- );
92
- }
93
- });
94
- vm.mount(container);
95
- this.vm = vm;
96
- }
97
- /**
98
- * 打开飘窗
99
- *
100
- * @author zhanghanrui
101
- * @date 2024-03-19 19:03:14
102
- * @return {*} {Promise<void>}
103
- */
104
- async present() {
105
- await this._initPromise;
106
- await nextTick();
107
- return this.modal.present();
108
- }
109
- /**
110
- * 手动调用关闭飘窗
111
- *
112
- * @author zhanghanrui
113
- * @date 2024-03-19 19:03:19
114
- * @param {unknown} [data]
115
- * @return {*} {Promise<void>}
116
- */
117
- async dismiss(data) {
118
- await this.modal.dismiss(data);
119
- }
120
- /**
121
- * 订阅窗口关闭
122
- *
123
- * @author zhanghanrui
124
- * @date 2024-03-19 19:03:26
125
- * @template T
126
- * @return {*} {Promise<T>}
127
- */
128
- async onWillDismiss() {
129
- return new Promise((resolve) => {
130
- const callback = (data) => {
131
- resolve(data);
132
- this.evt.off("dismiss", callback);
133
- };
134
- this.evt.on("dismiss", callback);
135
- });
136
- }
137
- }
138
-
1
+ import { createApp, h, nextTick } from "vue";
2
+ import { QXEvent } from "qx-util";
3
+ //#region src/utils/openUtil/overlay-container/overlay-container.ts
4
+ /**
5
+ * 全局弹出承载组件
6
+ *
7
+ * @author zhanghanrui
8
+ * @date 2024-03-19 19:03:22
9
+ * @export
10
+ * @class OverlayContainer
11
+ * @implements {IOverlayContainer}
12
+ * @template O
13
+ */
14
+ var OverlayContainer = class OverlayContainer {
15
+ vm;
16
+ /**
17
+ * 具体模态组件对象
18
+ *
19
+ * @author zhanghanrui
20
+ * @date 2024-03-19 19:03:45
21
+ * @protected
22
+ * @type {*}
23
+ */
24
+ modal;
25
+ /**
26
+ * 调用dismiss时传的result结果
27
+ *
28
+ * @author zhanghanrui
29
+ * @date 2024-03-19 19:03:30
30
+ * @protected
31
+ * @type {unknown}
32
+ */
33
+ result;
34
+ /**
35
+ * 内部事件
36
+ *
37
+ * @author zhanghanrui
38
+ * @date 2024-03-19 19:03:44
39
+ * @protected
40
+ */
41
+ evt = new QXEvent();
42
+ /**
43
+ * init 执行完毕的 Promise,用于确保 present/dismiss 调用时 init 已完成
44
+ *
45
+ * @protected
46
+ * @type {Promise<void>}
47
+ */
48
+ _initPromise;
49
+ /**
50
+ * 创建全局呈现
51
+ *
52
+ * @author zhanghanrui
53
+ * @date 2024-03-19 19:03:51
54
+ * @param {unknown} component
55
+ * @param {(...args: any[]) => VNode} render
56
+ * @param {O} [opts]
57
+ */
58
+ constructor(component, render, opts) {
59
+ this.component = component;
60
+ this.render = render;
61
+ this.opts = opts;
62
+ this._initPromise = this.init();
63
+ }
64
+ static async createVueApp(rootComponent, rootProps) {
65
+ console.error("没有注入createVueApp方法");
66
+ return createApp(rootComponent, rootProps);
67
+ }
68
+ /**
69
+ * 初始化飘窗
70
+ *
71
+ * @author zhanghanrui
72
+ * @date 2024-03-19 19:03:00
73
+ * @protected
74
+ * @return {*} {void}
75
+ */
76
+ async init() {
77
+ const self = this;
78
+ const { render, opts } = this;
79
+ const container = document.createElement("div");
80
+ document.body.appendChild(container);
81
+ const vm = await OverlayContainer.createVueApp({
82
+ mounted() {
83
+ self.modal = this.$refs.root;
84
+ },
85
+ unmounted() {
86
+ document.body.removeChild(container);
87
+ self.evt.emit("dismiss", self.result);
88
+ },
89
+ render() {
90
+ return h(self.component, {
91
+ ref: "root",
92
+ opts,
93
+ onDismiss(data) {
94
+ self.result = data;
95
+ vm.unmount();
96
+ }
97
+ }, { default: render });
98
+ }
99
+ });
100
+ vm.mount(container);
101
+ this.vm = vm;
102
+ }
103
+ /**
104
+ * 打开飘窗
105
+ *
106
+ * @author zhanghanrui
107
+ * @date 2024-03-19 19:03:14
108
+ * @return {*} {Promise<void>}
109
+ */
110
+ async present() {
111
+ await this._initPromise;
112
+ await nextTick();
113
+ return this.modal.present();
114
+ }
115
+ /**
116
+ * 手动调用关闭飘窗
117
+ *
118
+ * @author zhanghanrui
119
+ * @date 2024-03-19 19:03:19
120
+ * @param {unknown} [data]
121
+ * @return {*} {Promise<void>}
122
+ */
123
+ async dismiss(data) {
124
+ await this.modal.dismiss(data);
125
+ }
126
+ /**
127
+ * 订阅窗口关闭
128
+ *
129
+ * @author zhanghanrui
130
+ * @date 2024-03-19 19:03:26
131
+ * @template T
132
+ * @return {*} {Promise<T>}
133
+ */
134
+ async onWillDismiss() {
135
+ return new Promise((resolve) => {
136
+ const callback = (data) => {
137
+ resolve(data);
138
+ this.evt.off("dismiss", callback);
139
+ };
140
+ this.evt.on("dismiss", callback);
141
+ });
142
+ }
143
+ };
144
+ //#endregion
139
145
  export { OverlayContainer };
@@ -1,38 +1,34 @@
1
- class InterceptorManager {
2
- handlers = [];
3
- use(handler) {
4
- this.handlers.push(handler);
5
- }
6
- getHandlers() {
7
- return this.handlers;
8
- }
9
- }
10
- class PermissionCenter {
11
- interceptors = new InterceptorManager();
12
- constructor() {
13
- this.interceptors.use(this.checkRole);
14
- }
15
- /**兜底基础权限 */
16
- baseCheck(key) {
17
- console.log(key);
18
- return true;
19
- }
20
- /**角色权限控制 */
21
- checkRole() {
22
- return true;
23
- }
24
- has(key) {
25
- if (!key) return true;
26
- const handlers = this.interceptors.getHandlers();
27
- for (const handler of handlers) {
28
- const result = handler(key);
29
- if (result === false) {
30
- return false;
31
- }
32
- }
33
- return this.baseCheck(key);
34
- }
35
- }
36
- const permission = new PermissionCenter();
37
-
1
+ //#region src/utils/permission.ts
2
+ var InterceptorManager = class {
3
+ handlers = [];
4
+ use(handler) {
5
+ this.handlers.push(handler);
6
+ }
7
+ getHandlers() {
8
+ return this.handlers;
9
+ }
10
+ };
11
+ var PermissionCenter = class {
12
+ interceptors = new InterceptorManager();
13
+ constructor() {
14
+ this.interceptors.use(this.checkRole);
15
+ }
16
+ /**兜底基础权限 */
17
+ baseCheck(key) {
18
+ console.log(key);
19
+ return true;
20
+ }
21
+ /**角色权限控制 */
22
+ checkRole() {
23
+ return true;
24
+ }
25
+ has(key) {
26
+ if (!key) return true;
27
+ const handlers = this.interceptors.getHandlers();
28
+ for (const handler of handlers) if (handler(key) === false) return false;
29
+ return this.baseCheck(key);
30
+ }
31
+ };
32
+ var permission = new PermissionCenter();
33
+ //#endregion
38
34
  export { permission };
@@ -1,43 +1,47 @@
1
- import path from 'path-browserify';
2
-
3
- class PluginStaticResource {
4
- /**
5
- * 插件静态资源工具类.
6
- *
7
- * @param {string} mateUrl
8
- * @param {boolean} [isDev=false]
9
- */
10
- constructor(mateUrl, isDev = false) {
11
- this.isDev = isDev;
12
- this.url = new URL(mateUrl);
13
- this.baseDir = path.dirname(this.url.pathname);
14
- }
15
- /**
16
- * 计算出的静态资源跟路径
17
- *
18
- * @protected
19
- * @type {string}
20
- */
21
- baseDir;
22
- /**
23
- * mete 路径解析对象
24
- *
25
- * @protected
26
- * @type {URL}
27
- */
28
- url;
29
- /**
30
- * 合并输出静态资源目录
31
- *
32
- * @param {string} pathStr
33
- * @return {*} {string}
34
- */
35
- dir(pathStr) {
36
- if (this.isDev === true) {
37
- return pathStr;
38
- }
39
- return this.url.origin + path.resolve(this.baseDir, pathStr);
40
- }
41
- }
42
-
1
+ import path from "path-browserify";
2
+ //#region src/utils/plugin-static-resource/plugin-static-resource.ts
3
+ /**
4
+ * 插件静态资源工具类
5
+ *
6
+ * @export
7
+ * @class PluginStaticResource
8
+ */
9
+ var PluginStaticResource = class {
10
+ /**
11
+ * 计算出的静态资源跟路径
12
+ *
13
+ * @protected
14
+ * @type {string}
15
+ */
16
+ baseDir;
17
+ /**
18
+ * mete 路径解析对象
19
+ *
20
+ * @protected
21
+ * @type {URL}
22
+ */
23
+ url;
24
+ /**
25
+ * 插件静态资源工具类.
26
+ *
27
+ * @param {string} mateUrl
28
+ * @param {boolean} [isDev=false]
29
+ */
30
+ constructor(mateUrl, isDev = false) {
31
+ this.isDev = isDev;
32
+ this.url = new URL(mateUrl);
33
+ this.baseDir = path.dirname(this.url.pathname);
34
+ }
35
+ /**
36
+ * 合并输出静态资源目录
37
+ *
38
+ * @param {string} pathStr
39
+ * @return {*} {string}
40
+ */
41
+ dir(pathStr) {
42
+ if (this.isDev === true) return pathStr;
43
+ return this.url.origin + path.resolve(this.baseDir, pathStr);
44
+ }
45
+ };
46
+ //#endregion
43
47
  export { PluginStaticResource };