style: column setting sub title

This commit is contained in:
jialin
2026-02-02 14:10:46 +08:00
parent 9796233897
commit fc599a0637
2 changed files with 17 additions and 4 deletions
+14 -3
View File
@@ -35,6 +35,18 @@ const Title = styled.div`
margin-top: 4px; margin-top: 4px;
`; `;
const LabelWrapper = styled.span`
color: var(--color-text-secondary);
> span {
display: flex;
align-items: center;
gap: 4px;
.sub-title {
display: none;
}
}
`;
const ColumnSettings: React.FC<{ const ColumnSettings: React.FC<{
width?: number; width?: number;
fixedColumns?: string[]; fixedColumns?: string[];
@@ -123,7 +135,6 @@ const ColumnSettings: React.FC<{
useEffect(() => { useEffect(() => {
const initColumns = async () => { const initColumns = async () => {
const stored = await readColumnSettings(tableName); const stored = await readColumnSettings(tableName);
console.log('stored columns:', stored);
if (stored && stored.length > 0) { if (stored && stored.length > 0) {
setInnerSelectedColumns(stored); setInnerSelectedColumns(stored);
onChange?.(stored); onChange?.(stored);
@@ -169,7 +180,7 @@ const ColumnSettings: React.FC<{
value={col.dataIndex} value={col.dataIndex}
style={{ marginBottom: 8 }} style={{ marginBottom: 8 }}
> >
<span className="text-secondary">{col.title}</span> <LabelWrapper>{col.title}</LabelWrapper>
</Checkbox> </Checkbox>
</Col> </Col>
))} ))}
@@ -185,7 +196,7 @@ const ColumnSettings: React.FC<{
value={col.dataIndex} value={col.dataIndex}
style={{ marginBottom: 8 }} style={{ marginBottom: 8 }}
> >
<span className="text-secondary">{col.title}</span> <LabelWrapper>{col.title}</LabelWrapper>
</Checkbox> </Checkbox>
</Col> </Col>
))} ))}
@@ -11,7 +11,9 @@ import styled from 'styled-components';
import { BenchmarkStatus, BenchmarkStatusLabelMap } from '../config'; import { BenchmarkStatus, BenchmarkStatusLabelMap } from '../config';
import { BenchmarkListItem as ListItem } from '../config/types'; import { BenchmarkListItem as ListItem } from '../config/types';
const SubTitleWrapper = styled.span` const SubTitleWrapper = styled.span.attrs({
className: 'sub-title'
})`
display: list-item; display: list-item;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;