@gct-paas/core 0.1.6-dev.9 → 6.0.0-dev.10

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 (137) hide show
  1. package/README.md +322 -0
  2. package/dist/index.esm.min.js +2 -1
  3. package/dist/{redirect-index-Ck5Ddtcb.js → redirect-index-QBY98C6e.js} +1 -0
  4. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  5. package/es/constants/expression-type/FunctionKeys.mjs +2 -0
  6. package/es/constants/expression-type/function.mjs +20 -0
  7. package/es/constants/expression-type/index.mjs +2 -0
  8. package/es/constants/expression-type/modeCfg.mjs +12 -2
  9. package/es/constants/index.d.ts +4 -0
  10. package/es/constants/index.mjs +5 -1
  11. package/es/enums/app-designer/index.d.ts +29 -3
  12. package/es/enums/app-designer/index.mjs +33 -4
  13. package/es/enums/appEnum.d.ts +5 -1
  14. package/es/enums/appEnum.mjs +6 -1
  15. package/es/enums/authActionEnum.d.ts +5 -1
  16. package/es/enums/authActionEnum.mjs +4 -0
  17. package/es/enums/developer-center/integration.d.ts +6 -0
  18. package/es/enums/developer-center/integration.mjs +8 -1
  19. package/es/enums/expressionEnum.d.ts +4 -2
  20. package/es/enums/expressionEnum.mjs +2 -0
  21. package/es/enums/globalEnum.d.ts +30 -0
  22. package/es/enums/globalEnum.mjs +40 -1
  23. package/es/enums/index.d.ts +11 -0
  24. package/es/enums/index.mjs +13 -1
  25. package/es/enums/page-designer/designer.d.ts +2 -0
  26. package/es/enums/page-designer/designer.mjs +2 -0
  27. package/es/enums/page-designer/layout.d.ts +6 -0
  28. package/es/enums/page-designer/layout.mjs +8 -1
  29. package/es/enums/page-designer/panel.d.ts +9 -2
  30. package/es/enums/page-designer/panel.mjs +10 -2
  31. package/es/enums/pageEnum.d.ts +2 -1
  32. package/es/enums/pageEnum.mjs +1 -0
  33. package/es/enums/process.d.ts +5 -0
  34. package/es/enums/process.mjs +9 -0
  35. package/es/enums/sizeEnum.d.ts +4 -0
  36. package/es/enums/sizeEnum.mjs +6 -1
  37. package/es/global/gct/gct.d.ts +25 -19
  38. package/es/global/gct/gct.mjs +9 -5
  39. package/es/hooks/index.d.ts +1 -0
  40. package/es/hooks/index.mjs +1 -0
  41. package/es/hooks/useDebouncePromise.d.ts +14 -0
  42. package/es/hooks/useDebouncePromise.mjs +56 -0
  43. package/es/index.d.ts +2 -0
  44. package/es/index.mjs +40 -28
  45. package/es/interface/i-action-item/i-action-item.d.ts +65 -0
  46. package/es/interface/i-app-context/i-app-context.d.ts +25 -1
  47. package/es/interface/i-dictionary/i-dictionary-item.d.ts +80 -0
  48. package/es/interface/i-pinia-action/i-global-actions.d.ts +9 -0
  49. package/es/interface/i-pinia-getter/i-global-getters.d.ts +22 -1
  50. package/es/interface/i-pinia-state/i-global-state.d.ts +9 -2
  51. package/es/interface/index.d.ts +2 -1
  52. package/es/interface/open-util/i-confirm-util/i-confirm-util.d.ts +65 -0
  53. package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
  54. package/es/interface/open-util/i-modal/i-modal.d.ts +14 -1
  55. package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
  56. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
  57. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
  58. package/es/interface/open-util/index.d.ts +2 -0
  59. package/es/locale/auto-register.d.ts +2 -0
  60. package/es/locale/auto-register.mjs +13 -0
  61. package/es/locale/index.d.ts +25 -1
  62. package/es/locale/index.mjs +57 -3
  63. package/es/locale/sys/model.mjs +9 -0
  64. package/es/locale/sys.d.ts +17 -0
  65. package/es/locale/sys.mjs +26 -0
  66. package/es/modules/env-manager/env-manager.const.d.ts +2 -0
  67. package/es/modules/env-manager/env-manager.const.mjs +4 -2
  68. package/es/modules/env-manager/env-manager.d.ts +8 -13
  69. package/es/modules/env-manager/env-manager.interface.d.ts +5 -9
  70. package/es/modules/env-manager/env-manager.interface.mjs +2 -0
  71. package/es/modules/env-manager/env-manager.mjs +19 -27
  72. package/es/modules/env-manager/env-manager.util.d.ts +5 -0
  73. package/es/modules/env-manager/env-manager.util.mjs +11 -0
  74. package/es/modules/env-manager/index.d.ts +1 -0
  75. package/es/modules/env-manager/index.mjs +1 -0
  76. package/es/modules/mqtt/interfaces/i-mqtt.d.ts +6 -2
  77. package/es/modules/mqtt/mqtt-client.d.ts +8 -7
  78. package/es/modules/mqtt/mqtt-client.mjs +30 -19
  79. package/es/modules/platform-config/constants/theme.const.d.ts +9 -1
  80. package/es/modules/platform-config/constants/theme.const.mjs +13 -2
  81. package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
  82. package/es/modules/platform-config/enums/login.enum.mjs +2 -0
  83. package/es/modules/platform-config/index.d.ts +3 -0
  84. package/es/modules/platform-config/index.mjs +3 -0
  85. package/es/modules/platform-config/store.d.ts +18 -18
  86. package/es/modules/platform-config/useDeploySetting.d.ts +1 -2
  87. package/es/modules/platform-config/useDeploySetting.mjs +6 -3
  88. package/es/modules/platform-config/useLoginSetting.d.ts +2 -2
  89. package/es/modules/platform-config/useLoginSetting.mjs +29 -31
  90. package/es/modules/platform-config/useOrgSetting.d.ts +2 -2
  91. package/es/modules/platform-config/useOrgSetting.mjs +4 -6
  92. package/es/modules/platform-config/useSecuritySetting.d.ts +2 -2
  93. package/es/modules/platform-config/useSecuritySetting.mjs +2 -3
  94. package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
  95. package/es/modules/platform-config/useThemeSetting.mjs +32 -4
  96. package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
  97. package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
  98. package/es/modules/sign-log/index.d.ts +1 -0
  99. package/es/modules/sign-log/index.mjs +1 -0
  100. package/es/modules/sign-log/sign-log.d.ts +10 -0
  101. package/es/modules/sign-log/sign-log.mjs +109 -0
  102. package/es/modules/sign-log/sing-log.interface.d.ts +9 -0
  103. package/es/modules/system-mqtt/index.d.ts +2 -0
  104. package/es/modules/system-mqtt/index.mjs +1 -0
  105. package/es/modules/system-mqtt/system-mqtt.interface.d.ts +71 -0
  106. package/es/modules/system-mqtt/system-mqtt.service.d.ts +104 -0
  107. package/es/modules/system-mqtt/system-mqtt.service.mjs +199 -0
  108. package/es/modules/user-stores/store/permission.store.d.ts +1 -0
  109. package/es/modules/user-stores/store/permission.store.mjs +10 -0
  110. package/es/modules/user-stores/store/user.store.mjs +4 -2
  111. package/es/router/guard/index.d.ts +4 -0
  112. package/es/router/guard/index.mjs +41 -0
  113. package/es/router/index.mjs +2 -0
  114. package/es/setup-app.mjs +2 -9
  115. package/es/state/global-pinia-state/global-pinia-state.d.ts +6 -0
  116. package/es/state/global-pinia-state/global-pinia-state.mjs +6 -0
  117. package/es/store/global-store.mjs +15 -1
  118. package/es/types/index.d.ts +7 -0
  119. package/es/utils/auth-util/auth-util.d.ts +37 -0
  120. package/es/utils/auth-util/auth-util.mjs +79 -0
  121. package/es/utils/axios/check-status.d.ts +1 -0
  122. package/es/utils/axios/check-status.mjs +64 -0
  123. package/es/utils/axios/interceptors.mjs +30 -0
  124. package/es/utils/deviceFingerprint.mjs +5 -1
  125. package/es/utils/i18n/index.mjs +1 -0
  126. package/es/utils/index.d.ts +4 -2
  127. package/es/utils/index.mjs +3 -1
  128. package/es/utils/kit-pkg-util/kit-pkg-util.mjs +1 -1
  129. package/es/utils/openUtil/modal/modal.d.ts +1 -1
  130. package/es/utils/openUtil/modal/modal.mjs +1 -1
  131. package/es/utils/openUtil/overlay-container/overlay-container.mjs +8 -2
  132. package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +2 -1
  133. package/es/utils/select-user-utils.d.ts +50 -0
  134. package/es/utils/select-user-utils.mjs +129 -0
  135. package/es/utils/tools/tools.d.ts +6 -0
  136. package/es/utils/tools/tools.mjs +12 -3
  137. package/package.json +5 -3
