This commit is contained in:
menxipeng
2025-11-30 22:44:50 +08:00
parent 55e5ffb25f
commit 5af109fc88
8 changed files with 90 additions and 58 deletions

View File

@@ -324,10 +324,10 @@ export default function InventoryPage() {
</SelectContent> </SelectContent>
</Select> </Select>
<Button variant="outline" className="w-full sm:w-auto"> {/*<Button variant="outline" className="w-full sm:w-auto">
<Download className="h-4 w-4 mr-2" /> <Download className="h-4 w-4 mr-2" />
导出 导出
</Button> </Button>*/}
</div> </div>
{/* Desktop Table View */} {/* Desktop Table View */}
@@ -714,16 +714,9 @@ function AddInventoryForm({ categories, onClose, onSuccess }: { categories: any;
userId: "1" userId: "1"
} }
const response = await fetch('/back/inventory', { const result = await apiPost('/back/inventory', requestData)
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(requestData)
})
if (response.ok) { if (result.code === 200) {
const result = await response.json()
console.log('库存添加成功:', result) console.log('库存添加成功:', result)
if (onSuccess) { if (onSuccess) {
onSuccess() onSuccess()
@@ -731,8 +724,8 @@ function AddInventoryForm({ categories, onClose, onSuccess }: { categories: any;
onClose() onClose()
} }
} else { } else {
const error = await response.json() console.error('添加库存失败:', result)
console.error('添加库存失败:', error) alert('添加库存失败' + (result.msg || '未知错误'))
} }
} catch (error) { } catch (error) {
console.error('请求失败:', error) console.error('请求失败:', error)
@@ -1189,7 +1182,7 @@ function LogisticsTracking() {
<TableHead></TableHead> <TableHead></TableHead>
<TableHead></TableHead> <TableHead></TableHead>
<TableHead></TableHead> <TableHead></TableHead>
<TableHead></TableHead> {/* <TableHead>操作</TableHead> */}
</TableRow> </TableRow>
</TableHeader> </TableHeader>
<TableBody> <TableBody>
@@ -1258,11 +1251,11 @@ function LogisticsTracking() {
</div> </div>
</div> </div>
</TableCell> </TableCell>
<TableCell> {/*<TableCell>
<Button variant="outline" size="sm"> <Button variant="outline" size="sm">
查看详情 查看详情
</Button> </Button>
</TableCell> </TableCell>*/}
</TableRow> </TableRow>
)) ))
)} )}
@@ -1342,11 +1335,11 @@ function LogisticsTracking() {
<span className="font-medium text-green-600">-</span> <span className="font-medium text-green-600">-</span>
</div> </div>
</div> </div>
<div className="pt-2 border-t"> {/*<div className="pt-2 border-t">
<Button variant="outline" size="sm" className="w-full"> <Button variant="outline" size="sm" className="w-full">
查看详情 查看详情
</Button> </Button>
</div> </div>*/}
</CardContent> </CardContent>
</Card> </Card>
)) ))

View File

