fix(gerp): 介绍类字段表单统一按多行输入渲染

WorkgroupIntroduction(工作组介绍)等 CharField 介绍字段此前被映射成单行 text,编辑时不好输入长文本。现按「字段名以 Introduction 结尾 或 verbose_name 含"介绍"」统一置为 textarea(TextField 类介绍字段本就已是 textarea,不受影响)。
This commit is contained in:
TermiNexus committed 2026-10-01 13:48:11 +08:00
1 parent 3859aa1762
commit b44dddd857
1 file changed
+7
+7
View File
@@ -549,6 +549,13 @@ class FormService(FormServiceBase):
# 指定表隐藏主键 UUID 列(公司/部门/工作组列表页表格不显示 UUID,仅前端隐藏)
if is_pk and table_name in self.HIDE_PK_UUID_IN_TABLE:
col['visible'] = False
# 「介绍」类字段统一按多行输入(textarea)渲染:
# 介绍/说明类内容较长,CharField 默认只映射为单行 text
# (如 WorkgroupIntroduction 工作组介绍、DepartmentIntroduction 部门介绍)
if field_type != 'textarea' and (
pascal_name.endswith('Introduction') or '介绍' in str(getattr(f, 'verbose_name', '') or '')
):
col['type'] = 'textarea'
# 强公司隔离:CompanyUUID 由后端自动注入,前端不可编辑
if self.company_scope and f.name == 'CompanyUUID':
col['editable'] = False