mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 10:42:19 +08:00
* feat: define desktopRoutes collection * feat: convert routes to schema * feat: support to add new route * feat: support to delete routes * feat: adaptor Hidden option * feat: adaptor Edit option * fix: fix incomplete menu display issue * feat: support to insert * feat: adjust permission configuration page interface * feat: add listAccessible action * feat: routes table * feat: edit button * style: optimize style * chore: add confirm text * fix: delete corresponding schema when removing routes to ensure data consistency * chore: add field type * feat: create a tab when creating a page * fix: fix tabs issue * fix: avoid undefined error * fix: should hide menu when it's hideInMenu is true * fix: should refresh menu when updating it * chore: optimize params * fix: fix tab when adding child * chore: should display empty * fix: fix subapp path * fix: fix activeKey of tab * chore: add translation * chore: prevent menu collapse after adding new menu item * refactor: rename useDesktopRoutes to useNocoBaseRoutes * fix: fix tab path * fix: fix draging issue * feat: support to set Hidden for Tab * feat: implement move * fix: draging * chore: add migration * fix: fix migration * chore: fix build * chore: fix e2e test * fix: fix menu creation position issue * fix: migration * chore: add translation * fix: fix some bugs * fix: fix 'Move to' * fix: compile Route name in permission management page * fix: fix table selection issue * chore: add comment * fix: hidden * fix: fix mobile route path * fix: do not select parent node when selecting child nodes * fix(mobile): hide menu * fix(mobile): path * fix(mobile): fix schema * fix(mobile): compile tab title * fix: fix permission configuration page selection error * fix: fix selection issues * fix(migration): transform old permission configuration to new permission configuration * chore: translate fields title * feat: support localization * fix: fix pagination * chore: fix build * fix: change aclSnippet * chore: fix unit tests * fix: fix error * chore: fix unit tests of server * chore(migration): update version of migration * chore: fix e2e tests * chore: fix build error * chore: make e2e tests pass * chore: fix migration error * fix: show ellipsis when text overflows * fix: show ellipsis when text overflows * chore: change 'Access' to 'View' * fix: should use sort field to sort * fix: fix tab drag and drop issue * refactor: rename unnamed tab label to 'Unnamed' * fix: fix draging issue * refactor: add 'enableTabs' field * refactor: optimize route fields * refactor: optimize migration * fix: set enableTabs to false when creating page * refactor: change empty tab name to 'Unnamed' * fix: fix tab path * fix: avoid undefined error * chore(migration): update appVersion * fix(migration): fix page issue * chore: fix unit test * fix(mobile): fix incorrect path * fix(mobile): fix enableTabs issue * fix: disable Add child route button when enableTabs is false * fix: fix embed issue * fix(migration): add migration for mobile * chore: update migration * fix: fix tab title not updating issue * fix: fix untranslated text issue * fix: fix routes table style * fix: fix group issue * fix(mobile): fix 404 issue * fix: should hide tabs when creating page * fix: should translate tabs title * fix: fix translation issue * fix(migration): fix appVersion * fix: fix ACL * fix: should set paginate to true and filter out hidden items * fix(migration): fix bug * refactor(desktopRoutes): add enableHeader and displayTitle * fix: fix permission issue * fix(mobile): fix error * fix(mobile): fix migration error * fix(migration): compatible with older versions * fix: make unit tests pass * chore: ignore some failing test cases * chore: test * fix: test
399 lines
9.0 KiB
TypeScript
399 lines
9.0 KiB
TypeScript
/**
|
|
* This file is part of the NocoBase (R) project.
|
|
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
* Authors: NocoBase Team.
|
|
*
|
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
*/
|
|
|
|
export default {
|
|
name: 'desktopRoutes',
|
|
dumpRules: 'required',
|
|
title: 'desktopRoutes',
|
|
inherit: false,
|
|
hidden: false,
|
|
description: null,
|
|
fields: [
|
|
{
|
|
key: 'ymgf0jxu1kg',
|
|
name: 'parentId',
|
|
type: 'bigInt',
|
|
interface: 'integer',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
isForeignKey: true,
|
|
uiSchema: {
|
|
type: 'number',
|
|
title: '{{t("Parent ID")}}',
|
|
'x-component': 'InputNumber',
|
|
'x-read-pretty': true,
|
|
},
|
|
},
|
|
{
|
|
key: 'b07aqgs2shv',
|
|
name: 'parent',
|
|
type: 'belongsTo',
|
|
interface: 'm2o',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
foreignKey: 'parentId',
|
|
treeParent: true,
|
|
onDelete: 'CASCADE',
|
|
uiSchema: {
|
|
title: '{{t("Parent")}}',
|
|
'x-component': 'AssociationField',
|
|
'x-component-props': {
|
|
multiple: false,
|
|
fieldNames: {
|
|
label: 'id',
|
|
value: 'id',
|
|
},
|
|
},
|
|
},
|
|
target: 'desktopRoutes',
|
|
targetKey: 'id',
|
|
},
|
|
{
|
|
key: 'p8sxllsgin1',
|
|
name: 'children',
|
|
type: 'hasMany',
|
|
interface: 'o2m',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
foreignKey: 'parentId',
|
|
treeChildren: true,
|
|
onDelete: 'CASCADE',
|
|
uiSchema: {
|
|
title: '{{t("Children")}}',
|
|
'x-component': 'AssociationField',
|
|
'x-component-props': {
|
|
multiple: true,
|
|
fieldNames: {
|
|
label: 'id',
|
|
value: 'id',
|
|
},
|
|
},
|
|
},
|
|
target: 'desktopRoutes',
|
|
targetKey: 'id',
|
|
sourceKey: 'id',
|
|
},
|
|
{
|
|
key: '7y601o9bmih',
|
|
name: 'id',
|
|
type: 'bigInt',
|
|
interface: 'integer',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
autoIncrement: true,
|
|
primaryKey: true,
|
|
allowNull: false,
|
|
uiSchema: {
|
|
type: 'number',
|
|
title: '{{t("ID")}}',
|
|
'x-component': 'InputNumber',
|
|
'x-read-pretty': true,
|
|
},
|
|
},
|
|
{
|
|
key: 'm8s9b94amz3',
|
|
name: 'createdAt',
|
|
type: 'date',
|
|
interface: 'createdAt',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
field: 'createdAt',
|
|
uiSchema: {
|
|
type: 'datetime',
|
|
title: '{{t("Created at")}}',
|
|
'x-component': 'DatePicker',
|
|
'x-component-props': {},
|
|
'x-read-pretty': true,
|
|
},
|
|
},
|
|
{
|
|
key: 'p3p69woziuu',
|
|
name: 'createdBy',
|
|
type: 'belongsTo',
|
|
interface: 'createdBy',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
target: 'users',
|
|
foreignKey: 'createdById',
|
|
uiSchema: {
|
|
type: 'object',
|
|
title: '{{t("Created by")}}',
|
|
'x-component': 'AssociationField',
|
|
'x-component-props': {
|
|
fieldNames: {
|
|
value: 'id',
|
|
label: 'nickname',
|
|
},
|
|
},
|
|
'x-read-pretty': true,
|
|
},
|
|
targetKey: 'id',
|
|
},
|
|
{
|
|
key: 's0gw1blo4hm',
|
|
name: 'updatedAt',
|
|
type: 'date',
|
|
interface: 'updatedAt',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
field: 'updatedAt',
|
|
uiSchema: {
|
|
type: 'string',
|
|
title: '{{t("Last updated at")}}',
|
|
'x-component': 'DatePicker',
|
|
'x-component-props': {},
|
|
'x-read-pretty': true,
|
|
},
|
|
},
|
|
{
|
|
key: 'd1l988n09gd',
|
|
name: 'updatedBy',
|
|
type: 'belongsTo',
|
|
interface: 'updatedBy',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
target: 'users',
|
|
foreignKey: 'updatedById',
|
|
uiSchema: {
|
|
type: 'object',
|
|
title: '{{t("Last updated by")}}',
|
|
'x-component': 'AssociationField',
|
|
'x-component-props': {
|
|
fieldNames: {
|
|
value: 'id',
|
|
label: 'nickname',
|
|
},
|
|
},
|
|
'x-read-pretty': true,
|
|
},
|
|
targetKey: 'id',
|
|
},
|
|
{
|
|
key: 'bo7btzkbyan',
|
|
name: 'title',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
translation: true,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Title")}}',
|
|
},
|
|
},
|
|
{
|
|
key: 'ozl5d8t2d5e',
|
|
name: 'icon',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Icon")}}',
|
|
},
|
|
},
|
|
// 页面的 schema uid
|
|
{
|
|
key: '6bbyhv00bp4',
|
|
name: 'schemaUid',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Schema UID")}}',
|
|
},
|
|
},
|
|
// 菜单的 schema uid
|
|
{
|
|
key: '6bbyhv00bp5',
|
|
name: 'menuSchemaUid',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Menu Schema UID")}}',
|
|
},
|
|
},
|
|
{
|
|
key: '6bbyhv00bp6',
|
|
name: 'tabSchemaName',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Tab Schema Name")}}',
|
|
},
|
|
},
|
|
{
|
|
key: 'm0k5qbaktab',
|
|
name: 'type',
|
|
type: 'string',
|
|
interface: 'input',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
uiSchema: {
|
|
type: 'string',
|
|
'x-component': 'Input',
|
|
title: '{{t("Type")}}',
|
|
},
|
|
},
|
|
{
|
|
key: 'ssuml1j2v1b',
|
|
name: 'options',
|
|
type: 'json',
|
|
interface: 'json',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
defaultValue: null,
|
|
uiSchema: {
|
|
type: 'object',
|
|
'x-component': 'Input.JSON',
|
|
'x-component-props': {
|
|
autoSize: {
|
|
minRows: 5,
|
|
},
|
|
},
|
|
default: null,
|
|
title: '{{t("Options")}}',
|
|
},
|
|
},
|
|
{
|
|
key: 'jjmosjqhz8l',
|
|
name: 'sort',
|
|
type: 'sort',
|
|
interface: 'sort',
|
|
description: null,
|
|
collectionName: 'desktopRoutes',
|
|
parentKey: null,
|
|
reverseKey: null,
|
|
scopeKey: 'parentId',
|
|
uiSchema: {
|
|
type: 'number',
|
|
'x-component': 'InputNumber',
|
|
'x-component-props': {
|
|
stringMode: true,
|
|
step: '1',
|
|
},
|
|
'x-validator': 'integer',
|
|
title: '{{t("Sort")}}',
|
|
},
|
|
},
|
|
{
|
|
type: 'belongsToMany',
|
|
name: 'roles',
|
|
through: 'rolesDesktopRoutes',
|
|
target: 'roles',
|
|
onDelete: 'CASCADE',
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'hideInMenu',
|
|
interface: 'checkbox',
|
|
uiSchema: {
|
|
type: 'boolean',
|
|
'x-component': 'Checkbox',
|
|
title: '{{t("Hide in menu")}}',
|
|
},
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'enableTabs',
|
|
interface: 'checkbox',
|
|
uiSchema: {
|
|
type: 'boolean',
|
|
'x-component': 'Checkbox',
|
|
title: '{{t("Enable tabs")}}',
|
|
},
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'enableHeader',
|
|
interface: 'checkbox',
|
|
uiSchema: {
|
|
type: 'boolean',
|
|
'x-component': 'Checkbox',
|
|
title: '{{t("Enable header")}}',
|
|
},
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'displayTitle',
|
|
interface: 'checkbox',
|
|
uiSchema: {
|
|
type: 'boolean',
|
|
'x-component': 'Checkbox',
|
|
title: '{{t("Display title")}}',
|
|
},
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'hidden',
|
|
interface: 'checkbox',
|
|
uiSchema: {
|
|
type: 'boolean',
|
|
'x-component': 'Checkbox',
|
|
title: '{{t("Hidden")}}',
|
|
},
|
|
},
|
|
],
|
|
category: [],
|
|
logging: true,
|
|
autoGenId: true,
|
|
createdAt: true,
|
|
createdBy: true,
|
|
updatedAt: true,
|
|
updatedBy: true,
|
|
template: 'tree',
|
|
view: false,
|
|
tree: 'adjacencyList',
|
|
filterTargetKey: 'id',
|
|
} as any;
|