import { a as _export_sfc, c as useHead, n as navigateTo } from './server.mjs'; import { defineComponent, ref, reactive, resolveComponent, mergeProps, unref, withCtx, createTextVNode, createVNode, toDisplayString, createBlock, openBlock, Fragment, renderList, createCommentVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent, ssrRenderList, ssrRenderClass, ssrRenderStyle } from 'vue/server-renderer'; import { ReloadOutlined, RightOutlined } from '@ant-design/icons-vue'; 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 'ant-design-vue'; 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: "index", __ssrInlineRender: true, setup(__props) { useHead({ title: "管理后台首页" }); const adminName = ref("管理员"); const loadingStats = ref(false); const coreStats = reactive([ { icon: "📝", label: "文章总数", value: 0, desc: "全部文章", color: "blue" }, { icon: "👥", label: "用户总数", value: 0, desc: "注册用户", color: "green" }, { icon: "🎓", label: "专家总数", value: 0, desc: "认证专家", color: "purple" }, { icon: "💼", label: "会员总数", value: 0, desc: "企业/个人会员", color: "orange" } ]); const todoItems = reactive([ { label: "待审核专家", value: 0, to: "/admin/experts/review", tagColor: "orange", dotColor: "dot-orange", urgent: false }, { label: "待审核会员", value: 0, to: "/admin/members/review", tagColor: "cyan", dotColor: "dot-cyan", urgent: false }, { label: "待处理建言", value: 0, to: "/admin/suggestions", tagColor: "blue", dotColor: "dot-blue", urgent: false }, { label: "待审核文章", value: 0, to: "/admin/articles", tagColor: "red", dotColor: "dot-red", urgent: false } ]); const quickLinks = [ { to: "/admin/articles", icon: "📝", label: "文章管理", bg: "#fff7ed" }, { to: "/admin/categories", icon: "🗂️", label: "栏目管理", bg: "#eff6ff" }, { to: "/admin/experts", icon: "🎓", label: "专家管理", bg: "#faf5ff" }, { to: "/admin/members", icon: "💼", label: "会员管理", bg: "#f0fdf4" }, { to: "/admin/suggestions", icon: "💬", label: "建言管理", bg: "#fdf4ff" }, { to: "/admin/users", icon: "👥", label: "用户管理", bg: "#f0f9ff" }, { to: "/admin/announcements", icon: "📢", label: "公告管理", bg: "#fff1f2" }, { to: "/admin/settings", icon: "⚙️", label: "系统设置", bg: "#f9fafb" } ]; async function loadStats() { loadingStats.value = true; try { todoItems[0].value = 0; todoItems[1].value = 0; todoItems[2].value = 0; todoItems[3].value = 0; } catch { } finally { loadingStats.value = false; } } return (_ctx, _push, _parent, _attrs) => { const _component_a_space = resolveComponent("a-space"); const _component_a_tag = resolveComponent("a-tag"); const _component_a_button = resolveComponent("a-button"); const _component_a_row = resolveComponent("a-row"); const _component_a_col = resolveComponent("a-col"); const _component_a_skeleton_input = resolveComponent("a-skeleton-input"); _push(`

🎛️ 决策咨询网管理后台

欢迎回来,${ssrInterpolate(unref(adminName))},今日数据已更新

`); _push(ssrRenderComponent(_component_a_space, null, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_tag, { color: "red", style: { "font-size": "13px", "padding": "4px 12px" } }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`超级管理员`); } else { return [ createTextVNode("超级管理员") ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_button, { size: "small", onClick: loadStats, loading: unref(loadingStats) }, { icon: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(unref(ReloadOutlined), null, null, _parent3, _scopeId2)); } else { return [ createVNode(unref(ReloadOutlined)) ]; } }), default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(` 刷新数据 `); } else { return [ createTextVNode(" 刷新数据 ") ]; } }), _: 1 }, _parent2, _scopeId)); } else { return [ createVNode(_component_a_tag, { color: "red", style: { "font-size": "13px", "padding": "4px 12px" } }, { default: withCtx(() => [ createTextVNode("超级管理员") ]), _: 1 }), createVNode(_component_a_button, { size: "small", onClick: loadStats, loading: unref(loadingStats) }, { icon: withCtx(() => [ createVNode(unref(ReloadOutlined)) ]), default: withCtx(() => [ createTextVNode(" 刷新数据 ") ]), _: 1 }, 8, ["loading"]) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_row, { gutter: [16, 16] }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(``); ssrRenderList(unref(coreStats), (stat) => { _push2(ssrRenderComponent(_component_a_col, { xs: 12, sm: 12, md: 6, key: stat.label }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`
${ssrInterpolate(stat.icon)}${ssrInterpolate(stat.label)}
`); if (unref(loadingStats)) { _push3(ssrRenderComponent(_component_a_skeleton_input, { active: true, size: "small", style: { "width": "60px" } }, null, _parent3, _scopeId2)); } else { _push3(`${ssrInterpolate(stat.value)}`); } _push3(`
${ssrInterpolate(stat.desc)}
`); } else { return [ createVNode("div", { class: ["stat-block", stat.color] }, [ createVNode("div", { class: "stat-block-header" }, [ createVNode("span", { class: "stat-block-icon" }, toDisplayString(stat.icon), 1), createVNode("span", { class: "stat-block-label" }, toDisplayString(stat.label), 1) ]), createVNode("div", { class: "stat-block-value" }, [ unref(loadingStats) ? (openBlock(), createBlock(_component_a_skeleton_input, { key: 0, active: true, size: "small", style: { "width": "60px" } })) : (openBlock(), createBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(stat.value), 1) ], 64)) ]), createVNode("div", { class: "stat-block-desc" }, toDisplayString(stat.desc), 1) ], 2) ]; } }), _: 2 }, _parent2, _scopeId)); }); _push2(``); } else { return [ (openBlock(true), createBlock(Fragment, null, renderList(unref(coreStats), (stat) => { return openBlock(), createBlock(_component_a_col, { xs: 12, sm: 12, md: 6, key: stat.label }, { default: withCtx(() => [ createVNode("div", { class: ["stat-block", stat.color] }, [ createVNode("div", { class: "stat-block-header" }, [ createVNode("span", { class: "stat-block-icon" }, toDisplayString(stat.icon), 1), createVNode("span", { class: "stat-block-label" }, toDisplayString(stat.label), 1) ]), createVNode("div", { class: "stat-block-value" }, [ unref(loadingStats) ? (openBlock(), createBlock(_component_a_skeleton_input, { key: 0, active: true, size: "small", style: { "width": "60px" } })) : (openBlock(), createBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(stat.value), 1) ], 64)) ]), createVNode("div", { class: "stat-block-desc" }, toDisplayString(stat.desc), 1) ], 2) ]), _: 2 }, 1024); }), 128)) ]; } }), _: 1 }, _parent)); _push(ssrRenderComponent(_component_a_row, { gutter: [16, 16] }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_col, { xs: 24, md: 12 }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`
🔔 待处理事项
`); ssrRenderList(unref(todoItems), (todo) => { _push3(`
${ssrInterpolate(todo.label)}`); _push3(ssrRenderComponent(_component_a_tag, { color: todo.tagColor }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { if (unref(loadingStats)) { _push4(`...`); } else { _push4(`${ssrInterpolate(todo.value)}`); } } else { return [ unref(loadingStats) ? (openBlock(), createBlock(Fragment, { key: 0 }, [ createTextVNode("...") ], 64)) : (openBlock(), createBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(todo.value), 1) ], 64)) ]; } }), _: 2 }, _parent3, _scopeId2)); _push3(`
`); _push3(ssrRenderComponent(unref(RightOutlined), { class: "todo-arrow" }, null, _parent3, _scopeId2)); _push3(`
`); }); _push3(``); if (!unref(loadingStats) && unref(todoItems).every((t) => t.value === 0)) { _push3(`
🎉 暂无待处理事项,一切正常!
`); } else { _push3(``); } _push3(`
`); } else { return [ createVNode("div", { class: "panel" }, [ createVNode("div", { class: "panel-header" }, [ createVNode("span", { class: "panel-title" }, "🔔 待处理事项") ]), createVNode("div", { class: "todo-list" }, [ (openBlock(true), createBlock(Fragment, null, renderList(unref(todoItems), (todo) => { return openBlock(), createBlock("div", { key: todo.label, class: ["todo-item", { "todo-item-urgent": todo.urgent }], onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))(todo.to) }, [ createVNode("div", { class: ["todo-dot", todo.dotColor] }, null, 2), createVNode("div", { class: "todo-content" }, [ createVNode("span", { class: "todo-label" }, toDisplayString(todo.label), 1), createVNode(_component_a_tag, { color: todo.tagColor }, { default: withCtx(() => [ unref(loadingStats) ? (openBlock(), createBlock(Fragment, { key: 0 }, [ createTextVNode("...") ], 64)) : (openBlock(), createBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(todo.value), 1) ], 64)) ]), _: 2 }, 1032, ["color"]) ]), createVNode(unref(RightOutlined), { class: "todo-arrow" }) ], 10, ["onClick"]); }), 128)), !unref(loadingStats) && unref(todoItems).every((t) => t.value === 0) ? (openBlock(), createBlock("div", { key: 0, class: "todo-empty" }, " 🎉 暂无待处理事项,一切正常! ")) : createCommentVNode("", true) ]) ]) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_col, { xs: 24, md: 12 }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`
⚡ 快速入口
`); ssrRenderList(quickLinks, (item) => { _push3(`
${ssrInterpolate(item.icon)}
${ssrInterpolate(item.label)}
`); }); _push3(`
`); } else { return [ createVNode("div", { class: "panel" }, [ createVNode("div", { class: "panel-header" }, [ createVNode("span", { class: "panel-title" }, "⚡ 快速入口") ]), createVNode("div", { class: "quick-grid" }, [ (openBlock(), createBlock(Fragment, null, renderList(quickLinks, (item) => { return createVNode("div", { key: item.to, class: "quick-card", onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))(item.to) }, [ createVNode("div", { class: "quick-icon", style: { background: item.bg } }, toDisplayString(item.icon), 5), createVNode("div", { class: "quick-label" }, toDisplayString(item.label), 1) ], 8, ["onClick"]); }), 64)) ]) ]) ]; } }), _: 1 }, _parent2, _scopeId)); } else { return [ createVNode(_component_a_col, { xs: 24, md: 12 }, { default: withCtx(() => [ createVNode("div", { class: "panel" }, [ createVNode("div", { class: "panel-header" }, [ createVNode("span", { class: "panel-title" }, "🔔 待处理事项") ]), createVNode("div", { class: "todo-list" }, [ (openBlock(true), createBlock(Fragment, null, renderList(unref(todoItems), (todo) => { return openBlock(), createBlock("div", { key: todo.label, class: ["todo-item", { "todo-item-urgent": todo.urgent }], onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))(todo.to) }, [ createVNode("div", { class: ["todo-dot", todo.dotColor] }, null, 2), createVNode("div", { class: "todo-content" }, [ createVNode("span", { class: "todo-label" }, toDisplayString(todo.label), 1), createVNode(_component_a_tag, { color: todo.tagColor }, { default: withCtx(() => [ unref(loadingStats) ? (openBlock(), createBlock(Fragment, { key: 0 }, [ createTextVNode("...") ], 64)) : (openBlock(), createBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(todo.value), 1) ], 64)) ]), _: 2 }, 1032, ["color"]) ]), createVNode(unref(RightOutlined), { class: "todo-arrow" }) ], 10, ["onClick"]); }), 128)), !unref(loadingStats) && unref(todoItems).every((t) => t.value === 0) ? (openBlock(), createBlock("div", { key: 0, class: "todo-empty" }, " 🎉 暂无待处理事项,一切正常! ")) : createCommentVNode("", true) ]) ]) ]), _: 1 }), createVNode(_component_a_col, { xs: 24, md: 12 }, { default: withCtx(() => [ createVNode("div", { class: "panel" }, [ createVNode("div", { class: "panel-header" }, [ createVNode("span", { class: "panel-title" }, "⚡ 快速入口") ]), createVNode("div", { class: "quick-grid" }, [ (openBlock(), createBlock(Fragment, null, renderList(quickLinks, (item) => { return createVNode("div", { key: item.to, class: "quick-card", onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))(item.to) }, [ createVNode("div", { class: "quick-icon", style: { background: item.bg } }, toDisplayString(item.icon), 5), createVNode("div", { class: "quick-label" }, toDisplayString(item.label), 1) ], 8, ["onClick"]); }), 64)) ]) ]) ]), _: 1 }) ]; } }), _: 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/index.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-26805697"]]); export { index as default }; //# sourceMappingURL=index-DhQFY9Jt.mjs.map