fix(monitor): 作品的跳转链接跟到标题后面,不再挂在整行最右边
挂在最后一列时它脱离了被修饰的东西 —— 眼睛得横穿整张表才找得到那个链接, 而它属于的是最左边那条作品。 一并去掉那一列(表头也去掉),列数从 9 回到 8:行比表头多一格,本来就对不齐。 现在两边都是 8 格:箭头 / 作品 / 4 项指标 / 发布日期 / 首次发现。
This commit is contained in:
@@ -80,8 +80,9 @@ function sumMetrics(notes: MonitorNote[]) {
|
|||||||
return { values, deltas }
|
return { values, deltas }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多出来的那几列:展开箭头、作品、发布日期、首次发现、跳转链接;分组表头会跨掉整行。
|
// 多出来的那几列:展开箭头、作品、发布日期、首次发现;分组表头会跨掉整行。
|
||||||
const COLUMN_COUNT = METRIC_COLUMNS.length + 5
|
// 作品的跳转链接**不算一列** —— 它跟在标题后面,见下面的行渲染。
|
||||||
|
const COLUMN_COUNT = METRIC_COLUMNS.length + 4
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号级指标那几个字段。
|
* 账号级指标那几个字段。
|
||||||
@@ -274,7 +275,6 @@ export function NotesTable({ taskId, onlyNew }: NotesTableProps) {
|
|||||||
))}
|
))}
|
||||||
<th className="text-right font-normal py-2 px-2">发布日期</th>
|
<th className="text-right font-normal py-2 px-2">发布日期</th>
|
||||||
<th className="text-right font-normal py-2 px-2">首次发现</th>
|
<th className="text-right font-normal py-2 px-2">首次发现</th>
|
||||||
<th className="w-8" />
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -419,6 +419,21 @@ export function NotesTable({ taskId, onlyNew }: NotesTableProps) {
|
|||||||
>
|
>
|
||||||
{note.title || note.note_id}
|
{note.title || note.note_id}
|
||||||
</span>
|
</span>
|
||||||
|
{/* 跳转紧跟在标题后面 —— 它属于**这条作品**,挂在整行最右边
|
||||||
|
时就脱离了它修饰的东西,眼睛得横穿整张表去找。
|
||||||
|
stopPropagation,否则点它会连带展开趋势图。 */}
|
||||||
|
{note.note_url && (
|
||||||
|
<a
|
||||||
|
href={note.note_url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
onClick={(event) => event.stopPropagation()}
|
||||||
|
title="打开原作品"
|
||||||
|
className="text-cyber-text-muted hover:text-cyber-neon-cyan flex-shrink-0"
|
||||||
|
>
|
||||||
|
<ExternalLink className="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{editingNote === rowKey ? (
|
{editingNote === rowKey ? (
|
||||||
<input
|
<input
|
||||||
@@ -479,21 +494,6 @@ export function NotesTable({ taskId, onlyNew }: NotesTableProps) {
|
|||||||
<td className="py-2 px-2 text-right text-[10px] text-cyber-text-muted">
|
<td className="py-2 px-2 text-right text-[10px] text-cyber-text-muted">
|
||||||
{formatRelative(note.first_seen_at)}
|
{formatRelative(note.first_seen_at)}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 px-1">
|
|
||||||
{/* 直接跳转到该作品。stopPropagation,否则点它会连带展开趋势图。 */}
|
|
||||||
{note.note_url && (
|
|
||||||
<a
|
|
||||||
href={note.note_url}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
onClick={(event) => event.stopPropagation()}
|
|
||||||
title="打开原作品"
|
|
||||||
className="text-cyber-text-muted hover:text-cyber-neon-cyan"
|
|
||||||
>
|
|
||||||
<ExternalLink className="w-3 h-3" />
|
|
||||||
</a>
|
|
||||||
)}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{open && (
|
{open && (
|
||||||
<tr className="bg-cyber-bg-secondary/40">
|
<tr className="bg-cyber-bg-secondary/40">
|
||||||
|
|||||||
Reference in New Issue
Block a user