fix: invalid drag and drop sort
This commit is contained in:
parent
9ff82f9998
commit
13248af671
@ -19,6 +19,7 @@ export interface CollectionOptions {
|
|||||||
title?: string;
|
title?: string;
|
||||||
filterTargetKey?: string;
|
filterTargetKey?: string;
|
||||||
targetKey?: string;
|
targetKey?: string;
|
||||||
|
sortable?: any;
|
||||||
fields?: FieldOptions[];
|
fields?: FieldOptions[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import { useSchemaTemplate } from '../../../schema-templates';
|
|||||||
import { useDesignable } from '../../hooks';
|
import { useDesignable } from '../../hooks';
|
||||||
|
|
||||||
export const TableBlockDesigner = () => {
|
export const TableBlockDesigner = () => {
|
||||||
const { name, title } = useCollection();
|
const { name, title, sortable } = useCollection();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const dataSource = useCollectionFilterOptions(name);
|
const dataSource = useCollectionFilterOptions(name);
|
||||||
@ -41,7 +41,7 @@ export const TableBlockDesigner = () => {
|
|||||||
onChange={(dragSort) => {
|
onChange={(dragSort) => {
|
||||||
field.decoratorProps.dragSort = dragSort;
|
field.decoratorProps.dragSort = dragSort;
|
||||||
fieldSchema['x-decorator-props'].dragSort = dragSort;
|
fieldSchema['x-decorator-props'].dragSort = dragSort;
|
||||||
service.run({ ...service.params?.[0], sort: defaultSort });
|
service.run({ ...service.params?.[0], sort: 'sort' });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
|
@ -39,7 +39,7 @@ export const TableVoidDesigner = () => {
|
|||||||
onChange={(dragSort) => {
|
onChange={(dragSort) => {
|
||||||
field.decoratorProps.dragSort = dragSort;
|
field.decoratorProps.dragSort = dragSort;
|
||||||
fieldSchema['x-decorator-props'].dragSort = dragSort;
|
fieldSchema['x-decorator-props'].dragSort = dragSort;
|
||||||
ctx.run({ ...ctx.params?.[0], sort: defaultSort });
|
ctx.run({ ...ctx.params?.[0], sort: 'sort' });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
|
Loading…
Reference in New Issue
Block a user