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(`
`);
_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(`
工作台 — ${ssrInterpolate(unref(ROLES).find((r) => r.key === unref(user)?.userRole)?.label || unref(user)?.userRole)}
${ssrInterpolate(stats.value.todayOrders || "--")}
今日工单
${ssrInterpolate(stats.value.inProgress || "--")}
进行中
${ssrInterpolate(stats.value.completedToday || "--")}
已完成
${ssrInterpolate(stats.value.exceptions || "--")}
异常
快捷操作
`);
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(`
当前角色权限
角色${ssrInterpolate(unref(ROLES).find((r) => r.key === unref(user)?.userRole)?.label)}
可操作模块${ssrInterpolate((roleMenus[unref(user)?.userRole || ""] || ["dashboard"]).join(", "))}
数据范围本机构
`);
};
}
});
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