@@ -9,18 +9,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
9
9
  deploySetting: {
10
10
  deployMode: import('./enums').DeployModeEnum;
11
11
  };
12
- setDeploySetting: (data: SysConfigResponse) => void;
12
+ setDeploySetting: (data: IObject | undefined) => void;
13
13
  isIndependentApp: import('vue').ComputedRef<boolean>;
14
14
  loginSetting: import('@gct-paas/api/platform').AuthConfig;
15
15
  postLoginSetting: () => Promise<void>;
16
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
16
+ setLoginSetting: (config: IObject | undefined) => void;
17
17
  loginModeAuthTypes: import('vue').Ref<string[], string[]>;
18
18
  openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
19
19
  sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
20
20
  openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
21
21
  loginModeConfig: Map<string, IObject>;
22
22
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
23
- setOrgSetting: (data: SysConfigResponse) => void;
23
+ setOrgSetting: (data: IObject) => void;
24
24
  postOrgSetting: () => Promise<void>;
25
25
  relationFields: import('vue').Ref<{
26
26
  label: string;
@@ -47,7 +47,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
47
47
  }[]>;
48
48
  securitySetting: import('@gct-paas/api/platform').SecurityConfig;
49
49
  postSecuritySetting: () => Promise<void>;
50
- setSecuritySetting: (data: SysConfigResponse) => void;
50
+ setSecuritySetting: (data: IObject | undefined) => void;
51
51
  getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
