@gct-paas/core 0.1.6-dev.3 → 0.1.6-dev.31

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 (138) hide show
  1. package/dist/index.esm.min.js +2 -1
  2. package/dist/{redirect-index-Ck5Ddtcb.js → redirect-index-D9Ri11Xk.js} +1 -0
  3. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/es/constants/core.d.ts +1 -0
  5. package/es/constants/core.mjs +27 -1
  6. package/es/constants/expression-type/modeCfg.mjs +6 -0
  7. package/es/constants/index.d.ts +5 -1
  8. package/es/constants/index.mjs +5 -1
  9. package/es/create-app-vue.d.ts +1 -1
  10. package/es/create-app-vue.mjs +1 -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 +29 -0
  22. package/es/enums/globalEnum.mjs +31 -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/panel.d.ts +1 -2
  28. package/es/enums/page-designer/panel.mjs +0 -1
  29. package/es/enums/pageEnum.d.ts +2 -1
  30. package/es/enums/pageEnum.mjs +1 -0
  31. package/es/enums/process.d.ts +5 -0
  32. package/es/enums/process.mjs +9 -0
  33. package/es/enums/sizeEnum.d.ts +4 -0
  34. package/es/enums/sizeEnum.mjs +6 -1
  35. package/es/global/gct/gct.d.ts +25 -19
  36. package/es/global/gct/gct.mjs +10 -5
  37. package/es/hooks/index.d.ts +2 -0
  38. package/es/hooks/index.mjs +2 -0
  39. package/es/hooks/useDebouncePromise.d.ts +14 -0
  40. package/es/hooks/useDebouncePromise.mjs +56 -0
  41. package/es/hooks/useObserver.d.ts +13 -0
  42. package/es/hooks/useObserver.mjs +46 -0
  43. package/es/index.d.ts +1 -0
  44. package/es/index.mjs +54 -34
  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 -0
  47. package/es/interface/i-dictionary/i-dictionary-item.d.ts +80 -0
  48. package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -2
  49. package/es/interface/i-pinia-action/i-global-actions.d.ts +9 -0
  50. package/es/interface/i-pinia-getter/i-global-getters.d.ts +22 -1
  51. package/es/interface/i-pinia-state/i-global-state.d.ts +9 -2
  52. package/es/interface/index.d.ts +2 -1
  53. package/es/interface/open-util/i-confirm-util/i-confirm-util.d.ts +65 -0
  54. package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
  55. package/es/interface/open-util/i-modal/i-modal.d.ts +14 -1
  56. package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
  57. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
  58. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
  59. package/es/interface/open-util/index.d.ts +2 -0
  60. package/es/locale/auto-register.d.ts +2 -0
  61. package/es/locale/auto-register.mjs +13 -0
  62. package/es/locale/index.d.ts +17 -1
  63. package/es/locale/index.mjs +34 -0
  64. package/es/locale/sys/model.mjs +9 -0
  65. package/es/locale/sys.d.ts +17 -0
  66. package/es/locale/sys.mjs +26 -0
  67. package/es/modules/env-manager/env-manager.const.d.ts +2 -0
  68. package/es/modules/env-manager/env-manager.const.mjs +4 -2
  69. package/es/modules/env-manager/env-manager.d.ts +8 -13
  70. package/es/modules/env-manager/env-manager.interface.d.ts +6 -8
  71. package/es/modules/env-manager/env-manager.interface.mjs +2 -0
  72. package/es/modules/env-manager/env-manager.mjs +20 -26
  73. package/es/modules/env-manager/env-manager.util.d.ts +5 -0
  74. package/es/modules/env-manager/env-manager.util.mjs +11 -0
  75. package/es/modules/env-manager/index.d.ts +1 -0
  76. package/es/modules/env-manager/index.mjs +4 -0
  77. package/es/modules/mqtt/interfaces/i-mqtt.d.ts +6 -2
  78. package/es/modules/mqtt/mqtt-client.d.ts +7 -7
  79. package/es/modules/mqtt/mqtt-client.mjs +20 -19
  80. package/es/modules/platform-config/constants/theme.const.d.ts +9 -1
  81. package/es/modules/platform-config/constants/theme.const.mjs +13 -2
  82. package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
  83. package/es/modules/platform-config/enums/login.enum.mjs +2 -0
  84. package/es/modules/platform-config/store.d.ts +18 -18
  85. package/es/modules/platform-config/useDeploySetting.d.ts +1 -2
  86. package/es/modules/platform-config/useDeploySetting.mjs +6 -3
  87. package/es/modules/platform-config/useLoginSetting.d.ts +2 -2
  88. package/es/modules/platform-config/useLoginSetting.mjs +29 -31
  89. package/es/modules/platform-config/useOrgSetting.d.ts +2 -2
  90. package/es/modules/platform-config/useOrgSetting.mjs +4 -6
  91. package/es/modules/platform-config/useSecuritySetting.d.ts +2 -2
  92. package/es/modules/platform-config/useSecuritySetting.mjs +2 -3
  93. package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
  94. package/es/modules/platform-config/useThemeSetting.mjs +32 -4
  95. package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
  96. package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
  97. package/es/modules/system-mqtt/index.d.ts +3 -0
  98. package/es/modules/system-mqtt/index.mjs +2 -0
  99. package/es/modules/system-mqtt/system-mqtt.const.d.ts +1 -0
  100. package/es/modules/system-mqtt/system-mqtt.const.mjs +13 -0
  101. package/es/modules/system-mqtt/system-mqtt.interface.d.ts +71 -0
  102. package/es/modules/system-mqtt/system-mqtt.service.d.ts +104 -0
  103. package/es/modules/system-mqtt/system-mqtt.service.mjs +198 -0
  104. package/es/modules/user-stores/store/permission.store.d.ts +1 -0
  105. package/es/modules/user-stores/store/permission.store.mjs +10 -0
  106. package/es/modules/user-stores/store/tenant.store.d.ts +3 -5
  107. package/es/modules/user-stores/store/tenant.store.mjs +10 -12
  108. package/es/modules/user-stores/store/user.store.mjs +7 -5
  109. package/es/router/guard/index.d.ts +4 -0
  110. package/es/router/guard/index.mjs +41 -0
  111. package/es/router/index.mjs +2 -0
  112. package/es/setup-app.mjs +2 -9
  113. package/es/state/global-pinia-state/global-pinia-state.d.ts +6 -0
  114. package/es/state/global-pinia-state/global-pinia-state.mjs +6 -0
  115. package/es/store/global-store.mjs +18 -4
  116. package/es/store/index.d.ts +1 -1
  117. package/es/store/session-store.d.ts +1 -0
  118. package/es/store/session-store.mjs +2 -1
  119. package/es/types/index.d.ts +13 -0
  120. package/es/utils/auth-util/auth-util.d.ts +37 -0
  121. package/es/utils/auth-util/auth-util.mjs +79 -0
  122. package/es/utils/axios/check-status.d.ts +1 -0
  123. package/es/utils/axios/check-status.mjs +64 -0
  124. package/es/utils/axios/interceptors.mjs +30 -0
  125. package/es/utils/deviceFingerprint.mjs +5 -1
  126. package/es/utils/i18n/index.mjs +1 -0
  127. package/es/utils/index.d.ts +4 -2
  128. package/es/utils/index.mjs +3 -1
  129. package/es/utils/namespace/namespace.mjs +1 -0
  130. package/es/utils/openUtil/modal/modal.d.ts +1 -1
  131. package/es/utils/openUtil/modal/modal.mjs +1 -1
  132. package/es/utils/openUtil/overlay-container/overlay-container.d.ts +1 -1
  133. package/es/utils/openUtil/overlay-container/overlay-container.mjs +28 -23
  134. package/es/utils/select-user-utils.d.ts +50 -0
  135. package/es/utils/select-user-utils.mjs +129 -0
  136. package/es/utils/tools/tools.d.ts +10 -2
  137. package/es/utils/tools/tools.mjs +31 -7
  138. 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,3 @@
