fix: add sort field to the users table
* [Fixed] 1、初始化数据表时,没有配置sort 2、增加sort接口类型 * [Fixed] 1、重新提交PR * [Fixed] 1、重新提交PR * [Fixed] 1、重新提交PR * [Fixed] 1、重新提交PR * [Fixed] 1、重新提交PR
This commit is contained in:
parent
d68196ab20
commit
14f492f414
@ -374,7 +374,7 @@ export const fieldsToFilterColumns = (fields: any[], options: any = {}) => {
|
||||
return;
|
||||
}
|
||||
const fieldOption = interfaces.get(field.interface);
|
||||
if (!fieldOption.operations) {
|
||||
if (!fieldOption?.operations) {
|
||||
return;
|
||||
}
|
||||
properties[`column${index}`] = {
|
||||
@ -493,7 +493,7 @@ Calendar.Filter.DesignableBar = () => {
|
||||
{fields
|
||||
.filter((collectionField) => {
|
||||
const option = interfaces.get(collectionField.interface);
|
||||
return option.operations?.length;
|
||||
return option?.operations?.length;
|
||||
})
|
||||
.map((collectionField) => (
|
||||
<SwitchMenuItem
|
||||
|
@ -1409,7 +1409,7 @@ const fieldsToFilterColumns = (fields: any[], options: any = {}) => {
|
||||
return;
|
||||
}
|
||||
const fieldOption = interfaces.get(field.interface);
|
||||
if (!fieldOption.operations) {
|
||||
if (!fieldOption?.operations) {
|
||||
return;
|
||||
}
|
||||
properties[`column${index}`] = {
|
||||
@ -1436,7 +1436,7 @@ const fieldsToSortColumns = (fields: any[]) => {
|
||||
|
||||
fields.forEach((field) => {
|
||||
const fieldOption = interfaces.get(field.interface);
|
||||
if (!fieldOption.sortable) {
|
||||
if (!fieldOption?.sortable) {
|
||||
return;
|
||||
}
|
||||
dataSource.push({
|
||||
@ -1546,7 +1546,7 @@ Table.Filter.DesignableBar = () => {
|
||||
{fields
|
||||
.filter((collectionField) => {
|
||||
const option = interfaces.get(collectionField.interface);
|
||||
return option.operations?.length;
|
||||
return option?.operations?.length;
|
||||
})
|
||||
.map((collectionField) => (
|
||||
<SwitchMenuItem
|
||||
|
@ -32,9 +32,11 @@ export default {
|
||||
}
|
||||
const config = table.getOptions();
|
||||
const collection = await Collection.create(config);
|
||||
// 把当前系统排序字段,排除掉,不写入fields表
|
||||
const fields = config.fields?.filter((field) => field.type !== 'sort');
|
||||
await collection.updateAssociations({
|
||||
generalFields: config.fields.filter((field) => field.state !== 0),
|
||||
systemFields: config.fields.filter((field) => field.state === 0),
|
||||
generalFields: fields.filter((field) => field.state !== 0),
|
||||
systemFields: fields.filter((field) => field.state === 0),
|
||||
});
|
||||
// await collection.migrate();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'users',
|
||||
title: '用户',
|
||||
sortable: 'sort',
|
||||
// developerMode: true,
|
||||
// internal: true,
|
||||
createdBy: false,
|
||||
|
Loading…
Reference in New Issue
Block a user