@gct-paas/core 0.1.5-dev.1 → 0.1.5-dev.11

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 (81) hide show
  1. package/dist/index.esm.min.js +1 -1
  2. package/es/enums/app-designer/index.d.ts +11 -0
  3. package/es/enums/app-designer/index.mjs +14 -1
  4. package/es/enums/appEnum.d.ts +8 -0
  5. package/es/enums/appEnum.mjs +10 -1
  6. package/es/enums/page-designer/designer.d.ts +13 -13
  7. package/es/enums/page-designer/widget.d.ts +2 -2
  8. package/es/global/gct/gct.d.ts +108 -107
  9. package/es/hooks/index.d.ts +1 -0
  10. package/es/hooks/index.mjs +1 -0
  11. package/es/hooks/useFile.d.ts +4 -0
  12. package/es/hooks/useFile.mjs +22 -0
  13. package/es/index.mjs +15 -6
  14. package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +23 -0
  15. package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
  16. package/es/interface/i-popover-options/i-popover-options.d.ts +98 -0
  17. package/es/interface/index.d.ts +3 -2
  18. package/es/interface/index.mjs +1 -0
  19. package/es/interface/model-designer/entity.d.ts +87 -79
  20. package/es/interface/model-designer/serial.d.ts +22 -0
  21. package/es/interface/model-designer/serial.mjs +49 -0
  22. package/es/interface/open-util/i-app-full-screen-container-options/i-app-full-screen-container-options.d.ts +26 -0
  23. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +52 -0
  24. package/es/interface/open-util/i-overlay-popover-container/i-overlay-popover-container.d.ts +21 -0
  25. package/es/interface/open-util/index.d.ts +3 -1
  26. package/es/locale/index.d.ts +26 -1
  27. package/es/locale/index.mjs +51 -3
  28. package/es/locale/sys/model.d.ts +5 -0
  29. package/es/locale/sys.d.ts +5 -0
  30. package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +1 -0
  31. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +2 -1
  32. package/es/modules/mqtt/mqtt-manager.d.ts +1 -1
  33. package/es/modules/mqtt/mqtt-manager.mjs +2 -1
  34. package/es/modules/platform-config/store.d.ts +106 -106
  35. package/es/modules/platform-config/store.mjs +0 -1
  36. package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
  37. package/es/modules/user-stores/store/tenant.store.d.ts +6 -8
  38. package/es/modules/user-stores/store/tenant.store.mjs +12 -14
  39. package/es/modules/user-stores/store/user.store.d.ts +11 -2
  40. package/es/modules/user-stores/store/user.store.mjs +15 -4
  41. package/es/modules/user-stores/types/tenant.d.ts +7 -1
  42. package/es/router/index.mjs +2 -2
  43. package/es/setup-app.mjs +6 -2
  44. package/es/store/global-store.mjs +3 -0
  45. package/es/store/index.d.ts +1 -0
  46. package/es/store/index.mjs +1 -0
  47. package/es/store/session-store.d.ts +7 -0
  48. package/es/store/session-store.mjs +7 -0
  49. package/es/store/storage-store.d.ts +2 -0
  50. package/es/store/storage-store.mjs +3 -2
  51. package/es/types/index.d.ts +0 -1
  52. package/es/utils/data-prems/const.d.ts +26 -0
  53. package/es/utils/data-prems/const.mjs +79 -0
  54. package/es/utils/file/download.d.ts +1 -1
  55. package/es/utils/file/parser.d.ts +1 -1
  56. package/es/utils/i18n/index.mjs +3 -0
  57. package/es/utils/index.d.ts +4 -0
  58. package/es/utils/index.mjs +5 -0
  59. package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +34 -13
  60. package/es/utils/kit-pkg-util/kit-pkg-util.mjs +55 -40
  61. package/es/utils/openUtil/index.d.ts +1 -0
  62. package/es/utils/openUtil/index.mjs +1 -0
  63. package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.d.ts +15 -0
  64. package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +19 -0
  65. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +3 -3
  66. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +1 -1
  67. package/es/utils/script-loader/script-loader.d.ts +62 -0
  68. package/es/utils/script-loader/script-loader.mjs +92 -0
  69. package/es/utils/style/index.d.ts +8 -0
  70. package/es/utils/style/index.mjs +67 -1
  71. package/es/utils/text-measure/text-measure.d.ts +141 -0
  72. package/es/utils/text-measure/text-measure.mjs +191 -0
  73. package/es/utils/tools/tools.d.ts +1 -1
  74. package/es/utils/uploader/uploader.mjs +3 -5
  75. package/es/utils/util.d.ts +1 -0
  76. package/es/utils/util.mjs +9 -1
  77. package/es/utils/vue-component-code.d.ts +8 -0
  78. package/es/utils/vue-component-code.mjs +37 -0
  79. package/package.json +20 -20
  80. package/es/interface/i-import-style-map/i-import-style-map.d.ts +0 -15
  81. package/es/interface/i-kit-info/i-kit-info.d.ts +0 -20
