@gct-paas/core 0.1.5-test.1 → 0.1.6-dev.0

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 (61) 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/index.mjs +13 -6
  8. package/es/interface/i-popover-options/i-popover-options.d.ts +98 -0
  9. package/es/interface/index.d.ts +2 -1
  10. package/es/interface/index.mjs +1 -0
  11. package/es/interface/model-designer/entity.d.ts +87 -79
  12. package/es/interface/model-designer/serial.d.ts +22 -0
  13. package/es/interface/model-designer/serial.mjs +49 -0
  14. package/es/interface/open-util/i-app-full-screen-container-options/i-app-full-screen-container-options.d.ts +26 -0
  15. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +52 -0
  16. package/es/interface/open-util/i-overlay-popover-container/i-overlay-popover-container.d.ts +21 -0
  17. package/es/interface/open-util/index.d.ts +3 -1
  18. package/es/locale/index.d.ts +23 -0
  19. package/es/locale/index.mjs +38 -1
  20. package/es/locale/sys/model.d.ts +5 -0
  21. package/es/locale/sys.d.ts +5 -0
  22. package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +1 -0
  23. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +2 -1
  24. package/es/modules/mqtt/mqtt-manager.d.ts +1 -1
  25. package/es/modules/mqtt/mqtt-manager.mjs +2 -1
  26. package/es/modules/platform-config/store.mjs +0 -1
  27. package/es/modules/user-stores/store/user.store.d.ts +11 -2
  28. package/es/modules/user-stores/store/user.store.mjs +15 -4
  29. package/es/router/index.mjs +2 -2
  30. package/es/setup-app.mjs +6 -3
  31. package/es/store/index.d.ts +1 -0
  32. package/es/store/index.mjs +1 -0
  33. package/es/store/session-store.d.ts +7 -0
  34. package/es/store/session-store.mjs +7 -0
  35. package/es/store/storage-store.d.ts +2 -0
  36. package/es/store/storage-store.mjs +3 -2
  37. package/es/types/index.d.ts +0 -1
  38. package/es/utils/data-prems/const.d.ts +26 -0
  39. package/es/utils/data-prems/const.mjs +79 -0
  40. package/es/utils/i18n/index.mjs +3 -0
  41. package/es/utils/index.d.ts +3 -0
  42. package/es/utils/index.mjs +4 -0
  43. package/es/utils/kit-pkg-util/kit-pkg-util.mjs +6 -2
  44. package/es/utils/openUtil/index.d.ts +1 -0
  45. package/es/utils/openUtil/index.mjs +1 -0
  46. package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.d.ts +15 -0
  47. package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +19 -0
  48. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +1 -1
  49. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +1 -1
  50. package/es/utils/script-loader/script-loader.d.ts +62 -0
  51. package/es/utils/script-loader/script-loader.mjs +92 -0
  52. package/es/utils/style/index.d.ts +8 -0
  53. package/es/utils/style/index.mjs +67 -1
  54. package/es/utils/text-measure/text-measure.d.ts +141 -0
  55. package/es/utils/text-measure/text-measure.mjs +191 -0
  56. package/es/utils/tools/tools.d.ts +1 -1
  57. package/es/utils/uploader/uploader.mjs +3 -5
  58. package/es/utils/util.d.ts +1 -0
  59. package/es/utils/util.mjs +9 -1
  60. package/package.json +4 -3
  61. package/es/interface/i-import-style-map/i-import-style-map.d.ts +0 -15
@@ -1,6 +1,11 @@
1
+ import { ComputePositionConfig } from '@floating-ui/dom';
1
2
  import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
2
3
  import { IModalOptions } from '../i-modal-options/i-modal-options';
3
4
  import { IModalData } from '../i-modal-data/i-modal-data';
5
+ import { IPopoverOptions } from '../../i-popover-options/i-popover-options';
6
+ import { IOverlayPopoverContainer } from '../i-overlay-popover-container/i-overlay-popover-container';
7
+ import { IAppFullScreenContainerOptions } from '../i-app-full-screen-container-options/i-app-full-screen-container-options';
8
+ export type FloatingUIConfig = Partial<ComputePositionConfig>;
4
9
  /**
5
10
  * 全局呈现容器控制器
6
11
  *
@@ -33,4 +38,51 @@ export interface IOverlayController {
33
38
  * @return {*} {IOverlayContainer}
34
39
  */
35
40
  createModal(component: unknown, props?: IParams, opts?: IModalOptions): IOverlayContainer;
