@gct-paas/render 0.1.4-dev.15 → 0.1.4-dev.16
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/loader.esm.min.js +1 -1
- package/es/Event/Dependency/controller.d.ts +1 -1
- package/es/Event/bizServiceRequest.d.ts +1 -1
- package/es/Event/bizServiceRequest.mjs +2 -2
- package/es/index.mjs +3 -2
- package/es/utils/expression/index.d.ts +1 -1
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.mjs +2 -1
- package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.d.ts +43 -0
- package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs +65 -0
- package/package.json +15 -7
|
@@ -13,7 +13,7 @@ export declare const BizService: {
|
|
|
13
13
|
* @param config
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
|
-
export declare function $httpBizService(path: PathType, params: Record<string, unknown>, config
|
|
16
|
+
export declare function $httpBizService(path: PathType, params: Record<string, unknown>, ...config: [Record<string, unknown>, AxiosRequestConfig] | [AxiosRequestConfig]): Promise<unknown>;
|
|
17
17
|
/**post 业务服务请求 */
|
|
18
18
|
export declare function $request(modelKey: string, action: PathType['action'], { body, query }?: IObject, config?: AxiosRequestConfig): Promise<unknown>;
|
|
19
19
|
type BizServiceParams = Record<string, unknown>;
|
|
@@ -20,8 +20,8 @@ var BizService = {
|
|
|
20
20
|
* @param config
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
async function $httpBizService(path, params, config
|
|
24
|
-
return BizService[BizServiceEnum[path.action]](path, params, config);
|
|
23
|
+
async function $httpBizService(path, params, ...config) {
|
|
24
|
+
return BizService[BizServiceEnum[path.action]](path, params, ...config);
|
|
25
25
|
}
|
|
26
26
|
/**post 业务服务请求 */
|
|
27
27
|
async function $request(modelKey, action, { body = {}, query = {} } = {}, config = {}) {
|
package/es/index.mjs
CHANGED
|
@@ -3,11 +3,12 @@ import { DESIGN_DATA_KEY_TAG, DESIGN_TYPE, DateRangeMap, DesignItemAttribute, ge
|
|
|
3
3
|
import { ControllerType, DesignRenderViewPrefix, RenderNodeType } from "./constant/index.mjs";
|
|
4
4
|
import { RenderNodeRegister } from "./register/node/node.register.mjs";
|
|
5
5
|
import "./register/index.mjs";
|
|
6
|
+
import { calculate, identify } from "./utils/expression/index.mjs";
|
|
6
7
|
import { transformPropsField } from "./utils/field-attrs/index.mjs";
|
|
8
|
+
import { RenderPluginPgkUtil } from "./utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs";
|
|
7
9
|
import { schemaToStyle, useStyle } from "./utils/useStyle.mjs";
|
|
8
10
|
import { FieldSchema, initFieldWidgetRuntime } from "./utils/getFieldSchema.mjs";
|
|
9
11
|
import { addDataByForm, setDataByForm, transSelectData, transformData, transformDataToDict, transformSourceData } from "./utils/model-transformer.mjs";
|
|
10
|
-
import { calculate, identify } from "./utils/expression/index.mjs";
|
|
11
12
|
import { getRefInfoId } from "./utils/get-ref-data.mjs";
|
|
12
13
|
import "./utils/index.mjs";
|
|
13
14
|
import HandwritingPad_default from "./components/HandwritingPad.vue.mjs";
|
|
@@ -28,4 +29,4 @@ function onInit() {
|
|
|
28
29
|
else console.warn("渲染注册已存在,可能存在重复注册问题,请检查是否有重复引入渲染包的情况");
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
|
-
export { Context, ControllerType, DESIGN_DATA_KEY_TAG, DESIGN_TYPE, DateRangeMap, DesignItemAttribute, DesignRenderViewPrefix, Events, FieldSchema, GctComponent, Globals, HandwritingPad_default as HandwritingPad, PageTypeEnum, RenderNodeRegister, RenderNodeType, RenderRegister, addDataByForm, calculate, calculateDepResult, dependencyToShow, dependencyToShowSync, formMap, getDefaultDate, getDisabledDate, getMobileDateRange, getPageTitle, getPremission, getRefInfoId, globalVarCaches, identify, initFieldWidgetRuntime, insetDep, onInit, pageDataforJson, pageGlobaVariables, schemaToStyle, setDataByForm, setFormData, tableWidgetByDept, tableWidgetToShow, transSelectData, transformData, transformDataToDict, transformPropsField, transformSourceData, useDependency, useDependencyByRequired, useDependencyToShow, useDependencyToShowList, useDesignRenderController, useDisplayRuleColumnByStyles, useDisplayRuleOptions, useGctSelect, useStyle, useVisibileByRuleHook };
|
|
32
|
+
export { Context, ControllerType, DESIGN_DATA_KEY_TAG, DESIGN_TYPE, DateRangeMap, DesignItemAttribute, DesignRenderViewPrefix, Events, FieldSchema, GctComponent, Globals, HandwritingPad_default as HandwritingPad, PageTypeEnum, RenderNodeRegister, RenderNodeType, RenderPluginPgkUtil, RenderRegister, addDataByForm, calculate, calculateDepResult, dependencyToShow, dependencyToShowSync, formMap, getDefaultDate, getDisabledDate, getMobileDateRange, getPageTitle, getPremission, getRefInfoId, globalVarCaches, identify, initFieldWidgetRuntime, insetDep, onInit, pageDataforJson, pageGlobaVariables, schemaToStyle, setDataByForm, setFormData, tableWidgetByDept, tableWidgetToShow, transSelectData, transformData, transformDataToDict, transformPropsField, transformSourceData, useDependency, useDependencyByRequired, useDependencyToShow, useDependencyToShowList, useDesignRenderController, useDisplayRuleColumnByStyles, useDisplayRuleOptions, useGctSelect, useStyle, useVisibileByRuleHook };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseMemoizeReturn } from '@vueuse/core';
|
|
2
2
|
export declare const identify: UseMemoizeReturn<string[], [expr: string, isAll?: boolean | undefined]>;
|
|
3
|
-
export declare const calculate: UseMemoizeReturn<Promise<IObject>, [
|
|
3
|
+
export declare const calculate: UseMemoizeReturn<Promise<IObject | number>, [
|
|
4
4
|
expr: string,
|
|
5
5
|
values: IObject
|
|
6
6
|
]>;
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export { calculate, identify } from './expression';
|
|
1
2
|
export { transformPropsField } from './field-attrs';
|
|
3
|
+
export { RenderPluginPgkUtil } from './render-plugin-pkg-util/render-plugin-pkg-util';
|
|
2
4
|
export { useStyle, schemaToStyle } from './useStyle';
|
|
3
5
|
export { initFieldWidgetRuntime, FieldSchema } from './getFieldSchema';
|
|
4
6
|
export { transformDataToDict, transformSourceData, transformData, addDataByForm, setDataByForm, transSelectData, type RowData, type DictMap, } from './model-transformer';
|
|
5
|
-
export { calculate, identify } from './expression';
|
|
6
7
|
export { getRefInfoId } from './get-ref-data';
|
package/es/utils/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import "./expression/index.mjs";
|
|
1
2
|
import "./field-attrs/index.mjs";
|
|
3
|
+
import "./render-plugin-pkg-util/render-plugin-pkg-util.mjs";
|
|
2
4
|
import "./useStyle.mjs";
|
|
3
5
|
import "./getFieldSchema.mjs";
|
|
4
6
|
import "./model-transformer.mjs";
|
|
5
|
-
import "./expression/index.mjs";
|
|
6
7
|
import "./get-ref-data.mjs";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PluginTenant } from '@gct-paas/api/platform';
|
|
2
|
+
import { PluginModeEnum, PluginPgkUtil } from '@gct-paas/core';
|
|
3
|
+
/**
|
|
4
|
+
* 插件包处理工具类
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class RenderPluginPgkUtil
|
|
8
|
+
*/
|
|
9
|
+
export declare class RenderPluginPgkUtil extends PluginPgkUtil {
|
|
10
|
+
/**
|
|
11
|
+
* 加载渲染态指定端插件包
|
|
12
|
+
*
|
|
13
|
+
* @static
|
|
14
|
+
* @param {PluginModeEnum} mode
|
|
15
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
16
|
+
* @return {*} {Promise<void>}
|
|
17
|
+
*/
|
|
18
|
+
static loadRenderPlugin(mode: PluginModeEnum, configs?: PluginTenant['plugins']): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 加载渲染态移动端插件包
|
|
21
|
+
*
|
|
22
|
+
* @static
|
|
23
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
24
|
+
* @return {*} {Promise<void>}
|
|
25
|
+
*/
|
|
26
|
+
static loadMobilePlugin(configs?: PluginTenant['plugins']): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 加载渲染态平板端插件包
|
|
29
|
+
*
|
|
30
|
+
* @static
|
|
31
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
32
|
+
* @return {*} {Promise<void>}
|
|
33
|
+
*/
|
|
34
|
+
static loadPadPlugin(configs?: PluginTenant['plugins']): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* 加载渲染态网页端插件包
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
40
|
+
* @return {*} {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
static loadWebPlugin(configs?: PluginTenant['plugins']): Promise<void>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { PluginModeEnum, PluginPgkUtil } from "@gct-paas/core";
|
|
2
|
+
//#region src/utils/render-plugin-pkg-util/render-plugin-pkg-util.ts
|
|
3
|
+
/**
|
|
4
|
+
* 插件包处理工具类
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class RenderPluginPgkUtil
|
|
8
|
+
*/
|
|
9
|
+
var RenderPluginPgkUtil = class extends PluginPgkUtil {
|
|
10
|
+
/**
|
|
11
|
+
* 加载渲染态指定端插件包
|
|
12
|
+
*
|
|
13
|
+
* @static
|
|
14
|
+
* @param {PluginModeEnum} mode
|
|
15
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
16
|
+
* @return {*} {Promise<void>}
|
|
17
|
+
*/
|
|
18
|
+
static async loadRenderPlugin(mode, configs = []) {
|
|
19
|
+
try {
|
|
20
|
+
const moduleMap = await this.loadPlugins(mode, configs);
|
|
21
|
+
configs.forEach((plugin) => {
|
|
22
|
+
const key = plugin.key;
|
|
23
|
+
if (!moduleMap[key]) {
|
|
24
|
+
console.error(`${key} 插件加载失败,请检查插件配置是否正确`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
_gct.register.render.register(key, moduleMap[key].default);
|
|
28
|
+
});
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error(error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 加载渲染态移动端插件包
|
|
35
|
+
*
|
|
36
|
+
* @static
|
|
37
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
38
|
+
* @return {*} {Promise<void>}
|
|
39
|
+
*/
|
|
40
|
+
static loadMobilePlugin(configs = []) {
|
|
41
|
+
return this.loadRenderPlugin(PluginModeEnum.MOBILE, configs);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 加载渲染态平板端插件包
|
|
45
|
+
*
|
|
46
|
+
* @static
|
|
47
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
48
|
+
* @return {*} {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
static loadPadPlugin(configs = []) {
|
|
51
|
+
return this.loadRenderPlugin(PluginModeEnum.PAD, configs);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 加载渲染态网页端插件包
|
|
55
|
+
*
|
|
56
|
+
* @static
|
|
57
|
+
* @param {PluginTenant['plugins']} [configs=[]]
|
|
58
|
+
* @return {*} {Promise<void>}
|
|
59
|
+
*/
|
|
60
|
+
static loadWebPlugin(configs = []) {
|
|
61
|
+
return this.loadRenderPlugin(PluginModeEnum.WEB, configs);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { RenderPluginPgkUtil };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/render",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台网页端底包",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@gct-paas/api": "^0.1.1",
|
|
46
|
-
"@gct-paas/core": "0.1.4-dev.
|
|
47
|
-
"@gct-paas/core-web": "0.1.4-dev.
|
|
48
|
-
"@gct-paas/schema": "0.1.4-dev.
|
|
49
|
-
"@gct-paas/scss": "0.1.4-dev.
|
|
45
|
+
"@gct-paas/api": "^0.1.2-dev.1",
|
|
46
|
+
"@gct-paas/core": "0.1.4-dev.16",
|
|
47
|
+
"@gct-paas/core-web": "0.1.4-dev.16",
|
|
48
|
+
"@gct-paas/schema": "0.1.4-dev.16",
|
|
49
|
+
"@gct-paas/scss": "0.1.4-dev.16",
|
|
50
50
|
"@vueuse/core": "^14.1.0",
|
|
51
51
|
"axios": "^1.13.2",
|
|
52
52
|
"bignumber.js": "^10.0.2",
|
|
@@ -63,5 +63,13 @@
|
|
|
63
63
|
"@types/estraverse": "^5.1.7",
|
|
64
64
|
"@types/estree": "^1.0.8"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@gct-paas/api": "*",
|
|
68
|
+
"@gct-paas/core": "*",
|
|
69
|
+
"@gct-paas/core-web": "*",
|
|
70
|
+
"@gct-paas/schema": "*",
|
|
71
|
+
"@gct-paas/scss": "*",
|
|
72
|
+
"vue": ">=3"
|
|
73
|
+
},
|
|
74
|
+
"gitHead": "cee8da739039182f4df08a2c0126cdd578fbc33b"
|
|
67
75
|
}
|