diff --git a/code/fms/FMS新系统核心表结构设计.md b/code/fms/FMS新系统核心表结构设计.md index 86ebbcbe..23b0985f 100644 --- a/code/fms/FMS新系统核心表结构设计.md +++ b/code/fms/FMS新系统核心表结构设计.md @@ -373,7 +373,7 @@ create table s_menu ( b_route varchar(200) null, -- 固定页面路由或外链 b_module_id bigint null, -- data 页面绑定的数据/查询模块 b_power_code varchar(50) null, -- 页面访问权限编码(对应 s_power.b_code) - b_icon varchar(50) null, -- 图标 + b_icon nvarchar(max) null, -- 图标:lucide:Name 引用 lucide 图标;其他字符串视为 SVG 标记 b_xh int not null default 0, -- 排序号 b_canuse int not null default 1, -- 是否启用(停用后不显示且不可访问) constraint pk_s_menu primary key (b_id), diff --git a/code/fms/fms-api/config/migrations/100_initialize_fms_new.sql b/code/fms/fms-api/config/migrations/100_initialize_fms_new.sql index f3974a1c..64a650c0 100644 --- a/code/fms/fms-api/config/migrations/100_initialize_fms_new.sql +++ b/code/fms/fms-api/config/migrations/100_initialize_fms_new.sql @@ -257,7 +257,7 @@ BEGIN b_route varchar(200) NULL, b_module_id bigint NULL, b_power_code varchar(50) NULL, - b_icon varchar(50) NULL, + b_icon nvarchar(max) NULL, -- 图标:lucide:Name 引用 lucide,否则为 SVG 标记 b_xh int NOT NULL CONSTRAINT DF_s_menu_xh DEFAULT (0), b_canuse int NOT NULL CONSTRAINT DF_s_menu_canuse DEFAULT (1), CONSTRAINT PK_s_menu PRIMARY KEY (b_id), diff --git a/code/fms/fms-api/config/migrations/103_add_menu_icon_nvarchar.sql b/code/fms/fms-api/config/migrations/103_add_menu_icon_nvarchar.sql new file mode 100644 index 00000000..afaafec1 --- /dev/null +++ b/code/fms/fms-api/config/migrations/103_add_menu_icon_nvarchar.sql @@ -0,0 +1,19 @@ +/* + 扩展 s_menu.b_icon 以支持自定义 SVG 图标。 + b_icon 从 varchar(50) 改为 nvarchar(max): + - lucide:Settings —— 引用 lucide 图标 + - 其他字符串 —— 当作 SVG 标记直接渲染 + 可重复执行:存在性判断避免重复变更。 +*/ +SET NOCOUNT ON; +SET XACT_ABORT ON; + +IF DB_NAME() <> N'FMS' + THROW 53600, N'This migration can only run against the FMS database.', 1; + +IF COL_LENGTH(N'dbo.s_menu', N'b_icon') IS NOT NULL +BEGIN + ALTER TABLE dbo.s_menu ALTER COLUMN b_icon nvarchar(max) NULL; +END; + +PRINT N'Migration 103 applied: s_menu.b_icon expanded to nvarchar(max).'; \ No newline at end of file diff --git a/code/fms/fms-vue/src/components/fms-table/FmsTable.vue b/code/fms/fms-vue/src/components/fms-table/FmsTable.vue index 8f4838fa..b7590c93 100644 --- a/code/fms/fms-vue/src/components/fms-table/FmsTable.vue +++ b/code/fms/fms-vue/src/components/fms-table/FmsTable.vue @@ -1,5 +1,5 @@ + + + + diff --git a/code/fms/fms-vue/src/components/ui/form/form-item.vue b/code/fms/fms-vue/src/components/ui/form/form-item.vue index a065c5bc..f49f76e1 100644 --- a/code/fms/fms-vue/src/components/ui/form/form-item.vue +++ b/code/fms/fms-vue/src/components/ui/form/form-item.vue @@ -168,7 +168,13 @@ onBeforeUnmount(() => {