import { defineComponent, ref, reactive, resolveComponent, mergeProps, withCtx, unref, createTextVNode, createVNode, toDisplayString, createBlock, openBlock, Fragment, renderList, isRef, createCommentVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderClass, ssrInterpolate, ssrRenderStyle } from 'vue/server-renderer'; import { ReloadOutlined, UserOutlined } from '@ant-design/icons-vue'; import { message } from 'ant-design-vue'; import { p as pageUsers, u as updateUserStatus, a as updateUserPassword } from './index-fit_DIQT.mjs'; import { a as _export_sfc, c as useHead } from './server.mjs'; import './request-BIxQh2im.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import 'better-sqlite3'; import 'vue-router'; import '@babel/runtime/helpers/esm/extends'; import 'stylis'; import 'dayjs'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/plugins'; import 'unhead/utils'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "users", __ssrInlineRender: true, setup(__props) { useHead({ title: "用户管理 - 平台管理" }); const loading = ref(false); const users2 = ref([]); const filterStatus = ref(void 0); const searchKeyword = ref(""); const pagination = reactive({ current: 1, pageSize: 20, total: 0, showSizeChanger: true, showQuickJumper: true }); const stats = reactive([ { icon: "👥", label: "总用户数", value: 0, color: "blue" }, { icon: "✅", label: "正常用户", value: 0, color: "green" }, { icon: "🔒", label: "冻结用户", value: 0, color: "red" }, { icon: "🛡️", label: "管理员", value: 0, color: "orange" } ]); const columns = [ { title: "用户信息", key: "userInfo", width: 220 }, { title: "联系方式", key: "contact", width: 180 }, { title: "账号状态", key: "status", width: 110 }, { title: "余额/积分", key: "balance", width: 140 }, { title: "注册时间", key: "createTime", width: 110 }, { title: "操作", key: "action", width: 220 } ]; const showDetailModal = ref(false); const currentUser = ref(null); async function loadUsers() { loading.value = true; try { const res = await pageUsers({ page: pagination.current, limit: pagination.pageSize, status: filterStatus.value, keywords: searchKeyword.value || void 0 }); users2.value = res?.list || []; pagination.total = res?.count || 0; loadStats(); } catch { message.error("加载用户列表失败"); } finally { loading.value = false; } } async function loadStats() { try { const [allRes, normalRes, frozenRes, adminRes] = await Promise.allSettled([ pageUsers({ page: 1, limit: 1 }), pageUsers({ page: 1, limit: 1, status: 0 }), pageUsers({ page: 1, limit: 1, status: 1 }), pageUsers({ page: 1, limit: 1, isAdmin: 1 }) ]); if (allRes.status === "fulfilled") stats[0].value = allRes.value?.count || 0; if (normalRes.status === "fulfilled") stats[1].value = normalRes.value?.count || 0; if (frozenRes.status === "fulfilled") stats[2].value = frozenRes.value?.count || 0; if (adminRes.status === "fulfilled") stats[3].value = adminRes.value?.count || 0; } catch { } } function handleSearch() { pagination.current = 1; loadUsers(); } function handleTableChange(pag) { pagination.current = pag.current; pagination.pageSize = pag.pageSize; loadUsers(); } function handleView(record) { currentUser.value = record; showDetailModal.value = true; } async function handleToggleStatus(record) { const newStatus = record.status === 0 ? 1 : 0; try { await updateUserStatus(record.userId, newStatus); message.success(newStatus === 1 ? "用户已冻结" : "用户已解冻"); loadUsers(); } catch (e) { message.error(e?.message || "操作失败"); } } async function handleResetPassword(record) { try { await updateUserPassword(record.userId, "123456"); message.success(`已重置「${record.nickname || record.username}」的密码为 123456`); } catch (e) { message.error(e?.message || "重置失败"); } } return (_ctx, _push, _parent, _attrs) => { const _component_a_space = resolveComponent("a-space"); const _component_a_button = resolveComponent("a-button"); const _component_a_row = resolveComponent("a-row"); const _component_a_col = resolveComponent("a-col"); const _component_a_select = resolveComponent("a-select"); const _component_a_select_option = resolveComponent("a-select-option"); const _component_a_input_search = resolveComponent("a-input-search"); const _component_a_table = resolveComponent("a-table"); const _component_a_avatar = resolveComponent("a-avatar"); const _component_a_tag = resolveComponent("a-tag"); const _component_a_badge = resolveComponent("a-badge"); const _component_a_popconfirm = resolveComponent("a-popconfirm"); const _component_a_modal = resolveComponent("a-modal"); const _component_a_divider = resolveComponent("a-divider"); const _component_a_descriptions = resolveComponent("a-descriptions"); const _component_a_descriptions_item = resolveComponent("a-descriptions-item"); _push(``); _push(ssrRenderComponent(_component_a_row, { gutter: [16, 16], class: "mb-6" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(``); ssrRenderList(unref(stats), (stat) => { _push2(ssrRenderComponent(_component_a_col, { xs: 12, md: 6, key: stat.label }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`
${ssrInterpolate(stat.icon)}
${ssrInterpolate(stat.value)}
${ssrInterpolate(stat.label)}
`); } else { return [ createVNode("div", { class: ["stat-card", stat.color] }, [ createVNode("div", { class: "stat-icon" }, toDisplayString(stat.icon), 1), createVNode("div", { class: "stat-info" }, [ createVNode("div", { class: "stat-value" }, toDisplayString(stat.value), 1), createVNode("div", { class: "stat-label" }, toDisplayString(stat.label), 1) ]) ], 2) ]; } }), _: 2 }, _parent2, _scopeId)); }); _push2(``); } else { return [ (openBlock(true), createBlock(Fragment, null, renderList(unref(stats), (stat) => { return openBlock(), createBlock(_component_a_col, { xs: 12, md: 6, key: stat.label }, { default: withCtx(() => [ createVNode("div", { class: ["stat-card", stat.color] }, [ createVNode("div", { class: "stat-icon" }, toDisplayString(stat.icon), 1), createVNode("div", { class: "stat-info" }, [ createVNode("div", { class: "stat-value" }, toDisplayString(stat.value), 1), createVNode("div", { class: "stat-label" }, toDisplayString(stat.label), 1) ]) ], 2) ]), _: 2 }, 1024); }), 128)) ]; } }), _: 1 }, _parent)); _push(`
📋 用户列表`); _push(ssrRenderComponent(_component_a_space, { wrap: "" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_select, { value: unref(filterStatus), "onUpdate:value": ($event) => isRef(filterStatus) ? filterStatus.value = $event : null, style: { "width": "120px" }, onChange: handleSearch }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(_component_a_select_option, { value: void 0 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`全部状态`); } else { return [ createTextVNode("全部状态") ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_select_option, { value: 0 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`正常`); } else { return [ createTextVNode("正常") ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_select_option, { value: 1 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`已冻结`); } else { return [ createTextVNode("已冻结") ]; } }), _: 1 }, _parent3, _scopeId2)); } else { return [ createVNode(_component_a_select_option, { value: void 0 }, { default: withCtx(() => [ createTextVNode("全部状态") ]), _: 1 }), createVNode(_component_a_select_option, { value: 0 }, { default: withCtx(() => [ createTextVNode("正常") ]), _: 1 }), createVNode(_component_a_select_option, { value: 1 }, { default: withCtx(() => [ createTextVNode("已冻结") ]), _: 1 }) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_input_search, { value: unref(searchKeyword), "onUpdate:value": ($event) => isRef(searchKeyword) ? searchKeyword.value = $event : null, placeholder: "搜索用户名/手机/邮箱", style: { "width": "220px" }, onSearch: handleSearch }, null, _parent2, _scopeId)); } else { return [ createVNode(_component_a_select, { value: unref(filterStatus), "onUpdate:value": ($event) => isRef(filterStatus) ? filterStatus.value = $event : null, style: { "width": "120px" }, onChange: handleSearch }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: void 0 }, { default: withCtx(() => [ createTextVNode("全部状态") ]), _: 1 }), createVNode(_component_a_select_option, { value: 0 }, { default: withCtx(() => [ createTextVNode("正常") ]), _: 1 }), createVNode(_component_a_select_option, { value: 1 }, { default: withCtx(() => [ createTextVNode("已冻结") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]), createVNode(_component_a_input_search, { value: unref(searchKeyword), "onUpdate:value": ($event) => isRef(searchKeyword) ? searchKeyword.value = $event : null, placeholder: "搜索用户名/手机/邮箱", style: { "width": "220px" }, onSearch: handleSearch }, null, 8, ["value", "onUpdate:value"]) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_table, { columns, "data-source": unref(users2), loading: unref(loading), pagination: unref(pagination), "row-key": "userId", onChange: handleTableChange, size: "middle" }, { bodyCell: withCtx(({ column, record }, _push2, _parent2, _scopeId) => { if (_push2) { if (column.key === "userInfo") { _push2(``); } else { _push2(``); } if (column.key === "contact") { _push2(`
`); if (record.phone || record.mobile) { _push2(`
📱 ${ssrInterpolate(record.phone || record.mobile)}
`); } else { _push2(``); } if (record.email) { _push2(`
${ssrInterpolate(record.email)}
`); } else { _push2(``); } if (!record.phone && !record.mobile && !record.email) { _push2(`-`); } else { _push2(``); } _push2(`
`); } else { _push2(``); } if (column.key === "status") { _push2(ssrRenderComponent(_component_a_badge, { status: record.status === 0 ? "success" : "error", text: record.status === 0 ? "正常" : "已冻结" }, null, _parent2, _scopeId)); } else { _push2(``); } if (column.key === "balance") { _push2(`
`); if (record.balance !== void 0) { _push2(`
💰 ¥${ssrInterpolate((record.balance / 100).toFixed(2))}
`); } else { _push2(``); } if (record.points !== void 0) { _push2(`
🏆 ${ssrInterpolate(record.points)} 积分
`); } else { _push2(``); } _push2(`
`); } else { _push2(``); } if (column.key === "createTime") { _push2(`${ssrInterpolate(record.createTime?.substring(0, 10) || "-")}`); } else { _push2(``); } if (column.key === "action") { _push2(ssrRenderComponent(_component_a_space, null, { default: withCtx((_, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(_component_a_button, { type: "link", size: "small", onClick: ($event) => handleView(record) }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`详情`); } else { return [ createTextVNode("详情") ]; } }), _: 2 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_popconfirm, { title: record.status === 0 ? "确认冻结此用户账号?" : "确认解冻此用户账号?", onConfirm: ($event) => handleToggleStatus(record) }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_button, { type: "link", size: "small", danger: record.status === 0 }, { default: withCtx((_3, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(`${ssrInterpolate(record.status === 0 ? "冻结" : "解冻")}`); } else { return [ createTextVNode(toDisplayString(record.status === 0 ? "冻结" : "解冻"), 1) ]; } }), _: 2 }, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_button, { type: "link", size: "small", danger: record.status === 0 }, { default: withCtx(() => [ createTextVNode(toDisplayString(record.status === 0 ? "冻结" : "解冻"), 1) ]), _: 2 }, 1032, ["danger"]) ]; } }), _: 2 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_popconfirm, { title: "确认重置密码为 123456?", onConfirm: ($event) => handleResetPassword(record) }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_button, { type: "link", size: "small" }, { default: withCtx((_3, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(`重置密码`); } else { return [ createTextVNode("重置密码") ]; } }), _: 2 }, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_button, { type: "link", size: "small" }, { default: withCtx(() => [ createTextVNode("重置密码") ]), _: 1 }) ]; } }), _: 2 }, _parent3, _scopeId2)); } else { return [ createVNode(_component_a_button, { type: "link", size: "small", onClick: ($event) => handleView(record) }, { default: withCtx(() => [ createTextVNode("详情") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_popconfirm, { title: record.status === 0 ? "确认冻结此用户账号?" : "确认解冻此用户账号?", onConfirm: ($event) => handleToggleStatus(record) }, { default: withCtx(() => [ createVNode(_component_a_button, { type: "link", size: "small", danger: record.status === 0 }, { default: withCtx(() => [ createTextVNode(toDisplayString(record.status === 0 ? "冻结" : "解冻"), 1) ]), _: 2 }, 1032, ["danger"]) ]), _: 2 }, 1032, ["title", "onConfirm"]), createVNode(_component_a_popconfirm, { title: "确认重置密码为 123456?", onConfirm: ($event) => handleResetPassword(record) }, { default: withCtx(() => [ createVNode(_component_a_button, { type: "link", size: "small" }, { default: withCtx(() => [ createTextVNode("重置密码") ]), _: 1 }) ]), _: 1 }, 8, ["onConfirm"]) ]; } }), _: 2 }, _parent2, _scopeId)); } else { _push2(``); } } else { return [ column.key === "userInfo" ? (openBlock(), createBlock("div", { key: 0, class: "user-info-cell" }, [ createVNode(_component_a_avatar, { size: 38, src: record.avatar || record.avatarUrl }, { icon: withCtx(() => [ createVNode(unref(UserOutlined)) ]), _: 1 }, 8, ["src"]), createVNode("div", { class: "user-info-text" }, [ createVNode("div", { class: "user-name" }, [ createTextVNode(toDisplayString(record.nickname || record.username) + " ", 1), record.isAdmin ? (openBlock(), createBlock(_component_a_tag, { key: 0, color: "red", style: { "margin-left": "6px", "font-size": "10px" } }, { default: withCtx(() => [ createTextVNode("管理员") ]), _: 1 })) : createCommentVNode("", true) ]), createVNode("div", { class: "user-sub" }, "@" + toDisplayString(record.username), 1) ]) ])) : createCommentVNode("", true), column.key === "contact" ? (openBlock(), createBlock("div", { key: 1, style: { "font-size": "13px" } }, [ record.phone || record.mobile ? (openBlock(), createBlock("div", { key: 0 }, "📱 " + toDisplayString(record.phone || record.mobile), 1)) : createCommentVNode("", true), record.email ? (openBlock(), createBlock("div", { key: 1, style: { "color": "rgba(0,0,0,0.45)", "font-size": "12px" } }, toDisplayString(record.email), 1)) : createCommentVNode("", true), !record.phone && !record.mobile && !record.email ? (openBlock(), createBlock("span", { key: 2, class: "text-gray-400" }, "-")) : createCommentVNode("", true) ])) : createCommentVNode("", true), column.key === "status" ? (openBlock(), createBlock(_component_a_badge, { key: 2, status: record.status === 0 ? "success" : "error", text: record.status === 0 ? "正常" : "已冻结" }, null, 8, ["status", "text"])) : createCommentVNode("", true), column.key === "balance" ? (openBlock(), createBlock("div", { key: 3, style: { "font-size": "13px" } }, [ record.balance !== void 0 ? (openBlock(), createBlock("div", { key: 0, style: { "color": "#059669" } }, "💰 ¥" + toDisplayString((record.balance / 100).toFixed(2)), 1)) : createCommentVNode("", true), record.points !== void 0 ? (openBlock(), createBlock("div", { key: 1, style: { "color": "rgba(0,0,0,0.45)", "font-size": "12px" } }, "🏆 " + toDisplayString(record.points) + " 积分", 1)) : createCommentVNode("", true) ])) : createCommentVNode("", true), column.key === "createTime" ? (openBlock(), createBlock("span", { key: 4, class: "text-sm text-gray" }, toDisplayString(record.createTime?.substring(0, 10) || "-"), 1)) : createCommentVNode("", true), column.key === "action" ? (openBlock(), createBlock(_component_a_space, { key: 5 }, { default: withCtx(() => [ createVNode(_component_a_button, { type: "link", size: "small", onClick: ($event) => handleView(record) }, { default: withCtx(() => [ createTextVNode("详情") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_popconfirm, { title: record.status === 0 ? "确认冻结此用户账号?" : "确认解冻此用户账号?", onConfirm: ($event) => handleToggleStatus(record) }, { default: withCtx(() => [ createVNode(_component_a_button, { type: "link", size: "small", danger: record.status === 0 }, { default: withCtx(() => [ createTextVNode(toDisplayString(record.status === 0 ? "冻结" : "解冻"), 1) ]), _: 2 }, 1032, ["danger"]) ]), _: 2 }, 1032, ["title", "onConfirm"]), createVNode(_component_a_popconfirm, { title: "确认重置密码为 123456?", onConfirm: ($event) => handleResetPassword(record) }, { default: withCtx(() => [ createVNode(_component_a_button, { type: "link", size: "small" }, { default: withCtx(() => [ createTextVNode("重置密码") ]), _: 1 }) ]), _: 1 }, 8, ["onConfirm"]) ]), _: 2 }, 1024)) : createCommentVNode("", true) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_modal, { open: unref(showDetailModal), "onUpdate:open": ($event) => isRef(showDetailModal) ? showDetailModal.value = $event : null, title: `用户详情:${unref(currentUser)?.nickname || unref(currentUser)?.username || ""}`, width: "680px", footer: null }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { if (unref(currentUser)) { _push2(`
`); _push2(ssrRenderComponent(_component_a_avatar, { size: 64, src: unref(currentUser).avatar || unref(currentUser).avatarUrl }, { icon: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(unref(UserOutlined), null, null, _parent3, _scopeId2)); } else { return [ createVNode(unref(UserOutlined)) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(`
${ssrInterpolate(unref(currentUser).nickname || unref(currentUser).username)}
@${ssrInterpolate(unref(currentUser).username)}
`); _push2(ssrRenderComponent(_component_a_space, { style: { "margin-top": "8px" } }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { if (unref(currentUser).isAdmin) { _push3(ssrRenderComponent(_component_a_tag, { color: "red" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`管理员`); } else { return [ createTextVNode("管理员") ]; } }), _: 1 }, _parent3, _scopeId2)); } else { _push3(``); } _push3(ssrRenderComponent(_component_a_badge, { status: unref(currentUser).status === 0 ? "success" : "error", text: unref(currentUser).status === 0 ? "账号正常" : "已冻结" }, null, _parent3, _scopeId2)); } else { return [ unref(currentUser).isAdmin ? (openBlock(), createBlock(_component_a_tag, { key: 0, color: "red" }, { default: withCtx(() => [ createTextVNode("管理员") ]), _: 1 })) : createCommentVNode("", true), createVNode(_component_a_badge, { status: unref(currentUser).status === 0 ? "success" : "error", text: unref(currentUser).status === 0 ? "账号正常" : "已冻结" }, null, 8, ["status", "text"]) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(`
`); _push2(ssrRenderComponent(_component_a_divider, null, null, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_descriptions, { column: 2, size: "small" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "用户ID" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).userId)}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).userId), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "手机号" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).phone || unref(currentUser).mobile || "-")}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).phone || unref(currentUser).mobile || "-"), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "邮箱" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).email || "-")}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).email || "-"), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "性别" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).sex === "1" ? "男" : unref(currentUser).sex === "2" ? "女" : "-")}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).sex === "1" ? "男" : unref(currentUser).sex === "2" ? "女" : "-"), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "余额" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`¥${ssrInterpolate(((unref(currentUser).balance || 0) / 100).toFixed(2))}`); } else { return [ createVNode("span", { style: { "color": "#059669" } }, "¥" + toDisplayString(((unref(currentUser).balance || 0) / 100).toFixed(2)), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "积分" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).points ?? "-")}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).points ?? "-"), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "注册时间", span: 2 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate(unref(currentUser).createTime || "-")}`); } else { return [ createTextVNode(toDisplayString(unref(currentUser).createTime || "-"), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); if (unref(currentUser).address) { _push3(ssrRenderComponent(_component_a_descriptions_item, { label: "地址", span: 2 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`${ssrInterpolate([unref(currentUser).province, unref(currentUser).city, unref(currentUser).region, unref(currentUser).address].filter(Boolean).join(" "))}`); } else { return [ createTextVNode(toDisplayString([unref(currentUser).province, unref(currentUser).city, unref(currentUser).region, unref(currentUser).address].filter(Boolean).join(" ")), 1) ]; } }), _: 1 }, _parent3, _scopeId2)); } else { _push3(``); } } else { return [ createVNode(_component_a_descriptions_item, { label: "用户ID" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).userId), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "手机号" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).phone || unref(currentUser).mobile || "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "邮箱" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).email || "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "性别" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).sex === "1" ? "男" : unref(currentUser).sex === "2" ? "女" : "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "余额" }, { default: withCtx(() => [ createVNode("span", { style: { "color": "#059669" } }, "¥" + toDisplayString(((unref(currentUser).balance || 0) / 100).toFixed(2)), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "积分" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).points ?? "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "注册时间", span: 2 }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).createTime || "-"), 1) ]), _: 1 }), unref(currentUser).address ? (openBlock(), createBlock(_component_a_descriptions_item, { key: 0, label: "地址", span: 2 }, { default: withCtx(() => [ createTextVNode(toDisplayString([unref(currentUser).province, unref(currentUser).city, unref(currentUser).region, unref(currentUser).address].filter(Boolean).join(" ")), 1) ]), _: 1 })) : createCommentVNode("", true) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(``); } else { _push2(``); } } else { return [ unref(currentUser) ? (openBlock(), createBlock(Fragment, { key: 0 }, [ createVNode("div", { class: "user-detail-header" }, [ createVNode(_component_a_avatar, { size: 64, src: unref(currentUser).avatar || unref(currentUser).avatarUrl }, { icon: withCtx(() => [ createVNode(unref(UserOutlined)) ]), _: 1 }, 8, ["src"]), createVNode("div", null, [ createVNode("div", { class: "detail-name" }, toDisplayString(unref(currentUser).nickname || unref(currentUser).username), 1), createVNode("div", { class: "detail-sub" }, "@" + toDisplayString(unref(currentUser).username), 1), createVNode(_component_a_space, { style: { "margin-top": "8px" } }, { default: withCtx(() => [ unref(currentUser).isAdmin ? (openBlock(), createBlock(_component_a_tag, { key: 0, color: "red" }, { default: withCtx(() => [ createTextVNode("管理员") ]), _: 1 })) : createCommentVNode("", true), createVNode(_component_a_badge, { status: unref(currentUser).status === 0 ? "success" : "error", text: unref(currentUser).status === 0 ? "账号正常" : "已冻结" }, null, 8, ["status", "text"]) ]), _: 1 }) ]) ]), createVNode(_component_a_divider), createVNode(_component_a_descriptions, { column: 2, size: "small" }, { default: withCtx(() => [ createVNode(_component_a_descriptions_item, { label: "用户ID" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).userId), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "手机号" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).phone || unref(currentUser).mobile || "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "邮箱" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).email || "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "性别" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).sex === "1" ? "男" : unref(currentUser).sex === "2" ? "女" : "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "余额" }, { default: withCtx(() => [ createVNode("span", { style: { "color": "#059669" } }, "¥" + toDisplayString(((unref(currentUser).balance || 0) / 100).toFixed(2)), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "积分" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).points ?? "-"), 1) ]), _: 1 }), createVNode(_component_a_descriptions_item, { label: "注册时间", span: 2 }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(currentUser).createTime || "-"), 1) ]), _: 1 }), unref(currentUser).address ? (openBlock(), createBlock(_component_a_descriptions_item, { key: 0, label: "地址", span: 2 }, { default: withCtx(() => [ createTextVNode(toDisplayString([unref(currentUser).province, unref(currentUser).city, unref(currentUser).region, unref(currentUser).address].filter(Boolean).join(" ")), 1) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 }) ], 64)) : createCommentVNode("", true) ]; } }), _: 1 }, _parent)); _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/admin/users.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const users = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0c7d49a8"]]); export { users as default }; //# sourceMappingURL=users-R2tJfhAK.mjs.map