diff --git a/packages/client/src/schemas/grid/index.tsx b/packages/client/src/schemas/grid/index.tsx index bda46fd53..030989464 100644 --- a/packages/client/src/schemas/grid/index.tsx +++ b/packages/client/src/schemas/grid/index.tsx @@ -8,7 +8,7 @@ import { useSensors, useSensor, PointerSensor, - MouseSensor + MouseSensor, } from '@dnd-kit/core'; import { observer, RecursionField } from '@formily/react'; import React, { useState } from 'react'; @@ -47,9 +47,11 @@ export const Grid: any = observer((props: any) => { const [clientWidths, setClientWidths] = useState([0, 0]); const { addNewComponent } = props; const AddNewComponent = useSchemaComponent(addNewComponent); - const sensors = useSensors( - useSensor(MouseSensor), - ); + const sensors = useSensors(useSensor(MouseSensor)); + const rows = Object.values(schema.properties || {}).filter((item) => { + return !item['x-hidden']; + }); + const path = getSchemaPath(schema); return (
{ }} >
{ data={{ type: 'row-divider', method: 'prepend', - path: getSchemaPath(schema), + path, }} /> - {schema.mapProperties((property) => { - return ; + {rows.map((property, index) => { + return ( + <> + {index > 0 && ( + + )} + + + ); })} + {designable && AddNewComponent && }
diff --git a/packages/client/src/schemas/grid/style.less b/packages/client/src/schemas/grid/style.less index d4279eb76..6abd1a8b0 100644 --- a/packages/client/src/schemas/grid/style.less +++ b/packages/client/src/schemas/grid/style.less @@ -141,7 +141,8 @@ body.dragging { // background-color: #ddd; height: 24px; width: 100%; - top: -24px; + top: auto; + margin-top: -24px; position: absolute; z-index: 20; // opacity: 0.5; diff --git a/packages/client/src/schemas/kanban/CardDesignableBar.tsx b/packages/client/src/schemas/kanban/CardDesignableBar.tsx index 37bff613e..821e063b8 100644 --- a/packages/client/src/schemas/kanban/CardDesignableBar.tsx +++ b/packages/client/src/schemas/kanban/CardDesignableBar.tsx @@ -87,13 +87,26 @@ export const CardDesignableBar = observer((props) => { return; } let data: ISchema = { - key: uid(), type: 'void', - 'x-decorator': 'Form.Field.Item', - 'x-designable-bar': 'Form.Field.DesignableBar', - 'x-component': 'Form.Field', - 'x-component-props': { - fieldName: field.name, + 'x-component': 'Grid.Row', + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Grid.Col', + properties: { + [uid()]: { + key: uid(), + type: 'void', + 'x-decorator': 'Form.Field.Item', + 'x-designable-bar': + 'Form.Field.DesignableBar', + 'x-component': 'Form.Field', + 'x-component-props': { + fieldName: field.name, + }, + }, + }, + }, }, }; const s = appendChild(data);