@gct-paas/design 0.1.4-dev.18 → 0.1.4-dev.19
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/hooks/design-view/design-state.d.ts +14 -0
- package/es/hooks/design-view/designer/useDesignModal.d.ts +17 -0
- package/es/hooks/design-view/designer/useDesignPreview.mjs +40 -55
- package/es/hooks/design-view/global/useGlobal.d.ts +8 -0
- package/es/hooks/design-view/layout/useToolkit.d.ts +2 -0
- package/es/hooks/design-view/useDesigner.d.ts +23 -0
- package/es/hooks/design-view/widget/useWidget.mjs +3 -1
- package/es/index.mjs +6 -5
- package/es/register/designer-register/designer-register.mjs +4 -0
- package/es/{utils → schema}/begin-drag/begin-drag.mjs +8 -6
- package/es/schema/common-config/common-field-editor-config.mjs +2 -0
- package/es/schema/field/data-table-column.mjs +52 -4
- package/es/schema/field/index.mjs +1 -1
- package/es/schema/index.d.ts +3 -1
- package/es/schema/index.mjs +4 -2
- package/es/schema/utils.d.ts +8 -0
- package/es/schema/utils.mjs +76 -0
- package/es/utils/index.d.ts +0 -1
- package/es/utils/index.mjs +1 -2
- package/package.json +7 -7
- /package/es/{utils → schema}/begin-drag/begin-drag.d.ts +0 -0
package/es/index.mjs
CHANGED
|
@@ -9,11 +9,10 @@ import { DesignStepCheck } from "./components/design-step-check/design-step-chec
|
|
|
9
9
|
import { ModalNameEditor } from "./components/modal-name-editor/modal-name-editor.mjs";
|
|
10
10
|
import { DesignViewLayout } from "./components/design-view-layout/design-view-layout.mjs";
|
|
11
11
|
import FieldCascader_default from "./components/field-cascader/src/FieldCascader.vue.mjs";
|
|
12
|
+
import { designInterceptors } from "./utils/design-interceptors/design-interceptors.mjs";
|
|
12
13
|
import { designRegister, platform } from "./utils/design-view/index.mjs";
|
|
13
14
|
import { basicAttrsUtils } from "./utils/field-attrs/basicAttrs.mjs";
|
|
14
15
|
import { transformField2Component } from "./utils/field-attrs/index.mjs";
|
|
15
|
-
import { beginDrag } from "./utils/begin-drag/begin-drag.mjs";
|
|
16
|
-
import { designInterceptors } from "./utils/design-interceptors/design-interceptors.mjs";
|
|
17
16
|
import { deptFilter, formulaFilter } from "./utils/field-filter/index.mjs";
|
|
18
17
|
import { openFormulaEditorByDesign } from "./utils/formula-editor-design/formula-editor-design.mjs";
|
|
19
18
|
import { findAllChildrenTypes } from "./utils/find-deep-types/find-deep-types.mjs";
|
|
@@ -24,6 +23,9 @@ import { buildRunJs, initMethodMap } from "./utils/transform-js/transform-js.mjs
|
|
|
24
23
|
import { flatten } from "./utils/flatten.mjs";
|
|
25
24
|
import "./utils/index.mjs";
|
|
26
25
|
import { modal_exports } from "./schema/modal/modal.mjs";
|
|
26
|
+
import { changeCmpData, createdSearchField } from "./schema/utils.mjs";
|
|
27
|
+
import { fixedAlignEditor } from "./schema/common-config/column-editor-config.mjs";
|
|
28
|
+
import { beginDrag } from "./schema/begin-drag/begin-drag.mjs";
|
|
27
29
|
import { hiddenButtonProps } from "./schema/common-config/button-props-func.mjs";
|
|
28
30
|
import { commonStyle, notNeedPxStyle } from "./schema/common-config/common-style.mjs";
|
|
29
31
|
import { displayEditor, displayProps } from "./schema/common-config/display-editor-config.mjs";
|
|
@@ -34,10 +36,9 @@ import { buttonEditor, buttonProps, buttonStyleEditor } from "./schema/common-co
|
|
|
34
36
|
import { formItemProps } from "./schema/common-config/formItem-editor-config.mjs";
|
|
35
37
|
import { deviceEvent } from "./schema/common-config/common-event-config.mjs";
|
|
36
38
|
import { getAutofillEditor } from "./schema/common-config/autofill-editor-config.mjs";
|
|
37
|
-
import {
|
|
39
|
+
import { FieldOverrideUtil, setupOverride } from "./schema/field/index.mjs";
|
|
38
40
|
import { BaseSearch, getSearchOptions } from "./schema/search/BaseSearch.mjs";
|
|
39
41
|
import { BaseDate } from "./schema/search/BaseDate.mjs";
|
|
40
|
-
import { FieldOverrideUtil, setupOverride } from "./schema/field/index.mjs";
|
|
41
42
|
import "./schema/index.mjs";
|
|
42
43
|
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";
|
|
43
44
|
import { useScope } from "./hooks/design-view/layout/useScope.mjs";
|
|
@@ -91,4 +92,4 @@ function onInit() {
|
|
|
91
92
|
}
|
|
92
93
|
onInit();
|
|
93
94
|
//#endregion
|
|
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 };
|
|
95
|
+
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, changeCmpData, commonStyle, createWidgetByType, createWidgetProvider, createdSearchField, 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 };
|
|
@@ -85,6 +85,10 @@ var DesignerRegister = class {
|
|
|
85
85
|
* @returns {*} {(IDesignerProvider | undefined)}
|
|
86
86
|
*/
|
|
87
87
|
getProvider(tag) {
|
|
88
|
+
if (!this.providers.has(tag)) {
|
|
89
|
+
console.warn(`getProvider with tag ${tag} is not registered.`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
88
92
|
return this.providers.get(tag);
|
|
89
93
|
}
|
|
90
94
|
/**
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { designRegister, platform } from "
|
|
2
|
-
import { basicAttrsUtils } from "
|
|
3
|
-
import { transformField2Component } from "
|
|
1
|
+
import { designRegister, platform } from "../../utils/design-view/index.mjs";
|
|
2
|
+
import { basicAttrsUtils } from "../../utils/field-attrs/basicAttrs.mjs";
|
|
3
|
+
import { transformField2Component } from "../../utils/field-attrs/index.mjs";
|
|
4
|
+
import "../../utils/index.mjs";
|
|
5
|
+
import { runSubtableFieldWidget, runWidget } from "../field/data-table-column.mjs";
|
|
4
6
|
import { useDesigner } from "../../hooks/design-view/useDesigner.mjs";
|
|
5
7
|
import { useAsyncOperateField } from "../../hooks/widgets/useAsyncFields.mjs";
|
|
6
8
|
import "../../hooks/index.mjs";
|
|
7
9
|
import { cloneDeep, get, merge } from "lodash-es";
|
|
8
10
|
import { CreateType, EntityModelTypeEnum, FIELD_TYPE, FieldIconMap, FormComponents, MaterialEnum, Platform, buildShortUUID } from "@gct-paas/core";
|
|
9
11
|
import { transformI18n } from "@gct-paas/schema";
|
|
10
|
-
//#region src/
|
|
12
|
+
//#region src/schema/begin-drag/begin-drag.ts
|
|
11
13
|
var { unBindAsyncStatus } = useAsyncOperateField();
|
|
12
14
|
/**
|
|
13
15
|
*
|
|
@@ -94,8 +96,8 @@ function beginDrag(data, { materialType = MaterialEnum.MaterialFormField, preLoc
|
|
|
94
96
|
transformI18n(cmp.props);
|
|
95
97
|
const widget = merge(cmp, basic);
|
|
96
98
|
provider.beforeCreate?.(widget);
|
|
97
|
-
if (materialType === MaterialEnum.MaterialTableField)
|
|
98
|
-
if ([MaterialEnum.MaterialSubTableField, MaterialEnum.MaterialTableSelectField].includes(materialType) && (widget.platform === Platform.WEB || widget.platform === Platform.PAD))
|
|
99
|
+
if (materialType === MaterialEnum.MaterialTableField) return runWidget(widget);
|
|
100
|
+
if ([MaterialEnum.MaterialSubTableField, MaterialEnum.MaterialTableSelectField].includes(materialType) && (widget.platform === Platform.WEB || widget.platform === Platform.PAD)) return runSubtableFieldWidget(widget);
|
|
99
101
|
if (materialType === MaterialEnum.MaterialSubTableModalField) {
|
|
100
102
|
const { subTableModalId } = useDesigner();
|
|
101
103
|
unBindAsyncStatus(subTableModalId.value);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { changeCmpData } from "../utils.mjs";
|
|
1
2
|
import { useScope } from "../../hooks/design-view/layout/useScope.mjs";
|
|
2
3
|
import { useDesigner } from "../../hooks/design-view/useDesigner.mjs";
|
|
3
4
|
import "../../hooks/index.mjs";
|
|
@@ -105,6 +106,7 @@ var getBindCmpTypeEditor = ({ name, type, hiddenCallback, filterOptionsCallback,
|
|
|
105
106
|
widget.props.displayTimeType = "d:h:m:s";
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
109
|
+
changeCmpData(widget);
|
|
108
110
|
}
|
|
109
111
|
}];
|
|
110
112
|
};
|
|
@@ -1,8 +1,56 @@
|
|
|
1
|
+
import { createdSearchField } from "../utils.mjs";
|
|
1
2
|
import { fixedAlignEditor } from "../common-config/column-editor-config.mjs";
|
|
2
|
-
import "lodash-es";
|
|
3
|
-
import { BindCmpStyleEnum, FIELD_TYPE, FormComponents, Platform, ProgressTypeEnum, PropGroup, StyleGroup, TagTypeEnum, TextDecoration, buildShortUUID, fixedAlignENUM, tableColumnWidthEnum, tagEnum } from "@gct-paas/core";
|
|
3
|
+
import { merge } from "lodash-es";
|
|
4
|
+
import { BindCmpStyleEnum, FIELD_TYPE, FormComponents, MaterialEnum, Platform, ProgressTypeEnum, PropGroup, StyleGroup, TagTypeEnum, TextDecoration, buildShortUUID, fixedAlignENUM, searchListByFieldType, t, tableColumnWidthEnum, tagEnum } from "@gct-paas/core";
|
|
4
5
|
import "@gct-paas/schema";
|
|
5
|
-
|
|
6
|
+
//#region src/schema/field/data-table-column.ts
|
|
7
|
+
var columns = {
|
|
8
|
+
props: {
|
|
9
|
+
fixedAlign: fixedAlignENUM.NONE,
|
|
10
|
+
embeddedSearch: false
|
|
11
|
+
},
|
|
12
|
+
style: {
|
|
13
|
+
columnwidthConfigure: tableColumnWidthEnum.ATUO,
|
|
14
|
+
columnwidth: 100,
|
|
15
|
+
columnFontStyleByRule: [],
|
|
16
|
+
columnBackgroundByRule: []
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var tempComponent = [];
|
|
20
|
+
function runWidget(widget) {
|
|
21
|
+
const columnWidget = merge({}, { ...widget }, columns);
|
|
22
|
+
if (widget.platform === Platform.MOBILE) {
|
|
23
|
+
/**移动端汇总字段 */
|
|
24
|
+
columnWidget.style.columnwidth = 25;
|
|
25
|
+
columnWidget.style.columnwidthConfigure = tableColumnWidthEnum.ATUO;
|
|
26
|
+
return columnWidget;
|
|
27
|
+
}
|
|
28
|
+
/** bindFieldKey 存在必然是关联模型关联字段 不需要内嵌搜索*/
|
|
29
|
+
columnWidget.props.embeddedSearch = !columnWidget.props.bindFieldKey;
|
|
30
|
+
const searchField = searchListByFieldType.includes(widget.props.fieldType);
|
|
31
|
+
if (searchField && columnWidget.props.embeddedSearch) {
|
|
32
|
+
if (!tempComponent.includes(widget.props.fieldType)) {
|
|
33
|
+
const search = createdSearchField(widget.props);
|
|
34
|
+
if (search) {
|
|
35
|
+
search.alias = t("sys.pageDesigner.embeddedSearch");
|
|
36
|
+
columnWidget.children = [search];
|
|
37
|
+
search.materialType = MaterialEnum.MaterialTableField;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
columnWidget.props.readonly = true;
|
|
41
|
+
columnWidget.props.required = false;
|
|
42
|
+
}
|
|
43
|
+
if (!searchField) {
|
|
44
|
+
columnWidget.props.readonly = true;
|
|
45
|
+
columnWidget.props.embeddedSearch = false;
|
|
46
|
+
columnWidget.props.required = false;
|
|
47
|
+
if (widget.props.fieldType === FIELD_TYPE.SERIAL) columnWidget.props.fieldReadonly = true;
|
|
48
|
+
}
|
|
49
|
+
return columnWidget;
|
|
50
|
+
}
|
|
51
|
+
function runSubtableFieldWidget(widget) {
|
|
52
|
+
return merge({}, { ...widget }, columns);
|
|
53
|
+
}
|
|
6
54
|
function webRunPropEditor(list) {
|
|
7
55
|
return [
|
|
8
56
|
...list,
|
|
@@ -218,4 +266,4 @@ function getBackgroundRule() {
|
|
|
218
266
|
};
|
|
219
267
|
}
|
|
220
268
|
//#endregion
|
|
221
|
-
export { mobileRunSubTableStyleEditor, runStyleEditor, webRunPropEditor };
|
|
269
|
+
export { mobileRunSubTableStyleEditor, runStyleEditor, runSubtableFieldWidget, runWidget, webRunPropEditor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runPropEditor } from "./card-list-field.mjs";
|
|
2
1
|
import { mobileRunSubTableStyleEditor, runStyleEditor, webRunPropEditor } from "./data-table-column.mjs";
|
|
2
|
+
import { runPropEditor } from "./card-list-field.mjs";
|
|
3
3
|
import { MaterialEnum, Platform, SUB_TABLE_EDIT_MODE } from "@gct-paas/core";
|
|
4
4
|
import { FieldEditorOverrideRegistry, padVTableSupportEditFieldTypes } from "@gct-paas/schema";
|
|
5
5
|
//#region src/schema/field/index.ts
|
package/es/schema/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as modalCfg from './modal/modal';
|
|
2
2
|
export { modalCfg };
|
|
3
|
+
export { beginDrag } from './begin-drag/begin-drag';
|
|
3
4
|
export * from './common-config/button-props-func';
|
|
4
5
|
export * from './common-config/common-style';
|
|
5
6
|
export * from './common-config/display-editor-config';
|
|
@@ -11,6 +12,7 @@ export * from './common-config/formItem-editor-config';
|
|
|
11
12
|
export * from './common-config/common-event-config';
|
|
12
13
|
export * from './common-config/autofill-editor-config';
|
|
13
14
|
export * from './common-config/column-editor-config';
|
|
15
|
+
export * from './field';
|
|
14
16
|
export * from './search/BaseSearch';
|
|
15
17
|
export * from './search/BaseDate';
|
|
16
|
-
export * from './
|
|
18
|
+
export * from './utils';
|
package/es/schema/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "./modal/modal.mjs";
|
|
2
|
+
import "./utils.mjs";
|
|
3
|
+
import "./common-config/column-editor-config.mjs";
|
|
4
|
+
import "./begin-drag/begin-drag.mjs";
|
|
2
5
|
import "./common-config/button-props-func.mjs";
|
|
3
6
|
import "./common-config/common-style.mjs";
|
|
4
7
|
import "./common-config/display-editor-config.mjs";
|
|
@@ -9,7 +12,6 @@ import "./common-config/button-editor-config.mjs";
|
|
|
9
12
|
import "./common-config/formItem-editor-config.mjs";
|
|
10
13
|
import "./common-config/common-event-config.mjs";
|
|
11
14
|
import "./common-config/autofill-editor-config.mjs";
|
|
12
|
-
import "./
|
|
15
|
+
import "./field/index.mjs";
|
|
13
16
|
import "./search/BaseSearch.mjs";
|
|
14
17
|
import "./search/BaseDate.mjs";
|
|
15
|
-
import "./field/index.mjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
/**
|
|
3
|
+
* 创建搜索字段组件
|
|
4
|
+
* @param data
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function createdSearchField(data: IObject): LowCodeWidget.SearchSchema;
|
|
8
|
+
export declare function changeCmpData(widget: LowCodeWidget.BasicSchema): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { designRegister } from "../utils/design-view/index.mjs";
|
|
2
|
+
import "../utils/index.mjs";
|
|
3
|
+
import { cloneDeep, difference, merge, pick, without } from "lodash-es";
|
|
4
|
+
import { FIELD_TYPE, FieldIconMap, buildShortUUID, t, transformBindCmp2CmpType } from "@gct-paas/core";
|
|
5
|
+
import { basicSearchAttrsUtils, transformField2SearchComponent, transformI18n } from "@gct-paas/schema";
|
|
6
|
+
//#region src/schema/utils.ts
|
|
7
|
+
/**
|
|
8
|
+
* 创建搜索字段组件
|
|
9
|
+
* @param data
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
function createdSearchField(data) {
|
|
13
|
+
const { field, fieldId, fieldName, fieldCodeChain, fieldType: comType, label, bindModelKey, modelKey, returnType, type, preLocation, isFieldModel, platform } = data;
|
|
14
|
+
const basic = {
|
|
15
|
+
id: buildShortUUID(comType),
|
|
16
|
+
name: `sys.pageDesigner.fieldCmp.${type || comType}`,
|
|
17
|
+
icon: FieldIconMap[type || comType],
|
|
18
|
+
isSearchField: true,
|
|
19
|
+
preLocation,
|
|
20
|
+
platform
|
|
21
|
+
};
|
|
22
|
+
const fieldType = [FIELD_TYPE.AGG, FIELD_TYPE.EXPRESSION].includes(comType) ? returnType : comType;
|
|
23
|
+
data.fieldType = fieldType;
|
|
24
|
+
const { searchCmpKey, attrsTransform } = transformField2SearchComponent(fieldType) || {};
|
|
25
|
+
if (!searchCmpKey) return;
|
|
26
|
+
const searchCmp = cloneDeep(designRegister.value.getProvider(searchCmpKey)?.schema);
|
|
27
|
+
const otherAttrs = Object.fromEntries(attrsTransform.concat([...basicSearchAttrsUtils.ope]).map((row) => {
|
|
28
|
+
const value = data[row.from];
|
|
29
|
+
return [row.to, row.transform ? row.transform(value) : value];
|
|
30
|
+
}));
|
|
31
|
+
merge(searchCmp.props, {
|
|
32
|
+
field,
|
|
33
|
+
fieldId,
|
|
34
|
+
fieldType,
|
|
35
|
+
fieldName,
|
|
36
|
+
fieldCodeChain,
|
|
37
|
+
label,
|
|
38
|
+
modelKey,
|
|
39
|
+
bindModelKey,
|
|
40
|
+
disabled: false,
|
|
41
|
+
readonly: false,
|
|
42
|
+
modeldata: {
|
|
43
|
+
modelCategory: data.modelCategory,
|
|
44
|
+
modelType: data.modelType
|
|
45
|
+
},
|
|
46
|
+
isFieldModel,
|
|
47
|
+
...otherAttrs
|
|
48
|
+
}, searchCmp.props.placeholder && { placeholder: t(searchCmp.props.placeholder) });
|
|
49
|
+
if (isFieldModel && fieldCodeChain) searchCmp.props.fieldSearchKey = [...JSON.parse(fieldCodeChain)?.fieldLink || [], field].join("$");
|
|
50
|
+
return merge(searchCmp, basic);
|
|
51
|
+
}
|
|
52
|
+
function changeCmpData(widget) {
|
|
53
|
+
const cmpType = transformBindCmp2CmpType[widget.props.bindCompStyleType];
|
|
54
|
+
const cmp = cloneDeep(designRegister.value.getProvider(cmpType)?.schema);
|
|
55
|
+
const sourceWidgetPropsAttrs = Object.keys(widget.props);
|
|
56
|
+
const nowWidgetPropsAttrs = Object.keys(cmp.props);
|
|
57
|
+
const commonAttrs = [
|
|
58
|
+
"field",
|
|
59
|
+
"fieldId",
|
|
60
|
+
"fieldType",
|
|
61
|
+
"fieldName",
|
|
62
|
+
"fieldCodeChain",
|
|
63
|
+
"bindFieldKey"
|
|
64
|
+
];
|
|
65
|
+
const addAttrs = difference(nowWidgetPropsAttrs, sourceWidgetPropsAttrs);
|
|
66
|
+
const delAttrs = without(difference(sourceWidgetPropsAttrs, nowWidgetPropsAttrs), ...commonAttrs);
|
|
67
|
+
widget.type = cmp.type;
|
|
68
|
+
delAttrs.forEach((attr) => {
|
|
69
|
+
delete widget.props[attr];
|
|
70
|
+
});
|
|
71
|
+
const addRes = pick(cmp.props, addAttrs);
|
|
72
|
+
merge(widget.props, addRes);
|
|
73
|
+
transformI18n(widget.props);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { changeCmpData, createdSearchField };
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import "./design-interceptors/design-interceptors.mjs";
|
|
1
2
|
import "./design-view/index.mjs";
|
|
2
3
|
import "./field-attrs/basicAttrs.mjs";
|
|
3
4
|
import "./field-attrs/index.mjs";
|
|
4
|
-
import "./begin-drag/begin-drag.mjs";
|
|
5
|
-
import "./design-interceptors/design-interceptors.mjs";
|
|
6
5
|
import "./field-filter/index.mjs";
|
|
7
6
|
import "./formula-editor-design/formula-editor-design.mjs";
|
|
8
7
|
import "./find-deep-types/find-deep-types.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/design",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台设计界面底包",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@ant-design/icons-vue": "^7.0.1",
|
|
46
46
|
"@babel/core": "^7.29.0",
|
|
47
47
|
"@babel/standalone": "^7.29.2",
|
|
48
|
-
"@gct-paas/api": "^0.1.2-dev.
|
|
49
|
-
"@gct-paas/core": "0.1.4-dev.
|
|
50
|
-
"@gct-paas/core-web": "0.1.4-dev.
|
|
51
|
-
"@gct-paas/schema": "0.1.4-dev.
|
|
52
|
-
"@gct-paas/scss": "0.1.4-dev.
|
|
48
|
+
"@gct-paas/api": "^0.1.2-dev.2",
|
|
49
|
+
"@gct-paas/core": "0.1.4-dev.19",
|
|
50
|
+
"@gct-paas/core-web": "0.1.4-dev.19",
|
|
51
|
+
"@gct-paas/schema": "0.1.4-dev.19",
|
|
52
|
+
"@gct-paas/scss": "0.1.4-dev.19",
|
|
53
53
|
"@jsplumb/browser-ui": "^6.2.10",
|
|
54
54
|
"@vueuse/core": "^14.1.0",
|
|
55
55
|
"ant-design-vue": "~3.2.20",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"@gct-paas/scss": "*",
|
|
80
80
|
"vue": ">=3"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "efd978bbe7552b0c5ef6dbc5b62780c68aa116ab"
|
|
83
83
|
}
|
|
File without changes
|