41
+ /**
42
+ * 飘窗打开组件
43
+ *
44
+ * @author zhanghanrui
45
+ * @date 2024-04-08 09:04:23
46
+ * @template T
47
+ * @param {HTMLElement} element 飘窗目标元素
48
+ * @param {unknown} component
49
+ * @param {IParams} [props]
50
+ * @param {IPopoverOptions<FloatingUIConfig>} [opts]
51
+ * @return {*} {Promise<T>}
52
+ */
53
+ popover<T = void>(element: HTMLElement, component: unknown, props?: IParams, opts?: IPopoverOptions<FloatingUIConfig>): Promise<T>;
54
+ /**
55
+ * 创建全局飘窗容器
56
+ *
57
+ * @author zhanghanrui
58
+ * @date 2024-04-08 09:04:58
59
+ * @param {unknown} component
60
+ * @param {IParams} [props]
61
+ * @param {IPopoverOptions<FloatingUIConfig>} [opts]
62
+ * @return {*} {IOverlayPopoverContainer}
63
+ */
64
+ createPopover(component: unknown, props?: IParams, opts?: IPopoverOptions<FloatingUIConfig>): IOverlayPopoverContainer;
65
+ /**
66
+ * 全屏容器打开组件
67
+ *
68
+ * @author zhanghanrui
69
+ * @date 2024-07-04 15:07:29
70
+ * @template T
71
+ * @param {unknown} component
72
+ * @param {IParams} [props]
73
+ * @param {IAppFullScreenContainerOptions} [opts]
74
+ * @return {*} {Promise<T>}
75
+ */
76
+ fullScreen<T = void>(component: unknown, props?: IParams, opts?: IAppFullScreenContainerOptions): Promise<T>;
77
+ /**
78
+ * 创建全局全屏容器
79
+ *
80
+ * @author zhanghanrui
81
+ * @date 2024-07-04 15:07:02
82
+ * @param {unknown} component
83
+ * @param {IParams} [props]
84
+ * @param {IAppFullScreenContainerOptions} [opts]
85
+ * @return {*} {IOverlayContainer}
86
+ */
87
+ createFullScreen(component: unknown, props?: IParams, opts?: IAppFullScreenContainerOptions): IOverlayContainer;
36
88
  }
@@ -0,0 +1,21 @@
1
+ import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
2
+ /**
3
+ * 飘窗容器
4
+ *
5
+ * @author chitanda
6
+ * @date 2022-11-09 14:11:39
7
+ * @export
8
+ * @interface IOverlayPopoverContainer
9
+ * @extends {IOverlayContainer}
10
+ */
11
+ export interface IOverlayPopoverContainer extends IOverlayContainer {
12
+ /**
13
+ * 展示飘窗容器
14
+ *
15
+ * @author chitanda
16
+ * @date 2022-11-09 14:11:47
17
+ * @param {HTMLElement} el
18
+ * @return {*} {Promise<void>}
19
+ */
20
+ present(el?: HTMLElement): Promise<void>;
21
+ }
@@ -1,7 +1,9 @@
1
+ export type { IAppFullScreenContainerOptions } from './i-app-full-screen-container-options/i-app-full-screen-container-options';
1
2
  export type { IMessageParams, IMessageUtil, } from './i-message-util/i-message-util';
2
3
  export type { IModal } from './i-modal/i-modal';
3
4
  export type { IModalData } from './i-modal-data/i-modal-data';
4
5
  export type { IModalOptions } from './i-modal-options/i-modal-options';
5
6
  export type { IOpenWindowOptions } from './i-open-window-options/i-open-window-options';
6
7
  export type { IOverlayContainer } from './i-overlay-container/i-overlay-container';
7
- export type { IOverlayController } from './i-overlay-controller/i-overlay-controller';
8
+ export type { FloatingUIConfig, IOverlayController, } from './i-overlay-controller/i-overlay-controller';
9
+ export type { IOverlayPopoverContainer } from './i-overlay-popover-container/i-overlay-popover-container';
@@ -2,12 +2,29 @@ import { I18n } from 'vue-i18n';
2
2
  import { App } from 'vue';
3
3
  import { I18nConfigResponse } from '@gct-paas/api/platform';
4
4
  type localeItem = Pick<I18nConfigResponse, 'id' | 'configured' | 'defaultLanguage' | 'language' | 'languageTag' | 'state'>;
