更新客户管理模块

This commit is contained in:
Eamon
2026-03-28 14:28:32 +08:00
parent 76d2d480ed
commit f72b6bddd0
7 changed files with 543 additions and 210 deletions

View File

@@ -15,13 +15,6 @@ import {
FieldLabel,
} from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { useFetch } from "@/hooks/data"
import type { User } from "@/models/user"
@@ -67,6 +60,7 @@ export default function UserPage() {
done: "用户已认领",
fail: "用户认领失败",
})
console.log(table, "table")
const onFilter = handleSubmit(data => {
const result: FilterValues = {}
@@ -94,10 +88,10 @@ export default function UserPage() {
render={({ field, fieldState }) => (
<Field
data-invalid={fieldState.invalid}
className="w-40 flex-none"
className="w-80 flex-none"
>
<FieldLabel></FieldLabel>
<Input {...field} placeholder="请输入账号" />
<FieldLabel>//</FieldLabel>
<Input {...field} placeholder="请输入账号/手机号/邮箱" />
<FieldError>{fieldState.error?.message}</FieldError>
</Field>
)}
@@ -111,14 +105,14 @@ export default function UserPage() {
data-invalid={fieldState.invalid}
className="w-40 flex-none"
>
<FieldLabel>--</FieldLabel>
<Input {...field} placeholder="请输入用户名-手机号-邮箱" />
<FieldLabel></FieldLabel>
<Input {...field} placeholder="请输入姓名" />
<FieldError>{fieldState.error?.message}</FieldError>
</Field>
)}
/>
<Controller
{/* <Controller
name="identified"
control={control}
render={({ field, fieldState }) => (
@@ -179,7 +173,7 @@ export default function UserPage() {
<FieldError>{fieldState.error?.message}</FieldError>
</Field>
)}
/>
/> */}
</div>
<FieldGroup className="flex-row justify-start mt-4 gap-2">
@@ -253,6 +247,19 @@ export default function UserPage() {
return idNo ? `${idNo.slice(0, 6)}****${idNo.slice(-4)}` : "-"
},
},
{
header: "客户来源",
accessorKey: "source",
cell: ({ row }) => {
const sourceMap: Record<number, string> = {
0: "官网注册",
1: "管理员添加",
2: "代理商注册",
3: "代理商添加",
}
return sourceMap[row.original.source] ?? "未知"
},
},
{
header: "账号状态",
accessorKey: "status",