From ebe710fac2b5cf120ffdb66ee1e27fd2e3ab3be7 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Thu, 23 Jan 2025 22:46:05 +0800 Subject: [PATCH] Update menu field show to display (#498) --- backend/app/admin/model/menu.py | 2 +- backend/app/admin/schema/menu.py | 2 +- backend/sql/mysql/create_tables.sql | 2 +- backend/sql/mysql/init_test_data.sql | 2 +- backend/sql/postgresql/create_tables.sql | 4 ++-- backend/sql/postgresql/init_test_data.sql | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/admin/model/menu.py b/backend/app/admin/model/menu.py index 039707b0..3b282d61 100644 --- a/backend/app/admin/model/menu.py +++ b/backend/app/admin/model/menu.py @@ -27,7 +27,7 @@ class Menu(Base): component: Mapped[str | None] = mapped_column(String(255), default=None, comment='组件路径') perms: Mapped[str | None] = mapped_column(String(100), default=None, comment='权限标识') status: Mapped[int] = mapped_column(default=1, comment='菜单状态(0停用 1正常)') - show: Mapped[int] = mapped_column(default=1, comment='是否显示(0否 1是)') + display: Mapped[int] = mapped_column(default=1, comment='是否显示(0否 1是)') cache: Mapped[int] = mapped_column(default=1, comment='是否缓存(0否 1是)') remark: Mapped[str | None] = mapped_column( LONGTEXT().with_variant(TEXT, 'postgresql'), default=None, comment='备注' diff --git a/backend/app/admin/schema/menu.py b/backend/app/admin/schema/menu.py index 0d4d49e4..7961d1e7 100644 --- a/backend/app/admin/schema/menu.py +++ b/backend/app/admin/schema/menu.py @@ -19,7 +19,7 @@ class MenuSchemaBase(SchemaBase): component: str | None = None perms: str | None = None status: StatusType = Field(default=StatusType.enable) - show: StatusType = Field(default=StatusType.enable) + display: StatusType = Field(default=StatusType.enable) cache: StatusType = Field(default=StatusType.enable) remark: str | None = None diff --git a/backend/sql/mysql/create_tables.sql b/backend/sql/mysql/create_tables.sql index ddec4aa7..7261f428 100644 --- a/backend/sql/mysql/create_tables.sql +++ b/backend/sql/mysql/create_tables.sql @@ -226,7 +226,7 @@ create table sys_menu component varchar(255) null comment '组件路径', perms varchar(100) null comment '权限标识', status int not null comment '菜单状态(0停用 1正常)', - `show` int not null comment '是否显示(0否 1是)', + display int not null comment '是否显示(0否 1是)', cache int not null comment '是否缓存(0否 1是)', remark longtext null comment '备注', parent_id int null comment '父菜单ID', diff --git a/backend/sql/mysql/init_test_data.sql b/backend/sql/mysql/init_test_data.sql index 1249af2d..81a48dd1 100644 --- a/backend/sql/mysql/init_test_data.sql +++ b/backend/sql/mysql/init_test_data.sql @@ -6,7 +6,7 @@ values (1, '创建API', 'POST', '/api/v1/apis', null, '2024-02-02 11:29:47', nu (2, '删除API', 'DELETE', '/api/v1/apis', null, '2024-02-02 11:31:32', null), (3, '编辑API', 'PUT', '/api/v1/apis/{pk}', null, '2024-02-02 11:32:22', null); -insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, show, cache, remark, parent_id, created_time, updated_time) +insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, display, cache, remark, parent_id, created_time, updated_time) values (1, '测试', 'test', 0, 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null), (2, '仪表盘', 'dashboard', 0, 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null), (3, '工作台', 'Workplace', 0, 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null), diff --git a/backend/sql/postgresql/create_tables.sql b/backend/sql/postgresql/create_tables.sql index f656ed59..8c53200d 100644 --- a/backend/sql/postgresql/create_tables.sql +++ b/backend/sql/postgresql/create_tables.sql @@ -273,7 +273,7 @@ create table sys_menu component varchar(255), perms varchar(100), status integer not null, - show integer not null, + display integer not null, cache integer not null, remark text, parent_id integer @@ -305,7 +305,7 @@ comment on column sys_menu.perms is '权限标识'; comment on column sys_menu.status is '菜单状态(0停用 1正常)'; -comment on column sys_menu.show is '是否显示(0否 1是)'; +comment on column sys_menu.display is '是否显示(0否 1是)'; comment on column sys_menu.cache is '是否缓存(0否 1是)'; diff --git a/backend/sql/postgresql/init_test_data.sql b/backend/sql/postgresql/init_test_data.sql index bd8171f0..0d1dea5b 100644 --- a/backend/sql/postgresql/init_test_data.sql +++ b/backend/sql/postgresql/init_test_data.sql @@ -6,7 +6,7 @@ values (1, '创建API', 'POST', '/api/v1/apis', null, '2024-02-02 11:29:47', nu (2, '删除API', 'DELETE', '/api/v1/apis', null, '2024-02-02 11:31:32', null), (3, '编辑API', 'PUT', '/api/v1/apis/{pk}', null, '2024-02-02 11:32:22', null); -insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, show, cache, remark, parent_id, created_time, updated_time) +insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, display, cache, remark, parent_id, created_time, updated_time) values (1, '测试', 'test', 0, 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null), (2, '仪表盘', 'dashboard', 0, 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null), (3, '工作台', 'Workplace', 0, 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null),