@@ -744,7 +744,7 @@ export default function MerchantsPage() {
</div> </div>
<div className="flex flex-col sm:flex-row gap-4"> <div className="flex flex-col sm:flex-row gap-4">
<Select value={statusFilter} onValueChange={handleStatusFilterChange}> {/*<Select value={statusFilter} onValueChange={handleStatusFilterChange}>
<SelectTrigger className="w-full sm:w-48"> <SelectTrigger className="w-full sm:w-48">
<Filter className="h-4 w-4 mr-2" /> <Filter className="h-4 w-4 mr-2" />
<SelectValue placeholder="筛选状态" /> <SelectValue placeholder="筛选状态" />
@@ -763,7 +763,7 @@ export default function MerchantsPage() {
已到期 {loadingUserEquipmentCount ? '' : `(${userEquipmentCount.countExpire})`} 已到期 {loadingUserEquipmentCount ? '' : `(${userEquipmentCount.countExpire})`}
</SelectItem> </SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>*/}
<Button <Button
variant="outline" variant="outline"

View File

@@ -259,15 +259,15 @@ export default function StatisticsPage() {
<SelectItem value="year"></SelectItem> <SelectItem value="year"></SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
<Button variant="outline"> {/* <Button variant="outline">
<Download className="h-4 w-4 mr-2" /> <Download className="h-4 w-4 mr-2" />
导出报表 导出报表
</Button> </Button> */}
</div> </div>
</div> </div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
{/* 1. 所有地区设备总数 */} { /* 1. 所有地区设备总数 */}
<Card> <Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium"></CardTitle> <CardTitle className="text-sm font-medium"></CardTitle>

View File

@@ -184,10 +184,10 @@ export default function UsersPage() {
</SelectContent> </SelectContent>
</Select> </Select>
<Button variant="outline"> {/*<Button variant="outline">
<Download className="h-4 w-4 mr-2" /> <Download className="h-4 w-4 mr-2" />
导出 导出
</Button> </Button>*/}
</div> </div>
{/* Loading State */} {/* Loading State */}

View File

@@ -422,15 +422,15 @@ export default function WorkOrdersPage() {
</SelectContent> </SelectContent>
</Select> </Select>
<Button variant="outline"> {/*<Button variant="outline">
<Download className="h-4 w-4 mr-2" /> <Download className="h-4 w-4 mr-2" />
导出 导出
</Button> </Button>*/}
</div> </div>
{/* Desktop Table View */} {/* Desktop Table View */}
<div className="hidden md:block rounded-md border overflow-x-hidden hover:overflow-x-auto transition-all"> <div className="hidden md:block rounded-md border">
<Table> <Table className="min-w-[1200px]" containerClassName="work-order-table-scroll">
<TableHeader> <TableHeader>
<TableRow> <TableRow>
<TableHead></TableHead> <TableHead></TableHead>

View File

@@ -386,10 +386,10 @@ export default function SalePage() {
</div> </div>
</div> </div>
<Button variant="outline" onClick={handleExport}> {/*<Button variant="outline" onClick={handleExport}>
<Download className="h-4 w-4 mr-2" /> <Download className="h-4 w-4 mr-2" />
导出 导出
</Button> </Button> */}
</div> </div>
{/* Desktop Table View */} {/* Desktop Table View */}

View File

@@ -4,11 +4,11 @@ import * as React from "react"
import { cn } from "@/utils" import { cn } from "@/utils"
function Table({ className, ...props }: React.ComponentProps<"table">) { function Table({ className, containerClassName, ...props }: React.ComponentProps<"table"> & { containerClassName?: string }) {
return ( return (
<div <div
data-slot="table-container" data-slot="table-container"
className="relative w-full overflow-x-auto" className={cn("relative w-full overflow-x-auto", containerClassName)}
> >
<table <table
data-slot="table" data-slot="table"

View File

@@ -58,4 +58,43 @@
} }
} }
/* 工单表格滚动条样式 - 直接应用到Table组件内部的滚动容器 */
.work-order-table-scroll {
/* 默认隐藏滚动条但保持滚动功能 */
-ms-overflow-style: none !important; /* IE and Edge */
scrollbar-width: none !important; /* Firefox */
}
.work-order-table-scroll::-webkit-scrollbar {
display: none !important; /* Chrome, Safari and Opera */
width: 0 !important;
height: 0 !important;
}
/* 悬停时显示滚动条 */
.work-order-table-scroll:hover {
-ms-overflow-style: auto !important; /* IE and Edge */
scrollbar-width: thin !important; /* Firefox */
}
.work-order-table-scroll:hover::-webkit-scrollbar {
display: block !important; /* Chrome, Safari and Opera */
height: 8px !important;
width: 8px !important;
}
.work-order-table-scroll:hover::-webkit-scrollbar-track {
background: #f1f1f1 !important;
border-radius: 4px !important;
}
.work-order-table-scroll:hover::-webkit-scrollbar-thumb {
background: #c1c1c1 !important;
border-radius: 4px !important;
}
.work-order-table-scroll:hover::-webkit-scrollbar-thumb:hover {
background: #a8a8a8 !important;
}