52
52
  themeSetting: import('./interfaces').IThemeSetting;
53
53
  setThemeSetting: (data: SysConfigResponse) => void;
@@ -56,7 +56,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
56
56
  toggleMenuCollapsed: () => void;
57
57
  menuCollapsedWidth: number;
58
58
  menuWidthRange: number[];
59
- themeColors: string[];
59
+ themeColors: readonly ["#026AC8", "#0DAA9C"];
60
60
  watermarkSetting: {
61
61
  openWatermark: boolean;
62
62
  watermarkContent: string;
@@ -70,7 +70,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
70
70
  height: number;
71
71
  };
72
72
  postWatermarkSetting: () => Promise<void>;
73
- setWatermarkSetting: (data: SysConfigResponse) => void;
73
+ setWatermarkSetting: (data: IObject | undefined) => void;
74
74
  projectSetting: {};
75
75
  setProjectConfig: (config: {}) => void;
76
76
  init: () => Promise<void>;
@@ -82,18 +82,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
82
82
  deploySetting: {
83
83
  deployMode: import('./enums').DeployModeEnum;
84
84
  };
85
- setDeploySetting: (data: SysConfigResponse) => void;
85
+ setDeploySetting: (data: IObject | undefined) => void;
86
86
  isIndependentApp: import('vue').ComputedRef<boolean>;
87
87
  loginSetting: import('@gct-paas/api/platform').AuthConfig;
88
88
  postLoginSetting: () => Promise<void>;
89
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
89
+ setLoginSetting: (config: IObject | undefined) => void;
90
90
  loginModeAuthTypes: import('vue').Ref<string[], string[]>;
91
91
  openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
92
92
  sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
93
93
  openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
94
94
  loginModeConfig: Map<string, IObject>;
95
95
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
96
- setOrgSetting: (data: SysConfigResponse) => void;
96
+ setOrgSetting: (data: IObject) => void;
97
97
  postOrgSetting: () => Promise<void>;
98
98
  relationFields: import('vue').Ref<{
99
99
  label: string;
@@ -120,7 +120,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
120
120
  }[]>;
121
121
  securitySetting: import('@gct-paas/api/platform').SecurityConfig;
122
122
  postSecuritySetting: () => Promise<void>;
123
- setSecuritySetting: (data: SysConfigResponse) => void;
123
+ setSecuritySetting: (data: IObject | undefined) => void;
124
124
  getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
125
125
  themeSetting: import('./interfaces').IThemeSetting;
126
126
  setThemeSetting: (data: SysConfigResponse) => void;
@@ -129,7 +129,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
129
129
  toggleMenuCollapsed: () => void;
130
130
  menuCollapsedWidth: number;
131
131
  menuWidthRange: number[];
132
- themeColors: string[];
132
+ themeColors: readonly ["#026AC8", "#0DAA9C"];
133
133
  watermarkSetting: {
134
134
  openWatermark: boolean;
135
135
  watermarkContent: string;
@@ -143,7 +143,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
143
143
  height: number;
144
144
  };
145
145
  postWatermarkSetting: () => Promise<void>;
146
- setWatermarkSetting: (data: SysConfigResponse) => void;
146
+ setWatermarkSetting: (data: IObject | undefined) => void;
147
147
  projectSetting: {};
148
148
  setProjectConfig: (config: {}) => void;
149
149
  init: () => Promise<void>;
@@ -155,18 +155,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
155
155
  deploySetting: {
156
156
  deployMode: import('./enums').DeployModeEnum;
157
157
  };
158
- setDeploySetting: (data: SysConfigResponse) => void;
158
+ setDeploySetting: (data: IObject | undefined) => void;
159
159
  isIndependentApp: import('vue').ComputedRef<boolean>;
160
160
  loginSetting: import('@gct-paas/api/platform').AuthConfig;
161
161
  postLoginSetting: () => Promise<void>;
162
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
162
+ setLoginSetting: (config: IObject | undefined) => void;
163
163
  loginModeAuthTypes: import('vue').Ref<string[], string[]>;
164
164
  openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
165
165
  sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
166
166
  openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
167
167
  loginModeConfig: Map<string, IObject>;
168
168
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
169
- setOrgSetting: (data: SysConfigResponse) => void;
169
+ setOrgSetting: (data: IObject) => void;
170
170
  postOrgSetting: () => Promise<void>;
