@gct-paas/core 0.1.6-dev.4 → 0.1.6-dev.41

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 (135) hide show
  1. package/dist/index.esm.min.js +2 -1
  2. package/dist/{redirect-index-Ck5Ddtcb.js → redirect-index-DA2_zO7-.js} +1 -0
  3. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/es/constants/expression-type/modeCfg.mjs +6 -0
  5. package/es/constants/index.d.ts +4 -0
  6. package/es/constants/index.mjs +5 -1
  7. package/es/create-app-vue.d.ts +1 -1
  8. package/es/create-app-vue.mjs +1 -1
  9. package/es/enums/app-designer/index.d.ts +29 -3
  10. package/es/enums/app-designer/index.mjs +33 -4
  11. package/es/enums/appEnum.d.ts +5 -1
  12. package/es/enums/appEnum.mjs +6 -1
  13. package/es/enums/authActionEnum.d.ts +5 -1
  14. package/es/enums/authActionEnum.mjs +4 -0
  15. package/es/enums/developer-center/integration.d.ts +6 -0
  16. package/es/enums/developer-center/integration.mjs +8 -1
  17. package/es/enums/expressionEnum.d.ts +4 -2
  18. package/es/enums/expressionEnum.mjs +2 -0
  19. package/es/enums/globalEnum.d.ts +30 -0
  20. package/es/enums/globalEnum.mjs +40 -1
  21. package/es/enums/index.d.ts +11 -0
  22. package/es/enums/index.mjs +13 -1
  23. package/es/enums/page-designer/designer.d.ts +2 -0
  24. package/es/enums/page-designer/designer.mjs +2 -0
  25. package/es/enums/page-designer/panel.d.ts +9 -2
  26. package/es/enums/page-designer/panel.mjs +10 -2
  27. package/es/enums/pageEnum.d.ts +2 -1
  28. package/es/enums/pageEnum.mjs +1 -0
  29. package/es/enums/process.d.ts +5 -0
  30. package/es/enums/process.mjs +9 -0
  31. package/es/enums/sizeEnum.d.ts +4 -0
  32. package/es/enums/sizeEnum.mjs +6 -1
  33. package/es/global/gct/gct.d.ts +25 -19
  34. package/es/global/gct/gct.mjs +10 -5
  35. package/es/hooks/index.d.ts +1 -0
  36. package/es/hooks/index.mjs +1 -0
  37. package/es/hooks/useDebouncePromise.d.ts +14 -0
  38. package/es/hooks/useDebouncePromise.mjs +56 -0
  39. package/es/index.d.ts +2 -0
  40. package/es/index.mjs +54 -34
  41. package/es/interface/i-action-item/i-action-item.d.ts +65 -0
  42. package/es/interface/i-app-context/i-app-context.d.ts +25 -0
  43. package/es/interface/i-dictionary/i-dictionary-item.d.ts +80 -0
  44. package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -2
  45. package/es/interface/i-pinia-action/i-global-actions.d.ts +9 -0
  46. package/es/interface/i-pinia-getter/i-global-getters.d.ts +22 -1
  47. package/es/interface/i-pinia-state/i-global-state.d.ts +9 -2
  48. package/es/interface/index.d.ts +2 -1
  49. package/es/interface/open-util/i-confirm-util/i-confirm-util.d.ts +65 -0
  50. package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
  51. package/es/interface/open-util/i-modal/i-modal.d.ts +14 -1
  52. package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
  53. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
  54. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
  55. package/es/interface/open-util/index.d.ts +2 -0
  56. package/es/locale/auto-register.d.ts +2 -0
  57. package/es/locale/auto-register.mjs +13 -0
  58. package/es/locale/index.d.ts +17 -1
  59. package/es/locale/index.mjs +34 -0
  60. package/es/locale/sys/model.mjs +9 -0
  61. package/es/locale/sys.d.ts +17 -0
  62. package/es/locale/sys.mjs +26 -0
  63. package/es/modules/env-manager/env-manager.const.d.ts +2 -0
  64. package/es/modules/env-manager/env-manager.const.mjs +4 -2
  65. package/es/modules/env-manager/env-manager.d.ts +8 -13
  66. package/es/modules/env-manager/env-manager.interface.d.ts +5 -9
  67. package/es/modules/env-manager/env-manager.interface.mjs +2 -0
  68. package/es/modules/env-manager/env-manager.mjs +20 -26
  69. package/es/modules/env-manager/env-manager.util.d.ts +5 -0
  70. package/es/modules/env-manager/env-manager.util.mjs +11 -0
  71. package/es/modules/env-manager/index.d.ts +1 -0
  72. package/es/modules/env-manager/index.mjs +4 -0
  73. package/es/modules/mqtt/interfaces/i-mqtt.d.ts +6 -2
  74. package/es/modules/mqtt/mqtt-client.d.ts +8 -7
  75. package/es/modules/mqtt/mqtt-client.mjs +30 -19
  76. package/es/modules/platform-config/constants/theme.const.d.ts +9 -1
  77. package/es/modules/platform-config/constants/theme.const.mjs +13 -2
  78. package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
  79. package/es/modules/platform-config/enums/login.enum.mjs +2 -0
  80. package/es/modules/platform-config/store.d.ts +18 -18
  81. package/es/modules/platform-config/useDeploySetting.d.ts +1 -2
  82. package/es/modules/platform-config/useDeploySetting.mjs +6 -3
  83. package/es/modules/platform-config/useLoginSetting.d.ts +2 -2
  84. package/es/modules/platform-config/useLoginSetting.mjs +29 -31
  85. package/es/modules/platform-config/useOrgSetting.d.ts +2 -2
  86. package/es/modules/platform-config/useOrgSetting.mjs +4 -6
  87. package/es/modules/platform-config/useSecuritySetting.d.ts +2 -2
  88. package/es/modules/platform-config/useSecuritySetting.mjs +2 -3
  89. package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
  90. package/es/modules/platform-config/useThemeSetting.mjs +32 -4
  91. package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
  92. package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
  93. package/es/modules/sign-log/index.d.ts +1 -0
  94. package/es/modules/sign-log/index.mjs +1 -0
  95. package/es/modules/sign-log/sign-log.d.ts +10 -0
  96. package/es/modules/sign-log/sign-log.mjs +109 -0
  97. package/es/modules/sign-log/sing-log.interface.d.ts +9 -0
  98. package/es/modules/system-mqtt/index.d.ts +2 -0
  99. package/es/modules/system-mqtt/index.mjs +1 -0
  100. package/es/modules/system-mqtt/system-mqtt.interface.d.ts +71 -0
  101. package/es/modules/system-mqtt/system-mqtt.service.d.ts +104 -0
  102. package/es/modules/system-mqtt/system-mqtt.service.mjs +199 -0
  103. package/es/modules/user-stores/store/permission.store.d.ts +1 -0
  104. package/es/modules/user-stores/store/permission.store.mjs +10 -0
  105. package/es/modules/user-stores/store/user.store.mjs +4 -2
  106. package/es/router/guard/index.d.ts +4 -0
  107. package/es/router/guard/index.mjs +41 -0
  108. package/es/router/index.mjs +2 -0
  109. package/es/setup-app.mjs +2 -9
  110. package/es/state/global-pinia-state/global-pinia-state.d.ts +6 -0
  111. package/es/state/global-pinia-state/global-pinia-state.mjs +6 -0
  112. package/es/store/global-store.mjs +18 -4
  113. package/es/store/index.d.ts +1 -1
  114. package/es/store/session-store.d.ts +1 -0
  115. package/es/store/session-store.mjs +2 -1
  116. package/es/types/index.d.ts +13 -0
  117. package/es/utils/auth-util/auth-util.d.ts +37 -0
  118. package/es/utils/auth-util/auth-util.mjs +79 -0
  119. package/es/utils/axios/check-status.d.ts +1 -0
  120. package/es/utils/axios/check-status.mjs +64 -0
  121. package/es/utils/axios/interceptors.mjs +30 -0
  122. package/es/utils/deviceFingerprint.mjs +5 -1
  123. package/es/utils/i18n/index.mjs +1 -0
  124. package/es/utils/index.d.ts +4 -2
  125. package/es/utils/index.mjs +3 -1
  126. package/es/utils/namespace/namespace.mjs +1 -0
  127. package/es/utils/openUtil/modal/modal.d.ts +1 -1
  128. package/es/utils/openUtil/modal/modal.mjs +1 -1
  129. package/es/utils/openUtil/overlay-container/overlay-container.d.ts +1 -1
  130. package/es/utils/openUtil/overlay-container/overlay-container.mjs +28 -23
  131. package/es/utils/select-user-utils.d.ts +50 -0
  132. package/es/utils/select-user-utils.mjs +129 -0
  133. package/es/utils/tools/tools.d.ts +6 -0
  134. package/es/utils/tools/tools.mjs +12 -3
  135. package/package.json +5 -3
