fix(bi): issue of dnd (#2315)

This commit is contained in:
YANG QIA 2023-07-25 20:45:01 +08:00 committed by GitHub
parent 986e2414d4
commit 78bfcba24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 13 deletions

View File

@ -20,7 +20,6 @@ const useDragEnd = (props?: any) => {
const wrapSchema = over?.data?.current?.wrapSchema; const wrapSchema = over?.data?.current?.wrapSchema;
const onSuccess = over?.data?.current?.onSuccess; const onSuccess = over?.data?.current?.onSuccess;
const removeParentsIfNoChildren = over?.data?.current?.removeParentsIfNoChildren ?? true; const removeParentsIfNoChildren = over?.data?.current?.removeParentsIfNoChildren ?? true;
if (!activeSchema || !overSchema) { if (!activeSchema || !overSchema) {
props?.onDragEnd?.(event); props?.onDragEnd?.(event);
return; return;

View File

@ -199,9 +199,8 @@ export const ChartConfigure: React.FC<{
afterSave(); afterSave();
return; return;
} }
insert(createRendererSchema(rendererProps), { insert(gridRowColWrap(createRendererSchema(rendererProps)), {
onSuccess: afterSave, onSuccess: afterSave,
wrap: gridRowColWrap,
}); });
}} }}
onCancel={() => { onCancel={() => {

View File

@ -96,11 +96,7 @@ ChartRenderer.Designer = function Designer() {
</SchemaSettings.Item> </SchemaSettings.Item>
<SchemaSettings.Item <SchemaSettings.Item
key="duplicate" key="duplicate"
onClick={() => onClick={() => insertAdjacent('afterEnd', gridRowColWrap(createRendererSchema(schema?.['x-decorator-props'])))}
insertAdjacent('afterEnd', createRendererSchema(schema?.['x-decorator-props']), {
wrap: gridRowColWrap,
})
}
> >
{t('Duplicate')} {t('Duplicate')}
</SchemaSettings.Item> </SchemaSettings.Item>

View File

@ -161,11 +161,7 @@ export const parseBuilder = (ctx: Context, builder: QueryParams) => {
}); });
orders.forEach((item: OrderProps) => { orders.forEach((item: OrderProps) => {
const dialect = sequelize.getDialect(); const alias = sequelize.getQueryInterface().quoteIdentifier(item.alias);
let alias = `"${item.alias}"`;
if (dialect === 'mysql') {
alias = `\`${item.alias}\``;
}
const name = hasAgg ? sequelize.literal(alias) : sequelize.col(item.field as string); const name = hasAgg ? sequelize.literal(alias) : sequelize.col(item.field as string);
order.push([name, item.order || 'ASC']); order.push([name, item.order || 'ASC']);
}); });