shebi xiufu

This commit is contained in:
menxipeng
2025-10-19 16:26:35 +08:00
parent 2f2cf47c6f
commit 282514e9c4

View File

@@ -56,6 +56,8 @@ interface Equipment {
equipmentType: string equipmentType: string
equipmentModel: string equipmentModel: string
merchantId: string merchantId: string
merchantName: string
mallName: string
installationLocation: string installationLocation: string
installationDate: string installationDate: string
status: string status: string
@@ -347,11 +349,10 @@ export default function EquipmentPage() {
} }
const filteredEquipment = equipmentList.filter((item) => { const filteredEquipment = equipmentList.filter((item) => {
const merchantInfo = getMerchantInfo(item.merchantId)
const matchesSearch = const matchesSearch =
item.equipmentName.toLowerCase().includes(searchTerm.toLowerCase()) || item.equipmentName.toLowerCase().includes(searchTerm.toLowerCase()) ||
merchantInfo.name.toLowerCase().includes(searchTerm.toLowerCase()) || item.merchantName.toLowerCase().includes(searchTerm.toLowerCase()) ||
merchantInfo.mall.toLowerCase().includes(searchTerm.toLowerCase()) item.mallName.toLowerCase().includes(searchTerm.toLowerCase())
// 修正状态筛选逻辑 // 修正状态筛选逻辑
let matchesStatus = true let matchesStatus = true
@@ -737,7 +738,6 @@ export default function EquipmentPage() {
</TableRow> </TableRow>
) : ( ) : (
filteredEquipment.map((item) => { filteredEquipment.map((item) => {
const merchantInfo = getMerchantInfo(item.merchantId)
const equipmentTypeDisplay = equipmentTypes[item.equipmentType] || item.equipmentType const equipmentTypeDisplay = equipmentTypes[item.equipmentType] || item.equipmentType
return ( return (
<TableRow key={item.equipmentId} className="hover:bg-gray-50"> <TableRow key={item.equipmentId} className="hover:bg-gray-50">
@@ -755,11 +755,11 @@ export default function EquipmentPage() {
</TableCell> </TableCell>
<TableCell> <TableCell>
<div className="space-y-1"> <div className="space-y-1">
<div className="font-medium">{merchantInfo.name}</div> <div className="font-medium">{item.merchantName}</div>
<div className="text-sm text-gray-600">{merchantInfo.mall}</div> <div className="text-sm text-gray-600">{item.mallName}</div>
<div className="flex items-center text-xs text-gray-500"> <div className="flex items-center text-xs text-gray-500">
<MapPin className="h-3 w-3 mr-1" /> <MapPin className="h-3 w-3 mr-1" />
{item.installationLocation || merchantInfo.address} {item.installationLocation}
</div> </div>
</div> </div>
</TableCell> </TableCell>