@gct-paas/core 0.0.1-dev.6 → 0.0.1-dev.8
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.min.cjs +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/_virtual/_commonjsHelpers.mjs +40 -0
- package/es/_virtual/index.mjs +7 -0
- package/es/constants/index.d.ts +5 -1
- package/es/constants/index.mjs +3 -2
- package/es/enums/app-designer/index.d.ts +80 -0
- package/es/enums/app-designer/index.mjs +58 -0
- package/es/enums/appEnum.d.ts +605 -0
- package/es/enums/appEnum.mjs +356 -0
- package/es/enums/appStateEnum.d.ts +14 -0
- package/es/enums/appStateEnum.mjs +12 -0
- package/es/enums/authActionEnum.d.ts +50 -0
- package/es/enums/authActionEnum.mjs +55 -0
- package/es/enums/breakpointEnum.d.ts +18 -0
- package/es/enums/breakpointEnum.mjs +28 -0
- package/es/enums/cacheEnum.d.ts +19 -0
- package/es/enums/cacheEnum.mjs +23 -0
- package/es/enums/designEnum.d.ts +82 -0
- package/es/enums/designEnum.mjs +72 -0
- package/es/enums/exceptionEnum.d.ts +17 -0
- package/es/enums/exceptionEnum.mjs +19 -0
- package/es/enums/httpEnum.d.ts +65 -0
- package/es/enums/httpEnum.mjs +63 -0
- package/es/enums/index.d.ts +16 -0
- package/es/enums/index.mjs +22 -0
- package/es/enums/menuEnum.d.ts +35 -0
- package/es/enums/menuEnum.mjs +40 -0
- package/es/enums/page-designer/designer.d.ts +277 -0
- package/es/enums/page-designer/designer.mjs +330 -0
- package/es/enums/page-designer/index.d.ts +4 -0
- package/es/enums/page-designer/index.mjs +6 -0
- package/es/enums/page-designer/panel.d.ts +243 -0
- package/es/enums/page-designer/panel.mjs +195 -0
- package/es/enums/page-designer/toolkit.d.ts +10 -0
- package/es/enums/page-designer/toolkit.mjs +14 -0
- package/es/enums/page-designer/widget.d.ts +316 -0
- package/es/enums/page-designer/widget.mjs +335 -0
- package/es/enums/pageEnum.d.ts +11 -0
- package/es/enums/pageEnum.mjs +15 -0
- package/es/enums/plugin-enum.d.ts +20 -0
- package/es/enums/plugin-enum.mjs +9 -0
- package/es/enums/processEnum.d.ts +35 -0
- package/es/enums/processEnum.mjs +28 -0
- package/es/enums/roleEnum.d.ts +4 -0
- package/es/enums/roleEnum.mjs +8 -0
- package/es/enums/sizeEnum.d.ts +5 -0
- package/es/enums/sizeEnum.mjs +9 -0
- package/es/global/gct/gct.d.ts +47 -0
- package/es/global/gct/gct.mjs +49 -0
- package/es/global/index.d.ts +1 -0
- package/es/global/index.mjs +3 -0
- package/es/index.d.ts +14 -0
- package/es/index.mjs +43 -1
- package/es/interface/controller/i-designer-controller.d.ts +116 -0
- package/es/interface/controller/i-designer-controller.mjs +1 -0
- package/es/interface/controller/index.d.ts +1 -0
- package/es/interface/controller/index.mjs +1 -0
- package/es/interface/hooks/i-designer-hooks.d.ts +26 -0
- package/es/interface/hooks/i-designer-hooks.mjs +3 -0
- package/es/interface/hooks/index.d.ts +1 -0
- package/es/interface/hooks/index.mjs +1 -0
- package/es/interface/i-import-style-map/i-import-style-map.d.ts +15 -0
- package/es/interface/i-import-style-map/i-import-style-map.mjs +1 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +14 -0
- package/es/interface/i-pinia-action/i-global-actions.mjs +1 -0
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +16 -0
- package/es/interface/i-pinia-getter/i-global-getters.mjs +1 -0
- package/es/interface/i-pinia-state/i-global-state.d.ts +15 -0
- package/es/interface/i-pinia-state/i-global-state.mjs +1 -0
- package/es/interface/index.d.ts +8 -0
- package/es/interface/index.mjs +6 -0
- package/es/interface/low-code-types/index.d.ts +4 -0
- package/es/interface/low-code-types/index.mjs +5 -0
- package/es/interface/low-code-types/modal-types.d.ts +67 -0
- package/es/interface/low-code-types/modal-types.mjs +3 -0
- package/es/interface/low-code-types/model/index.d.ts +5338 -0
- package/es/interface/low-code-types/model/index.mjs +1 -0
- package/es/interface/low-code-types/schema/index.d.ts +12 -0
- package/es/interface/low-code-types/schema/index.mjs +1 -0
- package/es/interface/low-code-types/widget-basic-types.d.ts +655 -0
- package/es/interface/low-code-types/widget-basic-types.mjs +3 -0
- package/es/interface/state/i-designer-state.d.ts +39 -0
- package/es/interface/state/i-designer-state.mjs +1 -0
- package/es/interface/state/index.d.ts +1 -0
- package/es/interface/state/index.mjs +1 -0
- package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +541 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/async-series-hook/async-series-hook.mjs +73 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/index.mjs +2 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs +100 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs +2 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/array/array.mjs +47 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/index.mjs +5 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/object/object.mjs +24 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event/qx-event.mjs +94 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event-emitter/qx-event-emitter.mjs +146 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/type-util/type-util.mjs +149 -0
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/util/util.mjs +227 -0
- package/es/provider/i-designer-provider/i-designer-provider.d.ts +102 -0
- package/es/provider/i-designer-provider/i-designer-provider.mjs +1 -0
- package/es/provider/index.d.ts +1 -0
- package/es/provider/index.mjs +1 -0
- package/es/register/designer-register/designer-register.d.ts +58 -0
- package/es/register/designer-register/designer-register.mjs +70 -0
- package/es/register/index.d.ts +2 -0
- package/es/register/index.mjs +4 -0
- package/es/register/render-register/render-register.d.ts +59 -0
- package/es/register/render-register/render-register.mjs +65 -0
- package/es/state/global-pinia-state/global-pinia-state.d.ts +16 -0
- package/es/state/global-pinia-state/global-pinia-state.mjs +11 -0
- package/es/state/index.d.ts +1 -0
- package/es/state/index.mjs +3 -0
- package/es/store/global-store.d.ts +2 -0
- package/es/store/global-store.mjs +22 -0
- package/es/store/index.d.ts +20 -0
- package/es/store/index.mjs +21 -0
- package/es/types/index.d.ts +46 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.mjs +2 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +86 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +164 -0
- package/es/utils/plugin-static-resource/plugin-static-resource.d.ts +41 -0
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -0
- package/package.json +14 -6
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createPinia, setActivePinia } from 'pinia';
|
|
2
|
+
import { useGlobalStore } from './global-store.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
class GlobalStoreUtil {
|
|
6
|
+
/**
|
|
7
|
+
* 全局唯一实例
|
|
8
|
+
*/
|
|
9
|
+
pinia = createPinia();
|
|
10
|
+
/**
|
|
11
|
+
* 全局状态管理实例
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
store;
|
|
15
|
+
constructor() {
|
|
16
|
+
setActivePinia(this.pinia);
|
|
17
|
+
this.store = useGlobalStore();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { GlobalStoreUtil };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import 'systemjs';
|
|
3
|
+
import type { GctGlobal } from '../global';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
/**
|
|
7
|
+
* paas 平台全局对象
|
|
8
|
+
*/
|
|
9
|
+
const gct_paas: GctGlobal;
|
|
10
|
+
|
|
11
|
+
interface Window {
|
|
12
|
+
/**
|
|
13
|
+
* paas 平台全局对象
|
|
14
|
+
*
|
|
15
|
+
* @type {GctGlobal}
|
|
16
|
+
*/
|
|
17
|
+
gct_paas: GctGlobal;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 任意参数对象
|
|
22
|
+
*
|
|
23
|
+
* @author zhanghanrui
|
|
24
|
+
* @date 2024-03-19 19:03:20
|
|
25
|
+
* @interface IParams
|
|
26
|
+
*/
|
|
27
|
+
type IParams = Record<string | symbol, any>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 任意数据对象
|
|
31
|
+
*
|
|
32
|
+
* @author zhanghanrui
|
|
33
|
+
* @date 2024-03-19 19:03:25
|
|
34
|
+
* @interface IData
|
|
35
|
+
*/
|
|
36
|
+
type IData = Record<string | symbol, any>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 任意对象结构
|
|
40
|
+
*
|
|
41
|
+
* @author zhanghanrui
|
|
42
|
+
* @date 2024-03-19 19:03:46
|
|
43
|
+
* @interface IObject
|
|
44
|
+
*/
|
|
45
|
+
type IObject = Record<string | symbol, any>;
|
|
46
|
+
}
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.mjs
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { Platform } from '../../enums';
|
|
3
|
+
/**
|
|
4
|
+
* 插件包处理工具类
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class PluginPgkUtil
|
|
8
|
+
*/
|
|
9
|
+
export declare class PluginPgkUtil {
|
|
10
|
+
/**
|
|
11
|
+
* 插件配置缓存
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
* @type {Map<string, IObject[]>}
|
|
15
|
+
*/
|
|
16
|
+
private static cache;
|
|
17
|
+
/**
|
|
18
|
+
* 模块缓存
|
|
19
|
+
*
|
|
20
|
+
* @private
|
|
21
|
+
* @static
|
|
22
|
+
*/
|
|
23
|
+
private static cacheModule;
|
|
24
|
+
/**
|
|
25
|
+
* todo: 临时获取插件包列表
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
* @static
|
|
29
|
+
* @returns {*}
|
|
30
|
+
*/
|
|
31
|
+
private static loadList;
|
|
32
|
+
/**
|
|
33
|
+
* 加载插件包配置
|
|
34
|
+
*
|
|
35
|
+
* @static
|
|
36
|
+
* @param {PluginModeEnum} mode 插件模式
|
|
37
|
+
* @param {Platform} platform
|
|
38
|
+
* @param {string[]} [kit]
|
|
39
|
+
* @returns {*} {Promise<IStyleIMportMap[]>}
|
|
40
|
+
*/
|
|
41
|
+
private static loadPluginConfig;
|
|
42
|
+
/**
|
|
43
|
+
* 批量加载平台界面 system js 插件包
|
|
44
|
+
*
|
|
45
|
+
* @static
|
|
46
|
+
* @param {IStyleIMportMap[]} plugins
|
|
47
|
+
* @returns {*} {Promise<System.Module[]>}
|
|
48
|
+
*/
|
|
49
|
+
private static loadPlugins;
|
|
50
|
+
/**
|
|
51
|
+
* 加载插件包
|
|
52
|
+
*
|
|
53
|
+
* @private
|
|
54
|
+
* @static
|
|
55
|
+
* @param {App} app
|
|
56
|
+
* @param {PluginModeEnum} mode
|
|
57
|
+
* @param {Platform} platform
|
|
58
|
+
* @returns {*}
|
|
59
|
+
*/
|
|
60
|
+
private static loadPlugin;
|
|
61
|
+
/**
|
|
62
|
+
* 加载设计态插件包
|
|
63
|
+
*
|
|
64
|
+
* @static
|
|
65
|
+
* @param {App} app
|
|
66
|
+
* @param {Platform} platform
|
|
67
|
+
* @returns {*} {Promise<IObject[]>}
|
|
68
|
+
*/
|
|
69
|
+
static loadDesignPlugin(app: App, platform: Platform, kit?: string[]): Promise<IObject[]>;
|
|
70
|
+
/**
|
|
71
|
+
* 加载绘制态移动端插件包
|
|
72
|
+
*
|
|
73
|
+
* @static
|
|
74
|
+
* @param {App} app
|
|
75
|
+
* @returns {*} {Promise<IObject[]>}
|
|
76
|
+
*/
|
|
77
|
+
static loadMobilePlugin(app: App, kit?: string[]): Promise<IObject[]>;
|
|
78
|
+
/**
|
|
79
|
+
* 加载绘制态网页端端插件包
|
|
80
|
+
*
|
|
81
|
+
* @static
|
|
82
|
+
* @param {App} app
|
|
83
|
+
* @returns {*} {Promise<IObject[]>}
|
|
84
|
+
*/
|
|
85
|
+
static loadWebPlugin(app: App, kit?: string[]): Promise<IObject[]>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import path from '../../_virtual/index.mjs';
|
|
2
|
+
import { PLUGIN_BASE_URL } from '../../constants/index.mjs';
|
|
3
|
+
import '../../enums/index.mjs';
|
|
4
|
+
import { PluginModeEnum } from '../../enums/plugin-enum.mjs';
|
|
5
|
+
import { Platform } from '../../enums/page-designer/widget.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
class PluginPgkUtil {
|
|
9
|
+
/**
|
|
10
|
+
* 插件配置缓存
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {Map<string, IObject[]>}
|
|
14
|
+
*/
|
|
15
|
+
static cache = /* @__PURE__ */ new Map();
|
|
16
|
+
/**
|
|
17
|
+
* 模块缓存
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
* @static
|
|
21
|
+
*/
|
|
22
|
+
static cacheModule = /* @__PURE__ */ new Map();
|
|
23
|
+
/**
|
|
24
|
+
* todo: 临时获取插件包列表
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @static
|
|
28
|
+
* @returns {*}
|
|
29
|
+
*/
|
|
30
|
+
static async loadList() {
|
|
31
|
+
const headers = new Headers();
|
|
32
|
+
headers.append(
|
|
33
|
+
"Token",
|
|
34
|
+
"eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJHQ1QiLCJ1c2VySWQiOiJFZ3lMQnpjbVF0ODhGdldNIiwidXNlcm5hbWUiOiJnY3QtYWRtaW4iLCJmdWxsbmFtZSI6IueuoeeQhuWRmCIsImlhdCI6MTczOTE1ODExNSwiZXhwIjoxNzQwMzY3NzE1fQ.mJo58rfQ266UqAQYFvSMlmJii-LxXHrFpL-HHokWOxk4eJzGmRX_REpLK5ZHmdUmmYkz57vsDtgrquDGtAeM6A"
|
|
35
|
+
);
|
|
36
|
+
headers.append("tenant-id", "HcWBpsZxX5LkiGzT");
|
|
37
|
+
headers.append("source", "501");
|
|
38
|
+
headers.append("App-Tag", "__platform__");
|
|
39
|
+
headers.append("Branch-Id", "ibxt");
|
|
40
|
+
headers.append("Lang", "zh-CN");
|
|
41
|
+
headers.append("timezone", "UTC+08:00");
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(
|
|
44
|
+
"http://paas.paasdev.gct-paas.com/gct-platform/api/plugin/list",
|
|
45
|
+
{
|
|
46
|
+
method: "GET",
|
|
47
|
+
headers,
|
|
48
|
+
redirect: "follow"
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
return response.json();
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 加载插件包配置
|
|
58
|
+
*
|
|
59
|
+
* @static
|
|
60
|
+
* @param {PluginModeEnum} mode 插件模式
|
|
61
|
+
* @param {Platform} platform
|
|
62
|
+
* @param {string[]} [kit]
|
|
63
|
+
* @returns {*} {Promise<IStyleIMportMap[]>}
|
|
64
|
+
*/
|
|
65
|
+
static async loadPluginConfig(mode, platform, kit = []) {
|
|
66
|
+
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
67
|
+
if (this.cache.has(tag)) {
|
|
68
|
+
return this.cache.get(tag);
|
|
69
|
+
}
|
|
70
|
+
const configs = await this.loadList();
|
|
71
|
+
if (configs.length > 0) {
|
|
72
|
+
this.cache.set(tag, configs);
|
|
73
|
+
}
|
|
74
|
+
return configs;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 批量加载平台界面 system js 插件包
|
|
78
|
+
*
|
|
79
|
+
* @static
|
|
80
|
+
* @param {IStyleIMportMap[]} plugins
|
|
81
|
+
* @returns {*} {Promise<System.Module[]>}
|
|
82
|
+
*/
|
|
83
|
+
static async loadPlugins(mode, configs) {
|
|
84
|
+
if (configs.length > 0) {
|
|
85
|
+
const plugins = configs.map((plugin) => {
|
|
86
|
+
const baseUrl = path.join(PLUGIN_BASE_URL, plugin.name, "latest/dist");
|
|
87
|
+
return {
|
|
88
|
+
imports: {
|
|
89
|
+
[plugin.name]: `${baseUrl}/${mode}.system.min.js`
|
|
90
|
+
},
|
|
91
|
+
styles: {
|
|
92
|
+
[plugin.name]: `${baseUrl}/${mode}.min.css`
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const all = [];
|
|
97
|
+
plugins.forEach((plugin) => {
|
|
98
|
+
System.addImportMap(plugin);
|
|
99
|
+
if (plugin.imports) {
|
|
100
|
+
Object.keys(plugin.imports).forEach((key) => {
|
|
101
|
+
all.push(System.import(key));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return Promise.all(all);
|
|
106
|
+
}
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 加载插件包
|
|
111
|
+
*
|
|
112
|
+
* @private
|
|
113
|
+
* @static
|
|
114
|
+
* @param {App} app
|
|
115
|
+
* @param {PluginModeEnum} mode
|
|
116
|
+
* @param {Platform} platform
|
|
117
|
+
* @returns {*}
|
|
118
|
+
*/
|
|
119
|
+
static async loadPlugin(app, mode, platform, kit) {
|
|
120
|
+
const plugins = await this.loadPluginConfig(mode, platform);
|
|
121
|
+
const modules = await this.loadPlugins(mode, plugins);
|
|
122
|
+
modules.forEach((module) => {
|
|
123
|
+
if (module.default) {
|
|
124
|
+
app.use(module.default);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
128
|
+
this.cacheModule.set(tag, modules);
|
|
129
|
+
return plugins;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 加载设计态插件包
|
|
133
|
+
*
|
|
134
|
+
* @static
|
|
135
|
+
* @param {App} app
|
|
136
|
+
* @param {Platform} platform
|
|
137
|
+
* @returns {*} {Promise<IObject[]>}
|
|
138
|
+
*/
|
|
139
|
+
static loadDesignPlugin(app, platform, kit = []) {
|
|
140
|
+
return this.loadPlugin(app, PluginModeEnum.DESIGN, platform, kit);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 加载绘制态移动端插件包
|
|
144
|
+
*
|
|
145
|
+
* @static
|
|
146
|
+
* @param {App} app
|
|
147
|
+
* @returns {*} {Promise<IObject[]>}
|
|
148
|
+
*/
|
|
149
|
+
static loadMobilePlugin(app, kit = []) {
|
|
150
|
+
return this.loadPlugin(app, PluginModeEnum.MOBILE, Platform.MOBILE, kit);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 加载绘制态网页端端插件包
|
|
154
|
+
*
|
|
155
|
+
* @static
|
|
156
|
+
* @param {App} app
|
|
157
|
+
* @returns {*} {Promise<IObject[]>}
|
|
158
|
+
*/
|
|
159
|
+
static loadWebPlugin(app, kit = []) {
|
|
160
|
+
return this.loadPlugin(app, PluginModeEnum.WEB, Platform.WEB, kit);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { PluginPgkUtil };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件静态资源工具类
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-11-03 10:11:08
|
|
6
|
+
* @export
|
|
7
|
+
* @class PluginStaticResource
|
|
8
|
+
*/
|
|
9
|
+
export declare class PluginStaticResource {
|
|
10
|
+
private isDev;
|
|
11
|
+
/**
|
|
12
|
+
* 计算出的静态资源跟路径
|
|
13
|
+
*
|
|
14
|
+
* @protected
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
protected baseDir: string;
|
|
18
|
+
/**
|
|
19
|
+
* mete 路径解析对象
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2023-07-06 20:07:36
|
|
23
|
+
* @protected
|
|
24
|
+
* @type {URL}
|
|
25
|
+
*/
|
|
26
|
+
protected url: URL;
|
|
27
|
+
/**
|
|
28
|
+
* 插件静态资源工具类.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} mateUrl
|
|
31
|
+
* @param {boolean} [isDev=false]
|
|
32
|
+
*/
|
|
33
|
+
constructor(mateUrl: string, isDev?: boolean);
|
|
34
|
+
/**
|
|
35
|
+
* 合并输出静态资源目录
|
|
36
|
+
*
|
|
37
|
+
* @param {string} pathStr
|
|
38
|
+
* @return {*} {string}
|
|
39
|
+
*/
|
|
40
|
+
dir(pathStr: string): string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import path from '../../_virtual/index.mjs';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class PluginStaticResource {
|
|
5
|
+
/**
|
|
6
|
+
* 插件静态资源工具类.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} mateUrl
|
|
9
|
+
* @param {boolean} [isDev=false]
|
|
10
|
+
*/
|
|
11
|
+
constructor(mateUrl, isDev = false) {
|
|
12
|
+
this.isDev = isDev;
|
|
13
|
+
this.url = new URL(mateUrl);
|
|
14
|
+
this.baseDir = path.dirname(this.url.pathname);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 计算出的静态资源跟路径
|
|
18
|
+
*
|
|
19
|
+
* @protected
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
baseDir;
|
|
23
|
+
/**
|
|
24
|
+
* mete 路径解析对象
|
|
25
|
+
*
|
|
26
|
+
* @author chitanda
|
|
27
|
+
* @date 2023-07-06 20:07:36
|
|
28
|
+
* @protected
|
|
29
|
+
* @type {URL}
|
|
30
|
+
*/
|
|
31
|
+
url;
|
|
32
|
+
/**
|
|
33
|
+
* 合并输出静态资源目录
|
|
34
|
+
*
|
|
35
|
+
* @param {string} pathStr
|
|
36
|
+
* @return {*} {string}
|
|
37
|
+
*/
|
|
38
|
+
dir(pathStr) {
|
|
39
|
+
if (this.isDev === true) {
|
|
40
|
+
return pathStr;
|
|
41
|
+
}
|
|
42
|
+
return this.url.origin + path.resolve(this.baseDir, pathStr);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { PluginStaticResource };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -38,16 +38,24 @@
|
|
|
38
38
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
39
39
|
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
40
40
|
"publish:beta": "npm run build && npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
|
|
41
|
-
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
41
|
+
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/",
|
|
42
|
+
"apis": "node ./src/service/index.js"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
+
"axios": "^1.7.9",
|
|
46
|
+
"path-browserify": "^1.0.1",
|
|
47
|
+
"pinia": "^2.3.1",
|
|
48
|
+
"qx-util": "^0.4.8",
|
|
49
|
+
"systemjs": "^6.15.1",
|
|
50
|
+
"vue": "^3.5.13",
|
|
51
|
+
"vue-i18n": "9.6.5"
|
|
45
52
|
},
|
|
46
53
|
"devDependencies": {
|
|
47
|
-
"@gct-paas/
|
|
54
|
+
"@gct-paas/build": "workspace:*",
|
|
55
|
+
"@types/path-browserify": "^1.0.3",
|
|
56
|
+
"fs-extra": "^11.3.0"
|
|
48
57
|
},
|
|
49
58
|
"peerDependencies": {
|
|
50
59
|
"vue": "^3.x"
|
|
51
|
-
}
|
|
52
|
-
"gitHead": "37b7b649cffcb0a4942903278a80a85ac9d4e7d7"
|
|
60
|
+
}
|
|
53
61
|
}
|