@@ -63,7 +63,7 @@ export declare class MqttManager implements IMqttManager {
63
63
  * @param instanceId 实例唯一标识
64
64
  * @returns 客户端实例,若不存在则返回 undefined
65
65
  */
66
- get(instanceId: string): IMqttClient | undefined;
66
+ get(instanceId?: string): IMqttClient | undefined;
67
67
  /**
68
68
  * 判断指定实例是否已存在
69
69
  *
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_MQTT_INSTANCE_ID } from "./enums/mqtt-status.enum.mjs";
1
2
  import { MqttClient } from "./mqtt-client.mjs";
2
3
  import { createUUID } from "qx-util";
3
4
  //#region src/modules/mqtt/mqtt-manager.ts
@@ -77,7 +78,7 @@ var MqttManager = class {
77
78
  * @param instanceId 实例唯一标识
78
79
  * @returns 客户端实例,若不存在则返回 undefined
79
80
  */
80
- get(instanceId) {
81
+ get(instanceId = DEFAULT_MQTT_INSTANCE_ID) {
81
82
  return this._clients.get(instanceId);
82
83
  }
83
84
  /**
@@ -3,39 +3,22 @@ import { SysConfigResponse } from '@gct-paas/api/platform';
3
3
  * 平台配置 Store
4
4
  */
5
5
  export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"platform-config", Pick<{
6
- projectSetting: {};
7
- setProjectConfig: (config: {}) => void;
6
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
7
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
8
+ postBasicSetting: () => Promise<string>;
8
9
  deploySetting: {
9
10
  deployMode: import('./enums').DeployModeEnum;
10
11
  };
11
12
  setDeploySetting: (data: SysConfigResponse) => void;
12
13
  isIndependentApp: import('vue').ComputedRef<boolean>;
13
- watermarkSetting: {
14
- openWatermark: boolean;
15
- watermarkContent: string;
16
- fontSize: number;
17
- color: string;
18
- verticalAlign: string;
19
- textAlign: string;
20
- text: string;
21
- transparent: number;
22
- width: number;
23
- height: number;
24
- };
25
- postWatermarkSetting: () => Promise<void>;
26
- setWatermarkSetting: (data: SysConfigResponse) => void;
27
- themeSetting: import('./interfaces').IThemeSetting;
28
- setThemeSetting: (data: SysConfigResponse) => void;
29
- postThemeSetting: () => Promise<void>;
30
- menuCollapsed: import('vue').Ref<boolean, boolean>;
31
- toggleMenuCollapsed: () => void;
32
- menuCollapsedWidth: number;
33
- menuWidthRange: number[];
34
- themeColors: string[];
35
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
36
- postSecuritySetting: () => Promise<void>;
37
- setSecuritySetting: (data: SysConfigResponse) => void;
38
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
14
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
15
+ postLoginSetting: () => Promise<void>;
16
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
17
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
18
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
19
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
20
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
21
+ loginModeConfig: Map<string, IObject>;
39
22
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
40
23
  setOrgSetting: (data: SysConfigResponse) => void;
41
24
  postOrgSetting: () => Promise<void>;
@@ -62,27 +45,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
62
45
  label: string;
63
46
  value: string;
64
47
  }[]>;
65
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
66
- postLoginSetting: () => Promise<void>;
67
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
68
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
69
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
70
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
71
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
72
- loginModeConfig: Map<string, IObject>;
73
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
74
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
75
- postBasicSetting: () => Promise<string>;
76
- init: () => Promise<void>;
77
- renderInit: () => Promise<void>;
78
- }, "projectSetting" | "deploySetting" | "watermarkSetting" | "themeSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "themeColors" | "securitySetting" | "orgSetting" | "relationFields" | "relationFiledsCopy" | "loginSetting" | "loginModeAuthTypes" | "openIDOAuthAuthTypes" | "sysLoginSort" | "openIDOAuthAuthSort" | "loginModeConfig" | "basicSetting">, Pick<{
79
- projectSetting: {};
80
- setProjectConfig: (config: {}) => void;
81
- deploySetting: {
82
- deployMode: import('./enums').DeployModeEnum;
83
- };
84
- setDeploySetting: (data: SysConfigResponse) => void;
85
- isIndependentApp: import('vue').ComputedRef<boolean>;
48
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
49
+ postSecuritySetting: () => Promise<void>;
50
+ setSecuritySetting: (data: SysConfigResponse) => void;
51
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
52
+ themeSetting: import('./interfaces').IThemeSetting;
53
+ setThemeSetting: (data: SysConfigResponse) => void;
54
+ postThemeSetting: () => Promise<void>;
55
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
56
+ toggleMenuCollapsed: () => void;
57
+ menuCollapsedWidth: number;
58
+ menuWidthRange: number[];
59
+ themeColors: string[];
86
60
  watermarkSetting: {
87
61
  openWatermark: boolean;
88
62
  watermarkContent: string;
@@ -97,18 +71,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
97
71
  };
98
72
  postWatermarkSetting: () => Promise<void>;
99
73
  setWatermarkSetting: (data: SysConfigResponse) => void;
100
- themeSetting: import('./interfaces').IThemeSetting;
101
- setThemeSetting: (data: SysConfigResponse) => void;
102
- postThemeSetting: () => Promise<void>;
103
- menuCollapsed: import('vue').Ref<boolean, boolean>;
104
- toggleMenuCollapsed: () => void;
105
- menuCollapsedWidth: number;
106
- menuWidthRange: number[];
107
- themeColors: string[];
108
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
109
- postSecuritySetting: () => Promise<void>;
110
- setSecuritySetting: (data: SysConfigResponse) => void;
111
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
74
+ projectSetting: {};
75
+ setProjectConfig: (config: {}) => void;
76
+ init: () => Promise<void>;
77
+ renderInit: () => Promise<void>;
78
+ }, "basicSetting" | "deploySetting" | "loginModeAuthTypes" | "loginModeConfig" | "loginSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "openIDOAuthAuthSort" | "openIDOAuthAuthTypes" | "orgSetting" | "projectSetting" | "relationFields" | "relationFiledsCopy" | "securitySetting" | "sysLoginSort" | "themeColors" | "themeSetting" | "watermarkSetting">, Pick<{
79
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
80
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
81
+ postBasicSetting: () => Promise<string>;
82
+ deploySetting: {
83
+ deployMode: import('./enums').DeployModeEnum;
84
+ };
85
+ setDeploySetting: (data: SysConfigResponse) => void;
86
+ isIndependentApp: import('vue').ComputedRef<boolean>;
87
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
88
+ postLoginSetting: () => Promise<void>;
89
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
90
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
91
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
92
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
93
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
94
+ loginModeConfig: Map<string, IObject>;
112
95
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
113
96
  setOrgSetting: (data: SysConfigResponse) => void;
