@gct-paas/schema 0.1.4-dev.10 → 0.1.4-dev.12

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 (47) hide show
  1. package/dist/index.esm.min.js +941 -0
  2. package/es/constants/index.d.ts +15 -1
  3. package/es/constants/index.mjs +408 -368
  4. package/es/index.d.ts +0 -1
  5. package/es/index.mjs +10 -20
  6. package/es/interface/designer.d.ts +0 -1
  7. package/es/interface/modal/i-modal-body.d.ts +1 -1
  8. package/es/interface/schema/widget-props/i-search-widget-props.d.ts +6 -0
  9. package/es/interface/schema/widget-types.d.ts +16 -6
  10. package/es/interface/widget/i-common.d.ts +2 -1
  11. package/es/interface/widget/i-editors.d.ts +2 -2
  12. package/es/interface/widget/i-props.d.ts +1 -10
  13. package/es/interface/widget/i-schemas.d.ts +1 -0
  14. package/es/utils/index.mjs +4 -0
  15. package/es/utils/schema/index.d.ts +9 -1
  16. package/es/utils/schema/index.mjs +118 -39
  17. package/es/utils/schema/search.d.ts +9 -0
  18. package/es/utils/schema/search.mjs +146 -0
  19. package/es/utils/schema/utils.d.ts +21 -0
  20. package/es/utils/schema/utils.mjs +182 -0
  21. package/es/utils/schema-style/index.mjs +203 -127
  22. package/es/utils/widget-info/widget-info.mjs +130 -57
  23. package/package.json +6 -5
  24. package/dist/index.esm.min.mjs +0 -1250
  25. package/dist/index.min.cjs +0 -1
  26. package/dist/index.system.min.js +0 -1
  27. package/es/schema/common-config/base-button-config.d.ts +0 -3
  28. package/es/schema/common-config/base-button-config.mjs +0 -84
  29. package/es/schema/common-config/button-editor-config.d.ts +0 -4
  30. package/es/schema/common-config/button-editor-config.mjs +0 -206
  31. package/es/schema/common-config/button-props-func.d.ts +0 -5
  32. package/es/schema/common-config/button-props-func.mjs +0 -11
  33. package/es/schema/common-config/common-field-editor-config.d.ts +0 -10
  34. package/es/schema/common-config/common-field-editor-config.mjs +0 -61
  35. package/es/schema/common-config/common-style.d.ts +0 -3
  36. package/es/schema/common-config/common-style.mjs +0 -85
  37. package/es/schema/common-config/display-editor-config.d.ts +0 -3
  38. package/es/schema/common-config/display-editor-config.mjs +0 -89
  39. package/es/schema/common-config/permission-editor-config.d.ts +0 -2
  40. package/es/schema/common-config/permission-editor-config.mjs +0 -23
  41. package/es/schema/index.d.ts +0 -9
  42. package/es/schema/modal/modal-body.d.ts +0 -2
  43. package/es/schema/modal/modal-body.mjs +0 -9
  44. package/es/schema/modal/modal-footer.d.ts +0 -2
  45. package/es/schema/modal/modal-footer.mjs +0 -9
  46. package/es/schema/modal/modal.d.ts +0 -8
  47. package/es/schema/modal/modal.mjs +0 -182
package/es/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export type * from './interface';
2
- export * from './schema';
3
2
  export * from './utils';
4
3
  export * from './constants';
