固定表格操作列
This commit is contained in:
@@ -78,6 +78,8 @@ export default function AdminPage() {
|
||||
cell: ({ row }) => <RolesCell roles={row.original.roles ?? []} />,
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -81,7 +81,6 @@ export default function BatchPage() {
|
||||
const table = useDataTable<Batch>((page, size) =>
|
||||
getPageBatch({ page, size, ...filters }),
|
||||
)
|
||||
console.log(table, "使用记录")
|
||||
|
||||
const onFilter = handleSubmit(data => {
|
||||
const result: APIFilterParams = {}
|
||||
|
||||
@@ -98,7 +98,6 @@ export default function BillingPage() {
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true)
|
||||
console.log(skuProductCode, "skuProductCode")
|
||||
getSkuList({
|
||||
product_code: skuProductCode,
|
||||
})
|
||||
@@ -112,7 +111,6 @@ export default function BillingPage() {
|
||||
resource_name: sku.name,
|
||||
})),
|
||||
)
|
||||
console.log(resp.data, "skus")
|
||||
})
|
||||
.catch(e => {
|
||||
console.error("获取套餐类型失败:", e)
|
||||
@@ -130,10 +128,7 @@ export default function BillingPage() {
|
||||
getPageBill({ page, size, ...filters }),
|
||||
)
|
||||
|
||||
console.log(table, "账单详情的table")
|
||||
const onFilter = handleSubmit(data => {
|
||||
console.log(data, "data")
|
||||
|
||||
const result: FilterValues = {}
|
||||
if (data.phone?.trim()) result.user_phone = data.phone.trim()
|
||||
if (data.inner_no?.trim()) result.trade_inner_no = data.inner_no.trim()
|
||||
|
||||
@@ -89,13 +89,9 @@ export default function ChannelPage() {
|
||||
const table = useDataTable<Channel>((page, size) =>
|
||||
getPageChannel({ page, size, ...filters }),
|
||||
)
|
||||
console.log(table, "IP管理的table")
|
||||
|
||||
const onFilter = handleSubmit(data => {
|
||||
console.log(data, "data")
|
||||
|
||||
const result: FilterValues = {}
|
||||
|
||||
if (data.batch_no?.trim()) result.batch_no = data.batch_no.trim()
|
||||
if (data.user_phone?.trim()) result.user_phone = data.user_phone.trim()
|
||||
if (data.resource_no?.trim()) result.resource_no = data.resource_no.trim()
|
||||
|
||||
@@ -74,6 +74,8 @@ export default function CouponPage() {
|
||||
format(new Date(row.original.updated_at), "yyyy-MM-dd HH:mm"),
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -108,8 +108,6 @@ export function AddUserDialog({
|
||||
setIsLoadingDiscount(true)
|
||||
try {
|
||||
const res = await getAllProductDiscount()
|
||||
console.log("折扣res", res)
|
||||
|
||||
if (res.success) {
|
||||
setDiscountList(res.data || [])
|
||||
} else {
|
||||
@@ -127,8 +125,6 @@ export function AddUserDialog({
|
||||
setIsLoadingAdmin(true)
|
||||
try {
|
||||
const res = await getAllAdmin()
|
||||
console.log(res, "管理员res")
|
||||
|
||||
if (res.success) {
|
||||
setAdminList(res.data || [])
|
||||
} else {
|
||||
|
||||
@@ -90,7 +90,6 @@ export default function UserPage() {
|
||||
)
|
||||
|
||||
const table = useDataTable<Cust>(fetchUsers)
|
||||
console.log(table, "table")
|
||||
|
||||
const onFilter = handleSubmit(data => {
|
||||
const result: FilterValues = {}
|
||||
@@ -458,6 +457,8 @@ export default function UserPage() {
|
||||
format(new Date(row.original.created_at), "yyyy-MM-dd HH:mm"),
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => {
|
||||
const isEditing = editingRowId === row.original.id
|
||||
|
||||
@@ -57,6 +57,8 @@ export default function DiscountPage() {
|
||||
format(new Date(row.original.updated_at), "yyyy-MM-dd HH:mm"),
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -48,8 +48,6 @@ function Products(props: {
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
const resp = await getAllProduct()
|
||||
console.log(resp, "产品管理的resp")
|
||||
|
||||
if (resp.success) {
|
||||
setList(resp.data)
|
||||
}
|
||||
@@ -141,6 +139,8 @@ function ProductSkus(props: { selected?: number }) {
|
||||
accessorFn: row => format(row.updated_at, "yyyy-MM-dd HH:mm"),
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-1">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { ColumnDef } from "@tanstack/react-table"
|
||||
import { format, isBefore, isSameDay } from "date-fns"
|
||||
import { Box, Loader2, Timer } from "lucide-react"
|
||||
import { Suspense, useCallback, useMemo, useState } from "react"
|
||||
|
||||
@@ -57,6 +57,8 @@ export default function RolesPage() {
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "action",
|
||||
meta: { pin: "right" },
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -85,7 +85,6 @@ export default function TradePage() {
|
||||
const table = useDataTable<Trade>((page, size) =>
|
||||
getPageTrade({ page, size, ...filters }),
|
||||
)
|
||||
console.log(table, "交易明细的table")
|
||||
const onFilter = handleSubmit(data => {
|
||||
const result: FilterValues = {}
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ export default function UserPage() {
|
||||
done: "用户已认领",
|
||||
fail: "用户认领失败",
|
||||
})
|
||||
console.log(table, "table")
|
||||
|
||||
const onFilter = handleSubmit(data => {
|
||||
const result: FilterValues = {}
|
||||
|
||||
@@ -4,7 +4,7 @@ export type User = {
|
||||
id: number
|
||||
admin_id?: number
|
||||
admin?: Admin
|
||||
account: string
|
||||
phone: string
|
||||
source: number
|
||||
has_password: boolean
|
||||
username: string
|
||||
|
||||
Reference in New Issue
Block a user