5
+ type ILocaleMessages = Record<string, string>;
6
+ type ILocaleDeclarations = Record<string, ILocaleMessages>;
5
7
  export declare class LocaleUtil {
6
8
  localeList: localeItem[];
7
9
  i18n: I18n;
8
10
  get locale(): string;
9
11
  get enableLocaleList(): localeItem[];
10
12
  changeLang(lang: string): Promise<void>;
13
+ /**
14
+ * 动态增量新增多语言声明。
15
+ * 传入语言标识与文案键值映射后,会与现有语言包进行增量合并。
16
+ *
17
+ * @param {ILocaleDeclarations} declarations
18
+ */
19
+ addLocaleDeclarations(declarations: ILocaleDeclarations): void;
20
+ /**
21
+ * 动态增量新增单语言声明。
22
+ * 仅对指定语言进行文案合并,适用于按需加载场景。
23
+ *
24
+ * @param {string} locale 语言标识
25
+ * @param {ILocaleMessages} messages 文案键值映射
26
+ */
27
+ addLocaleMessages(locale: string, messages: ILocaleMessages): void;
11
28
  /**只加载应用专用i18n JSON */
12
29
  initAppJson(): Promise<void>;
13
30
  init(): Promise<void>;
@@ -24,6 +41,12 @@ export declare class LocaleUtil {
24
41
  env: 'dev' | 'test' | 'prod';
25
42
  branch?: string;
26
43
  }): string;
44
+ /**
45
+ * 设置 HTML 根元素的 lang 属性,供浏览器、辅助技术识别当前语言
46
+ *
47
+ * @param locale 语言标识,如 zh-CN、en
48
+ */
49
+ private setHtmlPageLang;
27
50
  }
28
51
  export declare function setupI18n(app: App): void;
29
52
  export {};
@@ -1,6 +1,7 @@
1
1
  import { globalRefStorage } from "../store/storage-store.mjs";
2
2
  import "../store/index.mjs";
3
3
  import { createI18n } from "vue-i18n";
4
+ import { HttpUtil } from "@gct-paas/api";
4
5
  //#region src/locale/index.ts