114
97
  postOrgSetting: () => Promise<void>;
@@ -135,27 +118,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
135
118
  label: string;
136
119
  value: string;
137
120
  }[]>;
138
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
139
- postLoginSetting: () => Promise<void>;
140
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
141
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
142
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
143
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
144
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
145
- loginModeConfig: Map<string, IObject>;
146
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
147
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
148
- postBasicSetting: () => Promise<string>;
149
- init: () => Promise<void>;
150
- renderInit: () => Promise<void>;
151
- }, "isIndependentApp">, Pick<{
152
- projectSetting: {};
153
- setProjectConfig: (config: {}) => void;
154
- deploySetting: {
155
- deployMode: import('./enums').DeployModeEnum;
156
- };
157
- setDeploySetting: (data: SysConfigResponse) => void;
158
- isIndependentApp: import('vue').ComputedRef<boolean>;
121
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
122
+ postSecuritySetting: () => Promise<void>;
123
+ setSecuritySetting: (data: SysConfigResponse) => void;
124
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
125
+ themeSetting: import('./interfaces').IThemeSetting;
126
+ setThemeSetting: (data: SysConfigResponse) => void;
127
+ postThemeSetting: () => Promise<void>;
128
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
129
+ toggleMenuCollapsed: () => void;
130
+ menuCollapsedWidth: number;
131
+ menuWidthRange: number[];
132
+ themeColors: string[];
159
133
  watermarkSetting: {
160
134
  openWatermark: boolean;
161
135
  watermarkContent: string;
@@ -170,18 +144,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
170
144
  };
171
145
  postWatermarkSetting: () => Promise<void>;
172
146
  setWatermarkSetting: (data: SysConfigResponse) => void;
173
- themeSetting: import('./interfaces').IThemeSetting;
174
- setThemeSetting: (data: SysConfigResponse) => void;
175
- postThemeSetting: () => Promise<void>;
176
- menuCollapsed: import('vue').Ref<boolean, boolean>;
177
- toggleMenuCollapsed: () => void;
178
- menuCollapsedWidth: number;
179
- menuWidthRange: number[];
180
- themeColors: string[];
181
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
182
- postSecuritySetting: () => Promise<void>;
183
- setSecuritySetting: (data: SysConfigResponse) => void;
184
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
147
+ projectSetting: {};
148
+ setProjectConfig: (config: {}) => void;
149
+ init: () => Promise<void>;
150
+ renderInit: () => Promise<void>;
151
+ }, "isIndependentApp">, Pick<{
152
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
153
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
154
+ postBasicSetting: () => Promise<string>;
155
+ deploySetting: {
156
+ deployMode: import('./enums').DeployModeEnum;
157
+ };
158
+ setDeploySetting: (data: SysConfigResponse) => void;
159
+ isIndependentApp: import('vue').ComputedRef<boolean>;
160
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
161
+ postLoginSetting: () => Promise<void>;
162
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
163
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
164
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
165
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
166
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
167
+ loginModeConfig: Map<string, IObject>;
185
168
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
186
169
  setOrgSetting: (data: SysConfigResponse) => void;
187
170
  postOrgSetting: () => Promise<void>;
@@ -208,18 +191,35 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
208
191
  label: string;
209
192
  value: string;
210
193
  }[]>;