5
4
  declare const _default: {
package/es/index.mjs CHANGED
@@ -1,20 +1,10 @@
1
- import * as modal from './schema/modal/modal.mjs';
2
- export { modal as modalCfg };
3
- export { hiddenButtonProps } from './schema/common-config/button-props-func.mjs';
4
- export { commonStyle, notNeedPxStyle } from './schema/common-config/common-style.mjs';
5
- export { displayEditor, displayProps } from './schema/common-config/display-editor-config.mjs';
6
- export { getBindCmpTypeEditor } from './schema/common-config/common-field-editor-config.mjs';
7
- export { baseBtnEditor, baseBtnProp } from './schema/common-config/base-button-config.mjs';
8
- export { permissionEditor } from './schema/common-config/permission-editor-config.mjs';
9
- export { buttonEditor, buttonProps, buttonStyleEditor } from './schema/common-config/button-editor-config.mjs';
10
- export { cloneWidget, deepFindNotField, getCompPos, isFormFieldType, transformI18n } from './utils/schema/index.mjs';
11
- export { ALIGN_TO_FLEX_MAP, addImportant, addPxUnit, extractFontStyle, formatBorder, generateBorderStyles, generatePositionStyles, generateSpacingStyles, generateWrapperStyle, makeStyleProp, propsToStyle, pxToVw, transAlign2flex } from './utils/schema-style/index.mjs';
12
- export { getWidgetInfo, mobileWidgetInfo, padWidgetInfo, registerMobilePluginWidgetItem, registerMobileWidgetItem, registerPadPluginWidgetItem, registerPadWidgetItem, registerPluginWidgetItem, registerWebPluginWidgetItem, registerWebWidgetItem, registerWidgetItem, webWidgetInfo } from './utils/widget-info/widget-info.mjs';
13
- export { SEARCH_TYPE, padVTableSupportEditFieldTypes } from './constants/index.mjs';
14
-
15
- const index = {
16
- install() {
17
- }
18
- };
19
-
20
- export { index as default };
1
+ import { getWidgetInfo, mobileWidgetInfo, padWidgetInfo, registerMobilePluginWidgetItem, registerMobileWidgetItem, registerPadPluginWidgetItem, registerPadWidgetItem, registerPluginWidgetItem, registerWebPluginWidgetItem, registerWebWidgetItem, registerWidgetItem, webWidgetInfo } from "./utils/widget-info/widget-info.mjs";
2
+ import { DatepickerTypes, SEARCH_TYPE, padVTableSupportEditFieldTypes } from "./constants/index.mjs";
3
+ import { convertMappingType, flatten, transformMappingField, transformMappingField4Auto } from "./utils/schema/utils.mjs";
4
+ import { cloneWidget, createdSearchField, deepFindNotField, getCompPos, isFormFieldType, setChildrenId, transformI18n } from "./utils/schema/index.mjs";
5
+ import { ALIGN_TO_FLEX_MAP, addImportant, addPxUnit, extractFontStyle, formatBorder, generateBorderStyles, generatePositionStyles, generateSpacingStyles, generateWrapperStyle, makeStyleProp, propsToStyle, pxToVw, transAlign2flex } from "./utils/schema-style/index.mjs";
6
+ import "./utils/index.mjs";
7
+ //#region src/index.ts
8
+ var src_default = { install() {} };
9
+ //#endregion
10
+ export { ALIGN_TO_FLEX_MAP, DatepickerTypes, SEARCH_TYPE, addImportant, addPxUnit, cloneWidget, convertMappingType, createdSearchField, deepFindNotField, src_default as default, extractFontStyle, flatten, formatBorder, generateBorderStyles, generatePositionStyles, generateSpacingStyles, generateWrapperStyle, getCompPos, getWidgetInfo, isFormFieldType, makeStyleProp, mobileWidgetInfo, padVTableSupportEditFieldTypes, padWidgetInfo, propsToStyle, pxToVw, registerMobilePluginWidgetItem, registerMobileWidgetItem, registerPadPluginWidgetItem, registerPadWidgetItem, registerPluginWidgetItem, registerWebPluginWidgetItem, registerWebWidgetItem, registerWidgetItem, setChildrenId, transAlign2flex, transformI18n, transformMappingField, transformMappingField4Auto, webWidgetInfo };
@@ -26,7 +26,6 @@ export interface PageJson {
26
26
  css: string;
27
27
  modals: LowCodeModal.Modal[];
28
28
  timestamp?: number;
29
- newDesigner?: boolean;
30
29
  /**全局页面事件 */
31
30
  globalEvents: IPageGlobalEvents;
32
31
  permissions: Record<string, string | null>;
@@ -9,7 +9,7 @@ export interface IModalBody {
9
9
  /** 唯一标识 */
10
10
  id: string;
11
11
  /** 组件类型 */
12
- type: BuiltinType.MODAL_BODY;
12
+ type: BuiltinType.MODAL_BODY | string;
13
13
  /** 子组件列表 */
14
14
  children: LowCodeWidget.BasicSchema[];
15
15
  }
@@ -120,6 +120,12 @@ export interface SearchBizProcess extends LowCodeWidget.SearchSchema {
120
120
  showSearch: boolean;
121
121
  searchField: string[];
122
122
  refModelType?: EntityModelTypeEnum;
123
+ customMenu: boolean;
124
+ customMenuFilter: string[] | number[] | boolean[];
125
+ customMenuOptions: {
126
+ key: string;
127
+ value: string;
128
+ }[];
123
129
  } & LowCodeWidget.SearchSchema['props'];
124
130
  }
125
131
  /** 所有搜索组件类型联合 */
@@ -89,18 +89,23 @@ export interface DataTable extends LowCodeWidget.BasicSchema {
89
89
  OperateTable,
90
90
  {
91
91
  alias: string;
92
- props: IData;
92
+ props?: IData;
93
93
  children: (FormulaTable | ColumnTable)[];
94
+ preLocation?: string;
94
95
  },
95
96
  {
96
97
  alias: string;
97
- props: IData;
98
+ props?: IData;
98
99
  children: OperateButton[];
100
+ preLocation?: string;
101
+ visibleButtons?: number;
99
102
  },
100
103
  {
101
104
  alias: string;
102
- props: IData;
105
+ props?: IData;
103
106
  children: OperateButton[];
107
+ preLocation?: string;
108
+ visibleButtons?: number;
104
109
  },
105
110
  SubDataTable
106
111
  ];
@@ -111,18 +116,23 @@ export interface TreeTable extends LowCodeWidget.BasicSchema {
111
116
  OperateTable,
112
117
  {
113
118
  alias: string;
114
- props: IData;
119
+ props?: IData;
115
120
  children: (FormulaTable | ColumnTable)[];
121
+ preLocation?: string;
116
122
  },
117
123
  {
118
124
  alias: string;
119
- props: IData;
125
+ props?: IData;
120
126
  children: OperateButton[];
127
+ preLocation?: string;
128
+ visibleButtons?: number;
121
129
  },
122
130
  {
123
131
  alias: string;
124
- props: IData;
132
+ props?: IData;
125
133
  children: OperateButton[];
134
+ preLocation?: string;
135
+ visibleButtons?: number;
126
136
  }
127
137
  ];
128
138
  }
