@gct-paas/render 0.1.4-dev.9 → 0.1.5-dev.1

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.
Files changed (110) hide show
  1. package/dist/index.min.css +2 -0
  2. package/dist/loader.esm.min.js +1 -0
  3. package/es/Event/Dependency/controller.d.ts +1 -1
  4. package/es/Event/Dependency/controller.mjs +81 -94
  5. package/es/Event/Dependency/displayRule.mjs +130 -68
  6. package/es/Event/Dependency/useDependency.mjs +117 -0
  7. package/es/Event/Dependency/useDependencyToShow.d.ts +1 -1
  8. package/es/Event/Dependency/useDependencyToShow.mjs +100 -96
  9. package/es/Event/baseEvent.d.ts +28 -32
  10. package/es/Event/baseEvent.mjs +383 -439
  11. package/es/Event/bizServiceRequest.d.ts +1 -1
  12. package/es/Event/bizServiceRequest.mjs +29 -41
  13. package/es/Event/eventType.d.ts +1 -1
  14. package/es/Event/eventType.mjs +1 -0
  15. package/es/Event/index.d.ts +6 -3
  16. package/es/Event/index.mjs +7 -0
  17. package/es/Event/utils/appRedis.mjs +39 -49
  18. package/es/Event/utils/globalLoading.d.ts +13 -0
  19. package/es/Event/utils/globalLoading.mjs +104 -0
  20. package/es/Event/utils/processRovedInfo.mjs +228 -294
  21. package/es/Event/utils/runGlobalByPage.d.ts +4 -1
  22. package/es/Event/utils/runGlobalByPage.mjs +297 -301
  23. package/es/Event/utils/verificationVar.mjs +32 -38
  24. package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
  25. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  26. package/es/components/HandwritingPad.vue.d.ts +27 -0
  27. package/es/components/HandwritingPad.vue.mjs +7 -0
  28. package/es/components/HandwritingPad.vue_vue_type_script_setup_true_name_HandwritingPad_lang.mjs +109 -0
  29. package/es/components/HandwritingPad.vue_vue_type_style_index_0_scoped_d5b980b7_lang.css +9 -0
  30. package/es/components/index.d.ts +2 -0
  31. package/es/components/index.mjs +1 -0
  32. package/es/constant/data-format.d.ts +52 -0
  33. package/es/constant/data-format.mjs +66 -0
  34. package/es/constant/date-time.d.ts +99 -0
  35. package/es/constant/date-time.mjs +187 -0
  36. package/es/constant/index.d.ts +94 -0
  37. package/es/constant/index.mjs +100 -0
  38. package/es/controller/design-render/design-render.controller.d.ts +18 -0
  39. package/es/controller/design-render/design-render.controller.mjs +78 -0
  40. package/es/controller/design-render-base/design-render-base.controller.d.ts +9 -0
  41. package/es/controller/design-render-base/design-render-base.controller.mjs +12 -0
  42. package/es/controller/design-render-container/design-render-container.controller.d.ts +4 -0
  43. package/es/controller/design-render-container/design-render-container.controller.mjs +5 -0
  44. package/es/controller/design-render-item/design-render-item.controller.d.ts +4 -0
  45. package/es/controller/design-render-item/design-render-item.controller.mjs +5 -0
  46. package/es/controller/index.d.ts +4 -0
  47. package/es/controller/index.mjs +4 -0
  48. package/es/enums/index.mjs +17 -5
  49. package/es/hooks/index.d.ts +3 -0
  50. package/es/hooks/index.mjs +3 -0
  51. package/es/hooks/use-design-render-controller/use-design-render-controller.d.ts +11 -0
  52. package/es/hooks/use-design-render-controller/use-design-render-controller.mjs +32 -0
  53. package/es/hooks/useStorageRef.mjs +35 -31
  54. package/es/hooks/widgets/useFileAttrsHooks.d.ts +28 -0
  55. package/es/hooks/widgets/useFileAttrsHooks.mjs +37 -0
  56. package/es/index.d.ts +5 -0
  57. package/es/index.mjs +44 -21
  58. package/es/interface/controller/i-design-render-base.controller.d.ts +43 -0
  59. package/es/interface/controller/i-design-render-container.controller.d.ts +7 -0
  60. package/es/interface/controller/i-design-render-item.controller.d.ts +7 -0
  61. package/es/interface/controller/i-design-render.controller.d.ts +93 -0
  62. package/es/interface/index.d.ts +12 -0
  63. package/es/interface/provider/i-render-base-node.provider.d.ts +45 -0
  64. package/es/interface/provider/i-render-container-node.provider.d.ts +30 -0
  65. package/es/interface/provider/i-render-editor-node.provider.d.ts +29 -0
  66. package/es/interface/provider/i-render-item-node.provider.d.ts +30 -0
  67. package/es/interface/state/i-design-render-base.state.d.ts +19 -0
  68. package/es/interface/state/i-design-render-container.state.d.ts +11 -0
  69. package/es/interface/state/i-design-render-item.state.d.ts +11 -0
  70. package/es/interface/state/i-design-render.state.d.ts +18 -0
  71. package/es/loader.d.ts +1 -0
  72. package/es/register/index.d.ts +1 -0
  73. package/es/register/index.mjs +2 -0
  74. package/es/register/node/node.register.d.ts +92 -0
  75. package/es/register/node/node.register.mjs +116 -0
  76. package/es/register/render-register/render-register.mjs +63 -58
  77. package/es/state/design-render/design-render.state.d.ts +13 -0
  78. package/es/state/design-render/design-render.state.mjs +15 -0
  79. package/es/state/design-render-base/design-render-base.state.d.ts +4 -0
  80. package/es/state/design-render-base/design-render-base.state.mjs +6 -0
  81. package/es/state/design-render-container/design-render-container.state.d.ts +4 -0
  82. package/es/state/design-render-item/design-render-item.state.d.ts +4 -0
  83. package/es/state/index.d.ts +4 -0
  84. package/es/utils/cacheAdapter.mjs +62 -54
  85. package/es/utils/expression/index.d.ts +1 -1
  86. package/es/utils/expression/index.mjs +105 -122
  87. package/es/utils/expression/regularExpression/methods.mjs +426 -567
  88. package/es/utils/field-attrs/basicAttrs.mjs +56 -80
  89. package/es/utils/field-attrs/index.mjs +16 -13
  90. package/es/utils/get-ref-data.mjs +41 -59
  91. package/es/utils/getFieldSchema.mjs +66 -80
  92. package/es/utils/index.d.ts +6 -3
  93. package/es/utils/index.mjs +12 -0
  94. package/es/utils/model-transformer.mjs +74 -64
  95. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.d.ts +43 -0
  96. package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs +65 -0
  97. package/es/utils/search/index.d.ts +3 -0
  98. package/es/utils/search/index.mjs +3 -0
  99. package/es/utils/search/listhook.d.ts +17 -0
  100. package/es/utils/search/listhook.mjs +70 -0
  101. package/es/utils/search/search-default-value.d.ts +7 -0
  102. package/es/utils/search/search-default-value.mjs +244 -0
  103. package/es/utils/search/search-hooks.d.ts +6 -0
  104. package/es/utils/search/search-hooks.mjs +67 -0
  105. package/es/utils/useStyle.d.ts +2 -2
  106. package/es/utils/useStyle.mjs +20 -15
  107. package/package.json +21 -17
  108. package/dist/index.esm.min.mjs +0 -7758
  109. package/dist/index.min.cjs +0 -9
  110. package/dist/index.system.min.js +0 -9