171
171
  relationFields: import('vue').Ref<{
172
172
  label: string;
@@ -193,7 +193,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
193
193
  }[]>;
194
194
  securitySetting: import('@gct-paas/api/platform').SecurityConfig;
195
195
  postSecuritySetting: () => Promise<void>;
196
- setSecuritySetting: (data: SysConfigResponse) => void;
196
+ setSecuritySetting: (data: IObject | undefined) => void;
197
197
  getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
198
198
  themeSetting: import('./interfaces').IThemeSetting;
199
199
  setThemeSetting: (data: SysConfigResponse) => void;
@@ -202,7 +202,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
202
202
  toggleMenuCollapsed: () => void;
203
203
  menuCollapsedWidth: number;
204
204
  menuWidthRange: number[];
205
- themeColors: string[];
205
+ themeColors: readonly ["#026AC8", "#0DAA9C"];
206
206
  watermarkSetting: {
207
207
  openWatermark: boolean;
208
208
  watermarkContent: string;
@@ -216,7 +216,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
216
216
  height: number;
217
217
  };
218
218
  postWatermarkSetting: () => Promise<void>;
219
- setWatermarkSetting: (data: SysConfigResponse) => void;
219
+ setWatermarkSetting: (data: IObject | undefined) => void;
220
220
  projectSetting: {};
221
221
  setProjectConfig: (config: {}) => void;
222
222
  init: () => Promise<void>;
@@ -1,10 +1,9 @@
1
- import { SysConfigResponse } from '@gct-paas/api/platform';
2
1
  import { DeployModeEnum } from './enums/deploy.enum';
3
2
  /**
4
3
  * 设置部署配置信息
5
4
  * @param data - 系统配置响应数据
6
5
  */
7
- declare function setDeploySetting(data: SysConfigResponse): void;
6
+ declare function setDeploySetting(data: IObject | undefined): void;
8
7
  /**
9
8
  * 部署设置 Composable 函数
10
9
  * @returns 返回部署设置相关的响应式数据和方法
@@ -1,6 +1,10 @@
1
1
  import { DeployModeEnum } from "./enums/deploy.enum.mjs";
2
2
  import { computed, reactive } from "vue";
3
3
  //#region src/modules/platform-config/useDeploySetting.ts
4
+ /**
5
+ * 部署设置 Composable
6
+ * 用于管理应用的部署模式配置
7
+ */
4
8
  /** 部署设置响应式对象 */
5
9
  var deploySetting = reactive({ deployMode: DeployModeEnum.STANDARD });
6
10
  /** 是否为独立应用部署模式的计算属性 */
@@ -12,10 +16,9 @@ var isIndependentApp = computed(() => {
12
16
  * @param data - 系统配置响应数据
13
17
  */
14
18
  function setDeploySetting(data) {
15
- const { value } = data;
16
- if (!value) return;
19
+ if (!data || !data.id) return;
17
20
  try {
18
- Object.assign(deploySetting, JSON.parse(value));
21
+ Object.assign(deploySetting, data);
19
22
  } catch (err) {
20
23
  console.warn(err);
21
24
  }
@@ -1,4 +1,4 @@
1
- import { AuthConfig, SysConfigResponse } from '@gct-paas/api/platform';
1
+ import { AuthConfig } from '@gct-paas/api/platform';
2
2
  /**
3
3
  * 登录设置 Composable 函数
4
4
  * @returns 返回登录设置相关的响应式数据和方法
@@ -6,7 +6,7 @@ import { AuthConfig, SysConfigResponse } from '@gct-paas/api/platform';
6
6
  export declare function useLoginSetting(): {
7
7
  loginSetting: AuthConfig;
8
8
  postLoginSetting: () => Promise<void>;
9
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
9
+ setLoginSetting: (config: IObject | undefined) => void;
10
10
  loginModeAuthTypes: import('vue').Ref<string[], string[]>;
11
11
  openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
12
12
  sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
@@ -106,39 +106,37 @@ function useLoginSetting() {
106
106
  * @param config - 系统配置响应数据
107
107
  */
108
108
  const setLoginSetting = (config) => {
109
- if (config && config.value) {
110
- const value = JSON.parse(config.value);
111
- for (const k in value) if (k in loginSetting) loginSetting[k] = value[k];
112
- if (has(value, "sortJson") && !isEmpty(value.sortJson)) {
113
- const sortObj = JSON.parse(value.sortJson);
114
- if (has(sortObj, LoginSortTypeEnum.SYSTEM)) sysLoginSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.SYSTEM]);
115
- if (has(sortObj, LoginSortTypeEnum.THIRD_PARTY)) openIDOAuthAuthSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.THIRD_PARTY]);
116
- }
117
- loginSetting.loginModeConfigs?.forEach((item) => {
118
- loginModeConfig.set(item.authType, {
119
- ...item,
120
- enabled: 0
121
- });
109
+ if (!config || !config.id) return;
110
+ for (const k in config) if (k in loginSetting) loginSetting[k] = config[k];
111
+ if (has(config, "sortJson") && !isEmpty(config.sortJson)) {
112
+ const sortObj = JSON.parse(config.sortJson);
113
+ if (has(sortObj, LoginSortTypeEnum.SYSTEM)) sysLoginSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.SYSTEM]);
114
+ if (has(sortObj, LoginSortTypeEnum.THIRD_PARTY)) openIDOAuthAuthSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.THIRD_PARTY]);
115
+ }
116
+ loginSetting.loginModeConfigs?.forEach((item) => {
117
+ loginModeConfig.set(item.authType, {
118
+ ...item,
119
+ enabled: 0
122
120
  });
123
- const loginModeConfigs = loginSetting.loginModeConfigs?.filter((item) => {
124
- return item.enabled;
125
- }).map((i) => {
126
- return i.authType;
127
- }) || [];
128
- loginModeConfigs.push(LoginTypeEnum.ACCOUNT);
129
- loginModeAuthTypes.value = [...new Set(loginModeConfigs)];
130
- loginSetting.openIDOAuthConfigs?.forEach((item) => {
131
- loginModeConfig.set(item.authType, {
132
- ...item,
133
- enabled: 0
134
- });
121
+ });
122
+ const loginModeConfigs = loginSetting.loginModeConfigs?.filter((item) => {
123
+ return item.enabled;
124
+ }).map((i) => {
125
+ return i.authType;
126
+ }) || [];
127
+ loginModeConfigs.push(LoginTypeEnum.ACCOUNT);
128
+ loginModeAuthTypes.value = [...new Set(loginModeConfigs)];
129
+ loginSetting.openIDOAuthConfigs?.forEach((item) => {
130
+ loginModeConfig.set(item.authType, {
131
+ ...item,
132
+ enabled: 0
135
133
  });
136
- openIDOAuthAuthTypes.value = loginSetting.openIDOAuthConfigs?.filter((item) => {
137
- return item.enabled;
138
- }).map((i) => {
139
- return i.authType;
140
- }) || [];
141
- }
134
+ });
135
+ openIDOAuthAuthTypes.value = loginSetting.openIDOAuthConfigs?.filter((item) => {
136
+ return item.enabled;
137
+ }).map((i) => {
138
+ return i.authType;
139
+ }) || [];
142
140
  };