211
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
212
- postLoginSetting: () => Promise<void>;
213
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
214
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
215
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
216
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
217
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
218
- loginModeConfig: Map<string, IObject>;
219
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
220
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
221
- postBasicSetting: () => Promise<string>;
194
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
195
+ postSecuritySetting: () => Promise<void>;
196
+ setSecuritySetting: (data: SysConfigResponse) => void;
197
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
198
+ themeSetting: import('./interfaces').IThemeSetting;
199
+ setThemeSetting: (data: SysConfigResponse) => void;
200
+ postThemeSetting: () => Promise<void>;
201
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
202
+ toggleMenuCollapsed: () => void;
203
+ menuCollapsedWidth: number;
204
+ menuWidthRange: number[];
205
+ themeColors: string[];
206
+ watermarkSetting: {
207
+ openWatermark: boolean;
208
+ watermarkContent: string;
209
+ fontSize: number;
210
+ color: string;
211
+ verticalAlign: string;
212
+ textAlign: string;
213
+ text: string;
214
+ transparent: number;
215
+ width: number;
216
+ height: number;
217
+ };
218
+ postWatermarkSetting: () => Promise<void>;
219
+ setWatermarkSetting: (data: SysConfigResponse) => void;
220
+ projectSetting: {};
221
+ setProjectConfig: (config: {}) => void;
222
222
  init: () => Promise<void>;
223
223
  renderInit: () => Promise<void>;
224
- }, "setProjectConfig" | "setDeploySetting" | "postWatermarkSetting" | "setWatermarkSetting" | "setThemeSetting" | "postThemeSetting" | "toggleMenuCollapsed" | "postSecuritySetting" | "setSecuritySetting" | "getSignWay" | "setOrgSetting" | "postOrgSetting" | "postLoginSetting" | "setLoginSetting" | "setBasicSetting" | "postBasicSetting" | "init" | "renderInit">>;
224
+ }, "getSignWay" | "init" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
225
225
  export type IPlatformConfigStore = ReturnType<typeof usePlatformConfigStore>;