@@ -30,9 +30,10 @@ export interface validateRule {
30
30
  ruleName: string;
31
31
  field: string;
32
32
  ruleType: VERIFICATIONCONDITIONS_TYPE.JS;
33
- trigger?: 'change' | 'bulr';
33
+ trigger?: 'change' | 'blur';
34
34
  message?: string;
35
35
  jsName?: string;
36
+ extParams?: IObject;
36
37
  }
37
38
  /**
38
39
  * 组件类型与组件Schema接口映射
@@ -79,7 +79,7 @@ export interface IPropEditor {
79
79
  /** prop分组 */
80
80
  group: PropGroup | string;
81
81
  /** 自定义校验 */
82
- validate?: Promise<any>;
82
+ validate?: Promise<any> | Fn;
83
83
  /** editor内部的自定义config逻辑 */
84
84
  _config?: Partial<IPropEditorConfig>;
85
85
  /** 表单项额外配置 */
@@ -195,7 +195,7 @@ export interface IPropEditorConfig {
195
195
  /** 需要过滤的字段 */
196
196
  excludeFieldType?: FIELD_TYPE[];
197
197
  /** 最要过滤的字段key */
198
- excludeFieldKey?: string[];
198
+ excludeFieldKey?: string[] | Function;
199
199
  /** 默认展开所有节点 */
200
200
  defaultExpandAll?: boolean;
201
201
  /** 显示checkbox */
@@ -65,16 +65,7 @@ export interface IDependencyItem {
65
65
  *
66
66
  * @interface IDependency
67
67
  */
68
- export interface IDependency {
69
- [Dependency_ENUM.HIDDEN]: IDependencyItem;
70
- /** 只读 */
71
- [Dependency_ENUM.READONLY]: IDependencyItem;
72
- /** 禁用 */
73
- [Dependency_ENUM.DISABLED]: IDependencyItem;
74
- /** 必填 */
75
- [Dependency_ENUM.REQUIRED]: IDependencyItem;
76
- [Dependency_ENUM.ASSIGNMENT]: IDependencyItem;
77
- }
68
+ export type IDependency = Partial<Record<Dependency_ENUM, IDependencyItem>>;
78
69
  /**
79
70
  * 表单组件Prop Schema
80
71
  *
@@ -111,6 +111,7 @@ export interface ISearchSchema {
111
111
  isSearchField: boolean;
112
112
  materialType: MaterialEnum;
113
113
  props: {
114
+ [key: string]: any;
114
115
  /** 字段key */
115
116
  field: string;
116
117
  /** 字段id */
@@ -0,0 +1,4 @@
1
+ import "./widget-info/widget-info.mjs";
2
+ import "./schema/utils.mjs";
3
+ import "./schema/index.mjs";
4
+ import "./schema-style/index.mjs";
@@ -1,4 +1,4 @@
1
- import { LowCodeWidget } from '../../interface';
1
+ import { IBasicSchema, LowCodeWidget } from '../../interface';
2
2
  /**
3
3
  * 获取组件所属位置
4
4
  *
@@ -43,3 +43,11 @@ export declare function deepFindNotField(item: IObject[]): {
43
43
  [x: string]: any;
44
44
  [x: symbol]: any;
45
45
  }[];
46
+ export declare function setChildrenId(widget: IBasicSchema): void;
47
+ /**
48
+ * 创建搜索字段组件
49
+ * @param data
50
+ * @returns
51
+ */
52
+ export declare function createdSearchField(data: IObject): LowCodeWidget.SearchSchema;
53
+ export * from './utils';
@@ -1,49 +1,128 @@
1
- import { buildShortUUID, t, MaterialEnum } from '@gct-paas/core';
2
- import { cloneDeep, has } from 'lodash-es';
3
- import { getWidgetInfo } from '../widget-info/widget-info.mjs';
4
-
1
+ import { getWidgetInfo } from "../widget-info/widget-info.mjs";
2
+ import { basicSearchAttrsUtils, transformField2SearchComponent } from "./search.mjs";
3
+ import "./utils.mjs";
4
+ import { FIELD_TYPE, FieldIconMap, MaterialEnum, TreeHelper, buildShortUUID, t } from "@gct-paas/core";
5
+ import { cloneDeep, has, merge } from "lodash-es";
6
+ //#region src/utils/schema/index.ts
7
+ /**
8
+ * 获取组件所属位置
9
+ *
10
+ * @export
11
+ * @param {LowCodeWidget.BasicSchema} widget
12
+ * @param {string} fieldType
13
+ * @param {string} componentType
14
+ * @return {*}
15
+ */
5
16
  function getCompPos(widget, fieldType, componentType) {
6
- return widget.type === componentType && has(widget, "preLocation") && new RegExp(`^${fieldType}_`).test(widget.preLocation);
17
+ return widget.type === componentType && has(widget, "preLocation") && new RegExp(`^${fieldType}_`).test(widget.preLocation);
7
18
  }
19
+ /**
20
+ * 是否是表单字段类型
21
+ *
22
+ * @export
23
+ * @param {LowCodeWidget.BasicSchema} widget
24
+ * @return {boolean}
25
+ */
8
26
  function isFormFieldType(widget) {
9
- return [
10
- MaterialEnum.MaterialFormField,
11
- MaterialEnum.MaterialSubTableModalField,
12
- MaterialEnum.DescriptionsFormField
13
- ].includes(widget.materialType);
27
+ return [
28
+ MaterialEnum.MaterialFormField,
29
+ MaterialEnum.MaterialSubTableModalField,
30
+ MaterialEnum.DescriptionsFormField
31
+ ].includes(widget.materialType);
14
32
  }
33
+ /**
34
+ * 初始化国际化处理
35
+ *
36
+ * @export
37
+ * @param {LowCodeWidget.BasicSchema['props']} props
38
+ */
15
39
  function transformI18n(props) {
16
- const reg = /^\$\{(\S+)\}$/;
17
- for (const key in props) {
18
- const value = props[key];
19
- if (reg.test(value)) {
20
- props[key] = t(value.match(reg)?.[1]);
21
- }
22
- }
40
+ const reg = /^\$\{(\S+)\}$/;
41
+ for (const key in props) {
42
+ const value = props[key];
43
+ if (reg.test(value)) props[key] = t(value.match(reg)?.[1]);
44
+ }
23
45
  }
46
+ /**
47
+ * 克隆组件schema
48
+ *
49
+ * @export
50
+ * @param {LowCodeWidget.BasicSchema} widgetSchema
51
+ * @return {*} {LowCodeWidget.BasicSchema}
52
+ */
24
53
  function cloneWidget(widgetSchema) {
25
- const instance = cloneDeep(widgetSchema);
26
- instance.id = buildShortUUID(instance.type);
27
- instance.alias = t(instance.name);
28
- if (instance.formItem) {
29
- instance.props.label = t(instance.name);
30
- }
31
- const widgetInfo = getWidgetInfo(instance.platform);
32
- if (widgetInfo) {
33
- widgetInfo.beforeCreate?.[instance.type]?.(instance);
34
- }
35
- transformI18n(instance.props);
36
- return instance;
54
+ const instance = cloneDeep(widgetSchema);
55
+ instance.id = buildShortUUID(instance.type);
56
+ instance.alias = t(instance.name);
57
+ if (instance.formItem) instance.props.label = t(instance.name);
58
+ const widgetInfo = getWidgetInfo(instance.platform);
59
+ if (widgetInfo) widgetInfo.beforeCreate?.[instance.type]?.(instance);
60
+ transformI18n(instance.props);
61
+ return instance;
37
62
  }
63
+ /**
64
+ * 递归获取所有非字段组件
65
+ *
66
+ * @param {LowCodeWidget.BasicSchema} item
67
+ * @param {string[]} [types=[]]
68
+ * @returns {*} {string[]}
69
+ */
38
70
  function deepFindNotField(item) {
39
- return item.map((node) => ({ ...node })).filter((node) => {
40
- if (node.props?.model) {
41
- return predicate(node);
42
- }
43
- node.children = node.children && deepFindNotField(node.children);
44
- return predicate(node);
45
- });
71
+ return item.map((node) => ({ ...node })).filter((node) => {
72
+ if (node.props?.model) return predicate(node);
73
+ node.children = node.children && deepFindNotField(node.children);
74
+ return predicate(node);
75
+ });
46
76
  }
47
- const predicate = (node) => !node.formItem;
48
-
49
- export { cloneWidget, deepFindNotField, getCompPos, isFormFieldType, transformI18n };
77
+ var predicate = (node) => !node.formItem;
78
+ function setChildrenId(widget) {
79
+ if (widget.children?.length) TreeHelper.eachTree(widget.children, (child) => {
80
+ child.id = buildShortUUID(child.type);
81
+ return child;
82
+ });
83
+ }
84
+ /**
85
+ * 创建搜索字段组件
86
+ * @param data
87
+ * @returns
88
+ */
89
+ function createdSearchField(data) {
90
+ const { field, fieldId, fieldName, fieldCodeChain, fieldType: comType, label, bindModelKey, modelKey, returnType, type, preLocation, isFieldModel, platform } = data;
91
+ const basic = {
92
+ id: buildShortUUID(comType),
93
+ name: `sys.pageDesigner.fieldCmp.${type || comType}`,
94
+ icon: FieldIconMap[type || comType],
95
+ isSearchField: true,
96
+ preLocation,
97
+ platform
98
+ };
99
+ const fieldType = [FIELD_TYPE.AGG, FIELD_TYPE.EXPRESSION].includes(comType) ? returnType : comType;
100
+ data.fieldType = fieldType;
101
+ const { searchCmpKey, attrsTransform } = transformField2SearchComponent(fieldType) || {};
102
+ if (!searchCmpKey) return;
103
+ const otherAttrs = Object.fromEntries(attrsTransform.concat([...basicSearchAttrsUtils.ope]).map((row) => {
104
+ const value = data[row.from];
105
+ return [row.to, row.transform ? row.transform(value) : value];
106
+ }));
107
+ merge({
108
+ field,
109
+ fieldId,
110
+ fieldType,
111
+ fieldName,
112
+ fieldCodeChain,
113
+ label,
114
+ modelKey,
115
+ bindModelKey,
116
+ disabled: false,
117
+ readonly: false,
118
+ modeldata: {
119
+ modelCategory: data.modelCategory,
120
+ modelType: data.modelType
121
+ },
122
+ isFieldModel,
123
+ ...otherAttrs
124
+ });
125
+ return merge(basic);
126
+ }
127
+ //#endregion
128
+ export { cloneWidget, createdSearchField, deepFindNotField, getCompPos, isFormFieldType, setChildrenId, transformI18n };
@@ -0,0 +1,9 @@
1
+ import { FIELD_TYPE } from '@gct-paas/core';
2
+ export declare const basicSearchAttrsUtils: {
3
+ ope: {
4
+ from: string;
5
+ to: string;
6
+ transform: (value: FIELD_TYPE) => import('@gct-paas/core').SEARCH_SERVICE[];
7
+ }[];
8
+ };
9
+ export declare const transformField2SearchComponent: (fieldType: FIELD_TYPE) => IObject;
@@ -0,0 +1,146 @@
1
+ import { SEARCH_TYPE } from "../../constants/index.mjs";
2
+ import { FIELD_TYPE, SearchComponents } from "@gct-paas/core";
3
+ //#region src/utils/schema/search.ts
4
+ var basicSearchAttrsUtils = { ope: [{
5
+ from: "fieldType",
6
+ to: "ope",
7
+ transform: (value) => {
8
+ return [...SEARCH_TYPE[value]?.default || []];
9
+ }
10
+ }] };
11
+ var transformField2SearchComponent = (fieldType) => {
12
+ return {
13
+ [FIELD_TYPE.PRIMARY_KEY]: {
14
+ searchCmpKey: SearchComponents.SearchInput,
15
+ attrsTransform: []
16
+ },
17
+ [FIELD_TYPE.ASSOCIATED_PRIMARY_KEY]: {
18
+ searchCmpKey: SearchComponents.SearchSelect,
19
+ attrsTransform: []
20
+ },
21
+ [FIELD_TYPE.TEXT]: {
22
+ searchCmpKey: SearchComponents.SearchInput,
23
+ attrsTransform: []
24
+ },
25
+ [FIELD_TYPE.LONG_TEXT]: {
26
+ searchCmpKey: SearchComponents.SearchInput,
27
+ attrsTransform: []
28
+ },
29
+ [FIELD_TYPE.SERIAL]: {
30
+ searchCmpKey: SearchComponents.SearchInput,
31
+ attrsTransform: []
32
+ },
33
+ [FIELD_TYPE.DATE]: {
34
+ searchCmpKey: SearchComponents.SearchDate,
35
+ attrsTransform: []
36
+ },
37
+ [FIELD_TYPE.DATE_TIME]: {
38
+ searchCmpKey: SearchComponents.SearchDateTime,
39
+ attrsTransform: []
40
+ },
41
+ [FIELD_TYPE.TIME]: {
42
+ searchCmpKey: SearchComponents.SearchTime,
43
+ attrsTransform: []
44
+ },
45
+ [FIELD_TYPE.INTEGER]: {
46
+ searchCmpKey: SearchComponents.SearchNumberInput,
47
+ attrsTransform: []
48
+ },
49
+ [FIELD_TYPE.DOUBLE]: {
50
+ searchCmpKey: SearchComponents.SearchStringNumberInput,
51
+ attrsTransform: []
52
+ },
53
+ [FIELD_TYPE.LONG]: {
54
+ searchCmpKey: SearchComponents.SearchNumberInput,
55
+ attrsTransform: []
56
+ },
57
+ [FIELD_TYPE.DECIMAL]: {
58
+ searchCmpKey: SearchComponents.SearchStringNumberInput,
59
+ attrsTransform: []
60
+ },
61
+ [FIELD_TYPE.BOOLEAN]: {
62
+ searchCmpKey: SearchComponents.SearchSwitch,
63
+ attrsTransform: []
64
+ },
65
+ [FIELD_TYPE.ENUM]: {
66
+ searchCmpKey: SearchComponents.SearchSelect,
67
+ attrsTransform: []
68
+ },
69
+ [FIELD_TYPE.ENUM_MULTI]: {
70
+ searchCmpKey: SearchComponents.SearchSelect,
71
+ attrsTransform: []
72
+ },
73
+ [FIELD_TYPE.ORG_MULTI]: {
74
+ searchCmpKey: SearchComponents.SearchSelectDepartment,
75
+ attrsTransform: []
76
+ },
77
+ [FIELD_TYPE.USER_MULTI]: {
78
+ searchCmpKey: SearchComponents.SearchUserSelect,
79
+ attrsTransform: []
80
+ },
81
+ [FIELD_TYPE.ORG]: {
82
+ searchCmpKey: SearchComponents.SearchSelectDepartment,
83
+ attrsTransform: []
84
+ },
85
+ [FIELD_TYPE.USER]: {
86
+ searchCmpKey: SearchComponents.SearchUserSelect,
87
+ attrsTransform: []
88
+ },
89
+ [FIELD_TYPE.REF_MULTI]: {
90
+ searchCmpKey: SearchComponents.SearchSelect,
91
+ attrsTransform: [{
92
+ from: "refModelType",
93
+ to: "refModelType"
94
+ }]
95
+ },
96
+ [FIELD_TYPE.REF]: {
97
+ searchCmpKey: SearchComponents.SearchSelect,
98
+ attrsTransform: [{
99
+ from: "refModelType",
100
+ to: "refModelType"
101
+ }]
102
+ },
103
+ [FIELD_TYPE.RDO_REF]: {
104
+ searchCmpKey: SearchComponents.SearchRdoSelect,
105
+ attrsTransform: []
106
+ },
107
+ [FIELD_TYPE.TRANSACTION]: {
108
+ searchCmpKey: SearchComponents.SearchTransaction,
109
+ attrsTransform: []
110
+ },
111
+ [FIELD_TYPE.PRINTER]: {
112
+ searchCmpKey: SearchComponents.SearchPrinter,
113
+ attrsTransform: []
114
+ },
115
+ [FIELD_TYPE.RANGE_USER]: {
116
+ searchCmpKey: SearchComponents.SearchSelectRangUser,
117
+ attrsTransform: []
118
+ },
119
+ [FIELD_TYPE.MESSAGE_TMPL]: {
120
+ searchCmpKey: SearchComponents.SearchSelect,
121
+ attrsTransform: []
122
+ },
123
+ [FIELD_TYPE.LABEL_TEMPLATE_REF]: {
124
+ searchCmpKey: SearchComponents.SearchTmplTreeSelect,
125
+ attrsTransform: []
126
+ },
127
+ [FIELD_TYPE.DOCUMENT_TEMPLATE]: {
128
+ searchCmpKey: SearchComponents.SearchTmplTreeSelect,
129
+ attrsTransform: []
130
+ },
131
+ [FIELD_TYPE.ONLINE_FORM_TEMPLATE]: {
132
+ searchCmpKey: SearchComponents.SearchTmplTreeSelect,
133
+ attrsTransform: []
134
+ },
135
+ [FIELD_TYPE.E_DHR_TEMPLATE]: {
136
+ searchCmpKey: SearchComponents.SearchTmplTreeSelect,
137
+ attrsTransform: []
138
+ },
139
+ [FIELD_TYPE.Biz_Process]: {
140
+ searchCmpKey: SearchComponents.SearchBizProcess,
141
+ attrsTransform: []
142
+ }
143
+ }[fieldType];
144
+ };
145
+ //#endregion
146
+ export { basicSearchAttrsUtils, transformField2SearchComponent };
@@ -0,0 +1,21 @@
1
+ import { FIELD_TYPE, ReturnTypeEnum, EntityFormulaReturnTypeEnum } from '@gct-paas/core';
2
+ /** 树转一维数组 */
3
+ export declare function flatten(array?: IObject[], path?: string, inSubTable?: boolean): IObject[];
4
+ /** 字段映射项 */
5
+ interface FieldFilterConfig {
6
+ filterArr: FIELD_TYPE[];
7
+ equal?: boolean;
8
+ }
9
+ /**
10
+ * 字段填充映射处理
11
+ */
12
+ export declare const transformMappingField: (fieldType: FIELD_TYPE) => FieldFilterConfig | undefined;
13
+ /**
14
+ * 转换原始的returnType为字段类型
15
+ */
16
+ export declare const convertMappingType: (type: ReturnTypeEnum) => EntityFormulaReturnTypeEnum;
17
+ /**
18
+ * 自动填充映射处理
19
+ */
20
+ export declare const transformMappingField4Auto: (fieldType: FIELD_TYPE) => FieldFilterConfig | undefined;
21
+ export {};