@gct-paas/design 0.1.4-dev.16 → 0.1.4-dev.17

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.
@@ -43,7 +43,7 @@ async function loadPageInfo(app) {
43
43
  };
44
44
  else pageInfo.value = platform.value === Platform.WEB ? await _api.apaas.webpage.getInfo({ id: _gct.store.context.pid }) : platform.value === Platform.PAD ? await _api.apaas.padPage.getInfo({ id: _gct.store.context.pid }) : await _api.apaas.mobilePage.getInfo({ id: _gct.store.context.pid });
45
45
  const [configs] = await DesignPluginPgkUtil.loadDesignPlugin(app, platform.value, _gct.store.appInfo.suiteKey ? [_gct.store.appInfo.suiteKey] : void 0);
46
- setPluginConfigs([configs]);
46
+ setPluginConfigs(configs);
47
47
  if (!historyUtils.isHistoryInfoExist(_gct.store.context.pid)) historyUtils.init({ historyId: _gct.store.context.pid ?? "" });
48
48
  if (pageInfo.value.designerJson && !isNil(pageInfo.value.designerJson) && !isEmpty(pageInfo.value.designerJson)) {
49
49
  const _json = JSON.parse(pageInfo.value.designerJson);
@@ -7,7 +7,7 @@ export declare function useSelectedWidget(): {
7
7
  resetSelectedModal: () => void;
8
8
  setSelectedWidget: (widget: Partial<LowCodeWidget.BasicSchema>, scope?: SCOPE) => void;
9
9
  resetSelectedWidget: (scope?: SCOPE) => void;
10
- selectedAllPropEditors: import('vue').ComputedRef<any>;
10
+ selectedAllPropEditors: import('vue').ComputedRef<import('@gct-paas/schema').IPropEditor[]>;
11
11
  selectedAllStyleEditors: import('vue').ComputedRef<import('@gct-paas/schema').IStyleEditor[]>;
12
12
  selectedAllEvents: import('vue').ComputedRef<IObject[]>;
13
13
  selectedEvents: import('vue').WritableComputedRef<import('@gct-paas/schema').IBasicEvents, import('@gct-paas/schema').IBasicEvents>;
@@ -1,3 +1,4 @@
1
+ import { designRegister } from "../../../utils/design-view/index.mjs";
1
2
  import { commonStyle } from "../../../schema/common-config/common-style.mjs";
2
3
  import "../../../schema/index.mjs";
3
4
  import { subTableModalId, subTableModalState, widgetInfo } from "../design-state.mjs";
@@ -7,11 +8,8 @@ import { useWidgetQuery } from "./useWidgetQuery.mjs";
7
8
  import { get, has, isArray, isEmpty } from "lodash-es";
8
9
  import { BuiltinType, FIELD_TYPE, FormComponents, PanelEnum, TreeHelper } from "@gct-paas/core";
9
10
  import { computed, ref } from "vue";
10
- import { getCompPos } from "@gct-paas/schema";
11
+ import { FieldEditorOverrideRegistry, getCompPos } from "@gct-paas/schema";
11
12
  //#region src/hooks/design-view/widget/useSelectedWidget.ts
12
- var fieldFormEvents = {};
13
- var fieldFormEditors = {};
14
- var fieldFormStyles = {};
15
13
  var selectedConfig = ref({ mode: "move" });
16
14
  var selectedParentChildren = ref([]);
17
15
  var selectedParentWidgets = ref([]);
@@ -129,9 +127,17 @@ function useSelectedWidget() {
129
127
  /**被选择的组件/弹框拥有的所有事件 */
130
128
  const selectedAllEvents = computed(() => {
131
129
  const { type } = selectedRef.value;
132
- const eventConfig = widgetInfo.value.events[type] || fieldFormEvents[type] || [];
133
- if (typeof eventConfig === "function") return eventConfig(selectedRef.value);
134
- else return eventConfig;
130
+ const widgetEvents = widgetInfo.value.events;
131
+ if (widgetEvents[type] && isArray(widgetEvents[type])) return widgetEvents[type];
132
+ const provider = designRegister.value.getProvider(type);
133
+ if (!provider) {
134
+ console.warn(`selectedAllEvents 未找到组件 ${type} 的设计器项配置信息,请确保该组件已正确注册`);
135
+ return [];
136
+ }
137
+ if (selectedRef.value.props.fieldReadonly) return (provider.events || []).filter((event) => event.name === "onClick");
138
+ const overrideEvents = FieldEditorOverrideRegistry.get(type)?.events;
139
+ const defaultEvents = provider.events || [];
140
+ return overrideEvents?.(selectedRef.value, defaultEvents) || defaultEvents;
135
141
  });
136
142
  /**被选择的组件/弹框拥有的所有属性编辑器的描述集合 */
137
143
  const selectedAllPropEditors = computed(() => {
@@ -144,12 +150,28 @@ function useSelectedWidget() {
144
150
  return widget.id === get(selectedRef.value, "preLocation");
145
151
  });
146
152
  }
147
- return widgetPropsEditors[type] && isArray(widgetPropsEditors[type]) ? widgetPropsEditors[type] : fieldFormEditors[type]?.(selectedRef.value, preCompInfo);
153
+ if (widgetPropsEditors[type] && isArray(widgetPropsEditors[type])) return widgetPropsEditors[type];
154
+ const provider = designRegister.value.getProvider(type);
155
+ if (!provider) {
156
+ console.warn(`selectedAllPropEditors 未找到组件 ${type} 的设计器项配置信息,请确保该组件已正确注册`);
157
+ return [];
158
+ }
159
+ const overridePropEditor = FieldEditorOverrideRegistry.get(type)?.propEditor;
160
+ const defaultPropEditors = provider.propEditors || [];
161
+ return overridePropEditor?.(selectedRef.value, defaultPropEditors, preCompInfo) || defaultPropEditors;
148
162
  });
149
163
  /**被选择的组件/弹框拥有的所有样式编辑器的描述集合 */
150
164
  const selectedAllStyleEditors = computed(() => {
151
165
  const { type } = selectedRef.value;
152
- return widgetInfo.value.styleEditors[type] || fieldFormStyles[type]?.(selectedRef.value);
166
+ if (widgetInfo.value.styleEditors[type] && isArray(widgetInfo.value.styleEditors[type])) return widgetInfo.value.styleEditors[type];
167
+ const provider = designRegister.value.getProvider(type);
168
+ if (!provider) {
169
+ console.warn(`selectedAllStyleEditors 未找到组件 ${type} 的设计器项配置信息,请确保该组件已正确注册`);
170
+ return [];
171
+ }
172
+ const overrideStyleEditor = FieldEditorOverrideRegistry.get(type)?.styleEditor;
173
+ const defaultStyleEditors = provider.styleEditors || [];
174
+ return overrideStyleEditor?.(selectedRef.value, defaultStyleEditors) || defaultStyleEditors;
153
175
  });
154
176
  /**被选择的组件所有设计相关配置信息集合 */
155
177
  const selectedAllDesingerConfig = computed(() => {
package/es/index.mjs CHANGED
@@ -37,6 +37,7 @@ import { getAutofillEditor } from "./schema/common-config/autofill-editor-config
37
37
  import { fixedAlignEditor } from "./schema/common-config/column-editor-config.mjs";
38
38
  import { BaseSearch, getSearchOptions } from "./schema/search/BaseSearch.mjs";
39
39
  import { BaseDate } from "./schema/search/BaseDate.mjs";
40
+ import { FieldOverrideUtil, setupOverride } from "./schema/field/index.mjs";
40
41
  import "./schema/index.mjs";
41
42
  import { isModified, loading, methodMap, modalDesignId, modalDesignState, modalInfo, noMore, pageDesignHistoryList, pageJson, pageJsonSnapshot, pageNo, pluginConfigs, regRoot, subTableModalId, subTableModalState, transformPageJson, wfNodesModalId, wfNodesModalState, widgetInfo, workflowModalId, workflowModalState } from "./hooks/design-view/design-state.mjs";
42
43
  import { useScope } from "./hooks/design-view/layout/useScope.mjs";
@@ -90,4 +91,4 @@ function onInit() {
90
91
  }
91
92
  onInit();
92
93
  //#endregion
93
- export { BaseDate, BaseSearch, CategoryEnum, ControllerType, DesignContainerNode, DesignEditorNode, DesignEditorType, DesignItemActionTag, DesignItemAttribute, DesignNode, DesignNodePrefix, DesignNodeType, DesignPluginPgkUtil, DesignSaveTip, DesignStepCheck, DesignViewHooks, DesignViewLayout, DesignViewPrefix, DesignerRegister, FieldCascader_default as FieldCascader, FieldSchema, InsertNodeMode, MaterialGroup, MaterialRegister, MenuClickEvent, ModalNameEditor, ModelTypeEnum, NotMask, PageTypeEnum, ProcessTypeEnum, SCREditorUtils, ScriptTypeEnum, user_lock_default as UserLock, user_occupy_default as UserOccupy, baseBtnEditor, baseBtnProp, basicAttrsUtils, basicFieldEditor, beginDrag, BTN_TYPE_COLOR as btnTypeColor, buildRunJs, buildRuntimeJson, buttonEditor, buttonProps, buttonStyleEditor, commonStyle, createWidgetByType, createWidgetProvider, currentPanel, customMenu, deptFilter, designCreateAppVue, designInterceptors, designRegister, designSetupApp, destroyOccupyTimer, deviceEvent, displayEditor, displayProps, explainEditor, findAllChildrenTypes, fixedAlignEditor, flatten, formItemProps, formulaFilter, getAutofillEditor, getBindCmpTypeEditor, getInputAttrEditor, getSearchOptions, hiddenButtonProps, initFieldWidgetRuntime, initMethodMap, isModified, loadPageInfo, loadPageOccupyInfo, loading, lockPage, methodMap, modal_exports as modalCfg, modalDesignId, modalDesignState, modalInfo, multiFieldEditor, newKeyTag, noMore, nodeContainerProps, nodeEditorProps, nodeProps, notNeedPxStyle, occupyPage, onWidgetInfoInit, openFormulaEditorByDesign, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, pageOccupyInfo, pagePermissions, permissionEditor, placeholderEditor, platform, pluginConfigs, PRESET_COLOR as presetColor, propEditorProps, propsToStyle, regRoot, regexEditor, rgba2hex, schemaToStyle, shadeColor, styleEditorProps, subTableModalId, subTableModalState, submitInHideEditor, togglePanel, transformField2Component, transformPageJson, unlockAvailable, uploadDraggerEditor, useAsyncFieldConfig, useAsyncFileAttrs, useAsyncOperateField, useCacheHistory, useCacheHistoryInner, useDesignCache, useDesignHistory, useDesignModal, useDesignPreview, useDesignSave, useDesigner, useDesignerController, useFieldTransfer, useGlobal, useKeyParser, useModelField, usePage, usePageOccupy, usePropEditor, useScope, useSelectedWidget, useStyle, useStyleEditor, useToolkit, useUserOccupy, useWidget, useWidgetQuery, useWidgetRegistry, validatorEditor, wfNodesModalId, wfNodesModalState, widgetInfo, widgetProps, widgetWrapperProps, workflowModalId, workflowModalState };
94
+ export { BaseDate, BaseSearch, CategoryEnum, ControllerType, DesignContainerNode, DesignEditorNode, DesignEditorType, DesignItemActionTag, DesignItemAttribute, DesignNode, DesignNodePrefix, DesignNodeType, DesignPluginPgkUtil, DesignSaveTip, DesignStepCheck, DesignViewHooks, DesignViewLayout, DesignViewPrefix, DesignerRegister, FieldCascader_default as FieldCascader, FieldOverrideUtil, FieldSchema, InsertNodeMode, MaterialGroup, MaterialRegister, MenuClickEvent, ModalNameEditor, ModelTypeEnum, NotMask, PageTypeEnum, ProcessTypeEnum, SCREditorUtils, ScriptTypeEnum, user_lock_default as UserLock, user_occupy_default as UserOccupy, baseBtnEditor, baseBtnProp, basicAttrsUtils, basicFieldEditor, beginDrag, BTN_TYPE_COLOR as btnTypeColor, buildRunJs, buildRuntimeJson, buttonEditor, buttonProps, buttonStyleEditor, commonStyle, createWidgetByType, createWidgetProvider, currentPanel, customMenu, deptFilter, designCreateAppVue, designInterceptors, designRegister, designSetupApp, destroyOccupyTimer, deviceEvent, displayEditor, displayProps, explainEditor, findAllChildrenTypes, fixedAlignEditor, flatten, formItemProps, formulaFilter, getAutofillEditor, getBindCmpTypeEditor, getInputAttrEditor, getSearchOptions, hiddenButtonProps, initFieldWidgetRuntime, initMethodMap, isModified, loadPageInfo, loadPageOccupyInfo, loading, lockPage, methodMap, modal_exports as modalCfg, modalDesignId, modalDesignState, modalInfo, multiFieldEditor, newKeyTag, noMore, nodeContainerProps, nodeEditorProps, nodeProps, notNeedPxStyle, occupyPage, onWidgetInfoInit, openFormulaEditorByDesign, pageDesignHistoryList, pageInfo, pageJson, pageJsonSnapshot, pageNo, pageOccupyInfo, pagePermissions, permissionEditor, placeholderEditor, platform, pluginConfigs, PRESET_COLOR as presetColor, propEditorProps, propsToStyle, regRoot, regexEditor, rgba2hex, schemaToStyle, setupOverride, shadeColor, styleEditorProps, subTableModalId, subTableModalState, submitInHideEditor, togglePanel, transformField2Component, transformPageJson, unlockAvailable, uploadDraggerEditor, useAsyncFieldConfig, useAsyncFileAttrs, useAsyncOperateField, useCacheHistory, useCacheHistoryInner, useDesignCache, useDesignHistory, useDesignModal, useDesignPreview, useDesignSave, useDesigner, useDesignerController, useFieldTransfer, useGlobal, useKeyParser, useModelField, usePage, usePageOccupy, usePropEditor, useScope, useSelectedWidget, useStyle, useStyleEditor, useToolkit, useUserOccupy, useWidget, useWidgetQuery, useWidgetRegistry, validatorEditor, wfNodesModalId, wfNodesModalState, widgetInfo, widgetProps, widgetWrapperProps, workflowModalId, workflowModalState };
@@ -9,7 +9,7 @@ export declare const getInputAttrEditor: (needFieldAttrs: string[]) => LowCodeWi
9
9
  /** 获取组件类型config */
10
10
  export declare const getBindCmpTypeEditor: ({ name, type, hiddenCallback, filterOptionsCallback, groupName, }: {
11
11
  name: string;
12
- type: BindCmpStyleTypeEnum | ((arg: LowCodeWidget.BasicSchema) => BindCmpStyleTypeEnum);
12
+ type: BindCmpStyleTypeEnum | ((arg: LowCodeWidget.BasicSchema) => BindCmpStyleTypeEnum | undefined);
13
13
  hiddenCallback?: (arg: LowCodeWidget.BasicSchema | LowCodeModal.Modal) => boolean;
14
14
  filterOptionsCallback?: (arg: BindCmpStyleEnum, widget?: LowCodeWidget.BasicSchema) => boolean;
15
15
  groupName?: string;
@@ -0,0 +1,4 @@
1
+ import { LowCodeWidget } from '@gct-paas/schema';
2
+ export declare function runPropEditor(selected: IObject, propEditorList: LowCodeWidget.PropEditor[], isCard: boolean): LowCodeWidget.PropEditor[];
3
+ export declare function runStyleEditor(): LowCodeWidget.StyleEditor[];
4
+ export declare function runEventEditor(): never[];
@@ -0,0 +1,269 @@
1
+ import { displayEditor } from "../common-config/display-editor-config.mjs";
2
+ import { basicFieldEditor, getBindCmpTypeEditor } from "../common-config/common-field-editor-config.mjs";
3
+ import { BindCmpStyleEnum, BindCmpStyleTypeEnum, CURRENCY_ENUM, CURRENCY_LANG_ENUM, FIELD_TYPE, FormComponents, MaterialEnum, ProgressTypeEnum, PropGroup, SignatureTypeEnum, StyleGroup, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TagTypeEnum, TextDecoration, buildShortUUID, tagEnum } from "@gct-paas/core";
4
+ import { FieldEditorOverrideRegistry } from "@gct-paas/schema";
5
+ //#region src/schema/field/card-list-field.ts
6
+ function runPropEditor(selected, propEditorList, isCard) {
7
+ if ([
8
+ FIELD_TYPE.TEXT,
9
+ FIELD_TYPE.LONG_TEXT,
10
+ FIELD_TYPE.INTEGER,
11
+ FIELD_TYPE.LONG,
12
+ FIELD_TYPE.DOUBLE,
13
+ FIELD_TYPE.DECIMAL,
14
+ FIELD_TYPE.BOOLEAN,
15
+ FIELD_TYPE.ENUM,
16
+ FIELD_TYPE.ENUM_MULTI,
17
+ FIELD_TYPE.REF,
18
+ FIELD_TYPE.REF_MULTI,
19
+ FIELD_TYPE.TRANSACTION,
20
+ FIELD_TYPE.RDO_REF
21
+ ].includes(selected.props.fieldType) && isCard) return propEditorList;
22
+ if (selected.type === FormComponents.EXPRESSION || selected.type === FormComponents.AGG) return propEditorList;
23
+ const propArr = [...basicFieldEditor, ...displayEditor];
24
+ if (selected.type === FormComponents.Signature) propArr.push({
25
+ component: "select-editor",
26
+ name: "signatureType",
27
+ label: "sys.pageDesigner.signatureType",
28
+ group: PropGroup.FIELD_CONFIG,
29
+ _config: {
30
+ showSearch: true,
31
+ options: Object.keys(SignatureTypeEnum).map((key) => {
32
+ return {
33
+ label: "sys.pageDesigner." + SignatureTypeEnum[key],
34
+ value: SignatureTypeEnum[key]
35
+ };
36
+ })
37
+ },
38
+ hidden: (widget) => {
39
+ return widget.props.fieldType !== FIELD_TYPE.SIGNATURE;
40
+ }
41
+ }, {
42
+ component: "datetime-style-editor",
43
+ name: "displayStyle",
44
+ label: "sys.pageDesigner.displayStyle",
45
+ group: PropGroup.FIELD_CONFIG,
46
+ hidden: (widget) => {
47
+ return widget.props.fieldType !== FIELD_TYPE.SIGNATURE || widget.props.signatureType !== SignatureTypeEnum.SIGNATURE_DATETIME;
48
+ }
49
+ }, {
50
+ component: "date-style-editor",
51
+ name: "displayStyle",
52
+ label: "sys.pageDesigner.displayStyle",
53
+ group: PropGroup.FIELD_CONFIG,
54
+ hidden: (widget) => {
55
+ return widget.props.fieldType !== FIELD_TYPE.SIGNATURE || widget.props.signatureType !== SignatureTypeEnum.SIGNATURE_DATE;
56
+ }
57
+ });
58
+ if (selected.type === FormComponents.UploadImage && !isCard) propArr.push({
59
+ component: "max-display-editor",
60
+ name: "displayMaxNum",
61
+ label: "sys.pageDesigner.displayMaxNum",
62
+ group: PropGroup.SHOW,
63
+ _config: {
64
+ min: 1,
65
+ max: 20,
66
+ precision: 0
67
+ }
68
+ });
69
+ if ([
70
+ FormComponents.Switch,
71
+ FormComponents.Select,
72
+ FormComponents.Radio,
73
+ FormComponents.Checkbox,
74
+ FormComponents.Input,
75
+ FormComponents.ElectronicSignature,
76
+ FormComponents.Inputnumber
77
+ ].includes(selected.type)) {
78
+ propArr.push(...getBindCmpTypeEditor({
79
+ name: "bindCompStyleType",
80
+ hiddenCallback: (widget) => {
81
+ return [FIELD_TYPE.LONG_TEXT, FIELD_TYPE.TEXT].includes(widget.props.fieldType);
82
+ },
83
+ type: (widget) => {
84
+ if ([FIELD_TYPE.LONG_TEXT].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindLongText;
85
+ else if (FIELD_TYPE.BOOLEAN === widget.props.fieldType) return BindCmpStyleTypeEnum.BindBool;
86
+ else if ([FIELD_TYPE.USER].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindPerson;
87
+ else if ([FIELD_TYPE.ORG].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindDept;
88
+ else if ([FIELD_TYPE.REF, FIELD_TYPE.ENUM].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindLink;
89
+ else if ([
90
+ FIELD_TYPE.REF_MULTI,
91
+ FIELD_TYPE.ENUM_MULTI,
92
+ FIELD_TYPE.USER_MULTI,
93
+ FIELD_TYPE.ORG_MULTI
94
+ ].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindMulti;
95
+ else if ([FIELD_TYPE.LONG, FIELD_TYPE.INTEGER].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindNum;
96
+ else if ([FIELD_TYPE.DECIMAL].includes(widget.props.fieldType)) return BindCmpStyleTypeEnum.BindDecimal;
97
+ }
98
+ }));
99
+ if (FormComponents.Inputnumber === selected.type) propArr.push(...[{
100
+ component: "select-editor",
101
+ name: "displayTimeType",
102
+ label: "sys.pageDesigner.timeType",
103
+ group: PropGroup.FIELD_CONFIG,
104
+ hidden: (widget) => {
105
+ return widget.props.bindCompStyleType !== BindCmpStyleEnum.CMP_TIME;
106
+ },
107
+ _config: {
108
+ showSearch: true,
109
+ placeholder: "sys.pageDesigner.timeType",
110
+ clearable: false,
111
+ options: Object.keys(TIMETYPE_ENUM).map((key) => {
112
+ return {
113
+ label: "sys.component.time." + TIMETYPE_LANG_ENUM[key],
114
+ value: TIMETYPE_ENUM[key]
115
+ };
116
+ })
117
+ }
118
+ }, {
119
+ component: "select-editor",
120
+ name: "currency",
121
+ label: "",
122
+ group: PropGroup.FIELD_CONFIG,
123
+ hidden: (widget) => {
124
+ return widget.props.bindCompStyleType !== BindCmpStyleEnum.CMP_CURRENCY;
125
+ },
126
+ _config: {
127
+ showSearch: true,
128
+ placeholder: "sys.chooseText",
129
+ clearable: false,
130
+ options: Object.keys(CURRENCY_ENUM).map((key) => {
131
+ return {
132
+ label: "sys.pageDesigner." + CURRENCY_LANG_ENUM[key],
133
+ value: CURRENCY_ENUM[key]
134
+ };
135
+ })
136
+ }
137
+ }]);
138
+ }
139
+ return propArr;
140
+ }
141
+ function runStyleEditor() {
142
+ return [
143
+ {
144
+ component: "position-editor",
145
+ name: "position",
146
+ label: "sys.pageDesigner.position",
147
+ group: StyleGroup.LAYOUT
148
+ },
149
+ {
150
+ component: "number-editor",
151
+ name: "width",
152
+ label: "sys.width",
153
+ group: StyleGroup.LAYOUT
154
+ },
155
+ {
156
+ component: "number-editor",
157
+ name: "height",
158
+ label: "sys.height",
159
+ group: StyleGroup.LAYOUT
160
+ },
161
+ {
162
+ component: "font-editor",
163
+ name: "labelFont",
164
+ label: "sys.name",
165
+ group: StyleGroup.STYLE
166
+ },
167
+ {
168
+ component: "font-editor",
169
+ name: "contentFont",
170
+ label: "sys.content",
171
+ group: StyleGroup.STYLE,
172
+ hidden(widget) {
173
+ return [
174
+ FIELD_TYPE.ATTACHMENT,
175
+ FIELD_TYPE.IMAGE,
176
+ FIELD_TYPE.DATA_TABLE_FORMULA
177
+ ].includes(widget.props.fieldType);
178
+ },
179
+ _config: { hiddenColor: true }
180
+ },
181
+ {
182
+ component: "boolean-editor",
183
+ name: "tagStyleOpen",
184
+ label: "sys.pageDesigner.tagStyle",
185
+ group: StyleGroup.STYLE,
186
+ hidden(widget) {
187
+ if ([
188
+ FIELD_TYPE.ATTACHMENT,
189
+ FIELD_TYPE.IMAGE,
190
+ FIELD_TYPE.RDO_REF,
191
+ FIELD_TYPE.DATA_TABLE_FORMULA
192
+ ].includes(widget.props.fieldType)) return true;
193
+ if ([FormComponents.Switch, FormComponents.EXPRESSION].includes(widget.type)) return widget.props.bindCompStyleType === BindCmpStyleEnum.CMP_BOOLEAN;
194
+ return false;
195
+ },
196
+ _config: {
197
+ showType: "checkbox",
198
+ options: [{
199
+ label: "sys.pageDesigner.configureContentAsLabelStyle",
200
+ value: true
201
+ }]
202
+ },
203
+ changeCallback: (widget, value) => {
204
+ if (value && !widget.style.tagStyle) widget.style.tagStyle = {
205
+ color: "",
206
+ tagType: TagTypeEnum.RADIUS
207
+ };
208
+ }
209
+ },
210
+ {
211
+ component: "tag-editor",
212
+ name: "tagStyle",
213
+ group: StyleGroup.STYLE,
214
+ hidden: (widget) => {
215
+ if ([FormComponents.Switch, FormComponents.EXPRESSION].includes(widget.type) && widget.props.bindCompStyleType === BindCmpStyleEnum.CMP_BOOLEAN) return true;
216
+ if (widget.props?.fieldType === FIELD_TYPE.DATA_TABLE_FORMULA) return true;
217
+ return !widget.style.tagStyleOpen;
218
+ }
219
+ },
220
+ {
221
+ component: "column-tag-editor",
222
+ name: "columnFontStyleByRule",
223
+ label: "",
224
+ group: StyleGroup.STYLE,
225
+ _config: { generator: getFontStyleRule },
226
+ hidden: (widget) => {
227
+ return widget.props?.fieldType !== FIELD_TYPE.DATA_TABLE_FORMULA;
228
+ }
229
+ }
230
+ ];
231
+ }
232
+ function runEventEditor() {
233
+ return [];
234
+ }
235
+ FieldEditorOverrideRegistry.register(MaterialEnum.cardListFormField, {
236
+ events: (_selectedRef, _defaultEvents) => runEventEditor(),
237
+ propEditor: (selectedRef, defaultList, _preCompInfo) => {
238
+ return runPropEditor(selectedRef, defaultList, true);
239
+ },
240
+ styleEditor: (_selectedRef, _defaultWidget) => runStyleEditor()
241
+ });
242
+ /**添加样式规则 */
243
+ function getFontStyleRule() {
244
+ return {
245
+ id: buildShortUUID("content"),
246
+ displayRule: "",
247
+ contentFont: {
248
+ fontSize: "",
249
+ bold: false,
250
+ italic: false,
251
+ textDecoration: TextDecoration.NONE,
252
+ color: "",
253
+ align: "left"
254
+ },
255
+ tagStyle: {
256
+ color: "#0DAA9C",
257
+ tagType: TagTypeEnum.RADIUS,
258
+ progressBarType: ProgressTypeEnum.CIRCLE
259
+ },
260
+ progressStyle: {
261
+ color: "#0DAA9C",
262
+ tagType: ProgressTypeEnum.CIRCLE
263
+ },
264
+ tagType: tagEnum.TAG,
265
+ tagStyleOpen: false
266
+ };
267
+ }
268
+ //#endregion
269
+ export { runPropEditor };
@@ -0,0 +1,81 @@
1
+ import { tableColumnWidthEnum, fixedAlignENUM, PropGroup, Platform, FormComponents, MaterialEnum } from '@gct-paas/core';
2
+ import { ColumnTable, LowCodeWidget } from '@gct-paas/schema';
3
+ /**字段拖入表格内的逻辑 */
4
+ interface WidgetSchemas extends Omit<ColumnTable, 'props'> {
5
+ props: PartialByKeys<ColumnTable['props'], 'fieldType'>;
6
+ }
7
+ export declare function runWidget(widget: LowCodeWidget.FieldSchema): ColumnTable;
8
+ export declare function runSubtableFieldWidget(widget: LowCodeWidget.FieldSchema): {
9
+ [key: string]: any;
10
+ props: import('@gct-paas/schema').IFormItemProps & import('@gct-paas/schema').IWidgetProps;
11
+ id: string;
12
+ platform: Platform;
13
+ categoryType?: import('@gct-paas/core').CategoryTypeEnum;
14
+ alias: string;
15
+ name: string;
16
+ compName?: string;
17
+ compKey?: string;
18
+ type: string | FormComponents;
19
+ icon: string;
20
+ children?: any[];
21
+ internal?: boolean;
22
+ description?: string;
23
+ style: Partial<import('@gct-paas/schema').IBasicStyle>;
24
+ events: import('@gct-paas/schema').IBasicEvents;
25
+ formItem?: boolean;
26
+ display?: import('@gct-paas/core').DisplayEnums;
27
+ displayName?: string;
28
+ i18n?: Record<string, string>;
29
+ isField?: boolean;
30
+ materialType?: MaterialEnum;
31
+ preLocation?: string;
32
+ ignoringStyle?: string[];
33
+ isReadonlyWidget?: boolean;
34
+ parentComponent?: FormComponents;
35
+ dropPlaceholder?: string;
36
+ _plugin?: import('@gct-paas/schema').PagePlugin;
37
+ } & {
38
+ props: {
39
+ fixedAlign: fixedAlignENUM;
40
+ embeddedSearch: boolean;
41
+ };
42
+ style: {
43
+ columnwidthConfigure: tableColumnWidthEnum;
44
+ columnwidth: number;
45
+ columnFontStyleByRule: never[];
46
+ columnBackgroundByRule: never[];
47
+ };
48
+ };
49
+ export declare function webRunPropEditor(list: LowCodeWidget.PropEditor[]): (import('@gct-paas/schema').IPropEditor | {
50
+ component: string;
51
+ name: string;
52
+ label: string;
53
+ group: PropGroup;
54
+ _config: {
55
+ options: {
56
+ icon: string;
57
+ label: string;
58
+ value: string;
59
+ }[];
60
+ min?: undefined;
61
+ max?: undefined;
62
+ precision?: undefined;
63
+ };
64
+ hidden(widget: WidgetSchemas): true | undefined;
65
+ } | {
66
+ component: string;
67
+ name: string;
68
+ label: string;
69
+ group: PropGroup;
70
+ _config: {
71
+ min: number;
72
+ max: number;
73
+ precision: number;
74
+ options?: undefined;
75
+ };
76
+ hidden(widget: WidgetSchemas): true | undefined;
77
+ })[];
78
+ export declare function runStyleEditor(): LowCodeWidget.StyleEditor[];
79
+ export declare function mobileRunSubTableStyleEditor(): LowCodeWidget.StyleEditor[];
80
+ export declare function runEventEditor(_list: LowCodeWidget.EventsType[]): never[];
81
+ export {};