@gct-paas/render 0.1.4-dev.13 → 0.1.4-dev.14

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 (53) hide show
  1. package/dist/index.esm.min.js +1 -6189
  2. package/es/Event/Dependency/displayRule.mjs +66 -2
  3. package/es/Event/baseEvent.mjs +1 -1
  4. package/es/Event/index.d.ts +2 -0
  5. package/es/Event/index.mjs +2 -0
  6. package/es/Event/utils/runGlobalByPage.d.ts +1 -1
  7. package/es/Event/utils/runGlobalByPage.mjs +3 -3
  8. package/es/constant/date-time.d.ts +99 -0
  9. package/es/constant/date-time.mjs +187 -0
  10. package/es/constant/index.d.ts +93 -0
  11. package/es/constant/index.mjs +99 -0
  12. package/es/controller/design-render/design-render.controller.d.ts +18 -0
  13. package/es/controller/design-render/design-render.controller.mjs +78 -0
  14. package/es/controller/design-render-base/design-render-base.controller.d.ts +9 -0
  15. package/es/controller/design-render-base/design-render-base.controller.mjs +12 -0
  16. package/es/controller/design-render-container/design-render-container.controller.d.ts +4 -0
  17. package/es/controller/design-render-container/design-render-container.controller.mjs +5 -0
  18. package/es/controller/design-render-item/design-render-item.controller.d.ts +4 -0
  19. package/es/controller/design-render-item/design-render-item.controller.mjs +5 -0
  20. package/es/controller/index.d.ts +4 -0
  21. package/es/controller/index.mjs +4 -0
  22. package/es/hooks/index.d.ts +2 -0
  23. package/es/hooks/index.mjs +2 -0
  24. package/es/hooks/use-design-render-controller/use-design-render-controller.d.ts +11 -0
  25. package/es/hooks/use-design-render-controller/use-design-render-controller.mjs +32 -0
  26. package/es/index.d.ts +3 -0
  27. package/es/index.mjs +10 -1
  28. package/es/interface/controller/i-design-render-base.controller.d.ts +43 -0
  29. package/es/interface/controller/i-design-render-container.controller.d.ts +7 -0
  30. package/es/interface/controller/i-design-render-item.controller.d.ts +7 -0
  31. package/es/interface/controller/i-design-render.controller.d.ts +93 -0
  32. package/es/interface/index.d.ts +12 -0
  33. package/es/interface/provider/i-render-base-node.provider.d.ts +45 -0
  34. package/es/interface/provider/i-render-container-node.provider.d.ts +30 -0
  35. package/es/interface/provider/i-render-editor-node.provider.d.ts +29 -0
  36. package/es/interface/provider/i-render-item-node.provider.d.ts +30 -0
  37. package/es/interface/state/i-design-render-base.state.d.ts +19 -0
  38. package/es/interface/state/i-design-render-container.state.d.ts +11 -0
  39. package/es/interface/state/i-design-render-item.state.d.ts +11 -0
  40. package/es/interface/state/i-design-render.state.d.ts +18 -0
  41. package/es/register/index.d.ts +1 -0
  42. package/es/register/index.mjs +2 -0
  43. package/es/register/node/node.register.d.ts +92 -0
  44. package/es/register/node/node.register.mjs +116 -0
  45. package/es/state/design-render/design-render.state.d.ts +13 -0
  46. package/es/state/design-render/design-render.state.mjs +15 -0
  47. package/es/state/design-render-base/design-render-base.state.d.ts +4 -0
  48. package/es/state/design-render-base/design-render-base.state.mjs +6 -0
  49. package/es/state/design-render-container/design-render-container.state.d.ts +4 -0
  50. package/es/state/design-render-item/design-render-item.state.d.ts +4 -0
  51. package/es/state/index.d.ts +4 -0
  52. package/es/utils/expression/regularExpression/methods.mjs +1 -1
  53. package/package.json +7 -9
