- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
194 lines
11 KiB
JavaScript
194 lines
11 KiB
JavaScript
import { n as navigateTo, _ as __nuxt_component_0 } from "../server.mjs";
|
|
import { _ as _sfc_main$1 } from "./AppIcon--JRwwp2l.js";
|
|
import { defineComponent, ref, withAsyncContext, mergeProps, withCtx, createVNode, createTextVNode, toDisplayString, unref, useSSRContext } from "vue";
|
|
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr } from "vue/server-renderer";
|
|
import { u as usePlatformAuth } from "./usePlatformAuth-DS6-BJES.js";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/hookable/dist/index.mjs";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/ofetch/dist/node.mjs";
|
|
import "#internal/nuxt/paths";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/unctx/dist/index.mjs";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/h3/dist/index.mjs";
|
|
import "vue-router";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/defu/dist/defu.mjs";
|
|
import "/home/akoo/居家服务/hss-home-service/website/node_modules/ufo/dist/index.mjs";
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
async setup(__props) {
|
|
let __temp, __restore;
|
|
const { isLoggedIn, user, ROLES } = usePlatformAuth();
|
|
const stats = ref({});
|
|
ref([]);
|
|
const activeMenu = ref("dashboard");
|
|
if (!isLoggedIn.value) {
|
|
[__temp, __restore] = withAsyncContext(() => navigateTo("/platform/login")), await __temp, __restore();
|
|
}
|
|
const menuItems = [
|
|
{ key: "dashboard", label: "工作台", icon: "chart" },
|
|
{ key: "applications", label: "服务申请", icon: "clipboard", href: "/platform/applications" },
|
|
{ key: "work-orders", label: "工单管理", icon: "document", href: "/platform/work-orders" }
|
|
];
|
|
const roleMenus = {
|
|
RECEPTIONIST: ["applications"],
|
|
ASSESSOR: ["applications"],
|
|
DISPATCHER: ["work-orders"],
|
|
STAFF: ["work-orders"],
|
|
SETTLER: ["dashboard"],
|
|
SUPERVISOR: ["dashboard"],
|
|
ADMIN: ["applications", "work-orders"]
|
|
};
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_NuxtLink = __nuxt_component_0;
|
|
const _component_AppIcon = _sfc_main$1;
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-screen bg-surface flex" }, _attrs))}><aside class="hidden lg:flex flex-col w-56 bg-white border-r shrink-0"><div class="p-4 border-b">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/platform",
|
|
class: "flex items-center gap-2 font-bold text-primary"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div class="w-8 h-8 rounded-lg bg-primary flex items-center justify-center text-white text-xs font-mono"${_scopeId}>H</div><span class="text-sm"${_scopeId}>智慧医养平台</span>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", { class: "w-8 h-8 rounded-lg bg-primary flex items-center justify-center text-white text-xs font-mono" }, "H"),
|
|
createVNode("span", { class: "text-sm" }, "智慧医养平台")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div><nav class="flex-1 p-3 space-y-1"><!--[-->`);
|
|
ssrRenderList(menuItems, (m) => {
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
key: m.key,
|
|
to: m.href || "/platform",
|
|
class: ["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors", activeMenu.value === m.key ? "bg-primary-50 text-primary font-medium" : "text-text-secondary hover:bg-gray-50"]
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(ssrRenderComponent(_component_AppIcon, {
|
|
name: m.icon,
|
|
class: "w-4 h-4"
|
|
}, null, _parent2, _scopeId));
|
|
_push2(` ${ssrInterpolate(m.label)}`);
|
|
} else {
|
|
return [
|
|
createVNode(_component_AppIcon, {
|
|
name: m.icon,
|
|
class: "w-4 h-4"
|
|
}, null, 8, ["name"]),
|
|
createTextVNode(" " + toDisplayString(m.label), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 2
|
|
}, _parent));
|
|
});
|
|
_push(`<!--]--></nav><div class="p-3 border-t"><div class="flex items-center gap-2 px-3 py-2 text-sm"><div class="w-7 h-7 rounded-full bg-primary-50 text-primary flex items-center justify-center text-xs font-bold">${ssrInterpolate(unref(user)?.userName?.charAt(0))}</div><div class="min-w-0"><div class="text-xs font-medium truncate">${ssrInterpolate(unref(user)?.userName)}</div><select class="text-xs text-text-secondary bg-transparent border-none outline-none cursor-pointer"><!--[-->`);
|
|
ssrRenderList(unref(ROLES), (r) => {
|
|
_push(`<option${ssrRenderAttr("value", r.key)}${ssrIncludeBooleanAttr(unref(user)?.userRole === r.key) ? " selected" : ""}>${ssrInterpolate(r.label)}</option>`);
|
|
});
|
|
_push(`<!--]--></select></div></div><button class="w-full mt-2 px-3 py-2 text-xs text-text-secondary hover:text-red-500 transition-colors text-left rounded-lg hover:bg-red-50">退出登录</button></div></aside><main class="flex-1 overflow-auto"><div class="lg:hidden bg-white border-b px-4 py-3 flex items-center justify-between">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/platform",
|
|
class: "font-bold text-primary text-sm"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`智慧医养平台`);
|
|
} else {
|
|
return [
|
|
createTextVNode("智慧医养平台")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`<div class="flex items-center gap-2"><select class="text-xs border rounded-lg px-2 py-1 outline-none"><!--[-->`);
|
|
ssrRenderList(unref(ROLES), (r) => {
|
|
_push(`<option${ssrRenderAttr("value", r.key)}${ssrIncludeBooleanAttr(unref(user)?.userRole === r.key) ? " selected" : ""}>${ssrInterpolate(r.label)}</option>`);
|
|
});
|
|
_push(`<!--]--></select><button class="text-xs text-red-500">退出</button></div></div><div class="p-4 lg:p-8"><h2 class="text-xl font-bold mb-6">工作台 — ${ssrInterpolate(unref(ROLES).find((r) => r.key === unref(user)?.userRole)?.label || unref(user)?.userRole)}</h2><div class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8"><div class="bg-white rounded-xl p-4 shadow-sm border"><div class="text-2xl font-bold font-mono text-primary">${ssrInterpolate(stats.value.todayOrders || "--")}</div><div class="text-xs text-text-secondary mt-1">今日工单</div></div><div class="bg-white rounded-xl p-4 shadow-sm border"><div class="text-2xl font-bold font-mono text-accent-700">${ssrInterpolate(stats.value.inProgress || "--")}</div><div class="text-xs text-text-secondary mt-1">进行中</div></div><div class="bg-white rounded-xl p-4 shadow-sm border"><div class="text-2xl font-bold font-mono text-green-600">${ssrInterpolate(stats.value.completedToday || "--")}</div><div class="text-xs text-text-secondary mt-1">已完成</div></div><div class="bg-white rounded-xl p-4 shadow-sm border"><div class="text-2xl font-bold font-mono text-red-500">${ssrInterpolate(stats.value.exceptions || "--")}</div><div class="text-xs text-text-secondary mt-1">异常</div></div></div><div class="grid lg:grid-cols-2 gap-6"><div class="bg-white rounded-2xl shadow-sm border p-6"><h3 class="font-bold mb-4">快捷操作</h3><div class="grid grid-cols-2 gap-3">`);
|
|
if (["RECEPTIONIST", "ADMIN"].includes(unref(user)?.userRole || "")) {
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/platform/applications",
|
|
class: "p-4 rounded-xl bg-primary-50 text-primary text-sm font-medium hover:bg-primary hover:text-white transition-colors text-center"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`受理新申请`);
|
|
} else {
|
|
return [
|
|
createTextVNode("受理新申请")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (["DISPATCHER", "ADMIN"].includes(unref(user)?.userRole || "")) {
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/platform/work-orders",
|
|
class: "p-4 rounded-xl bg-accent-50 text-accent-700 text-sm font-medium hover:bg-accent hover:text-white transition-colors text-center"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`查看工单`);
|
|
} else {
|
|
return [
|
|
createTextVNode("查看工单")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/demo",
|
|
class: "p-4 rounded-xl bg-gray-50 text-text-secondary text-sm font-medium hover:bg-gray-100 transition-colors text-center"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`平台演示`);
|
|
} else {
|
|
return [
|
|
createTextVNode("平台演示")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/",
|
|
class: "p-4 rounded-xl bg-gray-50 text-text-secondary text-sm font-medium hover:bg-gray-100 transition-colors text-center"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`返回官网`);
|
|
} else {
|
|
return [
|
|
createTextVNode("返回官网")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div></div><div class="bg-white rounded-2xl shadow-sm border p-6"><h3 class="font-bold mb-4">当前角色权限</h3><div class="space-y-2 text-sm"><div class="flex justify-between py-2 border-b border-gray-50"><span class="text-text-secondary">角色</span><span class="font-medium">${ssrInterpolate(unref(ROLES).find((r) => r.key === unref(user)?.userRole)?.label)}</span></div><div class="flex justify-between py-2 border-b border-gray-50"><span class="text-text-secondary">可操作模块</span><span class="font-medium">${ssrInterpolate((roleMenus[unref(user)?.userRole || ""] || ["dashboard"]).join(", "))}</span></div><div class="flex justify-between py-2"><span class="text-text-secondary">数据范围</span><span class="font-medium">本机构</span></div></div></div></div></div></main></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/platform/index.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
export {
|
|
_sfc_main as default
|
|
};
|
|
//# sourceMappingURL=index-kIYeHZWZ.js.map
|