@gct-paas/core 0.1.6-dev.1 → 0.1.6-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/dist/index.esm.min.js +1 -1
- package/es/constants/core.d.ts +1 -0
- package/es/constants/core.mjs +27 -1
- package/es/constants/index.d.ts +1 -1
- package/es/create-app-vue.d.ts +1 -1
- package/es/create-app-vue.mjs +1 -1
- package/es/enums/appEnum.mjs +4 -0
- package/es/enums/globalEnum.d.ts +29 -0
- package/es/enums/globalEnum.mjs +33 -1
- package/es/global/gct/gct.mjs +1 -0
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useObserver.d.ts +13 -0
- package/es/hooks/useObserver.mjs +46 -0
- package/es/index.mjs +24 -12
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -2
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -1
- package/es/locale/index.mjs +7 -2
- package/es/modules/env-manager/env-manager.const.d.ts +2 -0
- package/es/modules/env-manager/env-manager.const.mjs +3 -1
- package/es/modules/env-manager/env-manager.d.ts +4 -0
- package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
- package/es/modules/env-manager/env-manager.mjs +11 -3
- package/es/modules/env-manager/index.mjs +3 -0
- package/es/modules/error-handler/error-handler.const.mjs +7 -0
- package/es/modules/mqtt/constants/mqtt.const.mjs +12 -0
- package/es/modules/user-stores/store/tenant.store.d.ts +3 -5
- package/es/modules/user-stores/store/tenant.store.mjs +10 -12
- package/es/modules/user-stores/store/user.store.mjs +11 -4
- package/es/state/global-pinia-state/global-pinia-state.mjs +3 -1
- package/es/store/global-store.mjs +9 -4
- package/es/store/index.d.ts +1 -1
- package/es/store/session-store.d.ts +1 -0
- package/es/store/session-store.mjs +5 -2
- package/es/store/storage-store.mjs +3 -0
- package/es/types/index.d.ts +6 -0
- package/es/utils/data-prems/const.mjs +2 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/namespace/namespace.mjs +1 -0
- package/es/utils/openUtil/overlay-container/overlay-container.d.ts +1 -1
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +28 -23
- package/es/utils/tools/tools.d.ts +4 -2
- package/es/utils/tools/tools.mjs +20 -5
- package/package.json +3 -3
|
@@ -25,6 +25,9 @@ var useGlobalStore = defineStore("global-store", {
|
|
|
25
25
|
async setContext(ctx = {}) {
|
|
26
26
|
Object.assign(this.context, ctx);
|
|
27
27
|
},
|
|
28
|
+
async setAid(aid) {
|
|
29
|
+
this.setContext({ aid });
|
|
30
|
+
},
|
|
28
31
|
async init() {
|
|
29
32
|
const paramStr = location.pathname.split("/")[2];
|
|
30
33
|
if (paramStr) {
|
|
@@ -33,12 +36,14 @@ var useGlobalStore = defineStore("global-store", {
|
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
async loadAppInfo() {
|
|
36
|
-
|
|
39
|
+
const res = await _api.apaas.designerCommon.getGetApp();
|
|
40
|
+
this.appInfo = res;
|
|
37
41
|
},
|
|
42
|
+
/**加載运行时全局常量显示 */
|
|
38
43
|
async loadEmptySetting() {
|
|
39
|
-
const
|
|
40
|
-
if (!value) return;
|
|
41
|
-
Object.assign(this.globalSetting, JSON.parse(value));
|
|
44
|
+
const res = await _gct.api.apaas.basicConfig.getDetail({ configEnum: PlatformSettingEnum.GLOBAL });
|
|
45
|
+
if (!res?.value) return;
|
|
46
|
+
Object.assign(this.globalSetting, JSON.parse(res.value));
|
|
42
47
|
},
|
|
43
48
|
setProjectName(name) {
|
|
44
49
|
this.projectName = name;
|
package/es/store/index.d.ts
CHANGED
|
@@ -1,7 +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
|
+
export { globalRefSession, ENV } from './session-store';
|
|
5
5
|
/**
|
|
6
6
|
* 全局的状态管理工具类
|
|
7
7
|
*
|
|
@@ -2,6 +2,9 @@ import { useSessionStorage } from "@vueuse/core";
|
|
|
2
2
|
/**
|
|
3
3
|
* 全局双向绑定持续化缓存Map
|
|
4
4
|
*/
|
|
5
|
-
var globalRefSession = useSessionStorage("GCT_GLOBAL_SESSION:PAAS", {
|
|
5
|
+
var globalRefSession = useSessionStorage("GCT_GLOBAL_SESSION:PAAS", {
|
|
6
|
+
/**登录登出标识 */
|
|
7
|
+
currentPlatOrAppId: "" });
|
|
8
|
+
var ENV = useSessionStorage("ENV", "");
|
|
6
9
|
//#endregion
|
|
7
|
-
export { globalRefSession };
|
|
10
|
+
export { ENV, globalRefSession };
|
package/es/types/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ var moduleConfig = {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
var getInterfaceApi = {
|
|
52
|
+
/** 获取分类列表 */
|
|
52
53
|
getCategoryList: ({ moduleType }) => {
|
|
53
54
|
if (moduleType === CategoryModuleEnum.CHECK_LIST) return _api.apaas.formRelate.getCategory({ moduleType });
|
|
54
55
|
const { modelKey, bsKeyList } = moduleConfig[moduleType] || {};
|
|
@@ -58,6 +59,7 @@ var getInterfaceApi = {
|
|
|
58
59
|
bsKey: bsKeyList.list
|
|
59
60
|
}, {}, {});
|
|
60
61
|
},
|
|
62
|
+
/** 获取模板列表 */
|
|
61
63
|
getTmplsList: (params, config) => {
|
|
62
64
|
if (params.moduleType === CategoryModuleEnum.CHECK_LIST) throw new Error("该模块不支持模板列表接口");
|
|
63
65
|
const { isQuery, ...otherParams } = params || {};
|
package/es/utils/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './openUtil';
|
|
|
13
13
|
export { KitPkgUtil } from './kit-pkg-util/kit-pkg-util';
|
|
14
14
|
export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
|
|
15
15
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
16
|
-
export { getToken, setToken, getTenant, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
16
|
+
export { getToken, setToken, getTenant, tenantRef, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
17
17
|
export * from './uuid/uuid';
|
|
18
18
|
export * from './value-helper/value-helper';
|
|
19
19
|
export { interceptors } from './axios/interceptors';
|
|
@@ -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):
|
|
64
|
+
static createVueApp(rootComponent: Component, rootProps?: IData): App<Element>;
|
|
65
65
|
/**
|
|
66
66
|
* 初始化飘窗
|
|
67
67
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createApp, h
|
|
1
|
+
import { createApp, h } from "vue";
|
|
2
2
|
import { QXEvent } from "qx-util";
|
|
3
3
|
//#region src/utils/openUtil/overlay-container/overlay-container.ts
|
|
4
4
|
/**
|
|
@@ -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
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare const tenantRef: Readonly<Ref<string>>;
|
|
1
3
|
/**
|
|
2
4
|
* 获取认证令牌
|
|
3
5
|
*
|
|
@@ -23,9 +25,9 @@ export declare function getTenant(): string | null;
|
|
|
23
25
|
* 设置租户标识至 cookie
|
|
24
26
|
*
|
|
25
27
|
* @export
|
|
26
|
-
* @param {string} tenant
|
|
28
|
+
* @param {string} [tenant]
|
|
27
29
|
*/
|
|
28
|
-
export declare function setTenant(tenant
|
|
30
|
+
export declare function setTenant(tenant?: string): void;
|
|
29
31
|
/**
|
|
30
32
|
* 是否为移动端设备
|
|
31
33
|
*/
|
package/es/utils/tools/tools.mjs
CHANGED
|
@@ -2,9 +2,25 @@ import { CoreConst } from "../../constants/core.mjs";
|
|
|
2
2
|
import "../../constants/index.mjs";
|
|
3
3
|
import qs from "qs";
|
|
4
4
|
import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
|
|
5
|
+
import { customRef, readonly } from "vue";
|
|
5
6
|
import { clearCookie, getCookie, setCookie } from "qx-util";
|
|
6
7
|
//#region src/utils/tools/tools.ts
|
|
7
8
|
/**
|
|
9
|
+
* 租户 cookie 双向绑定响应式引用:get 直接读 cookie,set 直接写 cookie
|
|
10
|
+
*/
|
|
11
|
+
var _tenantRef = customRef((track, trigger) => ({
|
|
12
|
+
get() {
|
|
13
|
+
track();
|
|
14
|
+
return getCookie(CoreConst.TENANT) || "";
|
|
15
|
+
},
|
|
16
|
+
set(value) {
|
|
17
|
+
if (value) setCookie(CoreConst.TENANT, value, 7, true);
|
|
18
|
+
else clearCookie(CoreConst.TENANT, true);
|
|
19
|
+
trigger();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
var tenantRef = readonly(_tenantRef);
|
|
23
|
+
/**
|
|
8
24
|
* 获取认证令牌
|
|
9
25
|
*
|
|
10
26
|
* @export
|
|
@@ -30,17 +46,16 @@ function setToken(token) {
|
|
|
30
46
|
* @returns {*} {(string | null)}
|
|
31
47
|
*/
|
|
32
48
|
function getTenant() {
|
|
33
|
-
return
|
|
49
|
+
return _tenantRef.value || null;
|
|
34
50
|
}
|
|
35
51
|
/**
|
|
36
52
|
* 设置租户标识至 cookie
|
|
37
53
|
*
|
|
38
54
|
* @export
|
|
39
|
-
* @param {string} tenant
|
|
55
|
+
* @param {string} [tenant]
|
|
40
56
|
*/
|
|
41
57
|
function setTenant(tenant) {
|
|
42
|
-
|
|
43
|
-
else clearCookie(CoreConst.TENANT, true);
|
|
58
|
+
_tenantRef.value = tenant || "";
|
|
44
59
|
}
|
|
45
60
|
/**
|
|
46
61
|
* 是否为移动端设备
|
|
@@ -140,4 +155,4 @@ function createWhiteImageWithText(name, width, height) {
|
|
|
140
155
|
return canvas.toDataURL("image/png");
|
|
141
156
|
}
|
|
142
157
|
//#endregion
|
|
143
|
-
export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams };
|
|
158
|
+
export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, 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.
|
|
3
|
+
"version": "0.1.6-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.1.
|
|
36
|
+
"@gct-paas/api": "^0.1.6-dev.5",
|
|
37
37
|
"@module-federation/runtime": "^2.2.3",
|
|
38
38
|
"@vueuse/core": "^14.1.0",
|
|
39
39
|
"async-validator": "^4.2.5",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"playwright": "^1.58.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@gct-paas/api": "^0.1.
|
|
61
|
+
"@gct-paas/api": "^0.1.6-dev.5",
|
|
62
62
|
"vue": ">=3",
|
|
63
63
|
"vue-i18n": ">=11",
|
|
64
64
|
"vue-router": ">=4"
|