@@ -3,7 +3,7 @@ import "../../utils/index.mjs";
3
3
  import { formMap, getPremission } from "../utils/runGlobalByPage.mjs";
4
4
  import { DisplayType } from "@gct-paas/core";
5
5
  import { watchDebounced } from "@vueuse/core";
6
- import { ref, toRef } from "vue";
6
+ import { reactive, ref, toRef } from "vue";
7
7
  //#region src/Event/Dependency/displayRule.ts
8
8
  /**单组件显隐控制 */
9
9
  function useVisibileByRuleHook(props, id) {
@@ -70,5 +70,69 @@ function playValueByRule(form, formCacheMap, displayRule, callback) {
70
70
  });
71
71
  calculate(displayRule, cache).then(callback);
72
72
  }
73
+ /**
74
+ * 需要做控制的数组组件
75
+ * @param optopns 被控制的数组
76
+ * @param tableForm 需要添加的额外的form {key:object }
77
+ * @returns
78
+ */
79
+ function useDisplayRuleOptions(optopns, tableForm) {
80
+ const OptionsFlag = reactive({});
81
+ return toRef(() => {
82
+ if (!optopns) return [];
83
+ return optopns.filter((i) => {
84
+ const { displayRule, hidden, displayType } = i.props || i;
85
+ /**按钮权限 */
86
+ if (!getPremission(i.id)) OptionsFlag[i.id] = false;
87
+ else if (displayType === DisplayType.CONFIG) OptionsFlag[i.id] = !hidden;
88
+ else getOptionsByDisplayRule({
89
+ displayRule,
90
+ tableForm
91
+ }, (f) => {
92
+ OptionsFlag[i.id] = f;
93
+ });
94
+ return OptionsFlag[i.id];
95
+ });
96
+ });
97
+ }
98
+ function useDisplayRuleColumnByStyles(optopnslist, tableForm) {
99
+ if (!optopnslist?.length) return;
100
+ const ColumnEmptyRule = [];
101
+ const ColumnRule = [];
102
+ optopnslist.forEach((i, index) => {
103
+ if (i.displayRule) ColumnRule.push({
104
+ ...i,
105
+ id: index
106
+ });
107
+ else ColumnEmptyRule.push({
108
+ ...i,
109
+ id: index
110
+ });
111
+ });
112
+ const tagWidgetStyle = useDisplayRuleOptionsBytable(ColumnRule, tableForm);
113
+ const tagDefaultStyle = useDisplayRuleOptionsBytable(ColumnEmptyRule, tableForm);
114
+ return toRef(() => tagWidgetStyle?.value || tagDefaultStyle?.value);
115
+ }
116
+ /**
117
+ * 需要做控制的逻辑数组
118
+ * @param optopns 被控制的数组
119
+ * @param tableForm 需要添加的额外的form {key:object }
120
+ * @returns
121
+ */
122
+ function useDisplayRuleOptionsBytable(optopns, tableForm) {
123
+ const OptionsFlag = reactive({});
124
+ if (!optopns) return;
125
+ return toRef(() => optopns.find((i) => {
126
+ const { displayRule, hidden, displayType } = i.props || i;
127
+ if (displayType === DisplayType.CONFIG) OptionsFlag[i.id] = !hidden;
128
+ else getOptionsByDisplayRule({
129
+ displayRule,
130
+ tableForm
131
+ }, (f) => {
132
+ OptionsFlag[i.id] = f;
133
+ });
134
+ return OptionsFlag[i.id];
135
+ }));
136
+ }
73
137
  //#endregion
74
- export { useVisibileByRuleHook };
138
+ export { useDisplayRuleColumnByStyles, useDisplayRuleOptions, useVisibileByRuleHook };
@@ -5,9 +5,9 @@ import { $httpBizService, $request, BizService } from "./bizServiceRequest.mjs";
5
5
  import { globalLoading } from "./utils/globalLoading.mjs";
6
6
  import { ProcessAppRovedData } from "./utils/processRovedInfo.mjs";
