Commit 0f3736ae by chenwq

```

feat(components): 为选择组件添加智能占位符提示

当选择组件没有配置占位符时,自动显示"请选择"加字段标签作为占位符,
提升用户体验和表单可访问性

fix(account-manage): 调整账户管理页面表格列宽度和样式

优化表格列宽度分配,为关键字段添加单行显示限制,改善表格布局和可读性

fix(role-manage): 修复角色管理中数据域相关问题

- 设置新增角色时默认数据域为固定值1
- 修正编辑角色时默认数据域的初始化逻辑
- 将默认数据域选择器设为禁用状态以防止误操作

perf(role-manage): 优化角色管理表格列宽配置

调整角色名称、角色编码和角色描述列的宽度,添加单行显示限制,
提升表格展示效果和数据可读性
```
1 parent d5a060df
......@@ -76,6 +76,10 @@ export function CombiForm<T extends Record<string, unknown>>({
<USelect
options={field.options}
mode={field.type === 'selectMultiple' ? 'multiple' : undefined}
placeholder={
field.selectProps?.placeholder ??
'请选择' + (typeof field.label === 'string' ? field.label : '')
}
disabled={disabled}
style={{ width: '100%' }}
{...field.selectProps}
......
......@@ -123,18 +123,19 @@ export default function AccountManage() {
{
title: '账号',
dataIndex: 'account',
width: 180,
width: 160,
line: 1,
render: (value) => (
<UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{value}</UText>
),
},
{ title: '姓名', dataIndex: 'name', width: 110 },
{ title: '姓名', dataIndex: 'name', width: 110, line: 1 },
{ title: '手机号', dataIndex: 'mobile', width: 120 },
{ title: '所属组织', dataIndex: 'orgPath', width: 260, line: 1 },
{ title: '所属组织', dataIndex: 'orgPath', width: 230, line: 1 },
{
title: '角色',
dataIndex: 'roleNames',
width: 220,
width: 280,
render: (names: string[]) =>
names.length
? names.map((name) => (
......
......@@ -34,7 +34,7 @@ export function RoleModal({ open, roleItem, onCancel, onSuccess }: RoleModalProp
mutationFn: (values: RoleFormValues) => {
const payload = {
roleName: values.roleName.trim(),
defaultDataScope: Number(values.defaultDataScope),
defaultDataScope: Number(1),
sort: Number(values.sort),
status: Number(values.status),
description: values.description?.trim() || undefined,
......@@ -58,7 +58,7 @@ export function RoleModal({ open, roleItem, onCancel, onSuccess }: RoleModalProp
sort: String(roleItem?.sort ?? 10),
status: roleItem?.status ?? 1,
description: roleItem?.description ?? '',
defaultDataScope: roleItem?.defaultDataScope,
defaultDataScope: Number(roleItem?.defaultDataScope ?? 1),
});
}, [form, open, roleItem]);
......@@ -117,6 +117,7 @@ export function RoleModal({ open, roleItem, onCancel, onSuccess }: RoleModalProp
name: 'defaultDataScope',
label: '默认数据域',
type: 'select',
disabled: true,
section: '数据域',
options: dataScopeOptions,
rules: [{ required: true, message: '请选择默认数据域' }],
......
......@@ -110,16 +110,17 @@ export default function RoleManage() {
},
];
const columns: DataTableColumnsType<Row> = [
{ title: '角色名称', dataIndex: 'name', width: 200 },
{ title: '角色名称', dataIndex: 'name', width: 200, line: 1 },
{
title: '角色编码',
dataIndex: 'code',
width: 150,
line: 1,
render: (v) => <UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{v}</UText>,
},
{ title: '默认数据域', dataIndex: 'scope', width: 130 },
{ title: '账号数', dataIndex: 'userCount', width: 90 },
{ title: '角色描述', dataIndex: 'description', width: 320, line: 1 },
{ title: '角色描述', dataIndex: 'description', width: 380, line: 1 },
{
title: '类型',
dataIndex: 'type',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!