@gct-paas/core 0.1.5-test.2 → 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.
- package/dist/index.esm.min.js +1 -1
- package/es/enums/app-designer/index.d.ts +11 -0
- package/es/enums/app-designer/index.mjs +14 -1
- package/es/enums/appEnum.d.ts +8 -0
- package/es/enums/appEnum.mjs +10 -1
- package/es/enums/page-designer/designer.d.ts +13 -13
- package/es/index.mjs +12 -6
- package/es/interface/i-popover-options/i-popover-options.d.ts +98 -0
- package/es/interface/index.d.ts +2 -1
- package/es/interface/index.mjs +1 -0
- package/es/interface/model-designer/entity.d.ts +87 -79
- package/es/interface/model-designer/serial.d.ts +22 -0
- package/es/interface/model-designer/serial.mjs +49 -0
- package/es/interface/open-util/i-app-full-screen-container-options/i-app-full-screen-container-options.d.ts +26 -0
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +52 -0
- package/es/interface/open-util/i-overlay-popover-container/i-overlay-popover-container.d.ts +21 -0
- package/es/interface/open-util/index.d.ts +3 -1
- package/es/locale/index.d.ts +23 -0
- package/es/locale/index.mjs +33 -0
- package/es/locale/sys/model.d.ts +5 -0
- package/es/locale/sys.d.ts +5 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +1 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.mjs +2 -1
- package/es/modules/mqtt/mqtt-manager.d.ts +1 -1
- package/es/modules/mqtt/mqtt-manager.mjs +2 -1
- package/es/modules/platform-config/store.mjs +0 -1
- package/es/modules/user-stores/store/user.store.d.ts +4 -0
- package/es/router/index.mjs +1 -1
- package/es/setup-app.mjs +3 -1
- package/es/utils/data-prems/const.d.ts +26 -0
- package/es/utils/data-prems/const.mjs +79 -0
- package/es/utils/i18n/index.mjs +3 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.mjs +4 -0
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +4 -0
- package/es/utils/openUtil/index.d.ts +1 -0
- package/es/utils/openUtil/index.mjs +1 -0
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.d.ts +15 -0
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +19 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +1 -1
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +1 -1
- package/es/utils/script-loader/script-loader.d.ts +62 -0
- package/es/utils/script-loader/script-loader.mjs +92 -0
- package/es/utils/style/index.d.ts +8 -0
- package/es/utils/style/index.mjs +67 -1
- package/es/utils/text-measure/text-measure.d.ts +141 -0
- package/es/utils/text-measure/text-measure.mjs +191 -0
- package/es/utils/uploader/uploader.mjs +3 -5
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.mjs +9 -1
- package/package.json +4 -3
- 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';
|
package/es/locale/index.d.ts
CHANGED
|
@@ -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 {};
|
package/es/locale/index.mjs
CHANGED
|
@@ -24,8 +24,31 @@ var LocaleUtil = class {
|
|
|
24
24
|
}
|
|
25
25
|
async changeLang(lang) {
|
|
26
26
|
globalRefStorage.value.lang = lang;
|
|
27
|
+
this.i18n.global.locale.value = lang;
|
|
28
|
+
this.setHtmlPageLang(lang);
|
|
27
29
|
await this.loadI18nJson();
|
|
28
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
|
+
}
|
|
29
52
|
/**只加载应用专用i18n JSON */
|
|
30
53
|
async initAppJson() {
|
|
31
54
|
const app_platformUrl = this.getMessageUrl({
|
|
@@ -65,6 +88,8 @@ var LocaleUtil = class {
|
|
|
65
88
|
}).filter((i) => i.configured === 1 && i.state === 1);
|
|
66
89
|
const defaultItem = this.localeList.find((item) => !!item.defaultLanguage);
|
|
67
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);
|
|
68
93
|
}
|
|
69
94
|
async loadMessages(url, locale = this.locale) {
|
|
70
95
|
if (!url) return;
|
|
@@ -85,6 +110,14 @@ var LocaleUtil = class {
|
|
|
85
110
|
}
|
|
86
111
|
return `/minio/locale-js/${payload.locale}__platform__.json`;
|
|
87
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* 设置 HTML 根元素的 lang 属性,供浏览器、辅助技术识别当前语言
|
|
115
|
+
*
|
|
116
|
+
* @param locale 语言标识,如 zh-CN、en
|
|
117
|
+
*/
|
|
118
|
+
setHtmlPageLang(locale) {
|
|
119
|
+
document.querySelector("html")?.setAttribute("lang", locale);
|
|
120
|
+
}
|
|
88
121
|
};
|
|
89
122
|
function setupI18n(app) {
|
|
90
123
|
app.use(_gct.i18n);
|
|
@@ -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
|
|
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;
|
package/es/router/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ var RouterUtil = class {
|
|
|
18
18
|
async add(route) {
|
|
19
19
|
if (Array.isArray(route)) route.forEach((r) => this.router.addRoute(r));
|
|
20
20
|
else this.router.addRoute(route);
|
|
21
|
-
if (!this.router.
|
|
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
|
@@ -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 };
|
package/es/utils/i18n/index.mjs
CHANGED
|
@@ -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
|
package/es/utils/index.d.ts
CHANGED
|
@@ -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';
|
package/es/utils/index.mjs
CHANGED
|
@@ -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,6 +26,10 @@ var KitPkgUtil = class {
|
|
|
26
26
|
* @return {*} {(Promise<IPluginKitModule | null>)}
|
|
27
27
|
*/
|
|
28
28
|
static async loadKit(kit, mode) {
|
|
29
|
+
if (!kit) {
|
|
30
|
+
console.error("Kit name is required to load a kit package");
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
29
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(
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IOverlayPopoverContainer, IPopoverOptions } from '../../../interface';
|
|
2
|
+
import { OverlayContainer } from '../overlay-container/overlay-container';
|
|
3
|
+
/**
|
|
4
|
+
* 飘窗组件呈现容器
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghanrui
|
|
7
|
+
* @date 2024-04-08 09:04:42
|
|
8
|
+
* @export
|
|
9
|
+
* @class OverlayPopoverContainer
|
|
10
|
+
* @extends {OverlayContainer<IPopoverOptions>}
|
|
11
|
+
* @implements {IOverlayPopoverContainer}
|
|
12
|
+
*/
|
|
13
|
+
export declare class OverlayPopoverContainer extends OverlayContainer<IPopoverOptions> implements IOverlayPopoverContainer {
|
|
14
|
+
present(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OverlayContainer } from "../overlay-container/overlay-container.mjs";
|
|
2
|
+
//#region src/utils/openUtil/overlay-popover-container/overlay-popover-container.ts
|
|
3
|
+
/**
|
|
4
|
+
* 飘窗组件呈现容器
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghanrui
|
|
7
|
+
* @date 2024-04-08 09:04:42
|
|
8
|
+
* @export
|
|
9
|
+
* @class OverlayPopoverContainer
|
|
10
|
+
* @extends {OverlayContainer<IPopoverOptions>}
|
|
11
|
+
* @implements {IOverlayPopoverContainer}
|
|
12
|
+
*/
|
|
13
|
+
var OverlayPopoverContainer = class extends OverlayContainer {
|
|
14
|
+
present(target) {
|
|
15
|
+
return this.modal.present(target);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { OverlayPopoverContainer };
|
|
@@ -47,7 +47,7 @@ export declare class PluginPgkUtil {
|
|
|
47
47
|
* @protected
|
|
48
48
|
* @static
|
|
49
49
|
* @param {IStyleIMportMap[]} plugins
|
|
50
|
-
* @returns {*} {Promise<
|
|
50
|
+
* @returns {*} {Promise<IObject[]>}
|
|
51
51
|
*/
|
|
52
52
|
protected static loadPlugins(mode: PluginModeEnum, configs?: PluginTenant['plugins']): Promise<IModuleMap>;
|
|
53
53
|
/**
|
|
@@ -60,7 +60,7 @@ var PluginPgkUtil = class {
|
|
|
60
60
|
* @protected
|
|
61
61
|
* @static
|
|
62
62
|
* @param {IStyleIMportMap[]} plugins
|
|
63
|
-
* @returns {*} {Promise<
|
|
63
|
+
* @returns {*} {Promise<IObject[]>}
|
|
64
64
|
*/
|
|
65
65
|
static async loadPlugins(mode, configs = []) {
|
|
66
66
|
const moduleMap = {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script 动态加载工具类
|
|
3
|
+
*
|
|
4
|
+
* 从 CDN 动态加载 JS 脚本文件,具备以下特性:
|
|
5
|
+
* - 已成功加载的路径永久缓存,避免重复插入 script 标签
|
|
6
|
+
* - 同一时刻对同一路径的多次调用共享同一个 Promise(请求去重)
|
|
7
|
+
* - 加载失败不写入缓存,允许下次重试
|
|
8
|
+
* - 加载前检查 DOM 中是否已存在相同 src 的 script 标签
|
|
9
|
+
* - 支持配置 async、defer、crossOrigin、type 等脚本属性
|
|
10
|
+
*
|
|
11
|
+
* @author chitanda
|
|
12
|
+
* @date 2026-04-17
|
|
13
|
+
*/
|
|
14
|
+
/** Script 加载选项 */
|
|
15
|
+
export interface IScriptOptions {
|
|
16
|
+
/** 是否异步加载,默认 true */
|
|
17
|
+
async?: boolean;
|
|
18
|
+
/** 是否延迟加载 */
|
|
19
|
+
defer?: boolean;
|
|
20
|
+
/** 跨域属性 */
|
|
21
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
22
|
+
/** 脚本 MIME 类型,默认 'text/javascript' */
|
|
23
|
+
type?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Script 动态加载工具类
|
|
27
|
+
*
|
|
28
|
+
* @class ScriptLoader
|
|
29
|
+
*/
|
|
30
|
+
declare class ScriptLoader {
|
|
31
|
+
/** 已成功加载的脚本 URL 集合(永久缓存) */
|
|
32
|
+
private _loadedSet;
|
|
33
|
+
/** 正在加载中的脚本 URL 对应的 Promise(用于请求去重) */
|
|
34
|
+
private _pendingMap;
|
|
35
|
+
/**
|
|
36
|
+
* 动态加载单个 JS 脚本文件
|
|
37
|
+
*
|
|
38
|
+
* 同一 URL 只会加载一次,首次调用时的 options 生效。
|
|
39
|
+
*
|
|
40
|
+
* @param {string} url 脚本文件的完整 URL
|
|
41
|
+
* @param {IScriptOptions} [options] 脚本加载选项
|
|
42
|
+
* @returns {Promise<void>} 加载完成后 resolve;加载失败则 reject
|
|
43
|
+
*/
|
|
44
|
+
load(url: string, options?: IScriptOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* 加载 ExcelJS 库
|
|
47
|
+
*
|
|
48
|
+
* @return {*} {Promise<IObject>}
|
|
49
|
+
*/
|
|
50
|
+
loadExcelsJs(): Promise<IObject>;
|
|
51
|
+
/**
|
|
52
|
+
* 并发加载多个 JS 脚本文件
|
|
53
|
+
*
|
|
54
|
+
* @param {string[]} urls 脚本文件 URL 列表
|
|
55
|
+
* @param {IScriptOptions} [options] 脚本加载选项,对所有 URL 生效
|
|
56
|
+
* @returns {Promise<void>} 所有文件均加载完成后 resolve;任一失败则 reject
|
|
57
|
+
*/
|
|
58
|
+
loadBatch(urls: string[], options?: IScriptOptions): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
/** Script 动态加载工具单例 */
|
|
61
|
+
export declare const scriptLoader: ScriptLoader;
|
|
62
|
+
export {};
|