lushdog@outlook.com 1 tuần trước cách đây
mục cha
commit
552755f0c8
1 tập tin đã thay đổi với 8 bổ sung7 xóa
  1. 8 7
      src/app/components/DataTable.tsx

+ 8 - 7
src/app/components/DataTable.tsx

@@ -12,6 +12,7 @@ interface TableData {
 	tokenAaddress?: string
 	tokenBaddress?: string
 	priceRange?: string
+	isInrange?: boolean
 	[key: string]: unknown
 }
 
@@ -354,7 +355,6 @@ function DataTableContent() {
 			content: `批量复制中... (0/${selectedRecords.length})`,
 			duration: 0,
 		})
-
 		// 依次处理每条记录
 		for (let i = 0; i < selectedRecords.length; i++) {
 			const record = selectedRecords[i]
@@ -368,9 +368,6 @@ function DataTableContent() {
 						positionAddress: record.positionAddress,
 						nftMintAddress: record.nftMintAddress,
 						maxUsdValue: quickCopyAmount,
-						isInrange:
-							currentPrice > Number(record.priceRange?.split('-')[0]) &&
-							currentPrice < Number(record.priceRange?.split('-')[1]),
 					}),
 				})
 
@@ -452,8 +449,11 @@ function DataTableContent() {
 			title: '区间',
 			dataIndex: 'priceRange',
 			key: 'priceRange',
-			render: (text: string, record: TableData) => {
-				if (record.isInrange) {
+			render: (text: string) => {
+				if (
+					currentPrice > Number(text.split('-')[0]) &&
+					currentPrice < Number(text.split('-')[1])
+				) {
 					return (
 						<span className="font-bold text-lg text-green-500">{text}</span>
 					)
@@ -846,7 +846,8 @@ function DataTableContent() {
 					}
 				/>
 				<span className="ml-2 mr-2 text-lg font-bold text-green-500">
-					余额:{balance} {tokenName} (${balanceUsd})
+					余额:{balance} {tokenName} (${balanceUsd}) | 当前价格:$
+					{Number(currentPrice).toFixed(4)}
 				</span>
 				<Button type="primary" className="ml-2 mr-2" onClick={handleRefresh}>
 					刷新