@@ -0,0 +1,79 @@
1
+ import { useUserStore } from "../../modules/user-stores/store/user.store.mjs";
2
+ import "../../modules/user-stores/index.mjs";
3
+ import { getToken, setTenant, setToken } from "../tools/tools.mjs";
4
+ //#region src/utils/auth-util/auth-util.ts
5
+ /**
6
+ * 认证工具类
7
+ *
8
+ * @export
9
+ * @class AuthUtil
10
+ */
11
+ var AuthUtil = class AuthUtil {
12
+ static instance;
13
+ constructor() {}
14
+ /**
15
+ * 加载用户信息
16
+ *
17
+ * @description 现阶段的认证在 paas-front 系统中登录,此处直接获取 token 并加载用户信息,无认证信息或者登录过期直接跳转到登录页
18
+ * @return {*} {Promise<void>}
19
+ */
20
+ async loadUser() {
21
+ const token = getToken();
22
+ if (token) try {
23
+ await useUserStore().getUserInfoAction(token);
24
+ } catch (error) {
25
+ console.error("获取用户信息失败", error);
26
+ }
27
+ }
28
+ async logout(goLogin) {
29
+ await useUserStore().submitLoginOut();
30
+ if (goLogin) {
31
+ const url = new URL(`${location.origin}/paas-front/portal`);
32
+ if (_gct.env.isSandbox || _gct.env.isAppSingle) {
33
+ if (_gct.store.context.aid) url.searchParams.set("aid", _gct.store.context.aid);
34
+ url.searchParams.set("env", _gct.env.getEnv());
35
+ if (_gct.env.isAppSingle) url.searchParams.set("mode", "single");
36
+ }
37
+ url.hash = `/login`;
38
+ window.location.href = url.toString();
39
+ }
40
+ }
41
+ /**
42
+ * 清除认证信息并跳转到登录页
43
+ *
44
+ * @return {*} {Promise<void>}
45
+ */
46
+ async clearAuthAndGoLogin() {
47
+ setToken();
48
+ setTenant();
49
+ const url = new URL(`${location.origin}/paas-front/portal`);
50
+ url.hash = `/login`;
51
+ window.location.href = url.toString();
52
+ }
53
+ /**
54
+ * 跳转到首页
55
+ *
56
+ * @return {*} {Promise<void>}
57
+ */
58
+ async goHome() {
59
+ const url = new URL(`${location.origin}/paas-front/portal`);
60
+ url.hash = `/home`;
61
+ window.location.href = url.toString();
62
+ }
63
+ /**
64
+ * 跳转到租户选择页
65
+ *
66
+ * @return {*} {Promise<void>}
67
+ */
68
+ async goTenantSelect() {
69
+ const url = new URL(`${location.origin}/paas-front/portal`);
70
+ url.hash = `/tenant`;
71
+ window.location.href = url.toString();
72
+ }
73
+ static getInstance() {
74
+ if (!AuthUtil.instance) AuthUtil.instance = new AuthUtil();
75
+ return AuthUtil.instance;
76
+ }
77
+ };
78
+ //#endregion
79
+ export { AuthUtil };
@@ -0,0 +1 @@
1
+ export declare function checkStatus(status: number, msg: string, errorMessageMode?: string): void;
@@ -0,0 +1,64 @@
1
+ import { AuthUtil } from "../auth-util/auth-util.mjs";
2
+ import { t } from "../i18n/index.mjs";
3
+ //#region src/utils/axios/check-status.ts
4
+ function checkStatus(status, msg, errorMessageMode = "message") {
5
+ let errMessage = "";
6
+ switch (status) {
7
+ case 400:
8
+ errMessage = `${msg}`;
9
+ break;
10
+ case 401:
11
+ errMessage = msg || t("sys.errMsg401");
12
+ AuthUtil.getInstance().clearAuthAndGoLogin();
13
+ break;
14
+ case 402:
15
+ setTimeout(() => {
16
+ if (_gct.env.isSandbox || _gct.env.isAppSingle) AuthUtil.getInstance().logout(true);
17
+ else AuthUtil.getInstance().goHome();
18
+ }, 3e3);
19
+ break;
20
+ case 403:
21
+ errMessage = t("sys.errMsg403");
22
+ break;
23
+ case 404:
24
+ errMessage = t("sys.errMsg404");
25
+ break;
26
+ case 405:
27
+ errMessage = t("sys.errMsg405");
28
+ break;
29
+ case 408:
30
+ errMessage = t("sys.errMsg408");
31
+ break;
32
+ case 500:
33
+ errMessage = t("sys.errMsg500");
34
+ break;
35
+ case 501:
36
+ errMessage = t("sys.errMsg501");
37
+ break;
38
+ case 502:
39
+ errMessage = t("sys.errMsg502");
40
+ break;
41
+ case 503:
42
+ errMessage = t("sys.errMsg503");
43
+ break;
44
+ case 504:
45
+ errMessage = t("sys.errMsg504");
46
+ break;
47
+ case 505:
48
+ errMessage = t("sys.errMsg505");
49
+ break;
50
+ case 510:
51
+ if (_gct.env.isSandbox) _gct.router.replace({
52
+ force: true,
53
+ path: "/notFound"
54
+ });
55
+ break;
56
+ default:
57
+ }
58
+ if (errMessage) {
59
+ if (errorMessageMode === "modal") console.warn("errorMessageMode === \"modal\" 暂未支持", errMessage);
60
+ else if (errorMessageMode === "message") _gct.message.error(errMessage);
61
+ }
62
+ }
63
+ //#endregion
64
+ export { checkStatus };
@@ -1,4 +1,7 @@
1
1
  import { getTenant, getToken } from "../tools/tools.mjs";
