This commit is contained in:
chenos 2021-08-09 10:10:36 +08:00
parent 3966c7f0f3
commit cf3a6ff2ff
5 changed files with 9 additions and 7 deletions

View File

@ -20,7 +20,9 @@ import * as uiSchema from './ui-schema';
const config = require('@nocobase/plugin-users/src/collections/users').default;
const Collection = database.getModel('collections');
const collection = await Collection.create(config);
await collection.updateAssociations(config);
await collection.updateAssociations({
generalFields: config.fields,
});
await collection.migrate();
const Route = database.getModel('routes');

View File

@ -618,7 +618,7 @@ const dbSchema = {
'x-component': 'Input',
'x-read-pretty': true,
},
fields: {
generalFields: {
type: 'array',
title: '数据表字段',
'x-decorator': 'FormItem',

View File

@ -120,7 +120,7 @@ export const DatabaseCollection = observer((props) => {
field.push({
name: `t_${uid()}`,
unsaved: true,
fields: getDefaultFields(),
generalFields: getDefaultFields(),
});
}
}}
@ -190,7 +190,7 @@ export const DatabaseCollection = observer((props) => {
const data = {
name: `t_${uid()}`,
title: value,
fields: getDefaultFields(),
generalFields: getDefaultFields(),
};
field.push(data);
setActiveIndex(field.value.length - 1);
@ -229,7 +229,7 @@ export const DatabaseCollection = observer((props) => {
field.push({
name: `t_${uid()}`,
unsaved: true,
fields: getDefaultFields(),
generalFields: getDefaultFields(),
});
}
if (activeIndex === index) {

View File

@ -538,7 +538,7 @@ const TableMain = () => {
/>
))}
<SortableContext
items={dataSource}
items={dataSource || []}
strategy={verticalListSortingStrategy}
>
<AntdTable

View File

@ -36,7 +36,7 @@ export default {
{
type: 'integer',
name: 'state',
default: 1,
defaultValue: 1,
},
{
type: 'hasMany',