143
141
  return {
144
142
  loginSetting,
@@ -1,4 +1,4 @@
1
- import { OrgConfig, SysConfigResponse } from '@gct-paas/api/platform';
1
+ import { OrgConfig } from '@gct-paas/api/platform';
2
2
  /**
3
3
  * 组织设置 Composable 函数
4
4
  * @param isPlatform - 是否为平台模式,默认为 true
@@ -6,7 +6,7 @@ import { OrgConfig, SysConfigResponse } from '@gct-paas/api/platform';
6
6
  */
7
7
  export declare function useOrgSetting(isPlatform?: boolean): {
8
8
  orgSetting: OrgConfig;
9
- setOrgSetting: (data: SysConfigResponse) => void;
9
+ setOrgSetting: (data: IObject) => void;
10
10
  postOrgSetting: () => Promise<void>;
11
11
  relationFields: import('vue').Ref<{
12
12
  label: string;
@@ -38,19 +38,17 @@ function useOrgSetting(isPlatform = true) {
38
38
  * @param data - 系统配置响应数据
39
39
  */
40
40
  function setOrgSetting(data) {
41
- const { value } = data;
42
- if (!value) return;
41
+ if (!data || !data.id) return;
43
42
  try {
44
- const setting = JSON.parse(value);
45
- for (const key in setting) if (key == "supportLoginFields") setting["supportLoginFields"] = setting["supportLoginFields"].filter((i) => i !== "username_");
46
- Object.assign(orgSetting, setting);
43
+ for (const key in data) if (key == "supportLoginFields") data["supportLoginFields"] = data["supportLoginFields"].filter((i) => i !== "username_");
44
+ Object.assign(orgSetting, data);
47
45
  if (orgSetting.extFieldConfigs && orgSetting.extFieldConfigs.length) orgSetting.extFieldConfigs.forEach((element) => {
48
46
  relationFields.value = relationFields.value.filter((i) => {
49
47
  if (i.value == element.relationField) relationFiledsCopy.value.push(i);
50
48
  return i.value !== element.relationField;
51
49
  });
52
50
  });
53
- orgSetting.extFieldConfigs = JSON.parse(JSON.stringify(setting.extFieldConfigs));
51
+ orgSetting.extFieldConfigs = JSON.parse(JSON.stringify(data.extFieldConfigs));
54
52
  } catch (err) {
55
53
  console.warn(err);
56
54
  }
@@ -1,4 +1,4 @@
1
- import { SecurityConfig, SysConfigResponse } from '@gct-paas/api/platform';
1
+ import { SecurityConfig } from '@gct-paas/api/platform';
2
2
  /**
3
3
  * 安全设置 Composable 函数
4
4
  * @param isPlatform - 是否为平台模式,默认为 true
@@ -7,6 +7,6 @@ import { SecurityConfig, SysConfigResponse } from '@gct-paas/api/platform';
7
7
  export declare function useSecuritySetting(isPlatform?: boolean): {
8
8
  securitySetting: SecurityConfig;
9
9
  postSecuritySetting: () => Promise<void>;
10
- setSecuritySetting: (data: SysConfigResponse) => void;
10
+ setSecuritySetting: (data: IObject | undefined) => void;
11
11
  getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
12
12
  };
@@ -54,10 +54,9 @@ function useSecuritySetting(isPlatform = true) {
54
54
  * @param data - 系统配置响应数据
55
55
  */
56
56
  function setSecuritySetting(data) {
57
- const { value } = data;
58
- if (!value) return;
57
+ if (!data || !data.id) return;
59
58
  try {
60
- Object.assign(securitySetting, JSON.parse(value));
59
+ Object.assign(securitySetting, data);
61
60
  } catch (err) {
62
61
  console.warn(err);
63
62
  }
@@ -12,5 +12,5 @@ export declare function useThemeSetting(): {
12
12
  toggleMenuCollapsed: () => void;
13
13
  menuCollapsedWidth: number;
14
14
  menuWidthRange: number[];
15
- themeColors: string[];
15
+ themeColors: readonly ["#026AC8", "#0DAA9C"];
16
16
  };
@@ -1,4 +1,4 @@
1
- import { MENU_WIDTH_RANGE, THEME_COLORS } from "./constants/theme.const.mjs";
1
+ import { MENU_WIDTH_RANGE, THEME_COLORS, THEME_COLOR_CLASS, THEME_COLOR_CLASS_MAP } from "./constants/theme.const.mjs";
2
2
  import { reactive, ref, watch } from "vue";
3
3
  //#region src/modules/platform-config/useThemeSetting.ts
4
4
  /**
@@ -30,20 +30,48 @@ var menuCollapsedWidth = 46;
30
30
  var menuWidthRange = MENU_WIDTH_RANGE;
31
31
  /** 可选的主题颜色列表 */
32
32
  var themeColors = THEME_COLORS;
33
+ function setThemeMode(mode) {
34
+ if (mode === "colorWeak") {
35
+ document.body.classList.add("color-weak");
36
+ document.body.classList.remove("gray-mode");
37
+ return;
38
+ }
39
+ if (mode === "gray") {
40
+ document.body.classList.add("gray-mode");
41
+ document.body.classList.remove("color-weak");
42
+ return;
43
+ }
44
+ document.body.classList.remove("gray-mode");
45
+ document.body.classList.remove("color-weak");
46
+ }
33
47
  /**
34
48
  * 切换颜色模式
35
49
  * 根据当前颜色模式更新界面显示效果
36
50
  */
37
51
  var toggleColorMode = () => {
38
52
  switch (themeSetting.colorMode) {
39
- case "colorWeak": break;
40
- case "gray": break;
41
- default:
53
+ case "colorWeak":
54
+ setThemeMode("colorWeak");
55
+ break;
56
+ case "gray":
57
+ setThemeMode("gray");
58
+ break;
59
+ default: setThemeMode();
42
60
  }
43
61
  };
44
62
  watch(() => themeSetting.colorMode, (value) => {
45
63
  if (value) toggleColorMode();
46
64
  });
65
+ function applyThemeColorClass(color) {
66
+ const normalized = color.toUpperCase();
67
+ const el = document.documentElement;
68
+ el.classList.remove(THEME_COLOR_CLASS);
69
+ const themeClass = THEME_COLOR_CLASS_MAP[normalized];
70
+ if (themeClass) el.classList.add(themeClass);
71
+ }
72
+ watch(() => themeSetting.themeColor, (value) => {
73
+ if (value) applyThemeColorClass(value);
74
+ }, { immediate: true });
47
75
  /**
48
76
  * 主题设置 Composable 函数
49
77
  * @returns 返回主题设置相关的响应式数据和方法
@@ -1,4 +1,7 @@
1
- import { SysConfigResponse } from '@gct-paas/api/platform';
1
+ /**
2
+ * 水印设置 Composable
3
+ * 用于管理平台的水印配置
4
+ */
2
5
  /**
3
6
  * 水印设置 Composable 函数
4
7
  * @returns 返回水印设置相关的响应式数据和方法
@@ -17,5 +20,5 @@ export declare function useWatermarkSetting(): {
17
20
  height: number;
18
21
  };
19
22
  postWatermarkSetting: () => Promise<void>;
20
- setWatermarkSetting: (data: SysConfigResponse) => void;
23
+ setWatermarkSetting: (data: IObject | undefined) => void;
21
24
  };
@@ -22,10 +22,9 @@ function useWatermarkSetting() {
22
22
  * @param data - 系统配置响应数据
23
23
  */
24
24
  function setWatermarkSetting(data) {
25
- const { value } = data;
26
- if (!value) return;
25
+ if (!data || !data.id) return;
27
26
  try {
28
- Object.assign(watermarkSetting, JSON.parse(value));
27
+ Object.assign(watermarkSetting, data);
29
28
  } catch (err) {
30
29
  console.warn(err);
31
30
  }
@@ -0,0 +1 @@
1
+ export * from './sign-log';
@@ -0,0 +1 @@
1
+ import "./sign-log.mjs";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 注册登录/切换日志。
3
+ *
4
+ * @param type 切入平台(如 WORKTABLE、APPFRONT、ENTERPRISE)
5
+ * @param appId 切入应用 ID
6
+ * @param tenantId 切入租户 ID
7
+ *
8
+ * 流程:读取上下文 → 计算切换标志 → 上报 → 清理 signWay → 更新 session
9
+ */
10
+ export declare function signLogRegister(type: string, appId: string, tenantId: string): Promise<void>;
@@ -0,0 +1,109 @@
1
+ import { getBrowserFingerprint, getPageIdentification } from "../../utils/deviceFingerprint.mjs";
2
+ import "../../utils/index.mjs";
3
+ import { LoginTypeEnum } from "../platform-config/enums/login.enum.mjs";
4
+ import "../platform-config/index.mjs";
5
+ //#region src/modules/sign-log/sign-log.ts
6
+ /** 读取并解析上一次记录的平台上下文 */
7
+ function getPlatOrAppSession() {
8
+ const raw = sessionStorage.getItem("currentPlatOrAppId");
9
+ return {
10
+ hasSession: !!raw,
11
+ prev: raw ? JSON.parse(raw) : {}
12
+ };
13
+ }
14
+ /**
15
+ * 判定是否为租户切换。
16
+ * 例:在工作台从租户 A 切到租户 B → changeTenant=true
17
+ */
18
+ function isChangeTenant(tenantId, hasSession, prev) {
19
+ return !!(tenantId && hasSession && prev.tenantId && tenantId !== prev.tenantId);
20
+ }
21
+ /**
22
+ * 判定是否为应用切换(同平台内 appId 变化)。
23
+ *
24
+ * - samePlatformAppSwitch:通用场景,要求前后都有 appId 且平台类型不变
25
+ * - appFrontAppSwitch:APPFRONT 特例,允许 prev.appId 为空(首次进入某应用后再切换)
26
+ */
27
+ function isChangeApp(type, appId, hasSession, prev) {
28
+ const samePlatformAppSwitch = !!(appId && hasSession && prev.appId && type === prev.type && appId !== prev.appId);
29
+ const appFrontAppSwitch = !!(hasSession && type === prev.type && appId !== prev.appId && type === "APPFRONT");
30
+ return samePlatformAppSwitch || appFrontAppSwitch;
31
+ }
32
+ /**
33
+ * 判定是否为平台切换。
34
+ *
35
+ * 满足以下任一即视为平台上下文变化:
36
+ * - platformTypeChanged:平台类型变化(如 ENTERPRISE → APPFRONT)
37
+ * - firstPlatformEntry:无历史 session 的首次进入
38
+ * - sameNonAppFrontReentry:同类型重入,但非 APPFRONT(APPFRONT 内切换应用不算平台切换)
39
+ *
40
+ * 以下情况排除,避免与登录 / 租户切换混淆:
41
+ * - loginWithSignWay:首次登录选租户(session 无 tenant 但有 signWay),应记为登录而非平台切换
42
+ * - isChangeTenant:纯租户切换不算平台切换
43
+ *
44
+ * 额外分支 nonAppFrontColdStart:
45
+ * 非 APPFRONT 且无 session 的冷启动记为平台切换,
46
+ * 但 WORKTABLE 且无 tenantId 除外(无租户直接进企业管理后台的场景)
47
+ */
48
+ function isChangePlatform(type, tenantId, signWay, hasSession, prev) {
49
+ const loginWithSignWay = !(hasSession && !!prev.tenantId) && !!tenantId && !!signWay;
50
+ const platformTypeChanged = !!(type && hasSession && prev.type && type !== prev.type);
51
+ const firstPlatformEntry = !!(type && !hasSession);
52
+ const sameNonAppFrontReentry = !!(hasSession && type === prev.type && type !== "APPFRONT");
53
+ return (platformTypeChanged || firstPlatformEntry || sameNonAppFrontReentry) && !loginWithSignWay && !isChangeTenant(tenantId, hasSession, prev) || type !== "APPFRONT" && !hasSession && !(type === "WORKTABLE" && !tenantId);
54
+ }
55
+ /**
56
+ * 判定本次上报是否附带 signWay(登录方式)。
57
+ *
58
+ * - isNormalLogin:常规首次登录,session 无租户且非「WORKTABLE 无 tenantId」,
59
+ * APPFRONT 需有 appId,其他平台直接附带
60
+ * - isMicrosoftLogin:Microsoft 登录在选租户后仍需附带 signWay(OAuth 回调时 tenant 尚未确定)
61
+ *
62
+ * 附带后会在 postSignLog 完成后清除 sessionStorage 中的 signWay,避免后续切换误用
63
+ */
64
+ function shouldAttachSignWay(type, appId, tenantId, signWay, hasSession, prev) {
65
+ const hasPrevTenant = hasSession && !!prev.tenantId;
66
+ const isMicrosoftLogin = signWay === `${LoginTypeEnum.MICROSOFT}_LOGIN` && !!tenantId;
67
+ return !hasPrevTenant && !(type === "WORKTABLE" && !tenantId) && !!signWay && (type === "APPFRONT" && !!appId || type !== "APPFRONT") || isMicrosoftLogin;
68
+ }
69
+ /**
70
+ * 注册登录/切换日志。
71
+ *
72
+ * @param type 切入平台(如 WORKTABLE、APPFRONT、ENTERPRISE)
73
+ * @param appId 切入应用 ID
74
+ * @param tenantId 切入租户 ID
75
+ *
76
+ * 流程:读取上下文 → 计算切换标志 → 上报 → 清理 signWay → 更新 session
77
+ */
78
+ async function signLogRegister(type, appId, tenantId) {
79
+ const signWay = sessionStorage.getItem("signWay");
80
+ const { hasSession, prev } = getPlatOrAppSession();
81
+ const fingerprint = await getBrowserFingerprint();
82
+ const env = _gct.env.getEnv();
83
+ const attachSignWay = shouldAttachSignWay(type, appId, tenantId, signWay, hasSession, prev);
84
+ const data = {
85
+ appId,
86
+ appIdOut: hasSession ? prev.appId ?? "" : "",
87
+ changeApp: isChangeApp(type, appId, hasSession, prev),
88
+ changePlatform: isChangePlatform(type, tenantId, signWay, hasSession, prev),
89
+ changeTenant: isChangeTenant(tenantId, hasSession, prev),
90
+ signWay: attachSignWay ? signWay : "",
91
+ platformIn: type,
92
+ platformOut: hasSession ? prev.type ?? "" : "",
93
+ env,
94
+ tenantIn: tenantId,
95
+ tenantOut: hasSession ? prev.tenantId ?? "" : ""
96
+ };
97
+ await _api.platform.signLog.post(data, { headers: {
98
+ pagetag: getPageIdentification(),
99
+ browser: fingerprint
100
+ } });
101
+ if (attachSignWay) sessionStorage.removeItem("signWay");
102
+ sessionStorage.setItem("currentPlatOrAppId", JSON.stringify({
103
+ appId,
104
+ type,
105
+ tenantId
106
+ }));
107
+ }
108
+ //#endregion
109
+ export { signLogRegister };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * sessionStorage `currentPlatOrAppId` 的结构。
3
+ * 记录用户当前所在的平台 / 应用 / 租户,作为下次切换时的「切出」基准。
4
+ */
5
+ export interface PlatOrAppSession {
6
+ appId?: string;
7
+ type?: string;
8
+ tenantId?: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ export type * from './system-mqtt.interface';
2
+ export { SystemMqttService } from './system-mqtt.service';
@@ -0,0 +1 @@
1
+ import "./system-mqtt.service.mjs";
@@ -0,0 +1,71 @@
1
+ /**
2
+ * MQTT 订阅消息回调函数类型
3
+ */
4
+ export type MqttSubCallback<T> = (payload?: T) => void | Promise<void>;
5
+ /**
6
+ * 登出消息
7
+ *
8
+ * @export
9
+ * @interface IKickOutPayload
10
+ */
11
+ export interface IKickOutPayload {
12
+ /**
13
+ * 用户 token
14
+ *
15
+ * @type {string}
16
+ * @memberof IKickOutPayload
17
+ */
18
+ token: string;
19
+ }
20
+ /**
21
+ * 未读消息变化
22
+ *
23
+ * @export
24
+ * @interface IInternalMessagePayload
25
+ */
26
+ export interface IInternalMessagePayload {
27
+ /**
28
+ * 全局未读消息数量
29
+ *
30
+ * @type {number}
31
+ */
32
+ totalUnreadCount: number;
33
+ /**
34
+ * 应用未读消息数量
35
+ *
36
+ * @type {{
37
+ * appId: string;
38
+ * unreadCount: number;
39
+ * }}
40
+ */
41
+ appMessageCount: {
42
+ appId: string;
43
+ unreadCount: number;
44
+ };
45
+ }
46
+ /**
47
+ * 待办消息数量变化
48
+ *
49
+ * @export
50
+ * @interface IToDoMessagePayload
51
+ */
52
+ export interface IToDoMessagePayload {
53
+ /**
54
+ * 待办消息数量
55
+ *
56
+ * @type {number}
57
+ */
58
+ Count: number;
59
+ /**
60
+ * 应用待办消息数量
61
+ *
62
+ * @type {{
63
+ * appId: string;
64
+ * count: number;
65
+ * }}
66
+ */
67
+ appMessageCount: {
68
+ appId: string;
69
+ count: number;
70
+ };
71
+ }