From e5b2ac9f8bc826085bf81739b040a7e8fd48ee88 Mon Sep 17 00:00:00 2001 From: "Bob.Song" Date: Wed, 8 Apr 2026 17:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- src/router/modules/activity.ts | 6 +- src/router/modules/user.ts | 8 ++ src/views/user/hook.tsx | 71 ++++++++----- src/views/user/index.vue | 50 ++++++++- src/views/user/online.vue | 186 +++++++++++++++++++++++++++++++++ 7 files changed, 291 insertions(+), 34 deletions(-) create mode 100644 src/views/user/online.vue diff --git a/.env.development b/.env.development index df09456..17beab5 100644 --- a/.env.development +++ b/.env.development @@ -7,4 +7,4 @@ VITE_PUBLIC_PATH = / # 开发环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") VITE_ROUTER_HISTORY = "hash" -VITE_API_BASE_URL = http://127.0.0.1:6052/api/ +VITE_API_BASE_URL = http://127.0.0.1:6052/apiBobSongAbc1234561234334/ diff --git a/.env.production b/.env.production index f1b9515..2d1e967 100644 --- a/.env.production +++ b/.env.production @@ -12,4 +12,4 @@ VITE_CDN = false # 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) VITE_COMPRESSION = "none" -VITE_API_BASE_URL = http://127.0.0.1:6052/api/ +VITE_API_BASE_URL = http://127.0.0.1:6052/apiBobSongAbc1234561234334/ diff --git a/src/router/modules/activity.ts b/src/router/modules/activity.ts index 9d0df75..c7897aa 100644 --- a/src/router/modules/activity.ts +++ b/src/router/modules/activity.ts @@ -13,15 +13,15 @@ export default { name: "活动列表", component: () => import("@/views/user/index.vue"), meta: { - title: "玩家列表" + title: "活动列表" } }, { path: "/activity/404", - name: "风险玩家", + name: "风险玩家1", component: () => import("@/views/user/index.vue"), meta: { - title: "风险玩家" + title: "风险玩家1" } } ] diff --git a/src/router/modules/user.ts b/src/router/modules/user.ts index 519c50c..4e021d3 100644 --- a/src/router/modules/user.ts +++ b/src/router/modules/user.ts @@ -16,6 +16,14 @@ export default { title: "玩家列表" } }, + { + path: "/user/online", + name: "在线玩家", + component: () => import("@/views/user/online.vue"), + meta: { + title: "在线玩家" + } + }, { path: "/user/dangerous", name: "风险玩家", diff --git a/src/views/user/hook.tsx b/src/views/user/hook.tsx index 3b73f3a..c265b49 100644 --- a/src/views/user/hook.tsx +++ b/src/views/user/hook.tsx @@ -11,8 +11,9 @@ import { getUserListApi } from "@/api/user"; export function useRole(tableRef: Ref) { const form = reactive({ - module: "", - requestTime: "" + username: "", + phone: "", + status: "" }); const dataList = ref([]); const loading = ref(true); @@ -29,55 +30,69 @@ export function useRole(tableRef: Ref) { const columns: TableColumnList = [ { label: "ID", - prop: "id" - }, - { - label: "用户头像", - prop: "avatar", - cellRenderer: ({ row }) => ( - - ), - width: 90 + prop: "id", + width: 240 }, { label: "昵称", - prop: "nickName" - }, - { - label: "国家", - prop: "country", - minWidth: 100 + prop: "nickName", + cellRenderer: ({ row }) => ( +
+ + {row.nickName} +
+ ) }, { label: "等级", prop: "level", - minWidth: 90 + width: 80 + }, + { + label: "国家", + prop: "country", + width: 80 }, { label: "上星", prop: "star", - minWidth: 90 + width: 80 }, { label: "高光", prop: "highlight", - minWidth: 90 + width: 80 }, { label: "VIP", prop: "vip", - minWidth: 90 + width: 80 + }, + { + label: "状态", + prop: "status", + minWidth: 120, + cellRenderer: ({ row, props }) => ( + + {row.status === 1 ? "封禁" : "正常"} + + ) }, { label: "操作", fixed: "right", - slot: "operation" + slot: "operation", + width: 220 } ]; diff --git a/src/views/user/index.vue b/src/views/user/index.vue index fc67e26..6639fcc 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -41,7 +41,7 @@ const {