@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,123 +1,100 @@
1
- import { defineStore } from 'pinia';
2
- import 'qs';
3
- import 'lodash-es';
4
- import '../../../utils/mitt/mitt.mjs';
5
- import '../../../enums/app-designer/index.mjs';
6
- import '../../../enums/page-designer/designer.mjs';
7
- import '../../../enums/breakpointEnum.mjs';
8
- import '../../../constants/expression-type/modeCfg.mjs';
9
- import '../../../constants/expression-type/BuiltOperators.mjs';
10
- import '../../../constants/expression-type/function.mjs';
11
- import '../../../constants/expression-type/variable.mjs';
12
- import 'vue';
13
- import 'qx-util';
14
- import 'path-browserify';
15
- import { getToken, setToken } from '../../../utils/tools/tools.mjs';
16
- import '../../../utils/uuid/uuid.mjs';
17
- import 'axios';
18
- import { getDeviceFingerprint, getPageIdentification } from '../../../utils/deviceFingerprint.mjs';
19
- import '../../../utils/useUUid.mjs';
20
- import 'dayjs';
21
- import '../../../utils/permission.mjs';
22
-
23
- const useUserStore = defineStore("user", {
24
- state: () => ({
25
- userInfo: {},
26
- // roleList
27
- roleList: [],
28
- // Whether the login expired
29
- sessionTimeout: false,
30
- // Last fetch time
31
- lastUpdateTime: 0,
32
- //平台后台权限 非前台运行时
33
- userPermissions: {}
34
- }),
35
- getters: {
36
- getUserInfo(state) {
37
- return state.userInfo;
38
- },
39
- getUserPermissions(state) {
40
- return state.userPermissions;
41
- }
42
- },
43
- actions: {
44
- async login(config, { hasError } = {}) {
45
- try {
46
- const data = await loginApi(config, hasError);
47
- const { token, signWay } = data;
48
- sessionStorage.setItem("signWay", signWay);
49
- setToken(token);
50
- return this.afterLoginAction();
51
- } catch (error) {
52
- return Promise.reject(error);
53
- }
54
- },
55
- async getUserInfoAction(Token) {
56
- if (!getToken && !Token) return null;
57
- const info = await _api.platform.user.getInfo({
58
- headers: { Token }
59
- });
60
- this.setUserInfo(info);
61
- this.userPermissions = (info?.platformManagerPermissions ?? []).reduce(
62
- (map, item) => {
63
- map[item] = true;
64
- return map;
65
- },
66
- {}
67
- );
68
- return info;
69
- },
70
- /**单应用登录 */
71
- async afterLoginSingleApp() {
72
- },
73
- /**登录后逻辑 */
74
- async afterLoginAction() {
75
- if (!getToken) return null;
76
- },
77
- async logout() {
78
- await doLogout();
79
- },
80
- async setUserInfo(info) {
81
- this.userInfo = {
82
- ...info,
83
- minioDomain: "/minio"
84
- };
85
- this.lastUpdateTime = (/* @__PURE__ */ new Date()).getTime();
86
- _gct.store.userInfo = this.userInfo;
87
- },
88
- async updateUserInfo(data) {
89
- const info = { ...this.userInfo, ...data };
90
- this.setUserInfo(info);
91
- }
92
- }
1
+ import { getToken, setToken } from "../../../utils/tools/tools.mjs";
2
+ import { getDeviceFingerprint, getPageIdentification } from "../../../utils/deviceFingerprint.mjs";
3
+ import "../../../utils/index.mjs";
4
+ import { defineStore } from "pinia";
5
+ //#region src/modules/user-stores/store/user.store.ts
6
+ var useUserStore = defineStore("user", {
7
+ state: () => ({
8
+ userInfo: {},
9
+ roleList: [],
10
+ sessionTimeout: false,
11
+ lastUpdateTime: 0,
12
+ userPermissions: {}
13
+ }),
14
+ getters: {
15
+ getUserInfo(state) {
16
+ return state.userInfo;
17
+ },
18
+ getUserPermissions(state) {
19
+ return state.userPermissions;
20
+ }
21
+ },
22
+ actions: {
23
+ async login(config, { hasError } = {}) {
24
+ try {
25
+ const { token, signWay } = await loginApi(config, hasError);
26
+ sessionStorage.setItem("signWay", signWay);
27
+ setToken(token);
28
+ return this.afterLoginAction();
29
+ } catch (error) {
30
+ return Promise.reject(error);
31
+ }
32
+ },
33
+ async getUserInfoAction(Token) {
34
+ if (!getToken && !Token) return null;
35
+ const info = await _api.platform.user.getInfo({ headers: { Token } });
36
+ this.setUserInfo(info);
37
+ this.userPermissions = (info?.platformManagerPermissions ?? []).reduce((map, item) => {
38
+ map[item] = true;
39
+ return map;
40
+ }, {});
41
+ return info;
42
+ },
43
+ async afterLoginSingleApp() {},
44
+ async afterLoginAction() {
45
+ if (!getToken) return null;
46
+ },
47
+ async logout() {
48
+ await doLogout();
49
+ },
50
+ async setUserInfo(info) {
51
+ this.userInfo = {
52
+ ...info,
53
+ minioDomain: "/minio"
54
+ };
55
+ this.lastUpdateTime = (/* @__PURE__ */ new Date()).getTime();
56
+ _gct.store.userInfo = this.userInfo;
57
+ },
58
+ async updateUserInfo(data) {
59
+ const info = {
60
+ ...this.userInfo,
61
+ ...data
62
+ };
63
+ this.setUserInfo(info);
64
+ }
65
+ }
93
66
  });
67
+ /**
68
+ * 登录
69
+ * @param params
70
+ * @param param1
71
+ * @returns
72
+ */
94
73
  async function loginApi(params, { hasError = true } = {}) {
95
- const fingerprint = await getDeviceFingerprint();
96
- const data = await _api.platform.login.postSign(params, {
97
- headers: {
98
- browser: fingerprint,
99
- "Auth-Code": params.authCode,
100
- hasError
101
- }
102
- });
103
- return data;
74
+ const fingerprint = await getDeviceFingerprint();
75
+ return await _api.platform.login.postSign(params, { headers: {
76
+ browser: fingerprint,
77
+ "Auth-Code": params.authCode,
78
+ hasError
79
+ } });
104
80
  }
81
+ /**
82
+ * 登出
83
+ */
105
84
  async function doLogout() {
106
- const session = sessionStorage.getItem("currentPlatOrAppId");
107
- const env = _gct.env.getEnv();
108
- const fingerprint = await getDeviceFingerprint();
109
- const params = {
110
- appId: session && JSON.parse(session).appId,
111
- platform: session && JSON.parse(session).type,
112
- env
113
- };
114
- const pageIdentification = getPageIdentification();
115
- await _api.platform.login.getSignOut(params, {
116
- headers: {
117
- browser: fingerprint,
118
- pagetag: pageIdentification
119
- }
120
- });
85
+ const session = sessionStorage.getItem("currentPlatOrAppId");
86
+ const env = _gct.env.getEnv();
87
+ const fingerprint = await getDeviceFingerprint();
88
+ const params = {
89
+ appId: session && JSON.parse(session).appId,
90
+ platform: session && JSON.parse(session).type,
91
+ env
92
+ };
93
+ const pageIdentification = getPageIdentification();
94
+ await _api.platform.login.getSignOut(params, { headers: {
95
+ browser: fingerprint,
96
+ pagetag: pageIdentification
97
+ } });
121
98
  }
122
-
99
+ //#endregion
123
100
  export { useUserStore };
@@ -1,31 +1,28 @@
1
- import { createRouter, createWebHashHistory } from 'vue-router';
2
- import 'vue';
3
-
4
- const routes = [];
5
- class RouterUtil {
6
- router;
7
- constructor() {
8
- this.router = createRouter({
9
- history: createWebHashHistory(),
10
- routes
11
- });
12
- }
13
- /**
14
- * 添加路由
15
- * @param route 添加路由记录
16
- * @description 将单个或多个路由记录添加到路由器中
17
- */
18
- async add(route) {
19
- if (Array.isArray(route)) {
20
- route.forEach((r) => this.add(r));
21
- } else {
22
- this.router.addRoute(route);
23
- }
24
- await this.router.replace(this.router.currentRoute.value.fullPath);
25
- }
26
- }
1
+ import "vue";
2
+ import { createRouter, createWebHashHistory } from "vue-router";
3
+ //#region src/router/index.ts
4
+ var routes = [];
5
+ var RouterUtil = class {
6
+ router;
7
+ constructor() {
8
+ this.router = createRouter({
9
+ history: createWebHashHistory(),
10
+ routes
11
+ });
12
+ }
13
+ /**
14
+ * 添加路由
15
+ * @param route 添加路由记录
16
+ * @description 将单个或多个路由记录添加到路由器中
17
+ */
18
+ async add(route) {
19
+ if (Array.isArray(route)) route.forEach((r) => this.add(r));
20
+ else this.router.addRoute(route);
21
+ await this.router.replace(this.router.currentRoute.value.fullPath);
22
+ }
23
+ };
27
24
  function setupRouter(app) {
28
- app.use(_gct.router);
25
+ app.use(_gct.router);
29
26
  }
30
-
27
+ //#endregion
31
28
  export { RouterUtil, setupRouter };
package/es/setup-app.mjs CHANGED
@@ -1,42 +1,26 @@
1
- import { setupErrorHandler } from './modules/error-handler/index.mjs';
2
- import { HttpUtil } from '@gct-paas/api';
3
- import 'qs';
4
- import 'lodash-es';
5
- import './utils/mitt/mitt.mjs';
6
- import './enums/app-designer/index.mjs';
7
- import './enums/page-designer/designer.mjs';
8
- import './enums/breakpointEnum.mjs';
9
- import './constants/expression-type/modeCfg.mjs';
10
- import './constants/expression-type/BuiltOperators.mjs';
11
- import './constants/expression-type/function.mjs';
12
- import './constants/expression-type/variable.mjs';
13
- import 'vue';
14
- import 'qx-util';
15
- import 'path-browserify';
16
- import { getToken } from './utils/tools/tools.mjs';
17
- import './utils/uuid/uuid.mjs';
18
- import { interceptors } from './utils/axios/interceptors.mjs';
19
- import '@fingerprintjs/fingerprintjs';
20
- import './utils/useUUid.mjs';
21
- import 'dayjs';
22
- import './utils/permission.mjs';
23
- import './modules/platform-config/constants/login.const.mjs';
24
- import { usePlatformConfigStore } from './modules/platform-config/store.mjs';
25
- import { useUserStore } from './modules/user-stores/store/user.store.mjs';
26
- import './modules/user-stores/store/tenant.store.mjs';
27
- import './modules/user-stores/store/permission.store.mjs';
28
-
1
+ import { getToken } from "./utils/tools/tools.mjs";
2
+ import { interceptors } from "./utils/axios/interceptors.mjs";
3
+ import "./utils/index.mjs";
4
+ import { setupErrorHandler } from "./modules/error-handler/index.mjs";
5
+ import { usePlatformConfigStore } from "./modules/platform-config/store.mjs";
6
+ import "./modules/platform-config/index.mjs";
7
+ import { useUserStore } from "./modules/user-stores/store/user.store.mjs";
8
+ import "./modules/user-stores/index.mjs";
9
+ import { HttpUtil } from "@gct-paas/api";
10
+ //#region src/setup-app.ts
11
+ /**
12
+ *
13
+ *
14
+ * @export
15
+ * @param {App} app
16
+ */
29
17
  async function setupApp(app) {
30
- await setupErrorHandler(app);
31
- HttpUtil.use(interceptors);
32
- await _gct.init();
33
- const token = getToken();
34
- if (token) {
35
- const userStore = useUserStore();
36
- await userStore.getUserInfoAction(token);
37
- }
38
- const platformStore = usePlatformConfigStore();
39
- await platformStore.init();
18
+ await setupErrorHandler(app);
19
+ HttpUtil.use(interceptors);
20
+ await _gct.init();
21
+ const token = getToken();
22
+ if (token) await useUserStore().getUserInfoAction(token);
23
+ await usePlatformConfigStore().init();
40
24
  }
41
-
25
+ //#endregion
42
26
  export { setupApp };
@@ -35,10 +35,4 @@ export declare class GlobalPiniaState implements IGlobalState {
35
35
  * @type {ProjectName}
36
36
  */
37
37
  projectName: ProjectName;
38
- /**
39
- * 多语言
40
- *
41
- * @type {string}
42
- */
43
- lang: string;
44
38
  }
@@ -1,72 +1,44 @@
1
- import '../../enums/app-designer/index.mjs';
2
- import { Platform } from '../../enums/page-designer/widget.mjs';
3
- import '../../enums/page-designer/designer.mjs';
4
- import { ProjectName } from '../../enums/appEnum.mjs';
5
- import '../../enums/breakpointEnum.mjs';
6
-
7
- class GlobalPiniaState {
8
- context = {
9
- aid: "",
10
- bid: "",
11
- pid: "",
12
- platform: Platform.WEB
13
- };
14
- /**
15
- *运行时全局函数
16
- * @type {'--'}
17
- */
18
- globalSetting = {
19
- /**运行时空值显示 */
20
- emptyDisplay: "--"
21
- };
22
- /**
23
- * 应用信息
24
- *
25
- * @type {IObject}
26
- */
27
- appInfo = {};
28
- /**
29
- * 用户信息
30
- *
31
- * @type {IObject}
32
- */
33
- userInfo = {};
34
- /**
35
- * 当前访问项目名称
36
- *
37
- * @type {ProjectName}
38
- */
39
- projectName = ProjectName.PORTAL;
40
- // /**
41
- // * 租户标识
42
- // *
43
- // * @type {string}
44
- // */
45
- // tenantId: string = '';
46
- /**
47
- * 多语言
48
- *
49
- * @type {string}
50
- */
51
- lang = "zh-CN";
52
- /**
53
- * 应用信息, todo: 等 api 包完成后,实际类型从 api 导入
54
- *
55
- * @type {IObject}
56
- */
57
- // appInfo: IObject = {};
58
- // /**
59
- // * 用户信息
60
- // *
61
- // * @type {IObject}
62
- // */
63
- // userInfo: IObject = {};
64
- /**
65
- * 用户信息
66
- *
67
- * @type {IObject}
68
- */
69
- // tenantUserInfo: IObject = {};
70
- }
71
-
1
+ import { ProjectName } from "../../enums/appEnum.mjs";
2
+ import { Platform } from "../../enums/page-designer/widget.mjs";
3
+ import "../../enums/index.mjs";
4
+ //#region src/state/global-pinia-state/global-pinia-state.ts
5
+ /**
6
+ * 全局pinia状态
7
+ *
8
+ * @export
9
+ * @class GlobalPiniaState
10
+ * @implements {IGlobalState}
11
+ */
12
+ var GlobalPiniaState = class {
13
+ context = {
14
+ aid: "",
15
+ bid: "",
16
+ pid: "",
17
+ platform: Platform.WEB
18
+ };
19
+ /**
20
+ *运行时全局函数
21
+ * @type {'--'}
22
+ */
23
+ globalSetting = { emptyDisplay: "--" };
24
+ /**
25
+ * 应用信息
26
+ *
27
+ * @type {IObject}
28
+ */
29
+ appInfo = {};
30
+ /**
31
+ * 用户信息
32
+ *
33
+ * @type {IObject}
34
+ */
35
+ userInfo = {};
36
+ /**
37
+ * 当前访问项目名称
38
+ *
39
+ * @type {ProjectName}
40
+ */
41
+ projectName = ProjectName.PORTAL;
42
+ };
43
+ //#endregion
72
44
  export { GlobalPiniaState };
@@ -0,0 +1 @@
1
+ import "./global-pinia-state/global-pinia-state.mjs";
@@ -1,74 +1,52 @@
1
- import { defineStore } from 'pinia';
2
- import { GlobalPiniaState } from '../state/global-pinia-state/global-pinia-state.mjs';
3
- import 'qs';
4
- import 'lodash-es';
5
- import '../utils/mitt/mitt.mjs';
6
- import '../enums/app-designer/index.mjs';
7
- import '../enums/page-designer/designer.mjs';
8
- import '../enums/breakpointEnum.mjs';
9
- import { PlatformSettingEnum, nullDisplayEnum } from '../enums/globalEnum.mjs';
10
- import '../constants/expression-type/modeCfg.mjs';
11
- import '../constants/expression-type/BuiltOperators.mjs';
12
- import '../constants/expression-type/function.mjs';
13
- import '../constants/expression-type/variable.mjs';
14
- import 'vue';
15
- import 'qx-util';
16
- import 'path-browserify';
17
- import { parseMatrixParams } from '../utils/tools/tools.mjs';
18
- import '../utils/uuid/uuid.mjs';
19
- import 'axios';
20
- import '@fingerprintjs/fingerprintjs';
21
- import '../utils/useUUid.mjs';
22
- import 'dayjs';
23
- import '../utils/permission.mjs';
24
-
25
- const useGlobalStore = defineStore("global-store", {
26
- state() {
27
- return new GlobalPiniaState();
28
- },
29
- getters: {
30
- getProjectName() {
31
- return this.projectName;
32
- },
33
- geLang() {
34
- return this.lang;
35
- },
36
- getAppInfo() {
37
- return this.appInfo;
38
- },
39
- getEmptyDisplay() {
40
- return nullDisplayEnum[this.globalSetting.emptyDisplay];
41
- }
42
- },
43
- actions: {
44
- async init() {
45
- const paramStr = location.pathname.split("/")[2];
46
- if (paramStr) {
47
- const params = parseMatrixParams(paramStr);
48
- if (params) {
49
- this.context = params;
50
- }
51
- }
52
- },
53
- async loadAppInfo() {
54
- const res = await _api.apaas.designerCommon.getGetApp();
55
- this.appInfo = res;
56
- },
57
- /**加載运行时全局常量显示 */
58
- async loadEmptySetting() {
59
- const { value } = await _gct.api.apaas.basicConfig.getDetail({
60
- configEnum: PlatformSettingEnum.GLOBAL
61
- });
62
- if (!value) return;
63
- Object.assign(this.globalSetting, JSON.parse(value));
64
- },
65
- setProjectName(name) {
66
- this.projectName = name;
67
- },
68
- setLang(lang) {
69
- this.lang = lang;
70
- }
71
- }
1
+ import { PlatformSettingEnum, nullDisplayEnum } from "../enums/globalEnum.mjs";
2
+ import "../enums/index.mjs";
3
+ import { GlobalPiniaState } from "../state/global-pinia-state/global-pinia-state.mjs";
4
+ import "../state/index.mjs";
5
+ import { parseMatrixParams } from "../utils/tools/tools.mjs";
6
+ import "../utils/index.mjs";
7
+ import { defineStore } from "pinia";
8
+ //#region src/store/global-store.ts
9
+ var useGlobalStore = defineStore("global-store", {
10
+ state() {
11
+ return new GlobalPiniaState();
12
+ },
13
+ getters: {
14
+ getProjectName() {
15
+ return this.projectName;
16
+ },
17
+ geLang() {
18
+ return this.lang;
19
+ },
20
+ getAppInfo() {
21
+ return this.appInfo;
22
+ },
23
+ getEmptyDisplay() {
24
+ return nullDisplayEnum[this.globalSetting.emptyDisplay];
25
+ }
26
+ },
27
+ actions: {
28
+ async init() {
29
+ const paramStr = location.pathname.split("/")[2];
30
+ if (paramStr) {
31
+ const params = parseMatrixParams(paramStr);
32
+ if (params) this.context = params;
33
+ }
34
+ },
35
+ async loadAppInfo() {
36
+ this.appInfo = await _api.apaas.designerCommon.getGetApp();
37
+ },
38
+ async loadEmptySetting() {
39
+ const { value } = await _gct.api.apaas.basicConfig.getDetail({ configEnum: PlatformSettingEnum.GLOBAL });
40
+ if (!value) return;
41
+ Object.assign(this.globalSetting, JSON.parse(value));
42
+ },
43
+ setProjectName(name) {
44
+ this.projectName = name;
45
+ },
46
+ setLang(lang) {
47
+ this.lang = lang;
48
+ }
49
+ }
72
50
  });
73
-
51
+ //#endregion
74
52
  export { useGlobalStore };
@@ -1,20 +1,26 @@
1
- import { createPinia, setActivePinia } from 'pinia';
2
- import { useGlobalStore } from './global-store.mjs';
3
-
4
- class GlobalStoreUtil {
5
- /**
6
- * 全局唯一实例
7
- */
8
- pinia = createPinia();
9
- /**
10
- * 全局状态管理实例
11
- *
12
- */
13
- store;
14
- constructor() {
15
- setActivePinia(this.pinia);
16
- this.store = useGlobalStore();
17
- }
18
- }
19
-
1
+ import { useGlobalStore } from "./global-store.mjs";
2
+ import { createPinia, setActivePinia } from "pinia";
3
+ //#region src/store/index.ts
4
+ /**
5
+ * 全局的状态管理工具类
6
+ *
7
+ * @export
8
+ * @class GlobalStore
9
+ */
10
+ var GlobalStoreUtil = class {
11
+ /**
12
+ * 全局唯一实例
13
+ */
14
+ pinia = createPinia();
15
+ /**
16
+ * 全局状态管理实例
17
+ *
18
+ */
19
+ store;
20
+ constructor() {
21
+ setActivePinia(this.pinia);
22
+ this.store = useGlobalStore();
23
+ }
24
+ };
25
+ //#endregion
20
26
  export { GlobalStoreUtil };
@@ -60,6 +60,13 @@ declare global {
60
60
  };
61
61
  }
62
62
 
63
+ type PartialByKeys<T, K extends keyof T> = {
64
+ [P in K]?: T[P];
65
+ } & Pick<T, Exclude<keyof T, K>>;
66
+ type RequiredByKeys<T, K extends keyof T> = {
67
+ [P in K]: T[P];
68
+ } & Pick<T, Exclude<keyof T, K>>;
69
+
63
70
  /**
64
71
  * 任意参数对象
65
72
  *