1
+ export * from './system-mqtt.const';
2
+ export type * from './system-mqtt.interface';
3
+ export { SystemMqttService } from './system-mqtt.service';
@@ -0,0 +1,2 @@
1
+ import "./system-mqtt.const.mjs";
2
+ import "./system-mqtt.service.mjs";
@@ -0,0 +1 @@
1
+ export declare const ProjectNameType: Record<string, string>;
@@ -0,0 +1,13 @@
1
+ import { ProjectName } from "../../enums/appEnum.mjs";
2
+ import "../../enums/index.mjs";
3
+ //#region src/modules/system-mqtt/system-mqtt.const.ts
4
+ var ProjectNameType = {
5
+ [ProjectName.PORTAL]: "WORKTABLE",
6
+ [ProjectName.BACKEND_MANAGEMENT]: "ENTERPRISE",
7
+ [ProjectName.DEVELOPER_CENTER]: "DEVELOPER",
8
+ [ProjectName.TENANT_CENTER]: "TENANT",
9
+ [ProjectName.APP_DESIGNER]: "APPDESIGN",
10
+ [ProjectName.WEB_RENDER]: "APPFRONT"
11
+ };
12
+ //#endregion
13
+ export { ProjectNameType };
@@ -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
+ }
@@ -0,0 +1,104 @@
1
+ import { MqttCancelSub, IMqttClient } from '../mqtt';
2
+ import { IInternalMessagePayload, IKickOutPayload, IToDoMessagePayload, MqttSubCallback } from './system-mqtt.interface';
3
+ /**
4
+ * 系统级 MQTT 业务
5
+ *
6
+ * @export
7
+ * @class SystemMqttService
8
+ */
9
+ export declare class SystemMqttService {
10
+ private static isInitialized;
11
+ protected static client: IMqttClient | undefined;
12
+ protected static fingerprint: string | undefined;
13
+ protected static readonly LOGOUT_CLIENT_TAG = "USER_LOGOUT";
14
+ /**
15
+ * 用户登出消息 topic
16
+ *
17
+ * @static
18
+ */
19
+ static readonly USER_LOGOUT_TOPIC = "users/logout/msg";
20
+ /**
21
+ * 踢出用户消息 topic
22
+ *
23
+ * @readonly
24
+ * @static
25
+ * @type {string}
26
+ */
27
+ static get KICK_OUT_TOPIC(): string;
28
+ /**
29
+ * 未读消息变化 topic
30
+ *
31
+ * @readonly
32
+ * @static
33
+ * @type {string}
34
+ */
35
+ static get INTERNAL_MESSAGE_TOPIC(): string;
36
+ /**
37
+ * 待办消息数量 topic
38
+ *
39
+ * @readonly
40
+ * @static
41
+ * @type {string}
42
+ */
43
+ static get TASK_TODO_COUNT_TOPIC(): string;
44
+ /**
45
+ * 强制刷新并清空缓存 topic
46
+ *
47
+ * @static
48
+ */
49
+ static readonly CLEAN_CACHE_TOPIC = "CLEAN_CACHE";
50
+ /**
51
+ * 初始化系统级 MQTT 客户端,需要在用户信息以及应用信息加载完成后调用
52
+ *
53
+ * @static
54
+ * @return {*} {Promise<void>}
55
+ */
56
+ static init(): Promise<void>;
57
+ protected static createMqtt(): Promise<void>;
58
+ protected static subs(): void;
59
+ /**
60
+ * 订阅系统级 MQTT 消息
61
+ *
62
+ * @static
63
+ * @param {string} topic
64
+ */
65
+ protected static subscribe<T = IObject>(topic: string, callback: MqttSubCallback<T>): MqttCancelSub;
66
+ /**
67
+ * 订阅用户被踢出消息
68
+ *
69
+ * @static
70
+ * @param {MqttSubCallback<IKickOutPayload>} callback
71
+ * @return {*} {MqttCancelSub}
72
+ */
73
+ protected static subKickOut(callback?: MqttSubCallback<IKickOutPayload>): MqttCancelSub;
74
+ /**
75
+ * 订阅未读消息变化
76
+ *
77
+ * @static
78
+ * @param {MqttSubCallback<IInternalMessagePayload>} callback
79
+ * @return {*} {MqttCancelSub}
80
+ */
81
+ static subInternalMessage(callback: MqttSubCallback<IInternalMessagePayload>): MqttCancelSub;
82
+ /**
83
+ * 订阅待办消息数量变化
84
+ *
85
+ * @static
86
+ * @param {MqttSubCallback<IToDoMessagePayload>} callback
87
+ * @return {*} {MqttCancelSub}
88
+ */
89
+ static subTaskTodoCount(callback: MqttSubCallback<IToDoMessagePayload>): MqttCancelSub;
90
+ /**
91
+ * 强制用户界面刷新
92
+ *
93
+ * @static
94
+ * @param {MqttSubCallback<void>} callback
95
+ * @return {*} {MqttCancelSub}
96
+ */
97
+ static subCleanCache(): MqttCancelSub;
98
+ /**
99
+ * 发送用户登出消息
100
+ *
101
+ * @static
102
+ */
103
+ static pubLogout(): void;
104
+ }