@@ -46,7 +46,6 @@ var usePlatformConfigStore = defineStore("platform-config", () => {
46
46
  if (map[PlatformSettingEnum.THEME]) theme.setThemeSetting(map[PlatformSettingEnum.THEME]);
47
47
  if (map[PlatformSettingEnum.WATERMARK]) watermark.setWatermarkSetting(map[PlatformSettingEnum.WATERMARK]);
48
48
  if (map[PlatformSettingEnum.DEPLOY]) deploy.setDeploySetting(map[PlatformSettingEnum.DEPLOY]);
49
- console.debug("平台配置初始化完成", map);
50
49
  }
51
50
  /**应用前台设置初始化 */
52
51
  async function renderInit() {
@@ -8,5 +8,5 @@ export declare function useSecuritySetting(isPlatform?: boolean): {
8
8
  securitySetting: SecurityConfig;
9
9
  postSecuritySetting: () => Promise<void>;
10
10
  setSecuritySetting: (data: SysConfigResponse) => void;
11
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
11
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
12
12
  };
@@ -1,9 +1,7 @@
1
1
  import { UserOfTenantDTO } from '@gct-paas/api/platform';
2
- export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", {
3
- tenantId: string;
4
- tenantUserInfo: {};
5
- tenantUserPermissions: {};
6
- }, {}, {
7
- setTenant(tenantId: string): void;
8
- getTenantUserInfoAction(): Promise<UserOfTenantDTO | undefined>;
9
- }>;
2
+ import { tenantState } from '../types/tenant';
3
+ export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {
4
+ getTenantUserInfoAction(state: {
5
+ tenantUserInfo: Record<string, UserOfTenantDTO>;
6
+ } & import('pinia').PiniaCustomStateProperties<tenantState>): () => Promise<UserOfTenantDTO>;
7
+ }, {}>;
@@ -1,22 +1,20 @@
1
+ import { getTenant } from "../../../utils/tools/tools.mjs";
2
+ import "../../../utils/index.mjs";
1
3
  import { defineStore } from "pinia";
2
4
  //#region src/modules/user-stores/store/tenant.store.ts
3
5
  var useTenantStore = defineStore("tenant", {
4
- state: () => ({
5
- tenantId: "",
6
- tenantUserInfo: {},
7
- tenantUserPermissions: {}
8
- }),
9
- actions: {
10
- setTenant(tenantId) {
11
- this.tenantId = tenantId;
12
- },
13
- async getTenantUserInfoAction() {
14
- if (!this.tenantId) return;
6
+ state: () => ({ tenantUserInfo: {} }),
7
+ getters: { getTenantUserInfoAction(state) {
8
+ return async () => {
9
+ const tenantId = getTenant();
10
+ if (!tenantId) return Promise.reject(null);
11
+ if (state.tenantUserInfo[tenantId]) return state.tenantUserInfo[tenantId];
15
12
  const info = await _api.platform.tenant.getUserInfo();
16
- this.tenantUserInfo = info;
13
+ state.tenantUserInfo[tenantId] = info;
17
14
  return info;
18
- }
19
- }
15
+ };
16
+ } },
17
+ actions: {}
20
18
  });
21
19
  //#endregion
22
20
  export { useTenantStore };
@@ -44,6 +44,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
44
44
  duty?: string | undefined;
45
45
  enabled?: number | undefined;
46
46
  id?: string | undefined;
47
+ latestLogin?: number | undefined;
47
48
  managerId?: string | undefined;
48
49
  managerName?: string | undefined;
49
50
  name?: string | undefined;
@@ -115,6 +116,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
115
116
  duty?: string | undefined;
116
117
  enabled?: number | undefined;
117
118
  id?: string | undefined;
119
+ latestLogin?: number | undefined;
118
120
  managerId?: string | undefined;
119
121
  managerName?: string | undefined;
120
122
  name?: string | undefined;
@@ -183,6 +185,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
183
185
  duty?: string | undefined;
184
186
  enabled?: number | undefined;
185
187
  id?: string | undefined;
188
+ latestLogin?: number | undefined;
186
189
  managerId?: string | undefined;
187
190
  managerName?: string | undefined;
188
191
  name?: string | undefined;
@@ -257,6 +260,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
257
260
  duty?: string | undefined;
258
261
  enabled?: number | undefined;
259
262
  id?: string | undefined;
263
+ latestLogin?: number | undefined;
260
264
  managerId?: string | undefined;
261
265
  managerName?: string | undefined;
262
266
  name?: string | undefined;
@@ -290,13 +294,18 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
290
294
  }, {
291
295
  login(config: LoginParams, { hasError }?: {
292
296
  hasError: any;
293
- }): Promise<null | undefined>;
297
+ }): Promise<UserLoginResp>;
294
298
  getUserInfoAction(Token?: string): Promise<UserLoginResp | null>;