5
6
  var LocaleUtil = class {
6
7
  localeList = [];
@@ -23,8 +24,31 @@ var LocaleUtil = class {
23
24
  }
24
25
  async changeLang(lang) {
25
26
  globalRefStorage.value.lang = lang;
27
+ this.i18n.global.locale.value = lang;
28
+ this.setHtmlPageLang(lang);
26
29
  await this.loadI18nJson();
27
30
  }
31
+ /**
32
+ * 动态增量新增多语言声明。
33
+ * 传入语言标识与文案键值映射后,会与现有语言包进行增量合并。
34
+ *
35
+ * @param {ILocaleDeclarations} declarations
36
+ */
37
+ addLocaleDeclarations(declarations) {
38
+ Object.entries(declarations).forEach(([locale, messages]) => {
39
+ this.i18n.global.mergeLocaleMessage(locale, messages);
40
+ });
41
+ }
42
+ /**
43
+ * 动态增量新增单语言声明。
44
+ * 仅对指定语言进行文案合并,适用于按需加载场景。
45
+ *
46
+ * @param {string} locale 语言标识
47
+ * @param {ILocaleMessages} messages 文案键值映射
48
+ */
49
+ addLocaleMessages(locale, messages) {
50
+ this.addLocaleDeclarations({ [locale]: messages });
51
+ }
28
52
  /**只加载应用专用i18n JSON */
29
53
  async initAppJson() {
30
54
  const app_platformUrl = this.getMessageUrl({
@@ -64,10 +88,15 @@ var LocaleUtil = class {
64
88
  }).filter((i) => i.configured === 1 && i.state === 1);
65
89
  const defaultItem = this.localeList.find((item) => !!item.defaultLanguage);
66
90
  globalRefStorage.value.lang = (globalRefStorage.value.lang ?? defaultItem?.languageTag) || "zh-CN";
91
+ this.i18n.global.locale.value = globalRefStorage.value.lang;
92
+ this.setHtmlPageLang(globalRefStorage.value.lang);
67
93
  }
68
94
  async loadMessages(url, locale = this.locale) {
69
95
  if (!url) return;
70
- const messages = (await (await fetch(url)).text()).split("\n").reduce((acc, item) => {
96
+ const messages = (await HttpUtil.get(url, {}, {}, {}, {
97
+ headers: { "Content-Type": void 0 },
98
+ nativeData: true
99
+ })).split("\n").reduce((acc, item) => {
71
100
  const [key, ...value] = item.split(":");
72
101
  acc[key] = value.join(":");
73
102
  return acc;
@@ -81,6 +110,14 @@ var LocaleUtil = class {
81
110
  }
82
111
  return `/minio/locale-js/${payload.locale}__platform__.json`;
83
112
  }
113
+ /**
114
+ * 设置 HTML 根元素的 lang 属性,供浏览器、辅助技术识别当前语言
115
+ *
116
+ * @param locale 语言标识,如 zh-CN、en
117
+ */
118
+ setHtmlPageLang(locale) {
119
+ document.querySelector("html")?.setAttribute("lang", locale);
120
+ }
84
121
  };
85
122
  function setupI18n(app) {
86
123
  app.use(_gct.i18n);
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ modelNameError: string;
3
+ notModelNameError: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ notNull: string;
3
+ regError: string;
4
+ };
5
+ export default _default;
@@ -1,3 +1,4 @@
1
+ export declare const DEFAULT_MQTT_INSTANCE_ID = "DEFAULT_MQTT_INSTANCE_ID";
1
2
  /**
2
3
  * MQTT 连接状态枚举
3
4
  *
@@ -1,4 +1,5 @@
1
1
  //#region src/modules/mqtt/enums/mqtt-status.enum.ts
2
+ var DEFAULT_MQTT_INSTANCE_ID = "DEFAULT_MQTT_INSTANCE_ID";
2
3
  /**
3
4
  * MQTT 连接状态枚举
4
5
  *
@@ -21,4 +22,4 @@ var MqttConnectionStatus = /* @__PURE__ */ function(MqttConnectionStatus) {
21
22
  return MqttConnectionStatus;
22
23
  }({});
23
24
  //#endregion
24
- export { MqttConnectionStatus };
25
+ export { DEFAULT_MQTT_INSTANCE_ID, MqttConnectionStatus };
@@ -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
  /**
@@ -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() {
@@ -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
@@ -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,10 +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
- console.log("setupApp", token);
21
- if (token) await useUserStore().getUserInfoAction(token);
22
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
+ }
23
26
  }
24
27
  //#endregion
25
28
  export { setupApp };
@@ -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
+ };
@@ -0,0 +1,79 @@
1
+ //#region src/utils/data-prems/const.ts
2
+ /**
3
+ * 分类的模块类型
4
+ */
5
+ var CategoryModuleEnum = /* @__PURE__ */ function(CategoryModuleEnum) {
6
+ /** 在线表单 */
7
+ CategoryModuleEnum["ONLINE_FORM"] = "online_form_module";
8
+ /** eDHR */
9
+ CategoryModuleEnum["EDHR"] = "edhr_module";
10
+ /** 单据项目 */
11
+ CategoryModuleEnum["CHECK_LIST"] = "check_list_module";
12
+ /** 检验模板 */
13
+ CategoryModuleEnum["INSPECTION"] = "inspection_module";
14
+ /** 放行模板 */
15
+ CategoryModuleEnum["RELEASE"] = "release_module";
16
+ return CategoryModuleEnum;
17
+ }({});
18
+ var moduleConfig = {
19
+ [CategoryModuleEnum.ONLINE_FORM]: {
20
+ modelKey: "em_form_category",
21
+ bsKeyList: {
22
+ list: "biz_tree",
23
+ tmpls: "biz_get_form_tmpls"
24
+ }
25
+ },
26
+ [CategoryModuleEnum.EDHR]: {
27
+ modelKey: "em_edhr_category",
28
+ bsKeyList: {
29
+ list: "biz_tree",
30
+ tmpls: "biz_get_edhr_tmpls",
31
+ querylist: "biz_list_edhr_tmpls"
32
+ }
33
+ },
34
+ [CategoryModuleEnum.INSPECTION]: {
35
+ modelKey: "em_inspection_category",
36
+ bsKeyList: {
37
+ list: "biz_tree",
38
+ tmpls: "biz_get_edhr_tmpls",
39
+ querylist: "biz_list_edhr_tmpls"
40
+ }
41
+ },
42
+ [CategoryModuleEnum.RELEASE]: {
43
+ modelKey: "em_product_release_category",
44
+ bsKeyList: {
45
+ list: "biz_tree",
46
+ tmpls: "biz_get_edhr_tmpls",
47
+ querylist: "biz_list_edhr_tmpls"
48
+ }
49
+ }
50
+ };
51
+ var getInterfaceApi = {
52
+ getCategoryList: ({ moduleType }) => {
53
+ if (moduleType === CategoryModuleEnum.CHECK_LIST) return _api.apaas.formRelate.getCategory({ moduleType });
54
+ const { modelKey, bsKeyList } = moduleConfig[moduleType] || {};
55
+ return _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({
56
+ modelCategory: "entity",
57
+ modelKey,
58
+ bsKey: bsKeyList.list
59
+ }, {}, {});
60
+ },
61
+ getTmplsList: (params, config) => {
62
+ if (params.moduleType === CategoryModuleEnum.CHECK_LIST) throw new Error("该模块不支持模板列表接口");
63
+ const { isQuery, ...otherParams } = params || {};
64
+ const { moduleType } = otherParams || {};
65
+ const { modelKey, bsKeyList } = moduleConfig[moduleType] || {};
66
+ const operatingState = Object.hasOwnProperty.call(otherParams, "operatingState") ? otherParams.operatingState : true;
67
+ const bsKey = isQuery ? bsKeyList?.querylist || bsKeyList?.tmpls : bsKeyList?.tmpls;
68
+ return _api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({
69
+ modelCategory: "entity",
70
+ modelKey,
71
+ bsKey: bsKey || ""
72
+ }, {
73
+ ...otherParams,
74
+ operatingState
75
+ }, config);
76
+ }
77
+ };
78
+ //#endregion
79
+ export { CategoryModuleEnum, getInterfaceApi };
@@ -10,6 +10,9 @@
10
10
  * @returns {*} {string}
11
11
  */
12
12
  var t = (...args) => {
13
+ if (!args || args.length === 0) return "";
14
+ const key = args[0];
15
+ if (!key || typeof key !== "string" || key.trim() === "") return "";
13
16
  return _gct.i18n.global.t(...args);
14
17
  };
15
18
  //#endregion
@@ -29,5 +29,8 @@ export * from './file/download';
29
29
  export * from './file/base64Conver';
30
30
  export * from './file/parser';
31
31
  export * from './design/design';
32
+ export * from './text-measure/text-measure';
33
+ export { scriptLoader, type IScriptOptions, } from './script-loader/script-loader';
32
34
  export { permission } from './permission';
33
35
  export { getVueComponentByCode } from './vue-component-code';
36
+ export * from './data-prems/const';
@@ -11,6 +11,7 @@ import "./model-loader/model-loader.mjs";
11
11
  import "./namespace/namespace.mjs";
12
12
  import "./openUtil/modal/modal.mjs";
13
13
  import "./openUtil/overlay-container/overlay-container.mjs";
14
+ import "./openUtil/overlay-popover-container/overlay-popover-container.mjs";
14
15
  import "./openUtil/index.mjs";
15
16
  import "./kit-pkg-util/kit-pkg-util.mjs";
16
17
  import "./plugin-pkg-util/plugin-pkg-util.mjs";
@@ -31,5 +32,8 @@ import "./file/base64Conver.mjs";
31
32
  import "./file/download.mjs";
32
33
  import "./file/parser.mjs";
33
34
  import "./design/design.mjs";
35
+ import "./text-measure/text-measure.mjs";
36
+ import "./script-loader/script-loader.mjs";
34
37
  import "./permission.mjs";
35
38
  import "./vue-component-code.mjs";
39
+ import "./data-prems/const.mjs";
@@ -26,13 +26,17 @@ var KitPkgUtil = class {
26
26
  * @return {*} {(Promise<IPluginKitModule | null>)}
27
27
  */
28
28
  static async loadKit(kit, mode) {
29
- const loaderUrl = this.joinPaths(this.KIT_PKG_BASE_PATH, kit, mode, `loader.esm.min.js`);
29
+ if (!kit) {
30
+ console.error("Kit name is required to load a kit package");
31
+ return null;
32
+ }
33
+ const loaderUrl = this.joinPaths(this.KIT_PKG_BASE_PATH, kit, mode, "loader.esm.min.js");
30
34
  try {
31
35
  const module = await import(
32
36
  /* @vite-ignore */
33
37
  loaderUrl
34
38
  );
35
- if (module && module.default) return module.default;
39
+ if (module) return module;
36
40
  else console.warn(`Kit ${kit} does not export a default function`);
37
41
  } catch (error) {
38
42
  console.error(`Error loading kit ${kit} from ${loaderUrl}:`, error);
@@ -1,2 +1,3 @@
1
1
  export { Modal } from './modal/modal';
2
2
  export { OverlayContainer } from './overlay-container/overlay-container';
3
+ export { OverlayPopoverContainer } from './overlay-popover-container/overlay-popover-container';
@@ -1,2 +1,3 @@
1
1
  import "./modal/modal.mjs";
2
2
  import "./overlay-container/overlay-container.mjs";
3
+ import "./overlay-popover-container/overlay-popover-container.mjs";