2
+ import { AuthUtil } from "../auth-util/auth-util.mjs";
3
+ import { t } from "../i18n/index.mjs";
4
+ import { checkStatus } from "./check-status.mjs";
2
5
  import { globalRefStorage } from "../../store/storage-store.mjs";
3
6
  import "../../store/index.mjs";
4
7
  import { AxiosHeaders } from "axios";
@@ -20,6 +23,33 @@ function interceptors(axios) {
20
23
  });
21
24
  return config;
22
25
  });
26
+ axios.interceptors.response.use((response) => {
27
+ if (response.data.code === 200) return response;
28
+ else {
29
+ const { errorMessageMode } = response.config || {};
30
+ const { subMessage, message, subCode } = response.data;
31
+ if (subCode === "sys.global.tenantId.required") {
32
+ console.error("租户信息缺失", response.data);
33
+ AuthUtil.getInstance().goTenantSelect();
34
+ } else if (subCode === "sys.plat.api.pass.failure.over.max_times") console.error("账号锁定", response.data);
35
+ else if (errorMessageMode === "none") console.error(response.data);
36
+ else if (subMessage || message) _gct.message.error(subMessage || message);
37
+ }
38
+ return response;
39
+ }, (error) => {
40
+ const { response, code, message, status } = error || {};
41
+ const errorMessageMode = response.config?.errorMessageMode || "none";
42
+ let errMessage = "";
43
+ if (code === "ECONNABORTED" && message?.indexOf("timeout") !== -1) errMessage = t("sys.apiTimeoutMessage");
44
+ if (message?.includes("Network Error")) errMessage = t("sys.networkExceptionMsg");
45
+ if (errMessage) {
46
+ if (errorMessageMode === "modal") console.warn("errorMessageMode === \"modal\" 暂未支持", errMessage);
47
+ else if (errorMessageMode === "message") _gct.message.error(errMessage);
48
+ return Promise.reject(error);
49
+ }
50
+ checkStatus(status, message, errorMessageMode);
51
+ return Promise.reject(error);
52
+ });
23
53
  }