@@ -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 };
@@ -0,0 +1,3 @@
1
+ export * from './search-hooks';
2
+ export * from './search-default-value';
3
+ export * from './listhook';
@@ -0,0 +1,3 @@
1
+ import "./search-hooks.mjs";
2
+ import "./search-default-value.mjs";
3
+ import "./listhook.mjs";
@@ -0,0 +1,17 @@
1
+ export declare function getIExp(exp: string, ignoreOptions?: never[]): string;
2
+ export declare function getIKeywordFieldKeys(searchField: string[], ignoreOptions?: never[]): string[];
3
+ /**
4
+ * 关键字段搜索
5
+ * @param searchField 需要搜索的字段
6
+ * @param keyword 搜索的关键字
7
+ */
8
+ export declare const getQueryDateByKeyWord: ({ searchField, keyword, }: IObject) => object;
9
+ /**
10
+ * 数据筛选生成查询条件
11
+ * @param datafilter
12
+ * @returns
13
+ */
14
+ export declare const useQueryfilter: (datafilter: IObject[] | IObject) => {
15
+ query: IObject;
16
+ getExp: (...arg: string[]) => string;
17
+ };
@@ -0,0 +1,70 @@
1
+ import { globalVarCaches } from "../../Event/utils/runGlobalByPage.mjs";
2
+ import "../../Event/index.mjs";
3
+ import { isArray } from "lodash-es";
4
+ //#region src/utils/search/listhook.ts
5
+ /** 数据类型 */
6
+ var ValueTypeEnum = {
7
+ FIXED: "FIXED",
8
+ SYS: "SYS",
9
+ FIELD: "FIELD",
10
+ VAR: "VAR"
11
+ };
12
+ function getIExp(exp, ignoreOptions = []) {
13
+ if (ignoreOptions?.[0] == "ignoreCase") return exp?.replace(/\./g, ".i");
14
+ return exp;
15
+ }
16
+ function getIKeywordFieldKeys(searchField, ignoreOptions = []) {
17
+ if (ignoreOptions?.[0] == "ignoreCase") return searchField?.map((i) => {
18
+ const arr = i.split(".");
19
+ return `${arr[0]}.i${arr[1]}`;
20
+ });
21
+ return searchField;
22
+ }
23
+ /**
24
+ * 关键字段搜索
25
+ * @param searchField 需要搜索的字段
26
+ * @param keyword 搜索的关键字
27
+ */
28
+ var getQueryDateByKeyWord = ({ searchField, keyword }) => {
29
+ if (!keyword) return {};
30
+ return searchField?.reduce((total, filedKey) => {
31
+ const expkey = filedKey.split(".").length > 1 ? filedKey : filedKey + ".like";
32
+ total[expkey] = keyword;
33
+ return total;
34
+ }, {}) || {};
35
+ };
36
+ /**
37
+ * 数据筛选生成查询条件
38
+ * @param datafilter
39
+ * @returns
40
+ */
41
+ var useQueryfilter = (datafilter) => {
42
+ let queryfilter = {}, exp = "";
43
+ if (isArray(datafilter)) queryfilter = { ...datafilter.reduce((total, curr) => {
44
+ const key = curr.key + "." + curr.ope;
45
+ total[key] = curr.value;
46
+ return total;
47
+ }, {}) };
48
+ else try {
49
+ const dataRule = JSON.parse(datafilter?.dataRule);
50
+ exp = dataRule?.exp;
51
+ const typeMap = dataRule?.typeMap || {};
52
+ const query = dataRule?.query || {};
53
+ for (const k in query) if (typeMap[k] === ValueTypeEnum.VAR) queryfilter[k] = globalVarCaches.value?.[query[k]]?.value;
54
+ else queryfilter[k] = query[k];
55
+ } catch (error) {
56
+ console.log(error);
57
+ }
58
+ function getExp(...arg) {
59
+ const explist = [exp, ...arg].filter((i) => i);
60
+ const expkey = explist.join(",");
61
+ if (explist.length > 1) return `AND(${expkey})`;
62
+ else return expkey;
63
+ }
64
+ return {
65
+ query: queryfilter,
66
+ getExp
67
+ };
68
+ };
69
+ //#endregion
70
+ export { getIExp, getIKeywordFieldKeys, getQueryDateByKeyWord, useQueryfilter };
@@ -0,0 +1,7 @@
1
+ import { ISearchSchema } from '@gct-paas/schema';
2
+ import { GetAppResponse } from '@gct-paas/api/apaas';
3
+ interface IParams {
4
+ appInfo?: GetAppResponse;
5
+ }
6
+ export declare const defaultValMap: Map<string, (widget: ISearchSchema, params?: IParams) => Promise<string | string[] | null | undefined | number | number[] | boolean>>;
7
+ export {};
@@ -0,0 +1,244 @@
1
+ import { DefaultDateTypeConst, FIELD_TYPE, isMultipleOperator } from "@gct-paas/core";
2
+ import dayjs from "dayjs";
3
+ //#region src/utils/search/search-default-value.ts
4
+ var defaultValMap = /* @__PURE__ */ new Map();
5
+ /**
6
+ * 组织选择默认值
7
+ *
8
+ * @author zhanghanrui
9
+ * @date 2024-09-11 17:09:35
10
+ * @param {*} widget
11
+ * @param {*} [_params={}]
12
+ * @return {*} {Promise<any>}
13
+ */
14
+ async function org_and_org_multi(widget, _params = {}) {
15
+ const { defaultValue } = widget.props;
16
+ if (!defaultValue) return null;
17
+ if (Array.isArray(defaultValue)) {
18
+ if (!defaultValue.includes("CURRENT_ORG")) return null;
19
+ } else if (defaultValue !== "CURRENT_ORG") return null;
20
+ const orgInfo = await _api.platform.tenant.getUserInfo();
21
+ if (orgInfo) {
22
+ const res = await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({
23
+ pageNo: 1,
24
+ pageSize: 999999999
25
+ });
26
+ if (res) {
27
+ const arr = res.data;
28
+ if (arr) {
29
+ if (arr.findIndex((item) => item.masterOrgId === orgInfo.masterOrgId) !== -1) return isMultipleOperator(widget.props.ope) ? [orgInfo.masterOrgId] : orgInfo.masterOrgId;
30
+ }
31
+ }
32
+ return null;
33
+ }
34
+ }
35
+ defaultValMap.set(FIELD_TYPE.ORG, org_and_org_multi);
36
+ defaultValMap.set(FIELD_TYPE.ORG_MULTI, org_and_org_multi);
37
+ /**
38
+ * 人员选择默认值
39
+ *
40
+ * @author zhanghanrui
41
+ * @date 2024-09-11 17:09:20
42
+ * @param {*} widget
43
+ * @param {*} [_params={}]
44
+ * @return {*} {Promise<any>}
45
+ */
46
+ async function user_and_user_multi(widget, _params = {}) {
47
+ const { defaultValue } = widget.props;
48
+ if (!defaultValue) return null;
49
+ if (Array.isArray(defaultValue)) {
50
+ if (!defaultValue.includes("CURRENT_USER")) return null;
51
+ } else if (defaultValue !== "CURRENT_USER") return null;
52
+ const userInfo = await _api.platform.user.getInfo();
53
+ if (userInfo) {
54
+ const res = await _api.apaas.designerCommon.getGetCanBeUsedOrgUser({
55
+ pageNo: 1,
56
+ pageSize: 999999999
57
+ });
58
+ if (res) {
59
+ const arr = res.data;
60
+ if (arr) {
61
+ if (arr.findIndex((item) => item.id === userInfo.userId) !== -1) return isMultipleOperator(widget.props.ope) ? [userInfo.userId] : userInfo.userId;
62
+ }
63
+ }
64
+ return null;
65
+ }
66
+ }
67
+ defaultValMap.set(FIELD_TYPE.USER, user_and_user_multi);
68
+ defaultValMap.set(FIELD_TYPE.USER_MULTI, user_and_user_multi);
69
+ /**
70
+ * 枚举选择默认值
71
+ *
72
+ * @author zhanghanrui
73
+ * @date 2024-09-12 20:09:57
74
+ * @param {*} widget
75
+ * @param {*} [_params={}]
76
+ * @return {*} {Promise<any>}
77
+ */
78
+ async function enum_and_enum_multi(widget, _params = {}) {
79
+ const { defaultValue } = widget.props;
80
+ if (!defaultValue || defaultValue.length === 0) return null;
81
+ return defaultValue;
82
+ }
83
+ defaultValMap.set(FIELD_TYPE.ENUM, enum_and_enum_multi);
84
+ defaultValMap.set(FIELD_TYPE.ENUM_MULTI, enum_and_enum_multi);
85
+ /**
86
+ * 数值默认值
87
+ *
88
+ * @author zhanghanrui
89
+ * @date 2024-09-12 20:09:57
90
+ * @param {*} widget
91
+ * @param {*} [_params={}]
92
+ * @return {*} {Promise<any>}
93
+ */
94
+ async function number(widget, _params = {}) {
95
+ const { defaultValue } = widget.props;
96
+ if (defaultValue == null) return null;
97
+ return defaultValue;
98
+ }
99
+ defaultValMap.set(FIELD_TYPE.INTEGER, number);
100
+ defaultValMap.set(FIELD_TYPE.LONG, number);
101
+ defaultValMap.set(FIELD_TYPE.DOUBLE, number);
102
+ defaultValMap.set(FIELD_TYPE.DECIMAL, number);
103
+ /**
104
+ * 文本默认值
105
+ *
106
+ * @author zhanghanrui
107
+ * @date 2024-09-12 20:09:57
108
+ * @param {*} widget
109
+ * @param {*} [_params={}]
110
+ * @return {*} {Promise<any>}
111
+ */
112
+ async function text(widget, _params = {}) {
113
+ const { defaultValue } = widget.props;
114
+ if (!defaultValue) return null;
115
+ return defaultValue;
116
+ }
117
+ defaultValMap.set(FIELD_TYPE.TEXT, text);
118
+ defaultValMap.set(FIELD_TYPE.LONG_TEXT, number);
119
+ /**
120
+ * 数值选择默认值
121
+ *
122
+ * @author zhanghanrui
123
+ * @date 2024-09-12 20:09:57
124
+ * @param {*} widget
125
+ * @param {*} [_params={}]
126
+ * @return {*} {Promise<any>}
127
+ */
128
+ async function boolean(widget, _params = {}) {
129
+ const { defaultValue } = widget.props;
130
+ if (defaultValue == null || defaultValue === "") return null;
131
+ return defaultValue;
132
+ }
133
+ defaultValMap.set(FIELD_TYPE.BOOLEAN, boolean);
134
+ /**
135
+ * 日期选择默认值
136
+ *
137
+ * @author zhanghanrui
138
+ * @date 2024-09-12 20:09:57
139
+ * @param {*} widget
140
+ * @param {*} [_params={}]
141
+ * @return {*} {Promise<any>}
142
+ */
143
+ async function date(widget, _params = {}) {
144
+ return date_and_date_time(widget, "YYYY-MM-DD");
145
+ }
146
+ defaultValMap.set(FIELD_TYPE.DATE, date);
147
+ /**
148
+ * 日期时间选择默认值
149
+ *
150
+ * @author zhanghanrui
151
+ * @date 2024-09-12 20:09:57
152
+ * @param {*} widget
153
+ * @param {*} [_params={}]
154
+ * @return {*} {Promise<any>}
155
+ */
156
+ async function date_time(widget, _params = {}) {
157
+ return date_and_date_time(widget, "YYYY-MM-DD 00:00:00");
158
+ }
159
+ defaultValMap.set(FIELD_TYPE.DATE_TIME, date_time);
160
+ /**
161
+ * 日期时间+日期默认值初始化
162
+ *
163
+ * 举例:当前时间为2024-9-20
164
+ * 近0天:当天,2024-9-20至2024-9-20
165
+ * 近0周:本周,2024-9-16至2024-9-22
166
+ * 近0月:本月,2024-9-1至2024-9-30
167
+ * 近0年:本年,2024-1-1至2024-12-31
168
+ * 近1天:2024-9-19至 2024-9-19
169
+ * 近1周:2024-9-9至 2024-9-15
170
+ * 近1月:2024-8-1至 2024-8-31
171
+ * 近1年:2023-1-1至 2023-12-31
172
+ * 近2天:2024-9-18至 2024-9-19
173
+ * 近2周:2024-9-2至 2024-9-15
174
+ * 近2月:2024-7-1至 2024-8-31
175
+ * 近2年:2022-1-1至 2023-12-31
176
+ *
177
+ * @author zhanghanrui
178
+ * @date 2024-09-13 15:09:49
179
+ * @param {*} widget
180
+ * @param {string} format
181
+ * @param {*} [_params={}]
182
+ * @return {*} {*}
183
+ */
184
+ function date_and_date_time(widget, _format, _params = {}) {
185
+ const { defaultValueType, defaultValue } = widget.props;
186
+ if (defaultValueType == null || defaultValueType == "") return null;
187
+ const { isRang, fieldType } = widget.props;
188
+ if (!isRang) {
189
+ const format = fieldType === FIELD_TYPE.DATE ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss";
190
+ switch (defaultValueType) {
191
+ case DefaultDateTypeConst.SystemDate: return dayjs(/* @__PURE__ */ new Date()).format(format);
192
+ }
193
+ }
194
+ if (isRang) {
195
+ const fs = fieldType === FIELD_TYPE.DATE ? "YYYY-MM-DD" : "YYYY-MM-DD 00:00:00";
196
+ const fe = fieldType === FIELD_TYPE.DATE ? "YYYY-MM-DD" : "YYYY-MM-DD 23:59:59";
197
+ const num = defaultValue != null ? Number(defaultValue) : 0;
198
+ const now = dayjs();
199
+ switch (defaultValueType) {
200
+ case DefaultDateTypeConst.SystemDate: return isRang ? [now.format(fs), now.format(fe)] : now.format(fs);
201
+ case DefaultDateTypeConst.PastDays: return [now.subtract(num, "day").format(fs), now.subtract(num > 0 ? 1 : 0, "day").format(fe)];
202
+ case DefaultDateTypeConst.PastWeeks: return [now.subtract(num, "week").startOf("isoWeek").format(fs), now.subtract(num > 0 ? 1 : 0, "week").endOf("isoWeek").format(fe)];
203
+ case DefaultDateTypeConst.PastMonths: return [now.subtract(num, "month").startOf("month").format(fs), now.subtract(num > 0 ? 1 : 0, "month").endOf("month").format(fe)];
204
+ case DefaultDateTypeConst.PastYears: return [now.subtract(num, "year").startOf("year").format(fs), now.subtract(num > 0 ? 1 : 0, "year").endOf("year").format(fe)];
205
+ case DefaultDateTypeConst.Yesterday: {
206
+ const yester = now.subtract(1, "day");
207
+ return [yester.format(fs), yester.format(fe)];
208
+ }
209
+ case DefaultDateTypeConst.Past7Days: return [now.subtract(6, "day").format(fs), now.format(fe)];
210
+ case DefaultDateTypeConst.Past30Days: return [now.subtract(29, "day").format(fs), now.format(fe)];
211
+ case DefaultDateTypeConst.ThisWeek: return [now.startOf("isoWeek").format(fs), now.endOf("isoWeek").format(fe)];
212
+ case DefaultDateTypeConst.LastWeek: {
213
+ const lastWeek = now.subtract(1, "week");
214
+ return [lastWeek.startOf("isoWeek").format(fs), lastWeek.endOf("isoWeek").format(fe)];
215
+ }
216
+ case DefaultDateTypeConst.ThisMonth: return [now.startOf("month").format(fs), now.endOf("month").format(fe)];
217
+ case DefaultDateTypeConst.LastMonth: {
218
+ const lastMonth = now.subtract(1, "month");
219
+ return [lastMonth.startOf("month").format(fs), lastMonth.endOf("month").format(fe)];
220
+ }
221
+ case DefaultDateTypeConst.ThisYear: return [now.startOf("year").format(fs), now.endOf("year").format(fe)];
222
+ case DefaultDateTypeConst.LastYear: {
223
+ const lastYear = now.subtract(1, "year");
224
+ return [lastYear.startOf("year").format(fs), lastYear.endOf("year").format(fe)];
225
+ }
226
+ default: return null;
227
+ }
228
+ }
229
+ return null;
230
+ }
231
+ /**
232
+ * 打印机
233
+ * @param widget
234
+ * @param _params
235
+ * @returns
236
+ */
237
+ async function printer(widget, _params = {}) {
238
+ const { defaultValue } = widget.props;
239
+ if (!defaultValue || defaultValue.length === 0) return null;
240
+ return defaultValue;
241
+ }
242
+ defaultValMap.set(FIELD_TYPE.PRINTER, printer);
243
+ //#endregion
244
+ export { defaultValMap };
@@ -0,0 +1,6 @@
1
+ import { ISearchSchema } from '@gct-paas/schema';
2
+ /**查询组件body转化为算子 */
3
+ export declare function useGetBodyBySearch(formState: IObject, cacheColumns: ISearchSchema[], expStr?: string): {
4
+ query: IObject;
5
+ exp: string;
6
+ };
@@ -0,0 +1,67 @@
1
+ import { FIELD_TYPE, SEARCH_SERVICE } from "@gct-paas/core";
2
+ //#region src/utils/search/search-hooks.ts
3
+ var isArrayOpe = [
4
+ SEARCH_SERVICE.CONTAINALL,
5
+ SEARCH_SERVICE.CONTAINANY,
6
+ SEARCH_SERVICE.IN,
7
+ SEARCH_SERVICE.NOTIN
8
+ ];
9
+ /**查询组件body转化为算子 */
10
+ function useGetBodyBySearch(formState, cacheColumns, expStr) {
11
+ /**
12
+ * 转化为post请求的格式
13
+ * @param fieldWidget
14
+ * @param state
15
+ */
16
+ function transformToBody(state) {
17
+ const body = {};
18
+ let exp = expStr || "";
19
+ cacheColumns.forEach((i) => {
20
+ const field = i.props.fieldSearchKey || i.props.field;
21
+ const ope = i.props.ope || [];
22
+ let value = state[i.id];
23
+ if (value !== null && value !== void 0 || i.props.useMore) ope.forEach((o) => {
24
+ value = getMultipleChoiceToArray(value, o);
25
+ const key = `${field}.${o}:${i.id}`, expkey = `${i.id}.${o}`;
26
+ body[key] = i.props.useMore ? null : value;
27
+ exp = exp.replace(expkey, key);
28
+ });
29
+ });
30
+ return {
31
+ body,
32
+ exp
33
+ };
34
+ }
35
+ /** rdo版本关联查询数据单独处理 */
36
+ function transformRdo(state, cacheColumns) {
37
+ if (!cacheColumns.length) return state;
38
+ const filterRdo = cacheColumns.filter((i) => {
39
+ return i.props.fieldType === FIELD_TYPE.RDO_REF;
40
+ });
41
+ if (!filterRdo.length) return state;
42
+ filterRdo.forEach((i) => {
43
+ if (!state[i.id]) return;
44
+ if (Array.isArray(state[i.id])) state[i.id] = state[i.id].map((p) => {
45
+ if (!p) return;
46
+ const [_fId, _cId] = p.split(":");
47
+ return _cId || _fId;
48
+ });
49
+ else {
50
+ const [_fId, _cId] = state[i.id].split(":");
51
+ return _cId || _fId;
52
+ }
53
+ });
54
+ return state;
55
+ }
56
+ const { body, exp } = transformToBody(transformRdo(formState, cacheColumns));
57
+ return {
58
+ query: body,
59
+ exp
60
+ };
61
+ }
62
+ function getMultipleChoiceToArray(value, ope) {
63
+ if (isArrayOpe.indexOf(ope) > -1 && typeof value === "string") return value.split(",");
64
+ else return value;
65
+ }
66
+ //#endregion
67
+ export { useGetBodyBySearch };
@@ -1,5 +1,5 @@
1
- import { LowCodeWidget } from '@gct-paas/schema';
2
- export declare function useStyle(widget: LowCodeWidget.BasicSchema): {
1
+ import { LowCodeWidget, RuntimeModal } from '@gct-paas/schema';
2
+ export declare function useStyle(widget: LowCodeWidget.BasicSchema | RuntimeModal): {
3
3
  wrapperStyle: IObject;
4
4
  wStyle: IObject;
5
5
  labelFont: IObject;
@@ -1,17 +1,22 @@
1
- import { propsToStyle, generateWrapperStyle, extractFontStyle } from '@gct-paas/schema';
2
-
1
+ import { extractFontStyle, generateWrapperStyle, propsToStyle } from "@gct-paas/schema";
2
+ //#region src/utils/useStyle.ts
3
3
  function useStyle(widget) {
4
- const { style = {}, ignoringStyle = [] } = widget || {};
5
- const wStyle = propsToStyle(style);
6
- const wrapperStyle = generateWrapperStyle(style, ignoringStyle);
7
- const labelFont = extractFontStyle(style.labelFont);
8
- const contentFont = extractFontStyle(style.contentFont);
9
- return {
10
- wrapperStyle,
11
- wStyle,
12
- labelFont,
13
- contentFont
14
- };
4
+ const { style = {} } = widget || {};
5
+ const ignoringStyle = "ignoringStyle" in widget ? widget.ignoringStyle ?? [] : [];
6
+ const wStyle = propsToStyle(style);
7
+ return {
8
+ wrapperStyle: generateWrapperStyle(style, ignoringStyle),
9
+ wStyle,
10
+ labelFont: extractFontStyle(style.labelFont),
11
+ contentFont: extractFontStyle(style.contentFont)
12
+ };
15
13
  }
16
-
17
- export { useStyle };
14
+ /**
15
+ * 将样式对象转换为字体样式
16
+ *
17
+ * @param schema - 样式配置对象
18
+ * @returns 转换后的字体样式对象
19
+ */
20
+ var schemaToStyle = (schema) => extractFontStyle(schema);
21
+ //#endregion
22
+ export { schemaToStyle, useStyle };
package/package.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "name": "@gct-paas/render",
3
- "version": "0.1.4-dev.9",
3
+ "version": "0.1.5-dev.1",
4
4
  "type": "module",
5
5
  "description": "paas 平台网页端底包",
6
- "main": "dist/index.min.cjs",
7
- "module": "es/index.mjs",
6
+ "loader": "dist/loader.esm.min.js",
8
7
  "types": "es/index.d.ts",
9
- "system": "dist/index.system.min.js",
10
8
  "exports": {
11
9
  ".": {
12
10
  "types": "./es/index.d.ts",
13
- "import": "./es/index.mjs",
14
- "require": "./dist/index.min.cjs"
11
+ "import": "./es/index.mjs"
15
12
  },
16
13
  "./types": {
17
14
  "types": "./es/types/index.d.ts"
@@ -45,11 +42,11 @@
45
42
  "publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
46
43
  },
47
44
  "dependencies": {
48
- "@gct-paas/api": "0.1.0-dev.8",
49
- "@gct-paas/core": "0.1.4-dev.9",
50
- "@gct-paas/core-web": "0.1.4-dev.9",
51
- "@gct-paas/schema": "0.1.4-dev.9",
52
- "@gct-paas/scss": "0.1.4-dev.9",
45
+ "@gct-paas/api": "^0.1.2-dev.3",
46
+ "@gct-paas/core": "0.1.5-dev.1",
47
+ "@gct-paas/core-web": "0.1.5-dev.1",
48
+ "@gct-paas/schema": "0.1.5-dev.1",
49
+ "@gct-paas/scss": "0.1.5-dev.1",
53
50
  "@vueuse/core": "^14.1.0",
54
51
  "axios": "^1.13.2",
55
52
  "bignumber.js": "^10.0.2",
@@ -57,16 +54,23 @@
57
54
  "escodegen": "^2.1.0",
58
55
  "esprima-next": "5.8.4",
59
56
  "estraverse": "^5.3.0",
60
- "qs": "^6.14.1",
57
+ "lodash-es": "^4.17.23",
58
+ "qs": "^6.15.0",
61
59
  "qx-util": "^0.4.8",
62
- "vue": "^3.5.29"
60
+ "vue": "^3.5.30"
63
61
  },
64
62
  "devDependencies": {
65
- "@gct-paas/build": "^0.1.5-dev.8",
66
63
  "@types/escodegen": "^0.0.10",
67
64
  "@types/estraverse": "^5.1.7",
68
- "@types/estree": "^1.0.8",
69
- "@types/qs": "^6.14.0"
65
+ "@types/estree": "^1.0.8"
70
66
  },
71
- "gitHead": "c51d9883f7d287433d2def4d7338a06773804fbf"
67
+ "peerDependencies": {
68
+ "@gct-paas/api": "^0.1.2-dev.3",
69
+ "@gct-paas/core": "*",
70
+ "@gct-paas/core-web": "*",
71
+ "@gct-paas/schema": "*",
72
+ "@gct-paas/scss": "*",
73
+ "vue": ">=3"
74
+ },
75
+ "gitHead": "d554696d0991c1d14dd5a2a43b277bafe3976371"
72
76
  }