diff --git a/src/components/Option/Metering/ListDetail.tsx b/src/components/Option/Metering/ListDetail.tsx index a991b08..6dca1ec 100644 --- a/src/components/Option/Metering/ListDetail.tsx +++ b/src/components/Option/Metering/ListDetail.tsx @@ -6,7 +6,8 @@ import { Space, TableProps, Divider, - Typography + Typography, + Tooltip } from "antd" import { NavLink } from "react-router-dom" @@ -25,7 +26,7 @@ const data = [ } ] -const outputTokenData = [ +const inputTokenData = [ { key: "关键词提示", value: "xxx" @@ -51,64 +52,60 @@ const outputTokenData = [ value: "xxx" } ] +const outputTokenData = [ + { + key: "类型", + value: "xxx" + }, + { + key: "来源", + value: "xxx" + }, + { + key: "token数量", + value: 2 + }, + { + key: "内容", + value: "xxx" + } +] interface DataType { key: string name: string age: number address: string - tags: string[] + tags: number + content: string } const columns: TableProps["columns"] = [ { - title: "Name", - dataIndex: "name", + title: "序号", + dataIndex: "key", key: "name", render: (text) => {text} }, { - title: "Age", + title: "标识", dataIndex: "age", key: "age" }, { - title: "Address", + title: "提供方", dataIndex: "address", key: "address" }, { - title: "Tags", + title: "token数量", key: "tags", - dataIndex: "tags", - render: (_, { tags }) => ( - <> - {tags.map((tag) => { - let color = tag.length > 5 ? "geekblue" : "green" - if (tag === "loser") { - color = "volcano" - } - return ( - - {tag.toUpperCase()} - - ) - })} - - ) + dataIndex: "tags" }, { - title: "Action", - key: "action", - render: (_, record) => ( - - {/* Invite {record.name} */} - - - Detail - - - ) + title: "内容", + key: "content", + dataIndex: "content" } ] @@ -118,21 +115,24 @@ const data1: DataType[] = [ name: "John Brown", age: 32, address: "New York No. 1 Lake Park", - tags: ["nice", "developer"] + tags: 2, + content: "内容" }, { key: "2", name: "Jim Green", age: 42, address: "London No. 1 Lake Park", - tags: ["loser"] + tags: 3, + content: "内容" }, { key: "3", name: "Joe Black", age: 32, address: "Sydney No. 1 Lake Park", - tags: ["cool", "teacher"] + tags: 3, + content: "内容" } ] @@ -147,22 +147,46 @@ export const ListDetail = () => { {item.value} )} + style={{ marginBottom: "2rem" }} /> -
+
+ 输入token详情 + ( + + + {item.key} + + + {item.value} + + + )} + style={{ marginBottom: "1rem" }} + /> + columns={columns} dataSource={data1} /> +
+ +
输出token详情 ( - - {item.key} {item.value} + + + {item.key} + + + {item.value} + )} />
- - columns={columns} dataSource={data1} />
) } diff --git a/src/components/Option/Metering/detail.tsx b/src/components/Option/Metering/detail.tsx index 944dc90..833d4d4 100644 --- a/src/components/Option/Metering/detail.tsx +++ b/src/components/Option/Metering/detail.tsx @@ -28,8 +28,8 @@ const columns: TableProps["columns"] = [ }, { title: "问题", - dataIndex: "query", - key: "query" + dataIndex: "queryContent", + key: "queryContent" }, { title: "提示词全文", @@ -54,14 +54,14 @@ const columns: TableProps["columns"] = [ { title: "回答", - dataIndex: "answer", - key: "answer", + dataIndex: "responseContent", + key: "responseContent", ellipsis: { showTitle: false }, - render: (answer) => ( - - {answer} + render: (responseContent) => ( + + {responseContent} ), width: "10%" @@ -75,7 +75,7 @@ const columns: TableProps["columns"] = [ title: "数联网token", dataIndex: "iodOutputToken", key: "iodOutputToken", - render: (iodOutputToken) =>
{iodOutputToken.length}
+ render: (iodOutputToken) =>
{iodOutputToken?.length}
}, { title: "大模型token", @@ -83,7 +83,9 @@ const columns: TableProps["columns"] = [ dataIndex: "largeModelToken", render: (_, record) => { return ( -
{record.iodInputToken.length + record.iodOutputToken.length}
+
+ {record.iodInputToken?.length + record.iodOutputToken?.length} +
) } }, @@ -108,7 +110,7 @@ const columns: TableProps["columns"] = [ {/* Invite {record.name} */} - Detail + 详情 )