Procházet zdrojové kódy

feat: 召回结果表新增「推荐状态」列

插在「向量相似度」与「解构:选题」之间, 取 videoDetail.推荐状态,
按"推荐/下线/审核"关键词自动着色, 缺失走 -- 占位.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
刘立冬 před 9 hodinami
rodič
revize
ae57f07fcf
1 změnil soubory, kde provedl 22 přidání a 1 odebrání
  1. 22 1
      src/components/RecallResultTable.tsx

+ 22 - 1
src/components/RecallResultTable.tsx

@@ -304,6 +304,13 @@ export default function RecallResultTable({
       fixed: 'left',
       render: (_v, item) => <ScoreCell score={item.score} />,
     },
+    {
+      title: '推荐状态',
+      key: 'recommendStatus',
+      width: 100,
+      align: 'center',
+      render: (_v, item) => <RecommendStatusCell value={item.videoDetail?.['推荐状态']} />,
+    },
     deconstructTopicCol(280),
     pointsCol('解构:灵感点', '灵感点', 240),
     pointsCol('解构:关键点', '关键点', 240),
@@ -433,7 +440,7 @@ export default function RecallResultTable({
         dataSource={filteredItems}
         columns={columns}
         pagination={false}
-        scroll={{ x: 2430 }}
+        scroll={{ x: 2530 }}
         onChange={(_pagination, _filters, sorter) => {
           const s = sorter as SorterResult<RowItem>
           if (s && s.columnKey === 'composite') {
@@ -716,6 +723,20 @@ function ScoreCell({ score }: { score: number | null }) {
   )
 }
 
+/** 推荐状态单元格 — 按状态关键字着色, 未知值走 default Tag */
+function RecommendStatusCell({ value }: { value: string | undefined }) {
+  if (!value) return <Text type="secondary">--</Text>
+  let color: string | undefined
+  if (/推荐|上线|分发/.test(value)) color = 'green'
+  else if (/下线|暂停|不推荐|停止/.test(value)) color = 'red'
+  else if (/审核|待|中/.test(value)) color = 'orange'
+  return (
+    <Tag color={color} style={{ margin: 0, fontSize: 11 }}>
+      {value}
+    </Tag>
+  )
+}
+
 /** 综合得分单元格 — hover Tooltip 展示 sim_norm/rov_norm/c 分解 */
 function CompositeScoreCell({ breakdown }: { breakdown: ScoreBreakdown | null }) {
   if (!breakdown) {