shangc
This commit is contained in:
@@ -324,10 +324,10 @@ export default function InventoryPage() {
|
||||
</SelectContent>
|
||||
</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" />
|
||||
导出
|
||||
</Button>
|
||||
</Button>*/}
|
||||
</div>
|
||||
|
||||
{/* Desktop Table View */}
|
||||
@@ -714,16 +714,9 @@ function AddInventoryForm({ categories, onClose, onSuccess }: { categories: any;
|
||||
userId: "1"
|
||||
}
|
||||
|
||||
const response = await fetch('/back/inventory', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
})
|
||||
const result = await apiPost('/back/inventory', requestData)
|
||||
|
||||
if (response.ok) {
|
||||
const result = await response.json()
|
||||
if (result.code === 200) {
|
||||
console.log('库存添加成功:', result)
|
||||
if (onSuccess) {
|
||||
onSuccess()
|
||||
@@ -731,8 +724,8 @@ function AddInventoryForm({ categories, onClose, onSuccess }: { categories: any;
|
||||
onClose()
|
||||
}
|
||||
} else {
|
||||
const error = await response.json()
|
||||
console.error('添加库存失败:', error)
|
||||
console.error('添加库存失败:', result)
|
||||
alert('添加库存失败:' + (result.msg || '未知错误'))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求失败:', error)
|
||||
@@ -1189,7 +1182,7 @@ function LogisticsTracking() {
|
||||
<TableHead>状态</TableHead>
|
||||
<TableHead>订单价值</TableHead>
|
||||
<TableHead>时间</TableHead>
|
||||
<TableHead>操作</TableHead>
|
||||
{/* <TableHead>操作</TableHead> */}
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -1258,11 +1251,11 @@ function LogisticsTracking() {
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{/*<TableCell>
|
||||
<Button variant="outline" size="sm">
|
||||
查看详情
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableCell>*/}
|
||||
</TableRow>
|
||||
))
|
||||
)}
|
||||
@@ -1342,11 +1335,11 @@ function LogisticsTracking() {
|
||||
<span className="font-medium text-green-600">-</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="pt-2 border-t">
|
||||
{/*<div className="pt-2 border-t">
|
||||
<Button variant="outline" size="sm" className="w-full">
|
||||
查看详情
|
||||
</Button>
|
||||
</div>
|
||||
</div>*/}
|
||||
</CardContent>
|
||||
</Card>
|
||||
))
|
||||
|
||||
@@ -744,7 +744,7 @@ export default function MerchantsPage() {
|
||||
</div>
|
||||
<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">
|
||||
<Filter className="h-4 w-4 mr-2" />
|
||||
<SelectValue placeholder="筛选状态" />
|
||||
@@ -763,7 +763,7 @@ export default function MerchantsPage() {
|
||||
已到期 {loadingUserEquipmentCount ? '' : `(${userEquipmentCount.countExpire})`}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Select>*/}
|
||||
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -259,15 +259,15 @@ export default function StatisticsPage() {
|
||||
<SelectItem value="year">本年</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button variant="outline">
|
||||
{/* <Button variant="outline">
|
||||
<Download className="h-4 w-4 mr-2" />
|
||||
导出报表
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
{/* 1. 所有地区设备总数 */}
|
||||
{ /* 1. 所有地区设备总数 */}
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">所有地区设备总数</CardTitle>
|
||||
|
||||
@@ -184,10 +184,10 @@ export default function UsersPage() {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<Button variant="outline">
|
||||
{/*<Button variant="outline">
|
||||
<Download className="h-4 w-4 mr-2" />
|
||||
导出
|
||||
</Button>
|
||||
</Button>*/}
|
||||
</div>
|
||||
|
||||
{/* Loading State */}
|
||||
|
||||
@@ -422,15 +422,15 @@ export default function WorkOrdersPage() {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<Button variant="outline">
|
||||
{/*<Button variant="outline">
|
||||
<Download className="h-4 w-4 mr-2" />
|
||||
导出
|
||||
</Button>
|
||||
</Button>*/}
|
||||
</div>
|
||||
|
||||
{/* Desktop Table View */}
|
||||
<div className="hidden md:block rounded-md border overflow-x-hidden hover:overflow-x-auto transition-all">
|
||||
<Table>
|
||||
<div className="hidden md:block rounded-md border">
|
||||
<Table className="min-w-[1200px]" containerClassName="work-order-table-scroll">
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>工单信息</TableHead>
|
||||
|
||||
@@ -386,10 +386,10 @@ export default function SalePage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button variant="outline" onClick={handleExport}>
|
||||
{/*<Button variant="outline" onClick={handleExport}>
|
||||
<Download className="h-4 w-4 mr-2" />
|
||||
导出
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
|
||||
{/* Desktop Table View */}
|
||||
|
||||
@@ -4,11 +4,11 @@ import * as React from "react"
|
||||
|
||||
import { cn } from "@/utils"
|
||||
|
||||
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
||||
function Table({ className, containerClassName, ...props }: React.ComponentProps<"table"> & { containerClassName?: string }) {
|
||||
return (
|
||||
<div
|
||||
data-slot="table-container"
|
||||
className="relative w-full overflow-x-auto"
|
||||
className={cn("relative w-full overflow-x-auto", containerClassName)}
|
||||
>
|
||||
<table
|
||||
data-slot="table"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user