import { n as navigateTo, _ as __nuxt_component_0 } from './server.mjs';
import { _ as _sfc_main$1 } from './AppIcon--JRwwp2l.mjs';
import { defineComponent, ref, withAsyncContext, mergeProps, withCtx, createVNode, createTextVNode, toDisplayString, unref, useSSRContext } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue/index.mjs';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue/server-renderer/index.mjs';
import { u as usePlatformAuth } from './usePlatformAuth-DS6-BJES.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/ofetch/dist/node.mjs';
import '../_/renderer.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue-bundle-renderer/dist/runtime.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/h3/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/ufo/dist/index.mjs';
import '../nitro/nitro.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/destr/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/hookable/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/node-mock-http/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unstorage/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unstorage/drivers/fs.mjs';
import 'node:crypto';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unstorage/drivers/fs-lite.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unstorage/drivers/lru-cache.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/ohash/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/klona/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/defu/dist/defu.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/scule/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unctx/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/radix3/dist/index.mjs';
import 'node:fs';
import 'node:url';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/pathe/dist/index.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/server.mjs';
import 'node:async_hooks';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/devalue/index.js';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/plugins.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/utils.mjs';
import 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue-router/vue-router.node.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: "\u5DE5\u4F5C\u53F0", icon: "chart" },
{ key: "applications", label: "\u670D\u52A1\u7533\u8BF7", icon: "clipboard", href: "/platform/applications" },
{ key: "work-orders", label: "\u5DE5\u5355\u7BA1\u7406", 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) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
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(`\u667A\u6167\u533B\u517B\u5E73\u53F0`);
} else {
return [
createTextVNode("\u667A\u6167\u533B\u517B\u5E73\u53F0")
];
}
}),
_: 1
}, _parent));
_push(`
\u5DE5\u4F5C\u53F0 \u2014 ${ssrInterpolate(((_d = unref(ROLES).find((r) => {
var _a2;
return r.key === ((_a2 = unref(user)) == null ? void 0 : _a2.userRole);
})) == null ? void 0 : _d.label) || ((_e = unref(user)) == null ? void 0 : _e.userRole))}
${ssrInterpolate(stats.value.todayOrders || "--")}
\u4ECA\u65E5\u5DE5\u5355
${ssrInterpolate(stats.value.inProgress || "--")}
\u8FDB\u884C\u4E2D
${ssrInterpolate(stats.value.completedToday || "--")}
\u5DF2\u5B8C\u6210
${ssrInterpolate(stats.value.exceptions || "--")}
\u5F02\u5E38
\u5FEB\u6377\u64CD\u4F5C
`);
if (["RECEPTIONIST", "ADMIN"].includes(((_f = unref(user)) == null ? void 0 : _f.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(`\u53D7\u7406\u65B0\u7533\u8BF7`);
} else {
return [
createTextVNode("\u53D7\u7406\u65B0\u7533\u8BF7")
];
}
}),
_: 1
}, _parent));
} else {
_push(``);
}
if (["DISPATCHER", "ADMIN"].includes(((_g = unref(user)) == null ? void 0 : _g.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(`\u67E5\u770B\u5DE5\u5355`);
} else {
return [
createTextVNode("\u67E5\u770B\u5DE5\u5355")
];
}
}),
_: 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(`\u5E73\u53F0\u6F14\u793A`);
} else {
return [
createTextVNode("\u5E73\u53F0\u6F14\u793A")
];
}
}),
_: 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(`\u8FD4\u56DE\u5B98\u7F51`);
} else {
return [
createTextVNode("\u8FD4\u56DE\u5B98\u7F51")
];
}
}),
_: 1
}, _parent));
_push(`
\u5F53\u524D\u89D2\u8272\u6743\u9650
\u89D2\u8272${ssrInterpolate((_h = unref(ROLES).find((r) => {
var _a2;
return r.key === ((_a2 = unref(user)) == null ? void 0 : _a2.userRole);
})) == null ? void 0 : _h.label)}
\u53EF\u64CD\u4F5C\u6A21\u5757${ssrInterpolate((roleMenus[((_i = unref(user)) == null ? void 0 : _i.userRole) || ""] || ["dashboard"]).join(", "))}
\u6570\u636E\u8303\u56F4\u672C\u673A\u6784
`);
};
}
});
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.mjs.map