@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.
- package/README.md +322 -0
- package/dist/index.esm.min.js +2 -1
- package/dist/{redirect-index-Ck5Ddtcb.js → redirect-index-QBY98C6e.js} +1 -0
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/constants/expression-type/FunctionKeys.mjs +2 -0
- package/es/constants/expression-type/function.mjs +20 -0
- package/es/constants/expression-type/index.mjs +2 -0
- package/es/constants/expression-type/modeCfg.mjs +12 -2
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.mjs +5 -1
- package/es/enums/app-designer/index.d.ts +29 -3
- package/es/enums/app-designer/index.mjs +33 -4
- package/es/enums/appEnum.d.ts +5 -1
- package/es/enums/appEnum.mjs +6 -1
- package/es/enums/authActionEnum.d.ts +5 -1
- package/es/enums/authActionEnum.mjs +4 -0
- package/es/enums/developer-center/integration.d.ts +6 -0
- package/es/enums/developer-center/integration.mjs +8 -1
- package/es/enums/expressionEnum.d.ts +4 -2
- package/es/enums/expressionEnum.mjs +2 -0
- package/es/enums/globalEnum.d.ts +30 -0
- package/es/enums/globalEnum.mjs +40 -1
- package/es/enums/index.d.ts +11 -0
- package/es/enums/index.mjs +13 -1
- package/es/enums/page-designer/designer.d.ts +2 -0
- package/es/enums/page-designer/designer.mjs +2 -0
- package/es/enums/page-designer/layout.d.ts +6 -0
- package/es/enums/page-designer/layout.mjs +8 -1
- package/es/enums/page-designer/panel.d.ts +9 -2
- package/es/enums/page-designer/panel.mjs +10 -2
- package/es/enums/pageEnum.d.ts +2 -1
- package/es/enums/pageEnum.mjs +1 -0
- package/es/enums/process.d.ts +5 -0
- package/es/enums/process.mjs +9 -0
- package/es/enums/sizeEnum.d.ts +4 -0
- package/es/enums/sizeEnum.mjs +6 -1
- package/es/global/gct/gct.d.ts +25 -19
- package/es/global/gct/gct.mjs +9 -5
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useDebouncePromise.d.ts +14 -0
- package/es/hooks/useDebouncePromise.mjs +56 -0
- package/es/index.d.ts +2 -0
- package/es/index.mjs +40 -28
- package/es/interface/i-action-item/i-action-item.d.ts +65 -0
- package/es/interface/i-app-context/i-app-context.d.ts +25 -1
- package/es/interface/i-dictionary/i-dictionary-item.d.ts +80 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +9 -0
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +22 -1
- package/es/interface/i-pinia-state/i-global-state.d.ts +9 -2
- package/es/interface/index.d.ts +2 -1
- package/es/interface/open-util/i-confirm-util/i-confirm-util.d.ts +65 -0
- package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
- package/es/interface/open-util/i-modal/i-modal.d.ts +14 -1
- package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
- package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
- package/es/interface/open-util/index.d.ts +2 -0
- package/es/locale/auto-register.d.ts +2 -0
- package/es/locale/auto-register.mjs +13 -0
- package/es/locale/index.d.ts +25 -1
- package/es/locale/index.mjs +57 -3
- package/es/locale/sys/model.mjs +9 -0
- package/es/locale/sys.d.ts +17 -0
- package/es/locale/sys.mjs +26 -0
- package/es/modules/env-manager/env-manager.const.d.ts +2 -0
- package/es/modules/env-manager/env-manager.const.mjs +4 -2
- package/es/modules/env-manager/env-manager.d.ts +8 -13
- package/es/modules/env-manager/env-manager.interface.d.ts +5 -9
- package/es/modules/env-manager/env-manager.interface.mjs +2 -0
- package/es/modules/env-manager/env-manager.mjs +19 -27
- package/es/modules/env-manager/env-manager.util.d.ts +5 -0
- package/es/modules/env-manager/env-manager.util.mjs +11 -0
- package/es/modules/env-manager/index.d.ts +1 -0
- package/es/modules/env-manager/index.mjs +1 -0
- package/es/modules/mqtt/interfaces/i-mqtt.d.ts +6 -2
- package/es/modules/mqtt/mqtt-client.d.ts +8 -7
- package/es/modules/mqtt/mqtt-client.mjs +30 -19
- package/es/modules/platform-config/constants/theme.const.d.ts +9 -1
- package/es/modules/platform-config/constants/theme.const.mjs +13 -2
- package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
- package/es/modules/platform-config/enums/login.enum.mjs +2 -0
- package/es/modules/platform-config/index.d.ts +3 -0
- package/es/modules/platform-config/index.mjs +3 -0
- package/es/modules/platform-config/store.d.ts +18 -18
- package/es/modules/platform-config/useDeploySetting.d.ts +1 -2
- package/es/modules/platform-config/useDeploySetting.mjs +6 -3
- package/es/modules/platform-config/useLoginSetting.d.ts +2 -2
- package/es/modules/platform-config/useLoginSetting.mjs +29 -31
- package/es/modules/platform-config/useOrgSetting.d.ts +2 -2
- package/es/modules/platform-config/useOrgSetting.mjs +4 -6
- package/es/modules/platform-config/useSecuritySetting.d.ts +2 -2
- package/es/modules/platform-config/useSecuritySetting.mjs +2 -3
- package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
- package/es/modules/platform-config/useThemeSetting.mjs +32 -4
- package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
- package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
- package/es/modules/sign-log/index.d.ts +1 -0
- package/es/modules/sign-log/index.mjs +1 -0
- package/es/modules/sign-log/sign-log.d.ts +10 -0
- package/es/modules/sign-log/sign-log.mjs +109 -0
- package/es/modules/sign-log/sing-log.interface.d.ts +9 -0
- package/es/modules/system-mqtt/index.d.ts +2 -0
- package/es/modules/system-mqtt/index.mjs +1 -0
- package/es/modules/system-mqtt/system-mqtt.interface.d.ts +71 -0
- package/es/modules/system-mqtt/system-mqtt.service.d.ts +104 -0
- package/es/modules/system-mqtt/system-mqtt.service.mjs +199 -0
- package/es/modules/user-stores/store/permission.store.d.ts +1 -0
- package/es/modules/user-stores/store/permission.store.mjs +10 -0
- package/es/modules/user-stores/store/user.store.mjs +4 -2
- package/es/router/guard/index.d.ts +4 -0
- package/es/router/guard/index.mjs +41 -0
- package/es/router/index.mjs +2 -0
- package/es/setup-app.mjs +2 -9
- package/es/state/global-pinia-state/global-pinia-state.d.ts +6 -0
- package/es/state/global-pinia-state/global-pinia-state.mjs +6 -0
- package/es/store/global-store.mjs +15 -1
- package/es/types/index.d.ts +7 -0
- package/es/utils/auth-util/auth-util.d.ts +37 -0
- package/es/utils/auth-util/auth-util.mjs +79 -0
- package/es/utils/axios/check-status.d.ts +1 -0
- package/es/utils/axios/check-status.mjs +64 -0
- package/es/utils/axios/interceptors.mjs +30 -0
- package/es/utils/deviceFingerprint.mjs +5 -1
- package/es/utils/i18n/index.mjs +1 -0
- package/es/utils/index.d.ts +4 -2
- package/es/utils/index.mjs +3 -1
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +1 -1
- package/es/utils/openUtil/modal/modal.d.ts +1 -1
- package/es/utils/openUtil/modal/modal.mjs +1 -1
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +8 -2
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +2 -1
- package/es/utils/select-user-utils.d.ts +50 -0
- package/es/utils/select-user-utils.mjs +129 -0
- package/es/utils/tools/tools.d.ts +6 -0
- package/es/utils/tools/tools.mjs +12 -3
- package/package.json +5 -3
|
@@ -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 };
|
package/es/utils/i18n/index.mjs
CHANGED
package/es/utils/index.d.ts
CHANGED
|
@@ -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';
|
package/es/utils/index.mjs
CHANGED
|
@@ -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";
|
|
@@ -39,7 +39,7 @@ var KitPkgUtil = class {
|
|
|
39
39
|
if (module) return module;
|
|
40
40
|
else console.warn(`Kit ${kit} does not export a default function`);
|
|
41
41
|
} catch (error) {
|
|
42
|
-
console.
|
|
42
|
+
console.warn(`Error loading kit ${kit} from ${loaderUrl}:`, error);
|
|
43
43
|
}
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
@@ -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,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KitPkgUtil } from "../../kit-pkg-util/kit-pkg-util.mjs";
|
|
2
|
+
import "../../index.mjs";
|
|
2
3
|
import { QXEvent } from "qx-util";
|
|
4
|
+
import { createApp, h } from "vue";
|
|
3
5
|
//#region src/utils/openUtil/overlay-container/overlay-container.ts
|
|
4
6
|
/**
|
|
5
7
|
* 全局弹出承载组件
|
|
@@ -81,7 +83,7 @@ var OverlayContainer = class OverlayContainer {
|
|
|
81
83
|
const { render, opts } = this;
|
|
82
84
|
const container = document.createElement("div");
|
|
83
85
|
document.body.appendChild(container);
|
|
84
|
-
return new Promise((resolve) => {
|
|
86
|
+
return new Promise(async (resolve) => {
|
|
85
87
|
const vm = OverlayContainer.createVueApp({
|
|
86
88
|
mounted() {
|
|
87
89
|
self.modal = this.$refs.root;
|
|
@@ -102,6 +104,10 @@ var OverlayContainer = class OverlayContainer {
|
|
|
102
104
|
}, { default: render });
|
|
103
105
|
}
|
|
104
106
|
});
|
|
107
|
+
if (_gct.store.appInfo.suiteKey) {
|
|
108
|
+
const module = await KitPkgUtil.loadWeb(_gct.store.appInfo.suiteKey);
|
|
109
|
+
if (module && module.createAppVue) module.createAppVue(vm);
|
|
110
|
+
}
|
|
105
111
|
vm.mount(container);
|
|
106
112
|
this.vm = vm;
|
|
107
113
|
});
|
|
@@ -11,7 +11,8 @@ import { OverlayContainer } from "../overlay-container/overlay-container.mjs";
|
|
|
11
11
|
* @implements {IOverlayPopoverContainer}
|
|
12
12
|
*/
|
|
13
13
|
var OverlayPopoverContainer = class extends OverlayContainer {
|
|
14
|
-
present(target) {
|
|
14
|
+
async present(target) {
|
|
15
|
+
await this._initPromise;
|
|
15
16
|
return this.modal.present(target);
|
|
16
17
|
}
|
|
17
18
|
};
|
|
@@ -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;
|
package/es/utils/tools/tools.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CoreConst } from "../../constants/core.mjs";
|
|
2
2
|
import "../../constants/index.mjs";
|
|
3
|
-
import
|
|
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.
|
|
3
|
+
"version": "6.0.0-dev.10",
|
|
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.
|
|
36
|
+
"@gct-paas/api": "^6.0.0-dev.7",
|
|
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.
|
|
63
|
+
"@gct-paas/api": "^6.0.0-dev.7",
|
|
62
64
|
"vue": ">=3",
|
|
63
65
|
"vue-i18n": ">=11",
|
|
64
66
|
"vue-router": ">=4"
|