fix: keep template table cells compact with Semi tooltips
This commit is contained in:
@@ -15,7 +15,9 @@ import {
|
|||||||
Table,
|
Table,
|
||||||
TextArea,
|
TextArea,
|
||||||
Toast,
|
Toast,
|
||||||
|
Typography,
|
||||||
} from "@douyinfe/semi-ui-19";
|
} from "@douyinfe/semi-ui-19";
|
||||||
|
import { WorkspaceTable } from "../components/WorkspaceTable";
|
||||||
import { ResearchInput } from "../ai/ResearchInput";
|
import { ResearchInput } from "../ai/ResearchInput";
|
||||||
import { IconAIEditLevel3 } from "@douyinfe/semi-icons";
|
import { IconAIEditLevel3 } from "@douyinfe/semi-icons";
|
||||||
import { api, post, formatTime } from "../api";
|
import { api, post, formatTime } from "../api";
|
||||||
@@ -354,20 +356,20 @@ export function ResearchWorkspace({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{listMode === "assets" ? (
|
{listMode === "assets" ? (
|
||||||
<>
|
<div className="research-template-table-container">
|
||||||
<Table<Asset>
|
<WorkspaceTable<Asset>
|
||||||
className="research-table"
|
key={JSON.stringify([search, assetPage])}
|
||||||
|
fill
|
||||||
dataSource={assets}
|
dataSource={assets}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
pagination={false}
|
scroll={{ x: 800, y: "100%" }}
|
||||||
size="small"
|
|
||||||
sticky
|
|
||||||
style={{ minWidth: 720 }}
|
|
||||||
empty="还没有模板。新建或导入一个模板开始研究。"
|
empty="还没有模板。新建或导入一个模板开始研究。"
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
title: "模板名称",
|
title: "模板名称",
|
||||||
key: "name",
|
key: "name",
|
||||||
|
width: 280,
|
||||||
|
ellipsis: { showTitle: false },
|
||||||
render: (_, item) => (
|
render: (_, item) => (
|
||||||
<Button
|
<Button
|
||||||
theme="borderless"
|
theme="borderless"
|
||||||
@@ -384,7 +386,13 @@ export function ResearchWorkspace({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{item.name}
|
<Typography.Text
|
||||||
|
size="inherit"
|
||||||
|
style={{ width: "100%", color: "inherit" }}
|
||||||
|
ellipsis={{ showTooltip: true }}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Typography.Text>
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -397,8 +405,17 @@ export function ResearchWorkspace({
|
|||||||
{
|
{
|
||||||
title: "表达式",
|
title: "表达式",
|
||||||
key: "expression",
|
key: "expression",
|
||||||
width: 260,
|
width: undefined,
|
||||||
render: (_, item) => <code>{item.content.expression}</code>,
|
ellipsis: { showTitle: false },
|
||||||
|
render: (_, item) => (
|
||||||
|
<Typography.Text
|
||||||
|
className="research-template-expression"
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
ellipsis={{ showTooltip: true }}
|
||||||
|
>
|
||||||
|
{item.content.expression}
|
||||||
|
</Typography.Text>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "分类",
|
title: "分类",
|
||||||
@@ -412,19 +429,21 @@ export function ResearchWorkspace({
|
|||||||
key: "actions",
|
key: "actions",
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (_, item) => (
|
render: (_, item) => (
|
||||||
<DeleteResearchButton
|
<div className="workspace-cell-actions">
|
||||||
name={item.name}
|
<DeleteResearchButton
|
||||||
label="模板"
|
name={item.name}
|
||||||
disabled={!!busy}
|
label="模板"
|
||||||
onConfirm={() =>
|
disabled={!!busy}
|
||||||
task("删除模板", () => removeAsset(item))
|
onConfirm={() =>
|
||||||
}
|
task("删除模板", () => removeAsset(item))
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Table<(typeof history)[number]>
|
<Table<(typeof history)[number]>
|
||||||
|
|||||||
@@ -104,6 +104,18 @@
|
|||||||
.research-table-scroll {
|
.research-table-scroll {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
.research-template-table-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.research-template-expression {
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
.research-table .semi-table-row-cell {
|
.research-table .semi-table-row-cell {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
|
|||||||
Reference in New Issue
Block a user