更新操作按钮为菜单栏 & 调整页面表格顺序
This commit is contained in:
@@ -104,7 +104,7 @@ export function DepositDialog({
|
||||
<Field data-invalid={!!errors.deposit}>
|
||||
<FieldLabel>充值(元)</FieldLabel>
|
||||
<Input
|
||||
type="text" // 改为 text,避免 number 输入冲突
|
||||
type="text"
|
||||
placeholder="请输入充值金额"
|
||||
{...register("deposit")}
|
||||
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
||||
@@ -11,6 +11,12 @@ import { Auth } from "@/components/auth"
|
||||
import { DataTable, useDataTable } from "@/components/data-table"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import {
|
||||
Field,
|
||||
FieldError,
|
||||
@@ -246,7 +252,7 @@ export default function CustPage() {
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
<Button type="submit">筛选</Button>
|
||||
<Button type="submit">搜索</Button>
|
||||
</FieldGroup>
|
||||
</form>
|
||||
|
||||
@@ -361,109 +367,124 @@ export default function CustPage() {
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => {
|
||||
const user = row.original
|
||||
return (
|
||||
<div className="flex flex-wrap gap-2 w-75">
|
||||
<div className="flex gap-2">
|
||||
<Auth scope={ScopeUserWriteBalanceInc}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
setDeposit(row.original)
|
||||
setDeposit(user)
|
||||
setDepositDialog(true)
|
||||
}}
|
||||
>
|
||||
充值
|
||||
</Button>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeUserWriteBalanceDec}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
setDeduction(row.original)
|
||||
setDeduction(user)
|
||||
setDeductionDialog(true)
|
||||
}}
|
||||
>
|
||||
扣款
|
||||
</Button>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeUserWriteBalance}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
setCurrentEditUser(row.original)
|
||||
setCurrentEditUser(user)
|
||||
setIsEditDialogOpen(true)
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeTradeReadOfUser}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(`/client/trade?userId=${row.original.id}`)
|
||||
}}
|
||||
>
|
||||
交易明细
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeBillReadOfUser}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/client/billing?userId=${row.original.id}`,
|
||||
)
|
||||
}}
|
||||
>
|
||||
账单详情
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeResourceRead}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/client/resources?userId=${row.original.id}`,
|
||||
)
|
||||
}}
|
||||
>
|
||||
套餐管理
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeBatchReadOfUser}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(`/client/batch?userId=${row.original.id}`)
|
||||
}}
|
||||
>
|
||||
提取记录
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeChannelReadOfUser}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/client/channel?userId=${row.original.id}`,
|
||||
)
|
||||
}}
|
||||
>
|
||||
IP管理
|
||||
</Button>
|
||||
</Auth>
|
||||
<Auth scope={ScopeBalanceActivityReadOfUser}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/client/balance?userId=${row.original.id}&phone=${row.original.phone}`,
|
||||
)
|
||||
}}
|
||||
>
|
||||
余额操作
|
||||
</Button>
|
||||
</Auth>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button size="sm" variant="outline">
|
||||
打开菜单
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-8">
|
||||
<Auth scope={ScopeTradeReadOfUser}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/trade?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
交易明细
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeBillReadOfUser}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/billing?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
账单详情
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeResourceRead}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/resources?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
套餐管理
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeBatchReadOfUser}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/batch?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
提取记录
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeChannelReadOfUser}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/channel?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
IP管理
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
|
||||
<Auth scope={ScopeBalanceActivityReadOfUser}>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/client/balance?userId=${user.id}&phone=${user.phone}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
余额明细
|
||||
</DropdownMenuItem>
|
||||
</Auth>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user