mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:38:13 +00:00
feat: add internal parameter to collection options
This commit is contained in:
parent
f12c619603
commit
880737c5c8
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'actions',
|
||||
title: '操作配置',
|
||||
internal: true,
|
||||
draggable: true,
|
||||
model: 'ActionModel',
|
||||
developerMode: true,
|
||||
|
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'collections',
|
||||
title: '数据表配置',
|
||||
internal: true,
|
||||
sortable: true,
|
||||
draggable: true,
|
||||
model: 'CollectionModel',
|
||||
@ -160,6 +161,17 @@ export default {
|
||||
type: 'hidden',
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'boolean',
|
||||
type: 'boolean',
|
||||
name: 'internal',
|
||||
title: '系统内置',
|
||||
defaultValue: false,
|
||||
developerMode: true,
|
||||
component: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'linkTo',
|
||||
type: 'hasMany',
|
||||
|
@ -4,6 +4,7 @@ import { options } from '../interfaces';
|
||||
export default {
|
||||
name: 'fields',
|
||||
title: '字段配置',
|
||||
internal: true,
|
||||
draggable: true,
|
||||
model: 'FieldModel',
|
||||
developerMode: true,
|
||||
|
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'tabs',
|
||||
title: '标签配置',
|
||||
internal: true,
|
||||
sortable: true,
|
||||
model: 'TabModel',
|
||||
developerMode: true,
|
||||
|
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'views',
|
||||
title: '视图配置',
|
||||
internal: true,
|
||||
sortable: true,
|
||||
model: 'ViewModel',
|
||||
developerMode: true,
|
||||
|
@ -440,7 +440,6 @@ export const sort = {
|
||||
interface: 'sort',
|
||||
type: 'integer',
|
||||
required: true,
|
||||
developerMode: true,
|
||||
component: {
|
||||
type: 'sort',
|
||||
showInTable: true,
|
||||
@ -453,7 +452,6 @@ export const password = {
|
||||
options: {
|
||||
interface: 'password',
|
||||
type: 'password',
|
||||
developerMode: true,
|
||||
hidden: true, // hidden 用来控制 api 不输出这个字段,但是可能这个字段显示在表单里 showInForm
|
||||
component: {
|
||||
type: 'password',
|
||||
|
@ -3,6 +3,7 @@ import { TableOptions } from '@nocobase/database';
|
||||
export default {
|
||||
name: 'attachments',
|
||||
title: '文件管理器',
|
||||
internal: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'string',
|
||||
|
@ -4,6 +4,7 @@ export default {
|
||||
name: 'pages',
|
||||
title: '页面配置',
|
||||
model: 'BaseModel',
|
||||
internal: true,
|
||||
developerMode: true,
|
||||
fields: [
|
||||
{
|
||||
|
@ -22,9 +22,9 @@ export default async function (options = {}) {
|
||||
const [Collection, Page] = database.getModels(['collections', 'pages']);
|
||||
|
||||
async function createCollectionPage(model) {
|
||||
// if (!model.get('showInDataMenu')) {
|
||||
// return;
|
||||
// }
|
||||
if (model.get('internal')) {
|
||||
return;
|
||||
}
|
||||
const parent = await Page.findOne({
|
||||
where: {
|
||||
path: '/collections',
|
||||
|
@ -4,6 +4,7 @@ export default {
|
||||
name: 'users',
|
||||
title: '用户',
|
||||
developerMode: true,
|
||||
internal: true,
|
||||
fields: [
|
||||
{
|
||||
interface: 'string',
|
||||
@ -55,14 +56,14 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'password',
|
||||
interface: 'string',
|
||||
type: 'string',
|
||||
name: 'token',
|
||||
title: 'Token',
|
||||
unique: true,
|
||||
hidden: true,
|
||||
component: {
|
||||
type: 'hidden',
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user