mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
(fix)(supersonic-fe)Fix the issue of field display in model construction (#2254)
This commit is contained in:
@@ -299,21 +299,22 @@ const ModelCreateForm: React.FC<CreateFormProps> = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const columnFields: any[] = columns.map((item: IDataSource.IExecuteSqlColumn) => {
|
const fieldMap = new Map(
|
||||||
|
fieldsClassifyList.map(field => [field.fieldName, field])
|
||||||
|
);
|
||||||
|
columns.forEach((item: IDataSource.IExecuteSqlColumn) => {
|
||||||
const { type, nameEn, comment } = item;
|
const { type, nameEn, comment } = item;
|
||||||
const oldItem =
|
const existingField = fieldMap.get(nameEn);
|
||||||
fieldsClassifyList.find((oItem) => {
|
|
||||||
return oItem.fieldName === item.nameEn;
|
fieldMap.set(nameEn, {
|
||||||
}) || {};
|
...existingField,
|
||||||
return {
|
|
||||||
...oldItem,
|
|
||||||
bizName: nameEn,
|
bizName: nameEn,
|
||||||
fieldName: nameEn,
|
fieldName: nameEn,
|
||||||
dataType: type,
|
dataType: type,
|
||||||
comment,
|
comment,
|
||||||
};
|
|
||||||
});
|
});
|
||||||
setFields(columnFields || []);
|
});
|
||||||
|
setFields(Array.from(fieldMap.values()));
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatterIdentifiers = (identifiersList: any[] = []) => {
|
const formatterIdentifiers = (identifiersList: any[] = []) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user