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 config = require('@nocobase/plugin-users/src/collections/users').default;
const Collection = database.getModel('collections'); const Collection = database.getModel('collections');
const collection = await Collection.create(config); const collection = await Collection.create(config);
await collection.updateAssociations(config); await collection.updateAssociations({
generalFields: config.fields,
});
await collection.migrate(); await collection.migrate();
const Route = database.getModel('routes'); const Route = database.getModel('routes');

View File

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

View File

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

View File

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

View File

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