7
7
  import { FormComponents, INNER_EVENT, t } from "@gct-paas/core";
8
+ import dayjs from "dayjs";
8
9
  import * as _ from "lodash-es";
9
10
  import { cloneDeep, differenceBy } from "lodash-es";
10
- import dayjs from "dayjs";
11
11
  import BigNumberJS from "bignumber.js";
12
12
  import { useStyleTag } from "@vueuse/core";
13
13
  import { toRaw } from "vue";
@@ -3,3 +3,5 @@ export { Events, Context, GctComponent, type ModalInstance } from './baseEvent';
3
3
  export * from './eventType';
4
4
  export * from './Dependency/useDependencyToShow';
5
5
  export * from './Dependency/useDependency';
6
+ export * from './Dependency/controller';
7
+ export * from './Dependency/displayRule';
@@ -1,5 +1,7 @@
1
1
  import "./utils/runGlobalByPage.mjs";
2
2
  import "./baseEvent.mjs";
3
3
  import "./eventType.mjs";
4
+ import "./Dependency/controller.mjs";
5
+ import "./Dependency/displayRule.mjs";
4
6
  import "./Dependency/useDependencyToShow.mjs";
5
7
  import "./Dependency/useDependency.mjs";
@@ -326,7 +326,7 @@ export declare class Globals {
326
326
  name: string | undefined;
327
327
  }>;
328
328
  /**注册钩子 */
329
- static usePageHooks<T extends Events = Events>(Event: T, pageEvents: RuntimePageJson['pageEvents'], globalEvents: RuntimePageJson['globalEvents'], pageCallback?: (Event: T) => Promise<void>): {
329
+ static usePageHooks<T extends Events = Events>(Event: T, pageEvents?: RuntimePageJson['pageEvents'], globalEvents?: RuntimePageJson['globalEvents'], pageCallback?: (Event: T) => Promise<void>): {
330
330
  pageload: import('vue').Ref<boolean, boolean>;
331
331
  };
332
332
  }
@@ -266,7 +266,7 @@ var Globals = class Globals {
266
266
  if (pageCallback) await pageCallback(Event);
267
267
  pageload.value = true;
268
268
  /**全局钩子 */
269
- if (globalEvents.pageMounted) for (const fun of this.globalHookCaches.pageMounted) await fun();
269
+ if (globalEvents?.pageMounted) for (const fun of this.globalHookCaches.pageMounted) await fun();
270
270
  const { extraParams, name } = pageEvents?.pageMounted || {};
271
271
  if (name)
272
272
  /**页面钩子 */
@@ -282,12 +282,12 @@ var Globals = class Globals {
282
282
  /**页面销毁时候的钩子函数 */
283
283
  Event.runExportByName(name, extraParams);
284
284
  /**全局钩子 */
285
- if (globalEvents.pageDestroyed) for (const fun of this.globalHookCaches.pageDestroyed) await fun();
285
+ if (globalEvents?.pageDestroyed) for (const fun of this.globalHookCaches.pageDestroyed) await fun();
286
286
  });