24
54
  //#endregion
25
55
  export { interceptors };
@@ -70,6 +70,10 @@ async function getDeviceFingerprint() {
70
70
  if (isWeb) localStorage.setItem(FINGERPRINT_KEY, visitorId);
71
71
  return `${name}/${visitorId}`;
72
72
  }
73
+ /** web 端指纹(语义兼容) */
74
+ function getBrowserFingerprint() {
75
+ return getDeviceFingerprint();
76
+ }
73
77
  /** mobile 端指纹(语义兼容) */
74
78
  function getMobileBrowserFingerprint() {
75
79
  return getDeviceFingerprint();
@@ -84,4 +88,4 @@ function getPageIdentification() {
84
88
  return pageTag;
85
89
  }
86
90
  //#endregion
87
- export { getDeviceFingerprint, getMobileBrowserFingerprint, getPageIdentification };
91
+ export { getBrowserFingerprint, getDeviceFingerprint, getMobileBrowserFingerprint, getPageIdentification };
@@ -15,5 +15,6 @@ var t = (...args) => {
15
15
  if (!key || typeof key !== "string" || key.trim() === "") return "";
16
16
  return _gct.i18n.global.t(...args);
17
17
  };
18
+ window.$t = t;
18
19
  //#endregion
19
20
  export { t };
@@ -1,3 +1,4 @@
1
+ export { AuthUtil } from './auth-util/auth-util';
1
2
  export { cssLoader } from './css-loader/css-loader';
2
3
  export { gctMemoizeAsync } from './cache-adapter/cache-adapter';
3
4
  export { DictionaryUtil } from './dictionary/dictionary';
@@ -13,11 +14,11 @@ export * from './openUtil';
13
14
  export { KitPkgUtil } from './kit-pkg-util/kit-pkg-util';
14
15
  export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
15
16
  export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
16
- export { getToken, setToken, getTenant, tenantRef, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
17
+ export { getToken, setToken, getTenant, tenantRef, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, isRdoUniqueField, } from './tools/tools';
17
18
  export * from './uuid/uuid';
18
19
  export * from './value-helper/value-helper';
19
20
  export { interceptors } from './axios/interceptors';
20
- export { getDeviceFingerprint, getPageIdentification, getMobileBrowserFingerprint, } from './deviceFingerprint';
21
+ export { getDeviceFingerprint, getPageIdentification, getMobileBrowserFingerprint, getBrowserFingerprint, } from './deviceFingerprint';
21
22
  export { TreeHelper } from './treeHelper/treeHelper';
22
23
  export * from './style';
23
24
  export * from './util';
@@ -34,3 +35,4 @@ export { scriptLoader, type IScriptOptions, } from './script-loader/script-loade
34
35
  export { permission } from './permission';
35
36
  export { getVueComponentByCode } from './vue-component-code';
36
37
  export * from './data-prems/const';
38
+ export * from './select-user-utils';
@@ -1,3 +1,5 @@
1
+ import "./tools/tools.mjs";
2
+ import "./auth-util/auth-util.mjs";
1
3
  import "./css-loader/css-loader.mjs";
2
4
  import "./cache-adapter/cache-adapter.mjs";
3
5
  import "./dictionary/dictionary.mjs";
@@ -16,7 +18,6 @@ import "./openUtil/index.mjs";
16
18
  import "./kit-pkg-util/kit-pkg-util.mjs";
17
19
  import "./plugin-pkg-util/plugin-pkg-util.mjs";
18
20
  import "./plugin-static-resource/plugin-static-resource.mjs";
19
- import "./tools/tools.mjs";
20
21
  import "./uuid/uuid.mjs";
21
22
  import "./value-helper/value-helper.mjs";
22
23
  import "./axios/interceptors.mjs";
@@ -37,3 +38,4 @@ import "./script-loader/script-loader.mjs";
37
38
  import "./permission.mjs";
38
39
  import "./vue-component-code.mjs";
39
40
  import "./data-prems/const.mjs";
41
+ import "./select-user-utils.mjs";
@@ -30,6 +30,7 @@ function _bem(namespace, block, blockSuffix, element, modifier) {
30
30
  * @class Namespace
31
31
  */
32
32
  var Namespace = class {
33
+ block;
33
34
  /**
34
35
  * 命名空间
35
36
  *
@@ -25,7 +25,7 @@ export declare class Modal implements IModal {
25
25
  shouldDismiss: AsyncSeriesHook<[], {
26
26
  allowClose?: boolean;
27
27
  }>;
28
- beforeDismiss: AsyncSeriesHook<[], IModalData>;
28
+ beforeDismiss: AsyncSeriesHook<[], IModalData<IData>>;
29
29
  };
30
30
  ok?: () => Promise<IModalData | null>;
31
31
  setOptions?: (options: object) => void;
@@ -1,5 +1,5 @@
1
- import { reactive } from "vue";
2
1
  import { AsyncSeriesHook } from "qx-util";
2
+ import { reactive } from "vue";
3
3
  //#region src/utils/openUtil/modal/modal.ts
4
4
  var Modal = class {
5
5
  ignoreDismissCheck = false;
@@ -61,7 +61,7 @@ export declare class OverlayContainer<O> implements IOverlayContainer {
61
61
  * @param {O} [opts]
62
62
  */
63
63
  constructor(component: unknown, render: (...args: any[]) => VNode, opts?: O | undefined);
64
- static createVueApp(rootComponent: Component, rootProps?: IData): Promise<App<Element>>;
64
+ static createVueApp(rootComponent: Component, rootProps?: IData): App<Element>;
65
65
  /**
66
66
  * 初始化飘窗
67
67
  *
@@ -1,5 +1,5 @@
1
- import { createApp, h, nextTick } from "vue";
2
1
  import { QXEvent } from "qx-util";
2
+ import { createApp, h } from "vue";
3
3
  //#region src/utils/openUtil/overlay-container/overlay-container.ts
4
4
  /**
5
5
  * 全局弹出承载组件
@@ -12,6 +12,9 @@ import { QXEvent } from "qx-util";
12
12
  * @template O
13
13
  */
14
14
  var OverlayContainer = class OverlayContainer {
15
+ component;
16
+ render;
17
+ opts;
15
18
  vm;
16
19
  /**
17
20
  * 具体模态组件对象
@@ -61,7 +64,7 @@ var OverlayContainer = class OverlayContainer {
61
64
  this.opts = opts;
62
65
  this._initPromise = this.init();
63
66
  }
64
- static async createVueApp(rootComponent, rootProps) {
67
+ static createVueApp(rootComponent, rootProps) {
65
68
  console.error("没有注入createVueApp方法");
66
69
  return createApp(rootComponent, rootProps);
67
70
  }
@@ -78,27 +81,30 @@ var OverlayContainer = class OverlayContainer {
78
81
  const { render, opts } = this;
79
82
  const container = document.createElement("div");
80
83
  document.body.appendChild(container);
81
- const vm = await OverlayContainer.createVueApp({
82
- mounted() {
83
- self.modal = this.$refs.root;
84
- },
85
- unmounted() {
86
- document.body.removeChild(container);
87
- self.evt.emit("dismiss", self.result);
88
- },
89
- render() {
90
- return h(self.component, {
91
- ref: "root",
92
- opts,
93
- onDismiss(data) {
94
- self.result = data;
95
- vm.unmount();
96
- }
97
- }, { default: render });
98
- }
84
+ return new Promise((resolve) => {
85
+ const vm = OverlayContainer.createVueApp({
86
+ mounted() {
87
+ self.modal = this.$refs.root;
88
+ resolve();
89
+ },
90
+ unmounted() {
91
+ document.body.removeChild(container);
92
+ self.evt.emit("dismiss", self.result);
93
+ },
94
+ render() {
95
+ return h(self.component, {
96
+ ref: "root",
97
+ opts,
98
+ onDismiss(data) {
99
+ self.result = data;
100
+ vm.unmount();
101
+ }
102
+ }, { default: render });
103
+ }
104
+ });
105
+ vm.mount(container);
106
+ this.vm = vm;
99
107
  });
100
- vm.mount(container);
101
- this.vm = vm;
102
108
  }
103
109
  /**
104
110
  * 打开飘窗
@@ -109,7 +115,6 @@ var OverlayContainer = class OverlayContainer {
109
115
  */
110
116
  async present() {
111
117
  await this._initPromise;
112
- await nextTick();
113
118
  return this.modal.present();
114
119
  }
115
120
  /**
@@ -0,0 +1,50 @@
1
+ import { FIELD_TYPE } from '../enums';
2
+ /** 动态类型 */
3
+ export declare enum DYN_FORMAT_TYPE_ENUM {
4
+ /** 申请人直属上级 */
5
+ DYN_SUBMITTER_MANAGER = "DYN_SUBMITTER_MANAGER",
6
+ /** 申请人部门负责人 */
7
+ DYN_SUBMITTER_DEPT_PRINCIPAL = "DYN_SUBMITTER_DEPT_PRINCIPAL",
8
+ /** 指定人员字段 */
9
+ DYN_MODEL_USERS = "DYN_MODEL_USERS",
10
+ /** 指定人员字段直属上级 */
11
+ DYN_MODEL_USER_MANAGER = "DYN_MODEL_USER_MANAGER",
12
+ /** 指定部门负责人 */
13
+ DYN_DEPT_PRINCIPAL = "DYN_DEPT_PRINCIPAL",
14
+ /** 指定部门字段 */
15
+ DYN_MODEL_ORG = "DYN_MODEL_ORG",
16
+ /** 指定部门字段负责人 */
17
+ DYN_MODEL_DEPT_PRINCIPAL = "DYN_MODEL_DEPT_PRINCIPAL"
18
+ }
19
+ export declare const DynFormatTypes: DYN_FORMAT_TYPE_ENUM[];
20
+ export declare const filterDynFormatTypes: string[];
21
+ export declare const dynamicData: ({
22
+ id: string;
23
+ formatId: DYN_FORMAT_TYPE_ENUM;
24
+ name: string;
25
+ desc: string;
26
+ panelKey?: undefined;
27
+ showPanel?: undefined;
28
+ panelType?: undefined;
29
+ } | {
30
+ id: string;
31
+ formatId: DYN_FORMAT_TYPE_ENUM;
32
+ name: string;
33
+ desc: string;
34
+ showPanel: boolean;
35
+ panelType: string;
36
+ panelKey: FIELD_TYPE[];
37
+ } | {
38
+ panelKey?: undefined;
39
+ id: string;
40
+ formatId: DYN_FORMAT_TYPE_ENUM;
41
+ name: string;
42
+ desc: string;
43
+ showPanel: boolean;
44
+ panelType: string;
45
+ })[];
46
+ export declare function list2Tree(list: IObject[]): IObject[];
47
+ export declare function highlightName(str: string, searchValue?: string): string | null;
48
+ export declare const filterTree: (tree: IObject[], searchValue: string) => IObject[];
49
+ export declare const findUniqueNode: (tree: IObject[], tid: string) => IObject | null;
50
+ export declare function showDynamicTitle(id: string, name: string): string;
@@ -0,0 +1,129 @@
1
+ import { FIELD_TYPE } from "../enums/appEnum.mjs";
2
+ import "../enums/index.mjs";
3
+ import { cloneDeep } from "lodash-es";
4
+ //#region src/utils/select-user-utils.ts
5
+ /** 动态类型 */
6
+ var DYN_FORMAT_TYPE_ENUM = /* @__PURE__ */ function(DYN_FORMAT_TYPE_ENUM) {
7
+ /** 申请人直属上级 */
8
+ DYN_FORMAT_TYPE_ENUM["DYN_SUBMITTER_MANAGER"] = "DYN_SUBMITTER_MANAGER";
9
+ /** 申请人部门负责人 */
10
+ DYN_FORMAT_TYPE_ENUM["DYN_SUBMITTER_DEPT_PRINCIPAL"] = "DYN_SUBMITTER_DEPT_PRINCIPAL";
11
+ /** 指定人员字段 */
12
+ DYN_FORMAT_TYPE_ENUM["DYN_MODEL_USERS"] = "DYN_MODEL_USERS";
13
+ /** 指定人员字段直属上级 */
14
+ DYN_FORMAT_TYPE_ENUM["DYN_MODEL_USER_MANAGER"] = "DYN_MODEL_USER_MANAGER";
15
+ /** 指定部门负责人 */
16
+ DYN_FORMAT_TYPE_ENUM["DYN_DEPT_PRINCIPAL"] = "DYN_DEPT_PRINCIPAL";
17
+ /** 指定部门字段 */
18
+ DYN_FORMAT_TYPE_ENUM["DYN_MODEL_ORG"] = "DYN_MODEL_ORG";
19
+ /** 指定部门字段负责人 */
20
+ DYN_FORMAT_TYPE_ENUM["DYN_MODEL_DEPT_PRINCIPAL"] = "DYN_MODEL_DEPT_PRINCIPAL";
21
+ return DYN_FORMAT_TYPE_ENUM;
22
+ }({});
23
+ var DynFormatTypes = Object.values(DYN_FORMAT_TYPE_ENUM);
24
+ var filterDynFormatTypes = Object.values(DYN_FORMAT_TYPE_ENUM).filter((item) => ![DYN_FORMAT_TYPE_ENUM.DYN_SUBMITTER_MANAGER, DYN_FORMAT_TYPE_ENUM.DYN_SUBMITTER_DEPT_PRINCIPAL].includes(item)).map((type) => `${type}:current`);
25
+ var dynamicData = [
26
+ {
27
+ id: "currentDs",
28
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_SUBMITTER_MANAGER,
29
+ name: "申请人直属上级",
30
+ desc: "可将申请人直属上级设为节点处理人"
31
+ },
32
+ {
33
+ id: "currentDeptDs",
34
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_SUBMITTER_DEPT_PRINCIPAL,
35
+ name: "申请人部门负责人",
36
+ desc: "可将申请人所在部门负责人设为节点处理人"
37
+ },
38
+ {
39
+ id: "userField",
40
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_MODEL_USERS,
41
+ name: "指定人员字段",
42
+ desc: "字段所选用户作为节点处理人",
43
+ showPanel: true,
44
+ panelType: "area",
45
+ panelKey: [FIELD_TYPE.USER, FIELD_TYPE.USER_MULTI]
46
+ },
47
+ {
48
+ id: "userFieldDs",
49
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_MODEL_USER_MANAGER,
50
+ name: "指定人员字段直属上级",
51
+ desc: "字段所选用户的直属上级为节点处理人",
52
+ showPanel: true,
53
+ panelType: "area",
54
+ panelKey: [FIELD_TYPE.USER, FIELD_TYPE.USER_MULTI]
55
+ },
56
+ {
57
+ id: "orgDs",
58
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_DEPT_PRINCIPAL,
59
+ name: "指定部门负责人",
60
+ desc: "所选部门负责人作为节点处理人",
61
+ showPanel: true,
62
+ panelType: "select"
63
+ },
64
+ {
65
+ id: "orgFieldDs",
66
+ formatId: DYN_FORMAT_TYPE_ENUM.DYN_MODEL_DEPT_PRINCIPAL,
67
+ name: "指定部门字段负责人",
68
+ desc: "字段所选部门负责人作为节点处理人",
69
+ showPanel: true,
70
+ panelType: "area",
71
+ panelKey: [FIELD_TYPE.ORG, FIELD_TYPE.ORG_MULTI]
72
+ }
73
+ ];
74
+ function list2Tree(list) {
75
+ const treeOptions = [];
76
+ const arrClone = cloneDeep(list);
77
+ const mapInfo = arrClone.reduce((obj, item) => {
78
+ item.children = [];
79
+ obj[item.id] = item;
80
+ return obj;
81
+ }, {});
82
+ arrClone.forEach((i) => {
83
+ const parent = mapInfo[i.parentId];
84
+ if (parent) parent.children.push(i);
85
+ else treeOptions.push(i);
86
+ });
87
+ return treeOptions;
88
+ }
89
+ function highlightName(str, searchValue = "") {
90
+ const displayName = str;
91
+ const rDisplayName = displayName?.replace(new RegExp(searchValue?.replace(/* @__PURE__ */ new RegExp(/(?=[$.?+[\]*^|\\(){}/])/g), "\\"), "g"), (s) => `<span class="is-highlight">${s}</span>`);
92
+ if (rDisplayName === displayName) return null;
93
+ return rDisplayName;
94
+ }
95
+ var filterTree = (tree, searchValue) => {
96
+ return tree.map((node) => {
97
+ if (node.children) {
98
+ const filteredChildren = filterTree(node.children, searchValue);
99
+ if (filteredChildren.length > 0) return {
100
+ ...node,
101
+ children: filteredChildren
102
+ };
103
+ }
104
+ const hlName = highlightName(node.name, searchValue);
105
+ if (hlName) return {
106
+ ...node,
107
+ highlightName: hlName
108
+ };
109
+ return null;
110
+ }).filter((node) => node !== null);
111
+ };
112
+ var findUniqueNode = (tree, tid) => {
113
+ for (const node of tree) {
114
+ if (node.id === tid) return node;
115
+ if (node.children) {
116
+ const foundNode = findUniqueNode(node.children, tid);
117
+ if (foundNode) return foundNode;
118
+ }
119
+ }
120
+ return null;
121
+ };
122
+ function showDynamicTitle(id, name) {
123
+ if (id.includes(DYN_FORMAT_TYPE_ENUM.DYN_MODEL_USER_MANAGER)) return `${name}:直属上级`;
124
+ if (id.includes(DYN_FORMAT_TYPE_ENUM.DYN_DEPT_PRINCIPAL)) return `${name}:负责人`;
125
+ if (id.includes(DYN_FORMAT_TYPE_ENUM.DYN_MODEL_DEPT_PRINCIPAL)) return `${name}:负责人`;
126
+ return name;
127
+ }
128
+ //#endregion
129
+ export { DYN_FORMAT_TYPE_ENUM, DynFormatTypes, dynamicData, filterDynFormatTypes, filterTree, findUniqueNode, highlightName, list2Tree, showDynamicTitle };
@@ -64,3 +64,9 @@ export declare function parseMatrixParams(path: string): IObject;
64
64
  * @return {string} 图片 base64 编码(png 格式)
65
65
  */
66
66
  export declare function createWhiteImageWithText(name: string, width: number, height: number): string;
67
+ /**
68
+ * 是否是rdo唯一字段
69
+ * @param key 字段key
70
+ * @returns
71
+ */
72
+ export declare function isRdoUniqueField(key: string): boolean;
@@ -1,9 +1,9 @@
1
1
  import { CoreConst } from "../../constants/core.mjs";
2
2
  import "../../constants/index.mjs";
3
- import qs from "qs";
3
+ import { clearCookie, getCookie, setCookie } from "qx-util";
4
4
  import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
5
+ import qs from "qs";
5
6
  import { customRef, readonly } from "vue";
6
- import { clearCookie, getCookie, setCookie } from "qx-util";
7
7
  //#region src/utils/tools/tools.ts
8
8
  /**
9
9
  * 租户 cookie 双向绑定响应式引用:get 直接读 cookie,set 直接写 cookie
@@ -154,5 +154,14 @@ function createWhiteImageWithText(name, width, height) {
154
154
  });
155
155
  return canvas.toDataURL("image/png");
156
156
  }
157
+ /**
158
+ * 是否是rdo唯一字段
159
+ * @param key 字段key
160
+ * @returns
161
+ */
162
+ function isRdoUniqueField(key) {
163
+ if (!key) return false;
164
+ return /^version_,.*?,default_$/.test(key);
165
+ }
157
166
  //#endregion
158
- export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams, tenantRef };
167
+ export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, isRdoUniqueField, parseMatrixParams, setTenant, setToken, stringifyMatrixParams, tenantRef };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/core",
3
- "version": "0.1.6-dev.4",
3
+ "version": "0.1.6-dev.41",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "loader": "dist/index.esm.min.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@fingerprintjs/fingerprintjs": "^5.1.0",
35
35
  "@floating-ui/dom": "^1.7.6",
36
- "@gct-paas/api": "^0.1.4-dev.4",
36
+ "@gct-paas/api": "^6.0.0-dev.2",
37
37
  "@module-federation/runtime": "^2.2.3",
38
38
  "@vueuse/core": "^14.1.0",
39
39
  "async-validator": "^4.2.5",
@@ -43,6 +43,7 @@
43
43
  "lodash-es": "^4.17.23",
44
44
  "mitt": "^3.0.1",
45
45
  "mqtt": "^5.15.0",
46
+ "nprogress": "^0.2.0",
46
47
  "overlayscrollbars": "^2.14.0",
47
48
  "pinia": "^3.0.4",
48
49
  "qs": "^6.15.0",
@@ -53,12 +54,13 @@
53
54
  "wujie": "^1.0.29"
54
55
  },
55
56
  "devDependencies": {
57
+ "@types/nprogress": "^0.2.3",
56
58
  "@vue/test-utils": "^2.4.6",
57
59
  "fs-extra": "^11.3.3",
58
60
  "playwright": "^1.58.0"
59
61
  },
60
62
  "peerDependencies": {
61
- "@gct-paas/api": "^0.1.4-dev.4",
63
+ "@gct-paas/api": "^6.0.0-dev.2",
62
64
  "vue": ">=3",
63
65
  "vue-i18n": ">=11",
64
66
  "vue-router": ">=4"