295
299
  /**单应用登录 */
296
300
  afterLoginSingleApp(): Promise<void>;
297
301
  /**登录后逻辑 */
298
302
  afterLoginAction(): Promise<null | undefined>;
299
- logout(): Promise<void>;
303
+ /**退出登录 接口*/
304
+ submitLoginOut(): Promise<void>;
305
+ /**
306
+ * 清空对应信息
307
+ */
308
+ appLoginOut(): Promise<void>;
300
309
  setUserInfo(info: IObject): Promise<void>;
301
310
  updateUserInfo(data: IObject): Promise<void>;
302
311
  }>;
@@ -1,6 +1,9 @@
1
1
  import { getTenant, getToken, setToken } from "../../../utils/tools/tools.mjs";
2
+ import { sha256 } from "../../../utils/uuid/uuid.mjs";
2
3
  import { getDeviceFingerprint, getPageIdentification } from "../../../utils/deviceFingerprint.mjs";
3
4
  import "../../../utils/index.mjs";
5
+ import { globalRefStorage } from "../../../store/storage-store.mjs";
6
+ import "../../../store/index.mjs";
4
7
  import { defineStore } from "pinia";
5
8
  //#region src/modules/user-stores/store/user.store.ts
6
9
  var useUserStore = defineStore("user", {
@@ -26,9 +29,9 @@ var useUserStore = defineStore("user", {
26
29
  async login(config, { hasError } = {}) {
27
30
  try {
28
31
  const { token, signWay } = await loginApi(config, hasError);
29
- sessionStorage.setItem("signWay", signWay);
32
+ globalRefStorage.value.signWay = signWay || "";
30
33
  setToken(token);
31
- return this.afterLoginAction();
34
+ return this.getUserInfoAction(token);
32
35
  } catch (error) {
33
36
  return Promise.reject(error);
34
37
  }
@@ -47,8 +50,13 @@ var useUserStore = defineStore("user", {
47
50
  async afterLoginAction() {
48
51
  if (!getToken) return null;
49
52
  },
50
- async logout() {
53
+ async submitLoginOut() {
51
54
  await doLogout();
55
+ this.appLoginOut();
56
+ },
57
+ async appLoginOut() {
58
+ setToken();
59
+ this.setUserInfo({});
52
60
  },
53
61
  async setUserInfo(info) {
54
62
  this.userInfo = {
@@ -75,7 +83,10 @@ var useUserStore = defineStore("user", {
75
83
  */
76
84
  async function loginApi(params, { hasError = true } = {}) {
77
85
  const fingerprint = await getDeviceFingerprint();
78
- return await _api.platform.login.postSign(params, { headers: {
86
+ return await _api.platform.login.postSign({
87
+ ...params,
88
+ password: sha256(params.password || "")
89
+ }, { headers: {
79
90
  browser: fingerprint,
80
91
  "Auth-Code": params.authCode,
81
92
  hasError
@@ -1 +1,7 @@
1
- export {};
1
+ import { UserOfTenantDTO } from '@gct-paas/api/platform';
2
+ /**
3
+ * 租户信息
4
+ */
5
+ export interface tenantState {
6
+ tenantUserInfo: Record<string, UserOfTenantDTO>;
7
+ }
@@ -16,9 +16,9 @@ var RouterUtil = class {
16
16
  * @description 将单个或多个路由记录添加到路由器中
17
17
  */
18
18
  async add(route) {
19
- if (Array.isArray(route)) route.forEach((r) => this.add(r));
19
+ if (Array.isArray(route)) route.forEach((r) => this.router.addRoute(r));
20
20
  else this.router.addRoute(route);
21
- await this.router.replace(this.router.currentRoute.value.fullPath);
21
+ if (!this.router.currentRoute.value.name) await this.router.replace(this.router.currentRoute.value.fullPath);
22
22
  }
23
23
  /**刷新当前路由 */
24
24
  async redo() {
package/es/setup-app.mjs CHANGED
@@ -16,9 +16,13 @@ import { HttpUtil } from "@gct-paas/api";
16
16
  async function setupApp(_app) {
17
17
  HttpUtil.use(interceptors);
18
18
  await _gct.init();
19
- const token = getToken();
20
- if (token) await useUserStore().getUserInfoAction(token);
21
19
  await usePlatformConfigStore().init();
20
+ const token = getToken();
21
+ if (token) try {
22
+ await useUserStore().getUserInfoAction(token);
23
+ } catch (error) {
24
+ console.error("获取用户信息失败", error);
25
+ }
22
26
  }
23
27
  //#endregion
24
28
  export { setupApp };
@@ -22,6 +22,9 @@ var useGlobalStore = defineStore("global-store", {
22
22
  }
23
23
  },
24
24
  actions: {
25
+ async setContext(ctx = {}) {
26
+ Object.assign(this.context, ctx);
27
+ },
25
28
  async init() {
26
29
  const paramStr = location.pathname.split("/")[2];
27
30
  if (paramStr) {
@@ -1,6 +1,7 @@
1
1
  import { IGlobalStore } from './global-store';
2
2
  import { IPlatformConfigStore } from '../modules/platform-config';
3
3
  export { globalRefStorage } from './storage-store';
4
+ export { globalRefSession } from './session-store';
4
5
  /**
5
6
  * 全局的状态管理工具类
6
7
  *
@@ -2,6 +2,7 @@ import { useGlobalStore } from "./global-store.mjs";
2
2
  import { usePlatformConfigStore } from "../modules/platform-config/store.mjs";
3
3
  import "../modules/platform-config/index.mjs";
4
4
  import "./storage-store.mjs";
5
+ import "./session-store.mjs";
5
6
  import { createPinia, setActivePinia } from "pinia";
6
7
  //#region src/store/index.ts
7
8
  /**
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 全局双向绑定持续化缓存Map
3
+ */
4
+ export declare const globalRefSession: import('@vueuse/core').RemovableRef<{
5
+ /**登录登出标识 */
6
+ currentPlatOrAppId: string;
7
+ }>;
@@ -0,0 +1,7 @@
1
+ import { useSessionStorage } from "@vueuse/core";
2
+ /**
3
+ * 全局双向绑定持续化缓存Map
4
+ */
5
+ var globalRefSession = useSessionStorage("GCT_GLOBAL_SESSION:PAAS", { currentPlatOrAppId: "" });
6
+ //#endregion
7
+ export { globalRefSession };
@@ -6,4 +6,6 @@ export declare const globalRefStorage: import('@vueuse/core').RemovableRef<{
6
6
  timezone: string;
7
7
  /**语言标识 */
8
8
  lang: string;
9
+ /**登录登出专用标识 */
10
+ signWay: string;
9
11
  }>;
@@ -2,9 +2,10 @@ import { useStorage } from "@vueuse/core";
2
2
  /**
3
3
  * 全局双向绑定持续化缓存Map
4
4
  */
5
- var globalRefStorage = useStorage("GCT_GLOBAL:PAAS", {
5
+ var globalRefStorage = useStorage("GCT_GLOBAL_STORAGE:PAAS", {
6
6
  timezone: "UTC+08:00",
7
- lang: ""
7
+ lang: "",
8
+ signWay: ""
8
9
  });
9
10
  //#endregion
10
11
  export { globalRefStorage };
@@ -64,7 +64,6 @@ declare global {
64
64
  }
65
65
 
66
66
  interface ImportMetaEnv {
67
- VITE_GLOBAL_HOST: string;
68
67
  pkg: {
69
68
  name: string;
70
69
  version: string;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 分类的模块类型
3
+ */
4
+ export declare enum CategoryModuleEnum {
5
+ /** 在线表单 */
6
+ ONLINE_FORM = "online_form_module",
7
+ /** eDHR */
8
+ EDHR = "edhr_module",
9
+ /** 单据项目 */
10
+ CHECK_LIST = "check_list_module",
11
+ /** 检验模板 */
12
+ INSPECTION = "inspection_module",
13
+ /** 放行模板 */
14
+ RELEASE = "release_module"
15
+ }
16
+ export type GetInterfaceParams = {
17
+ moduleType: CategoryModuleEnum;
18
+ } & IObject;
19
+ export declare const getInterfaceApi: {
20
+ /** 获取分类列表 */
21
+ getCategoryList: ({ moduleType }: {
22
+ moduleType: CategoryModuleEnum;
23
+ }) => Promise<object>;
24
+ /** 获取模板列表 */
25
+ getTmplsList: (params: GetInterfaceParams, config?: IObject) => Promise<object>;
26
+ };