diff --git a/packages/admin/src/components/Fields/FieldContentEditor.tsx b/packages/admin/src/components/Fields/FieldContentEditor.tsx
index cca1fe7b..4f1d915c 100644
--- a/packages/admin/src/components/Fields/FieldContentEditor.tsx
+++ b/packages/admin/src/components/Fields/FieldContentEditor.tsx
@@ -4,6 +4,7 @@ import { Rule } from 'antd/es/form'
import { IConnectEditor, IDatePicker, IFileAndImageEditor } from '@/components/Fields'
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'
import { IObjectEditor } from './Object'
+import { FormListFieldData } from 'antd/es/form/FormList'
const MarkdownEditor = React.lazy(() => import('@/components/Fields/Markdown'))
const RichTextEditor = React.lazy(() => import('@/components/Fields/RichText'))
@@ -154,6 +155,36 @@ export function getFieldEditor(field: SchemaField, key: number) {
)
break
case 'Array':
+ const schemaField = field as SchemaField & { [key: string]: any };
+ const renderItem = (formField: FormListFieldData) => {
+ switch (schemaField.elementType) {
+ case 'Enum':
+ return (
+
+
+
+ );
+ default:
+ return (
+
+
+
+ );
+ }
+ }
+
FieldEditor = (
{(fields, { add, remove }) => {
@@ -162,9 +193,7 @@ export function getFieldEditor(field: SchemaField, key: number) {
{fields?.map((field, index) => {
return (
-
-
-
+ {renderItem(field)}
{
+ switch (f.elementType) {
+ case 'Enum':
+ const enumOptions = f.enumElements || [];
+ const displayVal = enumOptions.find(e => e.value === val)?.label;
+ return {displayVal || val};
+ default:
+ return {val};
+ }
+ }
+
return (
- {record[name]?.map((val: string, index: number) => (
- {val}
- ))}
+ {record[name]?.map(renderItem)}
)
}
diff --git a/packages/admin/src/pages/project/schema/SchemaFieldEditor/Field.tsx b/packages/admin/src/pages/project/schema/SchemaFieldEditor/Field.tsx
index d6f395d0..fbe56776 100644
--- a/packages/admin/src/pages/project/schema/SchemaFieldEditor/Field.tsx
+++ b/packages/admin/src/pages/project/schema/SchemaFieldEditor/Field.tsx
@@ -260,6 +260,32 @@ export function getFieldFormItem(
>
)
+ case 'Array':
+ const renderElement = (fieldType: string,) => {
+ switch (fieldType) {
+ case 'Enum':
+ return getFieldFormItem(fieldType, { ...options });
+ default:
+ return null;
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+ {(ele) => {
+ const filed = ele.getFieldValue('elementType');
+ return renderElement(filed);
+ }}
+
+ >
+ )
default:
return ''
}