287
287
  onActivated(async () => {
288
288
  Globals.setContextByKey(Event.context);
289
289
  /**全局钩子 */
290
- if (globalEvents.pageActivated) for (const fun of this.globalHookCaches.pageActivated) await fun();
290
+ if (globalEvents?.pageActivated) for (const fun of this.globalHookCaches.pageActivated) await fun();
291
291
  const { extraParams, name } = pageEvents?.pageActivated || {};
292
292
  if (name)
293
293
  /**页面钩子 */
@@ -0,0 +1,99 @@
1
+ import { FieldSysVarDefaultValueEnum } from '@gct-paas/core';
2
+ import { default as dayjs, Dayjs } from 'dayjs';
3
+ export declare const DESIGN_TYPE = "view-design";
4
+ export declare const DESIGN_DATA_KEY_TAG = "id";
5
+ /**
6
+ * 设计项标识标签属性
7
+ */
8
+ export declare enum DesignItemAttribute {
9
+ /**
10
+ * 可以激活项的标识
11
+ */
12
+ ACTIVE_TAG = "design-active-item",
13
+ /**
14
+ * 拖拽项标识属性
15
+ */
16
+ DRAG_TAG = "design-drop-item",
17
+ /**
18
+ * 项排序值标识
19
+ */
20
+ INDEX_TAG = "design-item-index",
21
+ /**
22
+ * 设计项标识属性
23
+ */
24
+ NODE_ID_TAG = "design-item-id",
25
+ /**
26
+ * 项文本名称
27
+ */
28
+ DESIGN_NAME = "design-item-name",
29
+ /**
30
+ * 分组标识
31
+ */
32
+ GROUP_TAG = "design-group-tag",
33
+ /**
34
+ * 拖拽组类型
35
+ */
36
+ DRAG_GROUP_TYPE = "drag-group-type",
37
+ /**
38
+ * 是否为行内元素
39
+ */
40
+ IS_INLINE_BLOCK = "is-inline-block",
41
+ /**
42
+ * 特殊情况下,例如表格将表格元素自己复制了好几份,需要指定实际呈现元素在 querySelectorAll 中的位置。便于悬浮或者选中时位置的计算
43
+ */
44
+ SELECTOR_INDEX = "selector-index"
45
+ }
46
+ /** 日期时间可选范围 */
47
+ export declare const DateRangeMap: {
48
+ WEEK_NOW: (current: number) => {
49
+ disabled: boolean;
50
+ minDate: dayjs.Dayjs;
51
+ maxDate: dayjs.Dayjs;
52
+ };
53
+ MONTH_NOW: (current: number) => {
54
+ disabled: boolean;
55
+ minDate: dayjs.Dayjs;
56
+ maxDate: dayjs.Dayjs;
57
+ };
58
+ QUARTER_NOW: (current: number) => {
59
+ disabled: boolean;
60
+ minDate: dayjs.Dayjs;
61
+ maxDate: dayjs.Dayjs;
62
+ };
63
+ YEAR_NOW: (current: number) => {
64
+ disabled: boolean;
65
+ minDate: dayjs.Dayjs;
66
+ maxDate: dayjs.Dayjs;
67
+ };
68
+ WEEk_BEFORE: (current: number) => {
69
+ disabled: boolean;
70
+ minDate: dayjs.Dayjs;
71
+ maxDate: dayjs.Dayjs;
72
+ };
73
+ MONTH_BEFORE: (current: number) => {
74
+ disabled: boolean;
75
+ minDate: dayjs.Dayjs;
76
+ maxDate: dayjs.Dayjs;
77
+ };
78
+ QUARTER_BEFORE: (current: number) => {
79
+ disabled: boolean;
80
+ minDate: dayjs.Dayjs;
81
+ maxDate: dayjs.Dayjs;
82
+ };
83
+ YEAR_BEFORE: (current: number) => {
84
+ disabled: boolean;
85
+ minDate: dayjs.Dayjs;
86
+ maxDate: dayjs.Dayjs;
87
+ };
88
+ DATE_BEFORE: (current: number) => {
89
+ disabled: boolean;
90
+ maxDate: dayjs.Dayjs;
91
+ };
92
+ DATE_AFTER: (current: number) => {
93
+ disabled: boolean;
94
+ minDate: dayjs.Dayjs;
95
+ };
96
+ };
97
+ export declare const getDisabledDate: (current: Dayjs, rangeType: keyof typeof DateRangeMap) => boolean;
98
+ export declare const getMobileDateRange: (rangeType: keyof typeof DateRangeMap) => any;
99
+ export declare const getDefaultDate: (type: FieldSysVarDefaultValueEnum, formatType: string) => string | undefined;
@@ -0,0 +1,187 @@
1
+ import { FieldSysVarDefaultValueEnum } from "@gct-paas/core";
2
+ import dayjs from "dayjs";
3
+ //#region src/constant/date-time.ts
4
+ var DESIGN_TYPE = "view-design";
5
+ var DESIGN_DATA_KEY_TAG = "id";
6
+ /**
7
+ * 设计项标识标签属性
8
+ */
9
+ var DesignItemAttribute = /* @__PURE__ */ function(DesignItemAttribute) {
10
+ /**
11
+ * 可以激活项的标识
12
+ */
13
+ DesignItemAttribute["ACTIVE_TAG"] = "design-active-item";
14
+ /**
15
+ * 拖拽项标识属性
16
+ */
17
+ DesignItemAttribute["DRAG_TAG"] = "design-drop-item";
18
+ /**
19
+ * 项排序值标识
20
+ */
21
+ DesignItemAttribute["INDEX_TAG"] = "design-item-index";
22
+ /**
23
+ * 设计项标识属性
24
+ */
25
+ DesignItemAttribute["NODE_ID_TAG"] = "design-item-id";
26
+ /**
27
+ * 项文本名称
28
+ */
29
+ DesignItemAttribute["DESIGN_NAME"] = "design-item-name";
30
+ /**
31
+ * 分组标识
32
+ */
33
+ DesignItemAttribute["GROUP_TAG"] = "design-group-tag";
34
+ /**
35
+ * 拖拽组类型
36
+ */
37
+ DesignItemAttribute["DRAG_GROUP_TYPE"] = "drag-group-type";
38
+ /**
39
+ * 是否为行内元素
40
+ */
41
+ DesignItemAttribute["IS_INLINE_BLOCK"] = "is-inline-block";
42
+ /**
43
+ * 特殊情况下,例如表格将表格元素自己复制了好几份,需要指定实际呈现元素在 querySelectorAll 中的位置。便于悬浮或者选中时位置的计算
44
+ */
45
+ DesignItemAttribute["SELECTOR_INDEX"] = "selector-index";
46
+ return DesignItemAttribute;
47
+ }({});
48
+ /** 日期时间可选范围 */
49
+ var DateRangeMap = {
50
+ WEEK_NOW: (current) => {
51
+ const startDate = dayjs().startOf("week").add(1, "day");
52
+ const endDate = dayjs().endOf("week").add(1, "day");
53
+ const startTDS = startDate.valueOf();
54
+ const endTDS = endDate.valueOf();
55
+ return {
56
+ disabled: current < startTDS || current > endTDS,
57
+ minDate: startDate,
58
+ maxDate: endDate
59
+ };
60
+ },
61
+ MONTH_NOW: (current) => {
62
+ const startDate = dayjs().startOf("month");
63
+ const endDate = dayjs().endOf("month");
64
+ const startTDS = startDate.valueOf();
65
+ const endTDS = endDate.valueOf();
66
+ return {
67
+ disabled: current < startTDS || current > endTDS,
68
+ minDate: startDate,
69
+ maxDate: endDate
70
+ };
71
+ },
72
+ QUARTER_NOW: (current) => {
73
+ const startDate = dayjs().startOf("quarter");
74
+ const endDate = dayjs().endOf("quarter");
75
+ const startTDS = startDate.valueOf();
76
+ const endTDS = endDate.valueOf();
77
+ return {
78
+ disabled: current < startTDS || current > endTDS,
79
+ minDate: startDate,
80
+ maxDate: endDate
81
+ };
82
+ },
83
+ YEAR_NOW: (current) => {
84
+ const startDate = dayjs().startOf("year");
85
+ const endDate = dayjs().endOf("year");
86
+ const startTDS = startDate.valueOf();
87
+ const endTDS = endDate.valueOf();
88
+ return {
89
+ disabled: current < startTDS || current > endTDS,
90
+ minDate: startDate,
91
+ maxDate: endDate
92
+ };
93
+ },
94
+ WEEk_BEFORE: (current) => {
95
+ dayjs.locale("zh-cn");
96
+ const lastWeekStart = dayjs().startOf("week").subtract(1, "week");
97
+ const lastWeekEnd = lastWeekStart.clone().endOf("week");
98
+ const startTDS = lastWeekStart.valueOf();
99
+ const endTDS = lastWeekEnd.valueOf();
100
+ return {
101
+ disabled: current < startTDS || current > endTDS,
102
+ minDate: lastWeekStart,
103
+ maxDate: lastWeekEnd
104
+ };
105
+ },
106
+ MONTH_BEFORE: (current) => {
107
+ const startDate = dayjs().add(-1, "month").startOf("month");
108
+ const endDate = dayjs().add(-1, "month").endOf("month");
109
+ const startTDS = startDate.valueOf();
110
+ const endTDS = endDate.valueOf();
111
+ return {
112
+ disabled: current < startTDS || current > endTDS,
113
+ minDate: startDate,
114
+ maxDate: endDate
115
+ };
116
+ },
117
+ QUARTER_BEFORE: (current) => {
118
+ const startDate = dayjs().add(-1, "quarter").startOf("quarter");
119
+ const endDate = dayjs().add(-1, "quarter").endOf("quarter");
120
+ const startTDS = startDate.valueOf();
121
+ const endTDS = endDate.valueOf();
122
+ return {
123
+ disabled: current < startTDS || current > endTDS,
124
+ minDate: startDate,
125
+ maxDate: endDate
126
+ };
127
+ },
128
+ YEAR_BEFORE: (current) => {
129
+ const startDate = dayjs().add(-1, "year").startOf("year");
130
+ const endDate = dayjs().add(-1, "year").endOf("year");
131
+ const startTDS = startDate.valueOf();
132
+ const endTDS = endDate.valueOf();
133
+ return {
134
+ disabled: current < startTDS || current > endTDS,
135
+ minDate: startDate,
136
+ maxDate: endDate
137
+ };
138
+ },
139
+ DATE_BEFORE: (current) => {
140
+ const endDate = dayjs().add(-1, "day");
141
+ return {
142
+ disabled: current < endDate.valueOf(),
143
+ maxDate: endDate
144
+ };
145
+ },
146
+ DATE_AFTER: (current) => {
147
+ const startDate = dayjs();
148
+ return {
149
+ disabled: current > startDate.valueOf(),
150
+ minDate: startDate
151
+ };
152
+ }
153
+ };
154
+ var getDisabledDate = (current, rangeType) => {
155
+ const tds = dayjs(current).valueOf();
156
+ const func = DateRangeMap[rangeType];
157
+ if (func) {
158
+ const { disabled } = func(tds);
159
+ return disabled;
160
+ }
161
+ return false;
162
+ };
163
+ var getMobileDateRange = (rangeType) => {
164
+ const func = DateRangeMap[rangeType];
165
+ if (func) {
166
+ const { minDate, maxDate } = func(0);
167
+ return Object.assign({}, minDate && { minDate: new Date(minDate) }, maxDate && { maxDate: new Date(maxDate) });
168
+ }
169
+ return {};
170
+ };
171
+ var getDefaultDate = (type, formatType) => {
172
+ let defaultDate;
173
+ switch (type) {
174
+ case FieldSysVarDefaultValueEnum.SYS_DATE:
175
+ defaultDate = dayjs().format(formatType ?? "YYYY-MM-DD");
176
+ break;
177
+ case FieldSysVarDefaultValueEnum.SYS_DATE_TIME:
178
+ defaultDate = dayjs().format(formatType ?? "YYYY-MM-DD HH:mm:ss");
179
+ break;
180
+ case FieldSysVarDefaultValueEnum.SYS_TIME:
181
+ defaultDate = dayjs().format(formatType ?? "HH:mm:ss");
182
+ break;
183
+ }
184
+ return defaultDate;
185
+ };
186
+ //#endregion
187
+ export { DESIGN_DATA_KEY_TAG, DESIGN_TYPE, DateRangeMap, DesignItemAttribute, getDefaultDate, getDisabledDate, getMobileDateRange };
@@ -0,0 +1,93 @@
1
+ /**
2
+ * 控制器类型
3
+ *
4
+ * @author zhanghanrui
5
+ * @date 2024-07-05 13:07:45
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum ControllerType {
10
+ /**
11
+ * 设计视图
12
+ */
13
+ DESIGN_RENDER = "design-render"
14
+ }
15
+ /**
16
+ * 绘制界面模式前缀(主要用于插件的区分,此设计界面是通用的,通过此标识区分不同界面加载不同组件)
17
+ *
18
+ * @author zhanghanrui
19
+ * @date 2024-07-15 14:07:42
20
+ * @export
21
+ * @enum {number}
22
+ */
23
+ export declare enum DesignRenderViewPrefix {
24
+ /**
25
+ * 自定义视图
26
+ */
27
+ CUSTOM_HOME = "custom-home",
28
+ /**
29
+ * 卡片绘制
30
+ */
31
+ CARD_VIEW = "card-view",
32
+ /**
33
+ * 卡片绘制
34
+ */
35
+ MOBILE_CARD_VIEW = "mobile-card-view",
36
+ /**
37
+ * 设计编辑器
38
+ */
39
+ DESIGN_EDITOR = "design-editor"
40
+ }
41
+ /**
42
+ * 绘制节点类型
43
+ *
44
+ * @author zhanghanrui
45
+ * @date 2024-07-15 15:07:16
46
+ * @export
47
+ * @enum {number}
48
+ */
49
+ export declare enum RenderNodeType {
50
+ /**
51
+ * 页面
52
+ */
53
+ PAGE = "PAGE",
54
+ /**
55
+ * 页面小写标识
56
+ */
57
+ PAGE_LOWER = "page",
58
+ /**
59
+ * 属性
60
+ */
61
+ FIELD = "field",
62
+ /**
63
+ * 面板
64
+ */
65
+ PANEL = "panel",
66
+ /**
67
+ * 选项卡
68
+ */
69
+ TABS = "tabs",
70
+ /**
71
+ * 选项卡子项
72
+ */
73
+ TAB_ITEM = "tab-item",
74
+ /**
75
+ * 菜单列表
76
+ */
77
+ MENU_LIST = "menu-list",
78
+ /**
79
+ * 选择组件
80
+ */
81
+ SELECT_COMPONENT = "select-component",
82
+ GRID = "grid",
83
+ GRID_ITEM = "grid-item",
84
+ /**消息 */
85
+ MESSAGE = "message",
86
+ /**工作台 */
87
+ WORKBENCH = "workbench",
88
+ /**个人中心 */
89
+ PERSONAL_CENTER = "personal-center",
90
+ /**待办 */
91
+ TODO = "todo"
92
+ }
93
+ export * from './date-time';
@@ -0,0 +1,99 @@
1
+ import "./date-time.mjs";
2
+ //#region src/constant/index.ts
3
+ /**
4
+ * 控制器类型
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-07-05 13:07:45
8
+ * @export
9
+ * @enum {number}
10
+ */
11
+ var ControllerType = /* @__PURE__ */ function(ControllerType) {
12
+ /**
13
+ * 设计视图
14
+ */
15
+ ControllerType["DESIGN_RENDER"] = "design-render";
16
+ return ControllerType;
17
+ }({});
18
+ /**
19
+ * 绘制界面模式前缀(主要用于插件的区分,此设计界面是通用的,通过此标识区分不同界面加载不同组件)
20
+ *
21
+ * @author zhanghanrui
22
+ * @date 2024-07-15 14:07:42
23
+ * @export
24
+ * @enum {number}
25
+ */
26
+ var DesignRenderViewPrefix = /* @__PURE__ */ function(DesignRenderViewPrefix) {
27
+ /**
28
+ * 自定义视图
29
+ */
30
+ DesignRenderViewPrefix["CUSTOM_HOME"] = "custom-home";
31
+ /**
32
+ * 卡片绘制
33
+ */
34
+ DesignRenderViewPrefix["CARD_VIEW"] = "card-view";
35
+ /**
36
+ * 卡片绘制
37
+ */
38
+ DesignRenderViewPrefix["MOBILE_CARD_VIEW"] = "mobile-card-view";
39
+ /**
40
+ * 设计编辑器
41
+ */
42
+ DesignRenderViewPrefix["DESIGN_EDITOR"] = "design-editor";
43
+ return DesignRenderViewPrefix;
44
+ }({});
45
+ /**
46
+ * 绘制节点类型
47
+ *
48
+ * @author zhanghanrui
49
+ * @date 2024-07-15 15:07:16
50
+ * @export
51
+ * @enum {number}
52
+ */
53
+ var RenderNodeType = /* @__PURE__ */ function(RenderNodeType) {
54
+ /**
55
+ * 页面
56
+ */
57
+ RenderNodeType["PAGE"] = "PAGE";
58
+ /**
59
+ * 页面小写标识
60
+ */
61
+ RenderNodeType["PAGE_LOWER"] = "page";
62
+ /**
63
+ * 属性
64
+ */
65
+ RenderNodeType["FIELD"] = "field";
66
+ /**
67
+ * 面板
68
+ */
69
+ RenderNodeType["PANEL"] = "panel";
70
+ /**
71
+ * 选项卡
72
+ */
73
+ RenderNodeType["TABS"] = "tabs";
74
+ /**
75
+ * 选项卡子项
76
+ */
77
+ RenderNodeType["TAB_ITEM"] = "tab-item";
78
+ /**
79
+ * 菜单列表
80
+ */
81
+ RenderNodeType["MENU_LIST"] = "menu-list";
82
+ /**
83
+ * 选择组件
84
+ */
85
+ RenderNodeType["SELECT_COMPONENT"] = "select-component";
86
+ RenderNodeType["GRID"] = "grid";
87
+ RenderNodeType["GRID_ITEM"] = "grid-item";
88
+ /**消息 */
89
+ RenderNodeType["MESSAGE"] = "message";
90
+ /**工作台 */
91
+ RenderNodeType["WORKBENCH"] = "workbench";
92
+ /**个人中心 */
93
+ RenderNodeType["PERSONAL_CENTER"] = "personal-center";
94
+ /**待办 */
95
+ RenderNodeType["TODO"] = "todo";
96
+ return RenderNodeType;
97
+ }({});
98
+ //#endregion
99
+ export { ControllerType, DesignRenderViewPrefix, RenderNodeType };
@@ -0,0 +1,18 @@
1
+ import { IDesignNode, IDesignNodeData, IDesignTreeItem } from '@gct-paas/schema';
2
+ import { IDesignRenderBaseController, IDesignRenderController, IDesignRenderState } from '../../interface';
3
+ export declare class DesignRenderController implements IDesignRenderController {
4
+ state: IDesignRenderState;
5
+ prefix: string;
6
+ preview: boolean;
7
+ readonly item: Map<string, IDesignRenderBaseController<IDesignNodeData, import('../../interface').IDesignRenderBaseState>>;
8
+ protected nodes: IDesignNode<IDesignNodeData>[];
9
+ protected tree: IDesignTreeItem[];
10
+ setTree(tree: IDesignTreeItem[]): void;
11
+ setNodes(nodes: IDesignNode<IDesignNodeData>[]): void;
12
+ getNodes(parentId?: string): IDesignNode[];
13
+ protected getTreeItem(tag: string, items?: IDesignTreeItem[]): IDesignTreeItem | null;
14
+ getController(id: string): IDesignRenderBaseController;
15
+ mounted(): void;
16
+ unmounted(): void;
17
+ protected reset(): void;
18
+ }